-
Notifications
You must be signed in to change notification settings - Fork 32
fix: fix drop tables #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will this allow us to remove the overrides relating to table clean up or are they still needed?
Still needed only for one thing, to delete the rows from the table before execute DROP TABLE like Right now BooleanTest_spanner+spanner::test_render_literal_bool is failing due to the same reason, i think also need to override that method. |
@larkee, @HemangChothani, IIRC, on meeting we decided to fix it in Spanner connection API. As the Spanner DB API is the one who queues DDLs until anything else executed, the problem is actual for DB API as well. Fixing it in SQLAlchemy will not change it for Spanner connection API itself. Here is the code, and @larkee already proposed a solution somewhere in our PRs (I don't remember where, but I do remember how). Thus, it's better be fixed in Spanner DB API to fix it globally. |
@IlyaFaer Are you talking about #20 (comment) code? If yes, then alex suggested to modify the code and only apply for |
@HemangChothani, @larkee, I was going to make an example to show you what is the problem, and it appears that there is even a dead end in autocommit mode. See the screenshot. I've tried to set autocommit mode and execute a DDL. Expectedly, it wasn't executed, only queued. And the thing is that I wasn't even able to do a commit - it's not working in autocommit mode. So, I have two ways in such a situation: set !autocommit mode back and do commit manually, or call |
@larkee, @HemangChothani, so, here is the problematic case. One inits a connection and executes a DDL in autocommit mode. Then one is closing a connection and creating a new connection, trying to continue the work. Expectedly, the DDL got lost somewhere in space, and the table wasn't created, though the DDL was executed in autocommit mode. |
@IlyaFaer Yes,I have also seen this issue many times when executing compliance tests. |
Currently, the DDL statements are only executed if a non-DDL statement is executed after them. The fix for this is to call However, in light of the support to execute multiple DDL statements separated by |
@larkee agreed, Immediate call of method |
No description provided.