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-04 16:00 UTC Return to Bug #64338 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions:Developer: mah@everybody.orgUse 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; |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Thu Nov 21 11:01:29 2024 UTC |