By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,530 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,530 IT Pros & Developers. It's quick & easy.

MySQLdb error for sql >64K

P: n/a
JZ
I cannot execute insert data into TEXT field if that data is bigger than
64KB. :(
cursor.execute("INSERT INTO table (field) VALUES(%s) WHERE id=1", myValue)


Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\opt\PYTHON~1\lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
return self._execute(query, args)
File "C:\opt\PYTHON~1\lib\site-packages\MySQLdb\cursors.py", line 114, in
_execute
self.errorhandler(self, exc, value)
File "C:\opt\PYTHON~1\lib\site-packages\MySQLdb\connections.py", line 33,
in defaulterrorhandler
raise errorclass, errorvalue
Warning: Rows matched: 1 Changed: 0 Warnings: 1

The same sql query executed using MySQLFront client works without any
problems. So, I think the problem must be with MySQLdb 0.9.2 module.

Any suggestions?

--
JZ
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
JZ wrote:
I cannot execute insert data into TEXT field if that data is bigger than
64KB. :(

cursor.execute("INSERT INTO table (field) VALUES(%s) WHERE id=1", myValue)

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\opt\PYTHON~1\lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
return self._execute(query, args)
File "C:\opt\PYTHON~1\lib\site-packages\MySQLdb\cursors.py", line 114, in
_execute
self.errorhandler(self, exc, value)
File "C:\opt\PYTHON~1\lib\site-packages\MySQLdb\connections.py", line 33,
in defaulterrorhandler
raise errorclass, errorvalue
Warning: Rows matched: 1 Changed: 0 Warnings: 1

The same sql query executed using MySQLFront client works without any
problems. So, I think the problem must be with MySQLdb 0.9.2 module.

Any suggestions?

--
JZ


jz,
A MYSQL "text" type can be 0 to 65535 bytes; a "mediumtext"
type 2**8 times as big. Just a guess but maybe the failing
insert checks the sizes and the 'working' one just chops off
the excess. You could alter the column and try it fairly
easily.
wes

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.