SQL Server Key Word Issue
Issue #1310
resolved
'key' is a keyword/reserved word in mssql and it is not being properly escaped. Below is the diff of the change that I made and it resolved the issue I had:
Index: lib/sqlalchemy/databases/mssql.py
===================================================================
--- lib/sqlalchemy/databases/mssql.py (revision 5780)
+++ lib/sqlalchemy/databases/mssql.py (working copy)
@@ -249,7 +249,7 @@
from decimal import Decimal as _python_Decimal
-MSSQL_RESERVED_WORDS = set(['function']('function'))
+MSSQL_RESERVED_WORDS = set(['key']('function',))
class _StringType(object):
Comments (4)
-
-
Account Deleted Thanks for the quick response. Is there anything that I can do to help with that?
-
Corrected in e14734c8dd35dda06756496d0050c976cd90c5ab. I decided not to query the server since it doesn't work reliably on all dbapis.
-
repo owner - removed milestone
Removing milestone: 0.5.4 (automated comment)
- Log in to comment
Yeah I actually have a fix for this I need to get in. SQL Server itself can tell us the keywords based on the version the user is using. Which is a much better solution than manually coming up with the list.