Bug #47588 [Opn]: PDO_DBLIB: barfs on quoted field names
Edit report at http://bugs.php.net/bug.php?id=47588&edit=1 ID: 47588 User updated by: ssufficool at roadrunner dot com Reported by: ssufficool at roadrunner dot com Summary: PDO_DBLIB: barfs on quoted field names Status: Open Type: Bug Package: PDO related Operating System: Linux Gentoo 2.6.x -PHP Version: 5.2.9 +PHP Version: 5.3-svn New Comment: Set quoted identifiers to allow "FIELD NAME" quoting style. Index: ext/pdo_dblib/dblib_driver.c === --- ext/pdo_dblib/dblib_driver.c(revision 296453) +++ ext/pdo_dblib/dblib_driver.c(working copy) @@ -236,6 +236,9 @@ /* limit text/image from network */ DBSETOPT(H->link, DBTEXTSIZE, "2147483647"); + /* Allow double quoted field and table names */ + DBSETOPT(H->link, DBQUOTEDIDENT, NULL); + if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) { goto cleanup; } Previous Comments: -------- [2009-05-15 19:43:17] ssufficool at roadrunner dot com Solution: tsql from freetds package set the following where PDO does not: set quoted_identifier on set ansi_warnings on set ansi_padding on set ansi_nulls on set concat_null_yields_null on Since this is default behavior of FreeTDS (tsql) and NT DBLIB (isql), I assume it should be for PDO dblib as well. -------- [2009-03-06 16:13:33] ssufficool at roadrunner dot com Description: When passing a query containing double quoted field names, the query fails. Reproduce code: --- $pdo_ms = new PDO('dblib:host=db01;dbname=database', $_SESSION['user'], $_SESSION['pass'], array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) ); $rs = $pdo_ms->prepare('SELECT "myView"."FieldName" from "myView" order by "Some Field"') Expected result: A valid handle to a stmt in $rs Actual result: -- SQLSTATE[HY000]: General error: 20018 Incorrect syntax near 'FieldName'. [20018] (severity 5) [(null)] -- Edit this bug report at http://bugs.php.net/bug.php?id=47588&edit=1
#47589 [Bgs]: PDO DBLIB Fails with OOM on large recordsets
ID: 47589 User updated by: ssufficool at roadrunner dot com Reported By: ssufficool at roadrunner dot com Status: Bogus Bug Type: PDO related Operating System: Linux (Gentoo) PHP Version: 5.2.9 New Comment: Please re-open this bug. I understand that the behaviour is shared across the PDO::DBLIB and MSSQL_* functions, however other PDO drivers do not have this issue (I.E. PDO:POSTGRESQL) and the same query issued on the command line via freetds (tsql) does not consume memory like this. I am using a CURSOR_FWDONLY and this should not require buffering all the rows on the client. Previous Comments: [2009-03-06 17:04:47] ssufficool at roadrunner dot com My understanding of Bogus is indeed Bogus. After setting batchsize to 0 in php.ini, mssql_query also barfs on large recordssets. Apologies for the noise. [2009-03-06 16:36:43] ssufficool at roadrunner dot com Description: When pulling large recordsets with PDO DBLIB I get out of memory. This type of large recordset query works fine on mssql_* functions using the freetds library. This issue has been marked "Bogus" in the past. But since this works with other functions using FreeTDS, this issue may lie in the PDO layer. Correct me if my understanding of Bogus is Bogus. Reproduce code: --- $pdo_ms = new PDO('dblib: host=host', 'user','pass'); /* We die here */ $rs = $pdo_ms->query("SELECT TOP 5 from aVeryLargeTable"); Expected result: A valid handle to a resultset in $rs Actual result: -- Available memory exhausted, tried to allocate -- Edit this bug report at http://bugs.php.net/?id=47589&edit=1
#47588 [Opn]: PDO_DBLIB: barfs on quoted field names
ID: 47588 User updated by: ssufficool at roadrunner dot com Reported By: ssufficool at roadrunner dot com Status: Open Bug Type: PDO related Operating System: Linux Gentoo 2.6.x PHP Version: 5.2.9 New Comment: Solution: tsql from freetds package set the following where PDO does not: set quoted_identifier on set ansi_warnings on set ansi_padding on set ansi_nulls on set concat_null_yields_null on Since this is default behavior of FreeTDS (tsql) and NT DBLIB (isql), I assume it should be for PDO dblib as well. Previous Comments: [2009-03-06 16:13:33] ssufficool at roadrunner dot com Description: When passing a query containing double quoted field names, the query fails. Reproduce code: --- $pdo_ms = new PDO('dblib:host=db01;dbname=database', $_SESSION['user'], $_SESSION['pass'], array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) ); $rs = $pdo_ms->prepare('SELECT "myView"."FieldName" from "myView" order by "Some Field"') Expected result: A valid handle to a stmt in $rs Actual result: -- SQLSTATE[HY000]: General error: 20018 Incorrect syntax near 'FieldName'. [20018] (severity 5) [(null)] -- Edit this bug report at http://bugs.php.net/?id=47588&edit=1
#47589 [Opn->Bgs]: PDO DBLIB Fails with OOM on large recordsets
ID: 47589 User updated by: ssufficool at roadrunner dot com Reported By: ssufficool at roadrunner dot com -Status: Open +Status: Bogus Bug Type: PDO related Operating System: Linux (Gentoo) PHP Version: 5.2.9 New Comment: My understanding of Bogus is indeed Bogus. After setting batchsize to 0 in php.ini, mssql_query also barfs on large recordssets. Apologies for the noise. Previous Comments: [2009-03-06 16:36:43] ssufficool at roadrunner dot com Description: When pulling large recordsets with PDO DBLIB I get out of memory. This type of large recordset query works fine on mssql_* functions using the freetds library. This issue has been marked "Bogus" in the past. But since this works with other functions using FreeTDS, this issue may lie in the PDO layer. Correct me if my understanding of Bogus is Bogus. Reproduce code: --- $pdo_ms = new PDO('dblib: host=host', 'user','pass'); /* We die here */ $rs = $pdo_ms->query("SELECT TOP 5 from aVeryLargeTable"); Expected result: A valid handle to a resultset in $rs Actual result: -- Available memory exhausted, tried to allocate -- Edit this bug report at http://bugs.php.net/?id=47589&edit=1
#47589 [NEW]: PDO DBLIB Fails with OOM on large recordsets
From: ssufficool at roadrunner dot com Operating system: Linux (Gentoo) PHP version: 5.2.9 PHP Bug Type: PDO related Bug description: PDO DBLIB Fails with OOM on large recordsets Description: When pulling large recordsets with PDO DBLIB I get out of memory. This type of large recordset query works fine on mssql_* functions using the freetds library. This issue has been marked "Bogus" in the past. But since this works with other functions using FreeTDS, this issue may lie in the PDO layer. Correct me if my understanding of Bogus is Bogus. Reproduce code: --- $pdo_ms = new PDO('dblib: host=host', 'user','pass'); /* We die here */ $rs = $pdo_ms->query("SELECT TOP 5 from aVeryLargeTable"); Expected result: A valid handle to a resultset in $rs Actual result: -- Available memory exhausted, tried to allocate -- Edit bug report at http://bugs.php.net/?id=47589&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47589&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47589&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47589&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47589&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47589&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47589&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47589&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47589&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47589&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47589&r=support Expected behavior: http://bugs.php.net/fix.php?id=47589&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47589&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47589&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47589&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47589&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=47589&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47589&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47589&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47589&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47589&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47589&r=mysqlcfg
#47588 [NEW]: DBLIB barfs on quoted field names
From: ssufficool at roadrunner dot com Operating system: Linux Gentoo 2.6.x PHP version: 5.2.9 PHP Bug Type: PDO related Bug description: DBLIB barfs on quoted field names Description: When passing a query containing double quoted field names, the query fails. Reproduce code: --- $pdo_ms = new PDO('dblib:host=db01;dbname=database', $_SESSION['user'], $_SESSION['pass'], array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) ); $rs = $pdo_ms->prepare('SELECT "myView"."FieldName" from "myView" order by "Some Field"') Expected result: A valid handle to a stmt in $rs Actual result: -- SQLSTATE[HY000]: General error: 20018 Incorrect syntax near 'FieldName'. [20018] (severity 5) [(null)] -- Edit bug report at http://bugs.php.net/?id=47588&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47588&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47588&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47588&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47588&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47588&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47588&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47588&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47588&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47588&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47588&r=support Expected behavior: http://bugs.php.net/fix.php?id=47588&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47588&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47588&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47588&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47588&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=47588&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47588&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47588&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47588&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47588&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47588&r=mysqlcfg