keboola / php-db-import

MIT License
4 stars 0 forks source link

Snowflake - ODBC Bind Error Demo #18

Closed Halama closed 7 years ago

Halama commented 8 years ago

Run test:

docker-compose run  \ 
  -e SNOWFLAKE_PASSWORD=$SNOWFLAKE_PASSWORD \
  -e SNOWFLAKE_DATABASE=$SNOWFLAKE_DATABASE \
  -e SNOWFLAKE_WAREHOUSE=$SNOWFLAKE_WAREHOUSE \
  -e SNOWFLAKE_USER=$SNOWFLAKE_USER \
  -e SNOWFLAKE_HOST=$SNOWFLAKE_HOST \
  tests vendor/bin/phpunit tests/SnowflakeCreateBindingTest.php

Possible bug

odbc_execute throws dbc_execute(): Can't open file ddd error when binding value with quotes. Code example:

 $stmt = odbc_prepare($connection, "SELECT * FROM original WHERE x = ?");
 odbc_execute($stmt, array("'ddd'"));
 $result = odbc_fetch_array($stmt);
 $this->assertEmpty($result);
 odbc_free_result($stmt);

https://github.com/keboola/php-db-import/blob/d526fc32106478170cc889add9ebab958d603b37/tests/SnowflakeCreateBindingTest.php#L101