Package: python-mysqldb
Version: 1.1.6-1
Severity: normal

Here's some terminal dialogue:

lobus:~> python
Python 2.3.5 (#2, Feb  9 2005, 00:38:15) 
[GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> from sets import Set
>>> conn = MySQLdb.connect(user="test", passwd="x", db="test")
>>> cursor = conn.cursor()
>>> cursor.execute("drop table if exists foo")
0L
>>> cursor.execute("create table foo (xyzzy set('plugh', 'plover'))")
0L
>>> cursor.execute("insert into foo (xyzzy) values (%s)", (Set(['plugh', 
>>> 'plover']),))
1L
>>> cursor.execute("insert into foo (xyzzy) values ('plover')")
1L
>>> cursor.execute("insert into foo (xyzzy) values ('plugh,plover')")
1L
>>> cursor.fetchmany()
()
>>> cursor.execute("select * from foo")
3L
>>> cursor.fetchmany()
# The next one should return
# ((Set(['plugh', 'plover']),),(Set(['plover']),),(Set(['plugh', 'plover']),))
(('',), ('plover',), ('plugh,plover',))
>>> 

I think there are two separate bugs.  Writing fails, but if you write
without using mysqldb's converters, reading fails.  There is a
converter defined for reading but apparently it is never called,
probably because the type used as the key to conn.converter is never
MySQLdb.constants.FIELD_TYPE.SET.

I'm running mysql-server version 4.0.23-7.  I see the same problem on
another machine with mysql-server-4.1 version 4.1.9-2.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (1500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.26-treo
Locale: LANG=C, LC_CTYPE=C

Versions of packages python-mysqldb depends on:
ii  python                        2.3.4-4    An interactive high-level object-o
ii  python2.3-mysqldb             1.1.6-1    A Python interface to MySQL

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to