Skip to content
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

Snowflake: Query executed twice with queries like: alter statements #8

Closed
yoramdelangen opened this issue May 23, 2022 · 1 comment
Closed

Comments

@yoramdelangen
Copy link
Collaborator

yoramdelangen commented May 23, 2022

Ours and Snowflake's documentation states that prepare queries are executed directly on sent to the server. This is the default behavior of Snowflake, it can be disabled by adding to the driver configuration (Mac/Linux users: simba.snowflake.conf): NoExecuteInSqlPrepare=true.

But recently we have experienced this configuration is not working and were currently working with Snowflake support/internal ODBC dev team to look into this problem.

We have found 2 workarounds for this:
1. Remove or set NoExecuteInSqlPrepare=false and make sure you are using version 1.1.4. Because it is not executing the PDO original execute method on the PDO class when detecting 0 values bound to the prepare method.
2. Start using the snowflake_pdo extension which is supported from version 1.2.

UPDATE 2022-05-25

We have narrowed it down to alter column add constraint queries to fail and not respecting the NoExecuteInSqlPrepare=true driver configuration. Current workaround is within version 1.1.5, we're checking if the query is containing "add constraint" on execute. If so, we skip calling the execute call.

Support for the PDO snowflake PHP extension is available in 1.1.5.

@yoramdelangen
Copy link
Collaborator Author

yoramdelangen commented May 25, 2022

Updated description about the issue/current workaround. Added support for PDO Snowflake extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant