I've got a table with a SET-Column (which consists of max. 64 Strings, that either can be set or not)
As I run a SELECT-Statement on this table, an error will occur (see below), if rows are matched, that contain more than one string in the SET-Column.
Error Message:
>>> cur.execute('SELECT * FROM events')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 159, in execute
self.errorhandler(self, TypeError, m)
File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
raise errorclass, errorvalue
TypeError: str() takes at most 1 argument (2 given)
As I changed the SET-Columns Value (to only 1 of the 64 possible strings), everything worked again.
Is there a way to work around this (at best without extra-tables and extra-joins)?
Greetings from Freiburg, southern Germany,
Timo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I've got a table with a SET-Column (which consists of max. 64 Strings, that either can be set or not)
As I run a SELECT-Statement on this table, an error will occur (see below), if rows are matched, that contain more than one string in the SET-Column.
Error Message:
>>> cur.execute('SELECT * FROM events')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 159, in execute
self.errorhandler(self, TypeError, m)
File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
raise errorclass, errorvalue
TypeError: str() takes at most 1 argument (2 given)
As I changed the SET-Columns Value (to only 1 of the 64 possible strings), everything worked again.
Is there a way to work around this (at best without extra-tables and extra-joins)?
Greetings from Freiburg, southern Germany,
Timo
I use:
MySQL 5
Python 2.5
MySQLdb 1.2.1
(Ubuntu 7.04 on a Fujitsu Simens Lifebook)