Re: com php-src: FIX BUG #65219 - USE DB not being sent for FreeTDS version < 0.92 FreeTDS <0.92 does not support DBSETLDBNAME option and therefore
will not work with SQL Azure. Fallback to dbuse command in letter versions.: ext/pdo_dblib/dblib_driver.c
| From: | Nikita Popov | Date: | Sat, 05 Oct 2013 17:39:56 +0000 |
| Subject: | Re: com php-src: FIX BUG #65219 - USE DB not being sent for FreeTDS version < 0.92 FreeTDS <0.92 does not support DBSETLDBNAME option and therefore will not work with SQL Azure. Fallback to dbuse command in letter versions.: ext/pdo_dblib/dblib_driver.c |
||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-73362@lists.php.net to get a copy of this message | ||
On Sat, Oct 5, 2013 at 6:54 PM, Stanley Sufficool <ssufficool@php.net>wrote:
> Commit: 690bbe170d9ed4597629e4e986575fbe0a2cb796
> Author: Stanley Sufficool <ssufficool@php.net> Sat, 5 Oct 2013
> 09:54:45 -0700
> Parents: ac05cfb49912dd87264573df930d0ead3c3e0cca
> Branches: PHP-5.4
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=690bbe170d9ed4597629e4e986575fbe0a2cb796
>
> Log:
> FIX BUG #65219 - USE DB not being sent for FreeTDS version < 0.92
> FreeTDS <0.92 does not support DBSETLDBNAME option and therefore
> will not work with SQL Azure. Fallback to dbuse command in
> letter versions.
>
> Bugs:
> https://bugs.php.net/65219
>
> Changed paths:
> M ext/pdo_dblib/dblib_driver.c
>
>
> Diff:
> diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
> index 2aaf397..13444b8 100644
> --- a/ext/pdo_dblib/dblib_driver.c
> +++ b/ext/pdo_dblib/dblib_driver.c
> @@ -350,9 +350,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh,
> zval *driver_options TSRMLS_
>
> DBSETLAPP(H->login, vars[1].optval);
>
> +/* DBSETLDBNAME is only available in FreeTDS 0.92 or above */
> #ifdef DBSETLDBNAME
> if (vars[3].optval) {
> - DBSETLDBNAME(H->login, vars[3].optval);
> + if(FAIL == DBSETLDBNAME(H->login, vars[3].optval)) goto
> cleanup;
> }
> #endif
>
> @@ -362,6 +363,16 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh,
> zval *driver_options TSRMLS_
> goto cleanup;
> }
>
> +/*
> + * FreeTDS < 0.92 does not support the DBSETLDBNAME option
> + * Send use database here after login (Will not work with SQL Azure)
> + */
> +#ifndef DBSETLDBNAME
> + if (vars[3].optval) {
> + if(FAIL == dbuse(H->link, vars[3].optval)) goto gleanup;
> + }
> +#endif
>
Is that supposed to be "gleanup"?
Furthermore this does not look properly merged, see
https://github.com/php/php-src/network (PHP-5.4
not merged into PHP-5.5,
PHP-5.5 not merged into master).
Nikita