Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47831 invoked by uid 1010); 24 Oct 2007 15:34:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47816 invoked from network); 24 Oct 2007 15:34:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2007 15:34:53 -0000 X-Host-Fingerprint: 80.197.188.103 0x50c5bc67.odnxx5.adsl-dhcp.tele.dk Received: from [80.197.188.103] ([80.197.188.103:5126] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/1E-47805-C166F174 for ; Wed, 24 Oct 2007 11:34:53 -0400 Message-ID: To: internals@lists.php.net Reply-To: "Lars Westermann" References: Date: Wed, 24 Oct 2007 17:34:44 +0200 Lines: 314 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response X-Posted-By: 80.197.188.103 Subject: Re: PDO Firebird bugfixes - once again :) From: Lars.Westermann@privat.dk ("Lars Westermann") "Live and learn" ... Trying once again: Please find attached a unified diff (diff -u) for 4 files addressing bugfixes for PDO_firebird in the PHP_5_3 branch. The following bug reports are addressed: Bug #36128 (Interbase PDO - timestamp columns return NULL) When pdo_firebird is enabled, and interbase is disabled, then timestamps and dates are returned as NULL strings, as the format relies on INI-entries made by the interbase extension. The solution (after dialogue with Wez) is to NOT use INI-entries at all, but give the user the possibility to set format strings with PDO::setAttribute() and to define a set of ISO8601 default format strings. This is handled in: ext/pdo_firebird/php_pdo_firebird_int.h (all changes) # Added ISO8601 format definitions ext/pdo_firebird/pdo_firebird.c (all changes) # Registering of the format attributes ext/pdo_firebird/firebird_driver.c (@@ -114,6 +114,16 @@) (@@ -482,6 +492,30 @@) (@@ -500,7 +534,7 @@) # Removing a compiler warning ext/pdo_firebird/firebird_statement.c (@@ -374,51 +345,18 @@) # Which also removes some dead code Bug #39822 (new PDO() doesn't work with firebird) Bug #41522 (PDO firebird driver returns null if it fails to connect) The driver doesn't throw an exception (which it should according to the specification). The solution is to throw this exception (inspired by the solution in one of the other pdo drivers) in the pdo_firebird_handle_factory() function. This is handled in: ext/pdo_firebird/firebird_driver.c (@@ -646,6 +679,14 @@) Bug #35386 (firebird: first row is null) This was a bit hard to track down, but here goes: When columns of first row is handled (one by one), the datatype of the column is set to STRING in firebird_stmt_get_col(). But this was done AFTER the columntype already was set prior to the call of firebird_stmt_get_col(). Therefore the columntype was correct when the second row was handled. The columntype wasn't initialzed to a sane value in firebird_stmt_describe(). The solution (again with reference to the PDO spec I got from Wez) is to REMOVE the columntype (or param_type) handling from firebird_stmt_get_col() and put it into the right place: firebird_stmt_describe(). All parameters going from the driver to the PDO object should be passed as strings (according to the specification), thus all the code (#ifdef'ed out by abies) regarding native longs, shorts, etc. is removed. Bugfixes: ext/pdo_firebird/firebird_statement.c (@@ -170,43 +170,11 @@) # Set param_type to STRING (@@ -340,11 +317,6 @@) # Remove dead code (@@ -353,7 +325,6 @@) # Remove dead code (@@ -618,13 +556,6 @@) # Remove dead code Bug #39700 (NUMERIC error when result precision are 7,8 or 12-14 ) Took the solution from the comment section of the bugreport and put into play. ext/pdo_firebird/firebird_statement.c (@@ -302,15 +270,24 @@) Hope this is better Best regards Lars begin 666 pdo_firebird-diff-u.txt M26YD97@Z('!D;U]F:7)E8FER9"]F:7)E8FER9%]D2]P:' M2!01$\@=&\@9V5T(&$@9')I=F5R+7-P96-I9FEC(&1B:"!A M='1R:6)U=&4@*B\*+7-T871I8R!I;G0@9FER96)IR J+PH@>PH@"7!D M;U]F:7)E8FER9%]D8E]H86YD;&4@*D@@/2 H<&1O7V9IPI 0" M-C(W+#$U("LV M-C$L,30@0$ *( D)?0H@"0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I.PHM"0D)"0EBPH@"0D)"6-A#H@<&1O7V9IWM[("HO"B!["BL)4D5'25-415)?4$1/7T-,05-3 M7T-/3E-47TQ/3DPHK"5!$3U]&0E]!5%12 M7T1!5$5?1D]234%4(#T@4$1/7T%45%)?1%))5D527U-014-)1DE#+ HK"5!$ M3U]&0E]!5%127U1)345?1D]234%4+ HK"5!$3U]&0E]!5%127U1)34535$%- M4%]&3U)-050L"BM].PHK"B C96YD:68)+RH@4$A07U!$3U]&25)%0DE21%]) .3E1?2" J+PH@"B O*@H` ` end