ZF-3011: DB2 on i5 fails because of table and column names quoting

Issue Type: Bug Created: 2008-04-01T09:34:43.000+0000 Last Updated: 2009-01-10T11:41:33.000+0000 Status: Closed Fix version(s): - 1.7.3 (19/Jan/09)

Reporter: Alexander Veremyev (alexander) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Adapter_Db2

Related issues: - ZF-3072



The following script was used:

<pre class="highlight">
require_once 'Zend/Db/Adapter/Db2.php';
$db = new Zend_Db_Adapter_Db2(

$db->insert("animals",Array("a"=>"Serg ","b"=>"Just a","c"=>"12345"));
$v=$db->fetchRow("select * from animals where a='Serg '");

It fails with the following result:

<pre class="highlight">
[01-Apr-2008 07:37:45] PHP Warning:  db2_prepare(): Statement Prepare Failed in /usr/local/Zend/ZendFramework/library/Zend/Db/Statement/Db2.php on line 64
[01-Apr-2008 07:37:45] PHP Fatal error:  Uncaught exception 'Zend_Db_Statement_Db2_Exception' with message '"animals" in LOUISA type *FILE not found. SQLCODE=-204' in /usr/local/Zend/ZendFramework/library/Zend/Db/Statement/Db2.php:72
Stack trace:
#0 /usr/local/Zend/ZendFramework/library/Zend/Db/Statement.php(109): Zend_Db_Statement_Db2->_prepare('INSERT INTO "an...')
#1 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Db2.php(199): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Db2), 'INSERT INTO "an...')
#2 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(395): Zend_Db_Adapter_Db2->prepare('INSERT INTO "an...')
#3 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(474): Zend_Db_Adapter_Abstract->query('INSERT INTO "an...', Array)
#4 /usr/local/Zend/ZendFramework/t1.php(10): Zend_Db_Adapter_Abstract->insert('animals', Array)
#5 {main}
  thrown in /usr/local/Zend/ZendFramework/library/Zend/Db/Statement/Db2.php on line 72

var_dump() within Db2.php just before db2_prepare call gives the following result:

<pre class="highlight">
string(54) "INSERT INTO "animals" ("a", "b", "c") VALUES (?, ?, ?)"

The following script works OK:

<pre class="highlight">
$conn = db2_connect("xxxxxx", "LOUISA", "*******");

if ($conn) {
    echo "Connection succeeded.<br></br>";
else {
    echo "Connection failed.<br></br>";

$r=db2_prepare($conn,'insert into animals (a,b,c) values (?,?,?)');


Posted by Darby Felton (darby) on 2008-04-08T13:17:46.000+0000

Alex, how did you come to report this issue? Are you running DB2 on i5 somewhere?

Posted by Alexander Veremyev (alexander) on 2008-04-09T18:23:35.000+0000

Sergey Korolyov "serg at" (original reporter of the problem) has an access to DB2 on i5. We could ask him to make tests we need. Probably he can also provide an access to DB2 on i5 for us.

PS He also lives in SPb, but doesn't have a habit to work at nights :) So if you write him now, his respond will come with some delay

Posted by Wil Sinclair (wil) on 2008-04-18T13:20:28.000+0000

Please evaluate and categorize as necessary.

Posted by Alessandro Camilli (alex_cam) on 2008-06-26T02:42:47.000+0000

I have the same problem with i5 and os v5r3.

You can contact me at if you want more information of the problem

Posted by Ralph Schindler (ralph) on 2009-01-10T11:41:33.000+0000

This was fixed in ZF 1.7.2 with the new i5 enabled adapter.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.