Bugs item #2575809, was opened at 2009-02-07 09:15
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2575809&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: MySQL
Group: SQLObject from repository
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: escape reserved words with backtics
Initial Comment:
In order to create table and column names using SQL reserved words, as "read", "default", "select", "when" and so on, those names should be enclosed in backticks every time a query is generated:
class Issue(SQLObject):
read = BoolCol()
Issue.CreateTableSQL()
>>>"CREATE TABLE issue (id INT PRIMARY KEY AUTO_INCREMENT, read BOOL)"
Issue.CreateTable()
>>>ProgrammingError: You have an error in your SQL syntax ....
the correct SQL output should be
>>>"CREATE TABLE `issue` (`id` INT PRIMARY KEY AUTO_INCREMENT, `read` BOOL)"
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2009-02-07 17:11
Message:
This is a duplicate of
https://sourceforge.net/tracker2/?func=detail&aid=1539927&group_id=74338&atid=540672
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2575809&group_id=74338
|