Package: python-sqlalchemy
Version: 0.5.3-1
Severity: normal
When trying to autoload a table on a remote mssql server, sqlalchemy
crashes.
This may be related to http://www.sqlalchemy.org/trac/ticket/1312.
I have tried this on a lenny box with the sqlalchemy 0.5.2 backport, and it
does not have the problem.
My script to demonstrate the problem:
#!/usr/bin/python
#
# Demonstrates the exeption thrown by sqlalchemy 5.3, but not 5.2, on my
# debian systems
#
import sqlalchemy
import trinconfig
def main():
a = get_create_eng_args()
engine = sqlalchemy.create_engine('mssql://%s:%...@%s/%s' % a )
meta = sqlalchemy.MetaData()
meta.bind = engine
community_table = sqlalchemy.Table('Community', meta, autoload=True)
def get_create_eng_args():
return ('user', '12345', 'db01', 'project-DB')
if __name__ == '__main__':
main()
The output when run on this box:
$ ./demo_problem.py
Traceback (most recent call last):
File "./demo_problem.py", line 27, in <module>
main()
File "./demo_problem.py", line 15, in main
community_table = sqlalchemy.Table('Community', meta, autoload=True)
File "/usr/lib/pymodules/python2.5/sqlalchemy/schema.py", line 113, in
__call__
return type.__call__(self, name, metadata, *args, **kwargs)
File "/usr/lib/pymodules/python2.5/sqlalchemy/schema.py", line 241, in
__init__
_bind_or_error(metadata).reflecttable(self,
include_columns=include_columns)
File "/usr/lib/pymodules/python2.5/sqlalchemy/engine/base.py", line
1265, in reflecttable
self.dialect.reflecttable(conn, table, include_columns)
File "/usr/lib/pymodules/python2.5/sqlalchemy/databases/mssql.py",
line 1132, in reflecttable
c = connection.execute(s)
File "/usr/lib/pymodules/python2.5/sqlalchemy/engine/base.py", line
824, in execute
return Connection.executors[c](self, object, multiparams, params)
File "/usr/lib/pymodules/python2.5/sqlalchemy/engine/base.py", line
874, in _execute_clauseelement
return self.__execute_context(context)
File "/usr/lib/pymodules/python2.5/sqlalchemy/engine/base.py", line
896, in __execute_context
self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
File "/usr/lib/pymodules/python2.5/sqlalchemy/engine/base.py", line
950, in _cursor_execute
self._handle_dbapi_exception(e, statement, parameters, cursor, context)
File "/usr/lib/pymodules/python2.5/sqlalchemy/engine/base.py", line
931, in _handle_dbapi_exception
raise exc.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
sqlalchemy.exc.OperationalError: (OperationalError) SQL Server message
105, severity 15, state 1, line 3:
Unclosed quotation mark after the character string 'ORDIÂ'.
DB-Lib error message 105, severity 15:
General SQL Server error: Check messages from the SQL Server
SQL Server message 102, severity 15, state 1, line 3:
Incorrect syntax near 'ORDIÂ'.
DB-Lib error message 102, severity 15:
General SQL Server error: Check messages from the SQL Server
'SELECT [COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME],
[COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].[IS_NULLABLE],
[COLUMNS_1].[DATA_TYPE], [COLUMNS_1].[ORDINAL_POSITION],
[COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH], [COLUMNS_1].[NUMERIC_PRECISION],
[COLUMNS_1].[NUMERIC_SCALE], [COLUMNS_1].[COLUMN_DEFAULT],
[COLUMNS_1].[COLLATION_NAME] \nFROM [INFORMATION_SCHEMA].[COLUMNS] AS
[COLUMNS_1] \nWHERE [COLUMNS_1].[TABLE_NAME] = %(TABLE_NAME_1)s AND
[COLUMNS_1].[TABLE_SCHEMA] = %(TABLE_SCHEMA_1)s ORDER BY
[COLUMNS_1].[ORDINAL_POSITION]' {'TABLE_SCHEMA_1': 'dbo',
'TABLE_NAME_1': 'Community'}
I've got installed:
ii libsybdb5 0.82-5 libraries for connecting to MS SQL and
Sybas
ii freetds-common 0.82-5 configuration files for FreeTDS SQL
client l
ii python-pymssql 1.0.1+dfsg-1 Python database access for MS SQL
server and
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.29-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-sqlalchemy depends on:
ii python 2.5.4-2 An interactive high-level
object-o
ii python-support 1.0.2 automated rebuilding
support for P
python-sqlalchemy recommends no packages.
Versions of packages python-sqlalchemy suggests:
ii python 2.5.4-2 An interactive high-level
object-o
pn python-kinterbasdb <none> (no description available)
ii python-mysqldb 1.2.2-7 A Python interface to MySQL
pn python-psycopg2 <none> (no description available)
ii python-pysqlite2 2.5.0-2 Python interface to SQLite 3
pn python-sqlalchemy-doc <none> (no description available)
-- no debconf information
--
+-Geoff Crompton
+--Debian System Administrator
+---Trinity College
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]