MonetDB / sqlalchemy-monetdb

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

test_integrity_error test fail #17

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 721, in _commit_impl self.engine.dialect.do_commit(self.connection) File "/home/gijs/Work/sqlalchemy-monetdb/sqlalchemy_monetdb/dialect.py", line 328, in do_commit connection.commit() File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 108, in commit return self.cursor().execute('COMMIT') 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.IntegrityError: COMMIT: failed

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_dialect.py", line 40, in test_integrity_error {'id': 1, 'data': 'd1'} File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1944, in exit self.transaction.commit() File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1632, in commit self._do_commit() File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1663, in _do_commit self.connection._commit_impl() File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 723, in _commit_impl self._handle_dbapi_exception(e, None, None, None, None) 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 721, in _commit_impl self.engine.dialect.do_commit(self.connection) File "/home/gijs/Work/sqlalchemy-monetdb/sqlalchemy_monetdb/dialect.py", line 328, in do_commit connection.commit() File "/home/gijs/Work/sqlalchemy-monetdb/.venv3/lib/python3.5/site-packages/pymonetdb/sql/connections.py", line 108, in commit return self.cursor().execute('COMMIT') 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.IntegrityError: (pymonetdb.exceptions.IntegrityError) COMMIT: failed

gijzelaerr commented 7 years ago

looks like the context manager is trying to commit the session, but the session is dirty due to a failed insert. I think the test is maybe wrong? Asked upstream:

https://groups.google.com/forum/#!topic/sqlalchemy/OC4joEZOjOo

gijzelaerr commented 7 years ago

looks like this is a bug in the test suite: https://gerrit.sqlalchemy.org/#/c/576/