471,052 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,052 software developers and data experts.

MySQLdb error for sql >64K

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
1 1346
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.

Similar topics

1 post views Thread by Mario_5 | last post: by
reply views Thread by Ilja Booij | last post: by
1 post views Thread by Ike | last post: by
2 posts views Thread by razorfold | last post: by
14 posts views Thread by Stefan Mueller | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.