zillow / ctds

Python DB-API 2.0 library for MS SQL Server
MIT License
83 stars 12 forks source link

Ignore parameter markers in SQL if no parameters are passed to cursor.execute #7

Closed craigahobbs closed 6 years ago

craigahobbs commented 6 years ago
  1. Execute the following script:
import ctds

connection = ctds.connect('localhost', user='sa', password='password')
with connection:
    with connection.cursor() as cursor:
        cursor.execute('''\
/* this is great code: */
select @@version
''')
        row = cursor.fetchone()
        print(row[0])

Expected: Success - prints db version Actual: "_tds.InterfaceError: invalid parameter marker" - caused by ':' in multi-line comment

joshuahlang commented 6 years ago

Fixed in 1.4.0