[storm] Escaping columns names in mysql
Piotr Jackowski
jackowski.piotr at gmail.com
Wed Oct 22 21:39:17 BST 2008
Hi
Welcome everyone!
At the beginning I would like to remark that I'm new to Python and Storm.
I'm working with python & storm installed on Ubuntu 8.04
I have installed strom from Ubuntu repositories.
Python 2.5.2 and I think Storm version is 0.12
First of all I'm unable to load storm.tracer module:
from storm.tracer import debug:
ImportError: No module named tracer
But probably this is an issue for ubuntu team and I can leave without it
for now.
The second issue more important.
I wanted to use Storm with existing mysql database and one of the columns
names is: 'long' which is also sql kyeword.
So every time in my queries I have to escape colums names like for example:
SELECT ... WHERE `long` = 100.
And I think Strom doesn't escape columns names so it's completely useless
for me :(
My question is: it's a Storm bug or I miss something ?
Below you can find my sample Traceback when I wanted to update 'long'
column.
For other columns it works.
Regards
Peter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/storm/store.py", line 105, in
commit
self.flush()
File "/usr/lib/python2.5/site-packages/storm/store.py", line 443, in flush
self._flush_one(obj_info)
File "/usr/lib/python2.5/site-packages/storm/store.py", line 502, in
_flush_one
self._connection.execute(expr, noresult=True)
File "/usr/lib/python2.5/site-packages/storm/database.py", line 202, in
execute
self.raw_execute, statement, params)
File "/usr/lib/python2.5/site-packages/storm/database.py", line 317, in
_check_disconnect
return function(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/storm/database.py", line 283, in
raw_execute
raw_cursor.execute(statement, params)
File "/var/lib/python-support/python2.5/MySQLdb/cursors.py", line 166, in
execute
self.errorhandler(self, exc, value)
File "/var/lib/python-support/python2.5/MySQLdb/connections.py", line 35,
in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near 'long=100 WHERE giata_hotel.giata_id = 2' at
line 1")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20081022/23734234/attachment.htm
More information about the storm
mailing list