Skip to content

Commit

Permalink
Fix bug #5161 (#5165)
Browse files Browse the repository at this point in the history
* Fix odbc constant

* Fix bug #5161
  • Loading branch information
NathanFreeman authored Oct 16, 2023
1 parent facc147 commit 53ccce5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext-src/swoole_odbc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ SQLRETURN SQL_API swoole_odbc_SQLDisconnect(SQLHDBC ConnectionHandle) {
}

int php_swoole_odbc_minit(int module_id) {
if (zend_hash_str_find(&php_pdo_get_dbh_ce()->constants_table, ZEND_STRL("PGSQL_ATTR_DISABLE_PREPARES")) ==
if (zend_hash_str_find(&php_pdo_get_dbh_ce()->constants_table, ZEND_STRL("ODBC_ATTR_USE_CURSOR_LIBRARY")) ==
nullptr) {
#ifdef SQL_ATTR_CONNECTION_POOLING
char *pooling_val = NULL;
Expand Down Expand Up @@ -244,6 +244,8 @@ int php_swoole_odbc_minit(int module_id) {
REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_DRIVER", SQL_CUR_USE_DRIVER);
REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_ODBC", SQL_CUR_USE_ODBC);
}

php_pdo_unregister_driver(&swoole_pdo_odbc_driver);
php_pdo_register_driver(&swoole_pdo_odbc_driver);

return SUCCESS;
Expand Down

0 comments on commit 53ccce5

Please sign in to comment.