mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-16 12:27:03 +08:00
Version 0.9.2c3, see CHANGELOG
This commit is contained in:
@ -1,3 +1,29 @@
|
|||||||
|
0.9.2c3
|
||||||
|
|
||||||
|
* Did some more setup cleanups. Apparently on non-server versions of
|
||||||
|
MacOSX, the MySQL stuff installs in /sw instead of /usr/local.
|
||||||
|
|
||||||
|
* There's now a cursor._execute(), used by execute() and executemany(),
|
||||||
|
when does NOT clear cursor.messages. Internal use only. This is so
|
||||||
|
all messages can be kept with executemany().
|
||||||
|
|
||||||
|
* Fixed a memory leak (cursor+traceback) I introduced when reworking
|
||||||
|
the errorhandler code.
|
||||||
|
|
||||||
|
* If both conv and unicode options were given to connect, things
|
||||||
|
broke. (Skip Montanaro)
|
||||||
|
|
||||||
|
* Since MySQL uses the same internal FIELD_TYPE for both BLOB and
|
||||||
|
TEXT columns, reverting the 0.9.2c1 change that returned them
|
||||||
|
as array objects; they are now strings again. Array objects passed
|
||||||
|
as parameters are still converted correctly into string literals.
|
||||||
|
|
||||||
|
* Replaced cursor iterator implementation with something not dumb.
|
||||||
|
The old one worked, but the new one makes use of the iter()
|
||||||
|
function. StoreResultMixIn has it's own implementation which is
|
||||||
|
fast but doesn't update the rownumber, which should not be a real
|
||||||
|
problem in practice.
|
||||||
|
|
||||||
0.9.2c2
|
0.9.2c2
|
||||||
|
|
||||||
* errorhandler cleanups (Rob Steele)
|
* errorhandler cleanups (Rob Steele)
|
||||||
@ -15,6 +41,7 @@
|
|||||||
* BLOBs are now converted to Python array objects (from the array
|
* BLOBs are now converted to Python array objects (from the array
|
||||||
module). If you are expecting them to be strings, sorry. This
|
module). If you are expecting them to be strings, sorry. This
|
||||||
is actually the preferred representation for DB-API.
|
is actually the preferred representation for DB-API.
|
||||||
|
[Reverted in 0.9.2c3]
|
||||||
|
|
||||||
* MySQL converts array objects passed as parameters into a correct
|
* MySQL converts array objects passed as parameters into a correct
|
||||||
string representation (presumably for BLOB columns).
|
string representation (presumably for BLOB columns).
|
||||||
|
@ -20,7 +20,7 @@ version_info = (
|
|||||||
9,
|
9,
|
||||||
2,
|
2,
|
||||||
"gamma",
|
"gamma",
|
||||||
2)
|
3)
|
||||||
if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3]
|
if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3]
|
||||||
else: __version__ = "%d.%d.%d%1.1s%d" % version_info[:5]
|
else: __version__ = "%d.%d.%d%1.1s%d" % version_info[:5]
|
||||||
|
|
||||||
@ -37,9 +37,9 @@ apilevel = "2.0"
|
|||||||
paramstyle = "format"
|
paramstyle = "format"
|
||||||
|
|
||||||
from _mysql import *
|
from _mysql import *
|
||||||
from sets import DBAPISet, Set
|
from MySQLdb.sets import DBAPISet, Set
|
||||||
from constants import FIELD_TYPE
|
from MySQLdb.constants import FIELD_TYPE
|
||||||
from times import Date, Time, Timestamp, \
|
from MySQLdb.times import Date, Time, Timestamp, \
|
||||||
DateFromTicks, TimeFromTicks, TimestampFromTicks
|
DateFromTicks, TimeFromTicks, TimestampFromTicks
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,9 +91,12 @@ class BaseCursor:
|
|||||||
Returns long integer rows affected, if any
|
Returns long integer rows affected, if any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
del self.messages[:]
|
||||||
|
return self._execute(query, args)
|
||||||
|
|
||||||
|
def _execute(self, query, args):
|
||||||
from types import ListType, TupleType
|
from types import ListType, TupleType
|
||||||
from sys import exc_info
|
from sys import exc_info
|
||||||
del self.messages[:]
|
|
||||||
try:
|
try:
|
||||||
r = self._query(query % self.connection.literal(args))
|
r = self._query(query % self.connection.literal(args))
|
||||||
except TypeError, m:
|
except TypeError, m:
|
||||||
@ -103,8 +106,9 @@ class BaseCursor:
|
|||||||
else:
|
else:
|
||||||
self.errorhandler(self, TypeError, m)
|
self.errorhandler(self, TypeError, m)
|
||||||
except:
|
except:
|
||||||
e = exc_info()
|
exc, value, tb = exc_info()
|
||||||
self.errorhandler(self, e[0], e[1])
|
del tb
|
||||||
|
self.errorhandler(self, exc, value)
|
||||||
self._executed = query
|
self._executed = query
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@ -134,7 +138,7 @@ class BaseCursor:
|
|||||||
if not m:
|
if not m:
|
||||||
r = 0
|
r = 0
|
||||||
for a in args:
|
for a in args:
|
||||||
r = r + self.execute(query, a)
|
r = r + self._execute(query, a)
|
||||||
return r
|
return r
|
||||||
p = m.start(1)
|
p = m.start(1)
|
||||||
qv = query[p:]
|
qv = query[p:]
|
||||||
@ -149,8 +153,9 @@ class BaseCursor:
|
|||||||
else:
|
else:
|
||||||
self.errorhandler(self, TypeError, msg)
|
self.errorhandler(self, TypeError, msg)
|
||||||
except:
|
except:
|
||||||
e = exc_info()
|
exc, value, tb = exc_info()
|
||||||
self.errorhandler(self, e[0], e[1])
|
del tb
|
||||||
|
self.errorhandler(self, exc, value)
|
||||||
r = self._query(join(q,',\n'))
|
r = self._query(join(q,',\n'))
|
||||||
self._executed = query
|
self._executed = query
|
||||||
return r
|
return r
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define version_info "(0,9,2,'gamma',2)"
|
#define version_info "(0,9,2,'gamma',3)"
|
||||||
#define __version__ "0.9.2"
|
#define __version__ "0.9.2"
|
||||||
/*
|
/*
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@ -2135,7 +2135,8 @@ DL_EXPORT(void)
|
|||||||
init_mysql(void)
|
init_mysql(void)
|
||||||
{
|
{
|
||||||
PyObject *dict, *module, *emod, *edict;
|
PyObject *dict, *module, *emod, *edict;
|
||||||
module = Py_InitModule3("_mysql", _mysql_methods, _mysql___doc__);
|
module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
|
||||||
|
(PyObject *)NULL, PYTHON_API_VERSION);
|
||||||
#ifdef MS_WIN32
|
#ifdef MS_WIN32
|
||||||
_mysql_ConnectionObject_Type.ob_type = &PyType_Type;
|
_mysql_ConnectionObject_Type.ob_type = &PyType_Type;
|
||||||
_mysql_ResultObject_Type.ob_type = &PyType_Type;
|
_mysql_ResultObject_Type.ob_type = &PyType_Type;
|
||||||
|
@ -18,7 +18,7 @@ thread_safe_library = YES
|
|||||||
# forget to include the value of sys.platform and os.name.
|
# forget to include the value of sys.platform and os.name.
|
||||||
|
|
||||||
name = "MySQL-%s" % os.path.basename(sys.executable)
|
name = "MySQL-%s" % os.path.basename(sys.executable)
|
||||||
version = "0.9.2c2"
|
version = "0.9.2c3"
|
||||||
|
|
||||||
mysqlclient = thread_safe_library and "mysqlclient_r" or "mysqlclient"
|
mysqlclient = thread_safe_library and "mysqlclient_r" or "mysqlclient"
|
||||||
|
|
||||||
@ -56,8 +56,8 @@ elif sys.platform in ("freebsd4", "openbsd3"):
|
|||||||
include_dirs = ['%s/include/mysql' % LOCALBASE]
|
include_dirs = ['%s/include/mysql' % LOCALBASE]
|
||||||
library_dirs = ['%s/lib/mysql' % LOCALBASE]
|
library_dirs = ['%s/lib/mysql' % LOCALBASE]
|
||||||
elif sys.platform == "sunos5": # Solaris 2.8 + gcc
|
elif sys.platform == "sunos5": # Solaris 2.8 + gcc
|
||||||
runtime_library_dirs = ['/usr/local/lib:/usr/openwin/lib:/usr/dt/lib']
|
runtime_library_dirs.append('/usr/local/lib:/usr/openwin/lib:/usr/dt/lib')
|
||||||
extra_compile_args = ["-fPIC"]
|
extra_compile_args.append("-fPIC")
|
||||||
elif sys.platform == "win32": # Ugh
|
elif sys.platform == "win32": # Ugh
|
||||||
include_dirs = [r'c:\mysql\include']
|
include_dirs = [r'c:\mysql\include']
|
||||||
library_dirs = [r'c:\mysql\lib\opt']
|
library_dirs = [r'c:\mysql\lib\opt']
|
||||||
@ -67,9 +67,11 @@ elif sys.platform == "win32": # Ugh
|
|||||||
elif sys.platform == "cygwin":
|
elif sys.platform == "cygwin":
|
||||||
include_dirs = ['/c/mysql/include']
|
include_dirs = ['/c/mysql/include']
|
||||||
library_dirs = ['/c/mysql/lib']
|
library_dirs = ['/c/mysql/lib']
|
||||||
extra_compile_args = ['-DMS_WIN32']
|
extra_compile_args.append('-DMS_WIN32')
|
||||||
elif sys.platform[:6] == "darwin": # Mac OS X
|
elif sys.platform[:6] == "darwin": # Mac OS X
|
||||||
extra_link_args = ['-flat_namespace']
|
include_dirs.append('/sw/include')
|
||||||
|
library_dirs.append('/sw/lib')
|
||||||
|
extra_link_args.append('-flat_namespace')
|
||||||
elif sys.platform == 'linux2' and os.environ.get('HOSTTYPE') == 'alpha':
|
elif sys.platform == 'linux2' and os.environ.get('HOSTTYPE') == 'alpha':
|
||||||
libraries.extend(['ots', 'cpml'])
|
libraries.extend(['ots', 'cpml'])
|
||||||
elif os.name == "posix": # UNIX-ish platforms not covered above
|
elif os.name == "posix": # UNIX-ish platforms not covered above
|
||||||
|
Reference in New Issue
Block a user