Patch pdo_dblib.patch for PDO_DBLIB Bug #57879
Patch version 2015-05-07 12:36 UTC
Return to Bug #57879 |
Download this patch
Patch Revisions:
Developer: amila@cenango.lk
Use the DBSETLDBNAME macro to set the dbname in the db-lib LOGINREC.
That sets the dbname in the login packet, obviating the need for "USE
dbname" and allowing pdo_dblib to work with Azure's SQL.
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -288,6 +288,9 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
if (dbh->password) {
DBSETLPWD(H->login, dbh->password);
}
+ if (vars[3].optval) {
+ DBSETLDBNAME(H->login, vars[3].optval);
+ }
#if !PHP_DBLIB_IS_MSSQL
if (vars[0].optval) {
@@ -315,11 +315,8 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
DBSETOPT(H->link, DBTEXTSIZE, "2147483647");
/* allow double quoted indentifiers */
- DBSETOPT(H->link, DBQUOTEDIDENT, 1);
+ DBSETOPT(H->link, DBQUOTEDIDENT, "1");
- if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
- goto cleanup;
- }
ret = 1;
dbh->max_escaped_char_length = 2;
|