One of the DBMSes I'm writing a driver for does not support SELECT
statements without a FROM clause as you an see below.  (This is just
one of many unit tests failing with this error message.)

Is there an easy way to tell SQLAlchemy to use a different statement as NOP?

There's a related issue with SELECT CURRENT_TIMESTAMP, that DBMS
requires CALL CURRENT_TIMESTAMP instead.

What is the most elegant way to work around this, do I have to
override visit_select or is there a better approach?


======================================================================
ERROR: test.engine.test_reconnect.RecycleTest.test_basic
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/local/lib/python2.5/site-packages/nose/case.py", line
182, in runTest
    self.test(*self.arg)
  File "SQLAlchemy-0.5.6/test/engine/test_reconnect.py", line 309, in test_basic
    eq_(conn.execute(select([1])).scalar(), 1)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 1281, in execute
    return proxy.execute(self, super(ProxyConnection, self).execute,
object, *multiparams, **params)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/test/assertsql.py", line 261, in execute
    result = execute(clauseelement, *multiparams, **params)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 824, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 874, in
_execute_clauseelement
    return self.__execute_context(context)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 896, in
__execute_context
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 1287, in
_cursor_execute
    return proxy.cursor_execute(super(ProxyConnection,
self)._cursor_execute, cursor, statement, parameters, context, False)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/test/assertsql.py", line 274,
in cursor_execute
    result = execute(cursor, statement, parameters, context)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 950, in
_cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor, context)
  File "SQLAlchemy-0.5.6/lib/sqlalchemy/engine/base.py", line 931, in
_handle_dbapi_exception
    raise exc.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
DBAPIError: (Error) Unexpected token , requires FROM in statement
[SELECT 1] (SELECT 1) u'SELECT 1' []

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to