Roundup Tracker - Issues

Message3377

Author adustman
Recipients
Date 2005-05-02.22:48:15
Message-id
In-reply-to
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.
History
Date User Action Args
2009-02-03 14:23:57adminlinkissue1194126 messages
2009-02-03 14:23:57admincreate