MonetDB / sqlalchemy-monetdb

A SQLAlchemy dialect for MonetDB
MIT License
41 stars 17 forks source link

test_order_by_selectable_in_unions test fail #16

Closed gijzelaerr closed 7 years ago

gijzelaerr commented 7 years ago
Traceback (most recent call last):
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/cursors.py", line 164, in execute
    block = self.connection.execute(query)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 135, in execute
    return self.command('s' + query + '\n;')
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 140, in command
    return self.mapi.cmd(command)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/mapi.py", line 244, in cmd
    raise exception(string)
pymonetdb.exceptions.OperationalError: 42000!syntax error, unexpected ORDER, expecting UNION or EXCEPT or INTERSECT or ')' in: "(select some_table.id, some_table.x, some_table.y 
!from some_table 
!where some_t"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_select.py", line 270, in test_order_by_selectable_in_unions
    [(2, 2, 3), (3, 3, 4)]
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_select.py", line 219, in _assert_result
    config.db.execute(select, params).fetchall(),
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2064, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/cursors.py", line 164, in execute
    block = self.connection.execute(query)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 135, in execute
    return self.command('s' + query + '\n;')
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 140, in command
    return self.mapi.cmd(command)
  File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/mapi.py", line 244, in cmd
    raise exception(string)
sqlalchemy.exc.OperationalError: (pymonetdb.exceptions.OperationalError) 42000!syntax error, unexpected ORDER, expecting UNION or EXCEPT or INTERSECT or ')' in: "(select some_table.id, some_table.x, some_table.y 
!from some_table 
!where some_t"
 [SQL: '(SELECT some_table.id, some_table.x, some_table.y \nFROM some_table \nWHERE some_table.id = %(id_1)s ORDER BY some_table.id) UNION (SELECT some_table.id, some_table.x, some_table.y \nFROM some_table \nWHERE some_table.id = %(id_2)s ORDER BY some_table.id) ORDER BY id\nLIMIT 2'] [parameters: {'id_1': 2, 'id_2': 3}]
gijzelaerr commented 7 years ago

i think this is related to https://github.com/gijzelaerr/sqlalchemy-monetdb/issues/14