php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #57879
Patch pdo_dblib.patch revision 2015-05-07 12:36 UTC by amila at cenango dot lk

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;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 12:01:26 2024 UTC