diff --git a/MySQLdb/MANIFEST.in b/MySQLdb/MANIFEST.in index d889af2..07ab315 100644 --- a/MySQLdb/MANIFEST.in +++ b/MySQLdb/MANIFEST.in @@ -1,7 +1,6 @@ prune CVS recursive-include doc * recursive-include examples * -include _mysql_version.h include README.MySQLmodule include license.py include MANIFEST.in diff --git a/MySQLdb/MySQLdb/__init__.py b/MySQLdb/MySQLdb/__init__.py index bf1717f..7f05339 100644 --- a/MySQLdb/MySQLdb/__init__.py +++ b/MySQLdb/MySQLdb/__init__.py @@ -19,17 +19,18 @@ version_info = ( 0, 9, 0, - "beta", - 3) + "candidate", + 1) if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3] else: __version__ = "%d.%d.%d%1.1s%d" % version_info[:5] import _mysql -if __version__ != getattr(_mysql, '__version__', None): +v = getattr(_mysql, 'version_info', None) +if version_info != v: raise ImportError, "this is MySQLdb version %s, but _mysql is version %s" %\ - (__version__, _mysql.__version__) - + (version_info, v) +del v threadsafety = 1 apilevel = "2.0" diff --git a/MySQLdb/MySQLdb/connections.py b/MySQLdb/MySQLdb/connections.py index e6cf2a0..a7307e2 100644 --- a/MySQLdb/MySQLdb/connections.py +++ b/MySQLdb/MySQLdb/connections.py @@ -58,7 +58,6 @@ class Connection: self._db = apply(connect, args, kwargs2) self._db.converter[types.StringType] = self._db.string_literal self._transactional = self._db.server_capabilities & CLIENT.TRANSACTIONS - self._autocommit = 1 def __del__(self): if hasattr(self, '_db'): self.close() @@ -67,34 +66,21 @@ class Connection: """Close the connection. No further activity possible.""" self._db.close() - def autocommit(self, v): - """Turn autocommit on or off.""" - self._db.query("SET AUTOCOMMIT=%d"%v) - self._transactional = not v - self._autocommit = v - def begin(self): """Explicitly begin a transaction. Non-standard.""" self._db.query("BEGIN") - self._transactional = 1 def commit(self): """Commit the current transaction.""" - try: - if self._transactional: - self._db.query("COMMIT") - finally: - self._transactional = not self._autocommit + if self._transactional: + self._db.query("COMMIT") def rollback(self): """Rollback the current transaction.""" - try: - if self._transactional: - self._db.query("ROLLBACK") - else: - raise NotSupportedError, "Not supported by server" - finally: - self._transactional = not self._autocommit + if self._transactional: + self._db.query("ROLLBACK") + else: + raise NotSupportedError, "XXX Not supported by server" def cursor(self, cursorclass=None): diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index 8b839e8..46be0cc 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -1,4 +1,5 @@ -#include "_mysql_version.h" +#define version_info "(0,9,0,'candidate',1)" +#define __version__ "0.9.0c1" /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1560,8 +1561,12 @@ init_mysql(void) _mysql_ResultObject_Type.ob_type = &PyType_Type; #endif if (!(dict = PyModule_GetDict(module))) goto error; + if (PyDict_SetItemString(dict, "version_info", + PyRun_String(version_info, Py_eval_input, + dict, dict))) + goto error; if (PyDict_SetItemString(dict, "__version__", - PyString_FromString(_mysql__version__))) + PyString_FromString(__version__))) goto error; if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) goto error; diff --git a/MySQLdb/_mysql_version.h b/MySQLdb/_mysql_version.h deleted file mode 100644 index 566716d..0000000 --- a/MySQLdb/_mysql_version.h +++ /dev/null @@ -1 +0,0 @@ -static char _mysql__version__[] = "0.9.0b3"; diff --git a/MySQLdb/doc/MySQLdb.sgml b/MySQLdb/doc/MySQLdb.sgml index 1663f0f..d1cc25c 100644 --- a/MySQLdb/doc/MySQLdb.sgml +++ b/MySQLdb/doc/MySQLdb.sgml @@ -68,8 +68,7 @@ must use a transaction-safe table (TST). Current TSTs are BDB and InnoDB. GEMINI tables are slated for MySQL-4.0. Note that MySQL generally operates in DateTime

If you have the defines this method, can use autocommit(n) Turns AUTOCOMMIT mode on or off. This affects - how transactions are handled. By default, MySQL operates in - AUTOCOMMIT mode. - Cursor Objects diff --git a/MySQLdb/setup.cfg b/MySQLdb/setup.cfg new file mode 100644 index 0000000..6202f7d --- /dev/null +++ b/MySQLdb/setup.cfg @@ -0,0 +1,2 @@ +[bdist_rpm] +doc_files = README doc/*.?tml diff --git a/MySQLdb/setup.py b/MySQLdb/setup.py index 8cfd049..d6dd261 100644 --- a/MySQLdb/setup.py +++ b/MySQLdb/setup.py @@ -75,11 +75,12 @@ MySQLdb. MySQLdb is free software. setup (# Distribution meta-data name = "MySQL-python", - version = "0.9.0b3", + version = "0.9.0c1", description = "An interface to MySQL", long_description=long_description, author = "Andy Dustman", author_email = "andy@dustman.net", + licence = "GPL", url = "http://dustman.net/andy/python/MySQLdb", # Description of the modules and packages in the distribution