Fix for Python 2.5.

Added a unit test for single character columns.

Updated download URL.
This commit is contained in:
adustman
2006-10-27 23:33:35 +00:00
parent 1699cc8eb1
commit cfd4a94682
3 changed files with 12 additions and 2 deletions

View File

@ -1132,7 +1132,7 @@ _mysql_escape_dict(
PyObject *args) PyObject *args)
{ {
PyObject *o=NULL, *d=NULL, *r=NULL, *item, *quoted, *pkey; PyObject *o=NULL, *d=NULL, *r=NULL, *item, *quoted, *pkey;
int ppos = 0; Py_ssize_t ppos = 0;
if (!PyArg_ParseTuple(args, "O!O:escape_dict", &PyDict_Type, &o, &d)) if (!PyArg_ParseTuple(args, "O!O:escape_dict", &PyDict_Type, &o, &d))
goto error; goto error;
if (!PyMapping_Check(d)) { if (!PyMapping_Check(d)) {

View File

@ -29,7 +29,7 @@ author_email: andy@dustman.net
license: GPL license: GPL
platforms: ALL platforms: ALL
url: http://sourceforge.net/projects/mysql-python url: http://sourceforge.net/projects/mysql-python
download_url: http://easynews.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-%(version)s.tar.gz download_url: http://osdn.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-%(version)s.tar.gz
classifiers: classifiers:
Development Status :: 5 - Production/Stable Development Status :: 5 - Production/Stable
Environment :: Other Environment Environment :: Other Environment

View File

@ -75,6 +75,16 @@ class test_MySQLdb(test_capabilities.DatabaseTest):
c.execute("DROP PROCEDURE test_sp") c.execute("DROP PROCEDURE test_sp")
c.execute('drop table %s' % (self.table)) c.execute('drop table %s' % (self.table))
def test_small_CHAR(self):
# Character data
def generator(row,col):
i = (row*col+62)%256
if i == 62: return ''
if i == 63: return None
return chr(i)
self.check_data_integrity(
('col1 char(1)','col2 char(1)'),
generator)
if __name__ == '__main__': if __name__ == '__main__':
if test_MySQLdb.leak_test: if test_MySQLdb.leak_test: