Roundup Tracker - Issues

Issue 1194126

classification
MySQL support notes
Type: rfe Severity: normal
Components: Database Versions:
process
Status: open
:
: richard : adustman, richard, rouilj
Priority: normal :

Created on 2005-05-02 22:48 by adustman, last changed 2021-05-29 02:14 by rouilj.

Messages
msg3377 Author: [hidden] (adustman) Date: 2005-05-02 22:48
Some notes on back_mysql.py:

db_nuke(): Don't know what bug you are referring to --
might be an old
InnoDB thing from late 3.23 or early 4.0 -- but there
are some
comments here:

http://dev.mysql.com/doc/mysql/en/drop-database.html

Specifically, SET FOREIGN_KEY_CHECKS = 0 might solve
your problem, in
which case you can reduce this function to:

def db_nuke(config):
   """Clear all database contents and drop database
itself"""
   if db_exists(config):
       kwargs = connection_dict(config)
       conn = MySQLdb.connect(**kwargs)
       cursor = conn.cursor()
       cursor.execute("SET FOREIGN_KEY_CHECKS=0")
       command = "DROP IF EXISTS DATABASE
%s"%config.RDBMS_NAME
       logging.getLogger('hyperdb').info(command)
       cursor.execute(command)
       conn.commit()
       conn.close()

I think this should work for 4.0.18 (more than a year
old) and newer.

Database:

sql_open_connection():

MySQLdb-1.2 and newer turns autocommit off by default.
START
TRANSACTION is probably not useful. Since you require
Python 2.3 or
newer, you should probably require MySQLdb-1.2 or
newer; 1.0 is only
recommended for Python older than 2.2.

When creating tables, TYPE is deprecated in favor of
ENGINE since 4.0.18.

MysqlClass:

The 4.1 series has sub-selects, and 4.1.10 is the
current recommended
General Availability release; 4.0 is GA, but is not the
recommended
version. You could either require 4.1, or else have two
backends for
MySQL, and do some subclassing, and keep your filter()
method for the
old backend.
msg5745 Author: [hidden] (rouilj) Date: 2016-07-04 20:14
Just a note that ENGINE is in use and TYPE has been removed. The rest of
the items in the list still need to be addressed.

Changing the python to require a newer version of MySQLdb is
probably low effort.

Checking the drop code changes (set ignore foreign keys) and testing
nuke is medium effort. Requires some mysql setup and testing.

Rewriting filters to use subselects is probably high effort.

This issue should probably should be replaced with three rfe's each with
a different effort level. This would be low effort 8-).
History
Date User Action Args
2021-05-29 02:14:47rouiljsetkeywords: - Effort-High, Effort-Medium, Effort-Low
2016-07-04 20:14:44rouiljsetkeywords: + Effort-High, Effort-Medium, Effort-Low
nosy: + rouilj
messages: + msg5745
2005-05-02 22:48:15adustmancreate