Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45255 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3206 invoked from network); 10 Aug 2009 09:16:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2009 09:16:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:65472] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/33-19557-685EF7A4 for ; Mon, 10 Aug 2009 05:16:55 -0400 Received: by fxm20 with SMTP id 20so2549287fxm.24 for ; Mon, 10 Aug 2009 02:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+O2xP+jvTSql7UuVNNAbM+zf6zl+2oZ/Tk3xUTOFNrA=; b=ZLg8+fDDMqFUC/iTBt9PweTFypcnj9vCpiaLg15vun979O53lO4X0HKGDSxb/zhUV3 eQxnDJYwbvECccv4aEb3DdC9MS+qMNl8DNwBCDCP3QRxeOMJgIKwDSw/g7NaZ727Glxc dn5Sc5qJqwesDDXdW3A9+ItNQ5qE/3OGUGi3M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=J8CAggA1qQDxbq3MyWeKeWDzJz9J2jKc/LFvwf3AgOIjF8jlBkR3zo8UVOFXqasI9o CjcKLbuTeSiJXQLsEqMSxvl8F8G9qcwXAOm5+3QY77tHlpZSXjDbhF8+Z4aggalyyr7V PSsNzjGAnFHwNODMpMMsaOq6JKygQbzQqAk5k= MIME-Version: 1.0 Received: by 10.86.89.6 with SMTP id m6mr3076306fgb.1.1249895811486; Mon, 10 Aug 2009 02:16:51 -0700 (PDT) In-Reply-To: <4A7FE21B.3050907@gmail.com> References: <4A7F1E2C.8010406@gmail.com> <4A7FE21B.3050907@gmail.com> Date: Mon, 10 Aug 2009 11:16:51 +0200 Message-ID: To: Oskar Eisemuth Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: SQLite Bug 42589 still not fixed in php 5.3 windows (attached fix with ATTR_FETCH_TABLE_NAMES support) From: pierre.php@gmail.com (Pierre Joye) hi, Please post a link to the patch in the bug directly so we won't loose your patch in the ML archive. By the way, it is better to use the bug tracker to provide feedback, easier to follow or track them. Thanks for your effort :) Cheers, On Mon, Aug 10, 2009 at 11:02 AM, Oskar Eisemuth wrote: > Hello > > Attached is a patch that adds the necessary changes at config.w32 and > additional support for PDO::ATTR_FETCH_TABLE_NAMES in PDO SQLite. > > --- > Oskar > > > Index: ext/pdo_sqlite/config.w32 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/pdo_sqlite/config.w32 =A0 (revision 286990) > +++ ext/pdo_sqlite/config.w32 =A0 (working copy) > @@ -4,7 +4,7 @@ > =A0ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no"); > > =A0if (PHP_PDO_SQLITE !=3D "no") { > - =A0 =A0 =A0 EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c > sqlite_statement.c", null, "/DSQLITE_THREADSAFE=3D1 /I" + > configure_module_dirname + "/../sqlite3/libsqlite /I" + > configure_module_dirname); > + =A0 =A0 =A0 EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c > sqlite_statement.c", null, "/DSQLITE_THREADSAFE=3D1 > /DSQLITE_ENABLE_COLUMN_METADATA=3D1 /I" + configure_module_dirname + > "/../sqlite3/libsqlite /I" + configure_module_dirname); > > =A0 =A0 =A0 =A0ADD_EXTENSION_DEP('pdo_sqlite', 'pdo'); > =A0 =A0 =A0 =A0// If pdo_sqlite is static, and sqlite3 is also static, th= en we don't > add a second copy of the sqlite3 libs > Index: ext/pdo_sqlite/php_pdo_sqlite_int.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/pdo_sqlite/php_pdo_sqlite_int.h (revision 286990) > +++ ext/pdo_sqlite/php_pdo_sqlite_int.h (working copy) > @@ -50,6 +50,7 @@ > =A0 =A0 =A0 =A0sqlite3 *db; > =A0 =A0 =A0 =A0pdo_sqlite_error_info einfo; > =A0 =A0 =A0 =A0struct pdo_sqlite_func *funcs; > + =A0 =A0 =A0 unsigned fetch_table_names:1; > =A0} pdo_sqlite_db_handle; > > =A0typedef struct { > Index: ext/pdo_sqlite/sqlite_driver.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/pdo_sqlite/sqlite_driver.c =A0 =A0 =A0(revision 286990) > +++ ext/pdo_sqlite/sqlite_driver.c =A0 =A0 =A0(working copy) > @@ -283,6 +283,11 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0convert_to_long(val); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sqlite3_busy_timeout(H->db= , Z_LVAL_P(val) * 1000); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 1; > +#ifdef SQLITE_ENABLE_COLUMN_METADATA > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case PDO_ATTR_FETCH_TABLE_NAMES: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 H->fetch_table_names =3D Z_= BVAL_P(val); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 1; > +#endif > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0return 0; > =A0} > Index: ext/pdo_sqlite/sqlite_statement.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/pdo_sqlite/sqlite_statement.c =A0 (revision 286990) > +++ ext/pdo_sqlite/sqlite_statement.c =A0 (working copy) > @@ -221,8 +221,20 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 0; > =A0 =A0 =A0 =A0} > > + > + > +#ifdef SQLITE_ENABLE_COLUMN_METADATA > + =A0 =A0 =A0 if (S->H->fetch_table_names) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 int namelen; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 namelen =3D spprintf(&stmt->columns[colno].= name, 0, "%s.%s", > sqlite3_column_table_name(S->stmt, colno), sqlite3_column_name(S->stmt, > colno)); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 stmt->columns[colno].namelen =3D namelen; > + =A0 =A0 =A0 } else { > +#endif > =A0 =A0 =A0 =A0stmt->columns[colno].name =3D estrdup(sqlite3_column_name(= S->stmt, > colno)); > =A0 =A0 =A0 =A0stmt->columns[colno].namelen =3D strlen(stmt->columns[coln= o].name); > +#ifdef SQLITE_ENABLE_COLUMN_METADATA > + =A0 =A0 =A0 } > +#endif > =A0 =A0 =A0 =A0stmt->columns[colno].maxlen =3D 0xffffffff; > =A0 =A0 =A0 =A0stmt->columns[colno].precision =3D 0; > > Index: ext/sqlite3/config.w32 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/sqlite3/config.w32 =A0 =A0 =A0(revision 286990) > +++ ext/sqlite3/config.w32 =A0 =A0 =A0(working copy) > @@ -4,7 +4,7 @@ > =A0ARG_WITH("sqlite3", "SQLite 3 support", "no"); > > =A0if (PHP_SQLITE3 !=3D "no") { > - =A0 =A0 =A0 ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=3D" + (PHP= _ZTS =3D=3D > "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=3D1 /D SQLITE_CORE=3D1 "); > + =A0 =A0 =A0 ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=3D" + (PHP= _ZTS =3D=3D > "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=3D1 /D SQLITE_CORE=3D1 /D > DSQLITE_ENABLE_COLUMN_METADATA=3D1 "); > =A0 =A0 =A0 =A0EXTENSION("sqlite3", "sqlite3.c", null, "/I" + > configure_module_dirname + "/libsqlite /I" + configure_module_dirname); > > =A0 =A0 =A0 =A0ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqli= te3.c", > "sqlite3"); > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=20 Pierre http://blog.thepimp.net | http://www.libgd.org