|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch pdo_dblib.patch for MSSQL related Bug #64338Patch version 2013-03-02 15:30 UTC Return to Bug #64338 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: mah@everybody.org
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) {
@@ -317,9 +320,6 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
/* allow double quoted indentifiers */
DBSETOPT(H->link, DBQUOTEDIDENT, NULL);
- if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
- goto cleanup;
- }
ret = 1;
dbh->max_escaped_char_length = 2;
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 06:00:01 2025 UTC |