#35830 [NEW]: Type mismatch with bind variables

2005-12-28 Thread nate-php at seekio dot com
From: nate-php at seekio dot com
Operating system: Ubuntu 5.10
PHP version:  5.1.1
PHP Bug Type: PDO related
Bug description:  Type mismatch with bind variables

Description:

In PHP 5.1.1 bind variables no longer seem to work with the ODBC PDO
driver connecting to DB2.  The same code that worked fine in 5.1.0 and
previous now throws an exception in 5.1.1 and php5.1-20051130 CVS
snapshot:

The query I'm running is:
insert into nate.testdb values (?, ?)

The table is specified as:
create table tb.testdb (a int, b varchar(50))

Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

I looked up the db2 error code CLI0112E and this is what it said:

CLI0112E Error in assignment.  

Explanation: 

The data sent for a parameter or column was incompatible with the data
type of the associated table column.  

User Response: 

Respecify the output binding through SQLBindCol or SQLGetData or the input
binding through SQLSetParam or SQLBindParameter.

Reproduce code:
---
try {
  $db = new PDO('odbc:sample', 'webdb', 'xxx');
  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
  die("Connect failed: " . $e->getMessage() . "\n");
}

try {
  $query = "insert into nate.testdb values (?, ?)";
  $sth = $db->prepare($query);

  $sth->execute(array(1, 'foobar'))

} catch (Exception $e) {
  die("Exception at line " . $e->getLine() . " of file " . $e->getFile() .
": " . $e->getMessage() . "\n");
}


Expected result:

a row is inserted with the values of 1, and foobar in the a and b columns

Actual result:
--
Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

and no row is inserted.

-- 
Edit bug report at http://bugs.php.net/?id=35830&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35830&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35830&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35830&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35830&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=35830&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=35830&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=35830&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=35830&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=35830&r=support
Expected behavior:http://bugs.php.net/fix.php?id=35830&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=35830&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=35830&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35830&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35830&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35830&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=35830&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=35830&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35830&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=35830&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=35830&r=mysqlcfg


#35830 [Opn]: Type mismatch with bind variables

2005-12-28 Thread nate-php at seekio dot com
 ID:   35830
 User updated by:  nate-php at seekio dot com
 Reported By:  nate-php at seekio dot com
 Status:   Open
 Bug Type: PDO related
-Operating System: Ubuntu 5.10
+Operating System: Debian 3.1 Sarge
 PHP Version:  5.1.1
 New Comment:

Oops, that create table statement should read:

create table nate.testdb (a int, b varchar(50))

(I had cut and pasted in the wrong schema)


Previous Comments:


[2005-12-28 20:31:06] nate-php at seekio dot com

Description:

In PHP 5.1.1 bind variables no longer seem to work with the ODBC PDO
driver connecting to DB2.  The same code that worked fine in 5.1.0 and
previous now throws an exception in 5.1.1 and php5.1-20051130 CVS
snapshot:

The query I'm running is:
insert into nate.testdb values (?, ?)

The table is specified as:
create table tb.testdb (a int, b varchar(50))

Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

I looked up the db2 error code CLI0112E and this is what it said:

CLI0112E Error in assignment.  

Explanation: 

The data sent for a parameter or column was incompatible with the data
type of the associated table column.  

User Response: 

Respecify the output binding through SQLBindCol or SQLGetData or the
input binding through SQLSetParam or SQLBindParameter.

Reproduce code:
---
try {
  $db = new PDO('odbc:sample', 'webdb', 'xxx');
  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
  die("Connect failed: " . $e->getMessage() . "\n");
}

try {
  $query = "insert into nate.testdb values (?, ?)";
  $sth = $db->prepare($query);

  $sth->execute(array(1, 'foobar'))

} catch (Exception $e) {
  die("Exception at line " . $e->getLine() . " of file " .
$e->getFile() . ": " . $e->getMessage() . "\n");
}


Expected result:

a row is inserted with the values of 1, and foobar in the a and b
columns

Actual result:
--
Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

and no row is inserted.





-- 
Edit this bug report at http://bugs.php.net/?id=35830&edit=1


#35830 [Fbk->Opn]: Type mismatch with bind variables

2005-12-28 Thread nate-php at seekio dot com
 ID:   35830
 User updated by:  nate-php at seekio dot com
 Reported By:  nate-php at seekio dot com
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Debian 3.1 Sarge
 PHP Version:  5.1.1
 New Comment:

Yes, I'm quite sure.  I can install 5.1.0 and it works fine, touch
nothing but the version and it stops working.  Here is the configure
line for php, which I forgot to give earlier:

./configure  --with-apache=../apache_1.3.34 --with-mysql
--with-pdo-mysql --with-gd --with-zlib --with-gettext
--with-pdo-odbc=ibm-db2,/home/db2inst1/sqllib

The php.ini is just the php.ini-recommended from the tarball with no
changes, and nothing in the apache conf overriding anything other than
the include path.

Thanks,
Nate


Previous Comments:


[2005-12-28 21:06:41] [EMAIL PROTECTED]

>The same code that worked fine in 5.1.0
Are you sure?
The only difference between 5.1.0 and 5.1.1 is that 5.1.1 doesn't have
Date class, which obviously doesn't affect PDO in any way.



[2005-12-28 20:39:20] nate-php at seekio dot com

Oops, that create table statement should read:

create table nate.testdb (a int, b varchar(50))

(I had cut and pasted in the wrong schema)



[2005-12-28 20:31:06] nate-php at seekio dot com

Description:

In PHP 5.1.1 bind variables no longer seem to work with the ODBC PDO
driver connecting to DB2.  The same code that worked fine in 5.1.0 and
previous now throws an exception in 5.1.1 and php5.1-20051130 CVS
snapshot:

The query I'm running is:
insert into nate.testdb values (?, ?)

The table is specified as:
create table tb.testdb (a int, b varchar(50))

Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

I looked up the db2 error code CLI0112E and this is what it said:

CLI0112E Error in assignment.  

Explanation: 

The data sent for a parameter or column was incompatible with the data
type of the associated table column.  

User Response: 

Respecify the output binding through SQLBindCol or SQLGetData or the
input binding through SQLSetParam or SQLBindParameter.

Reproduce code:
---
try {
  $db = new PDO('odbc:sample', 'webdb', 'xxx');
  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
  die("Connect failed: " . $e->getMessage() . "\n");
}

try {
  $query = "insert into nate.testdb values (?, ?)";
  $sth = $db->prepare($query);

  $sth->execute(array(1, 'foobar'))

} catch (Exception $e) {
  die("Exception at line " . $e->getLine() . " of file " .
$e->getFile() . ": " . $e->getMessage() . "\n");
}


Expected result:

a row is inserted with the values of 1, and foobar in the a and b
columns

Actual result:
--
Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

and no row is inserted.





-- 
Edit this bug report at http://bugs.php.net/?id=35830&edit=1


#35830 [Fbk->Opn]: Type mismatch with bind variables

2005-12-28 Thread nate-php at seekio dot com
 ID:   35830
 User updated by:  nate-php at seekio dot com
 Reported By:  nate-php at seekio dot com
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Debian 3.1 Sarge
 PHP Version:  5.1.1
 New Comment:

Same thing:

Exception at line 19 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php5.1-200512282330/ext/pdo_odbc/odbc_stmt.c:133)


Previous Comments:


[2005-12-29 01:20:26] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip





[2005-12-29 01:02:59] nate-php at seekio dot com

Yes, I'm quite sure.  I can install 5.1.0 and it works fine, touch
nothing but the version and it stops working.  Here is the configure
line for php, which I forgot to give earlier:

./configure  --with-apache=../apache_1.3.34 --with-mysql
--with-pdo-mysql --with-gd --with-zlib --with-gettext
--with-pdo-odbc=ibm-db2,/home/db2inst1/sqllib

The php.ini is just the php.ini-recommended from the tarball with no
changes, and nothing in the apache conf overriding anything other than
the include path.

Thanks,
Nate



[2005-12-28 21:06:41] [EMAIL PROTECTED]

>The same code that worked fine in 5.1.0
Are you sure?
The only difference between 5.1.0 and 5.1.1 is that 5.1.1 doesn't have
Date class, which obviously doesn't affect PDO in any way.



[2005-12-28 20:39:20] nate-php at seekio dot com

Oops, that create table statement should read:

create table nate.testdb (a int, b varchar(50))

(I had cut and pasted in the wrong schema)



[2005-12-28 20:31:06] nate-php at seekio dot com

Description:

In PHP 5.1.1 bind variables no longer seem to work with the ODBC PDO
driver connecting to DB2.  The same code that worked fine in 5.1.0 and
previous now throws an exception in 5.1.1 and php5.1-20051130 CVS
snapshot:

The query I'm running is:
insert into nate.testdb values (?, ?)

The table is specified as:
create table tb.testdb (a int, b varchar(50))

Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

I looked up the db2 error code CLI0112E and this is what it said:

CLI0112E Error in assignment.  

Explanation: 

The data sent for a parameter or column was incompatible with the data
type of the associated table column.  

User Response: 

Respecify the output binding through SQLBindCol or SQLGetData or the
input binding through SQLSetParam or SQLBindParameter.

Reproduce code:
---
try {
  $db = new PDO('odbc:sample', 'webdb', 'xxx');
  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
  die("Connect failed: " . $e->getMessage() . "\n");
}

try {
  $query = "insert into nate.testdb values (?, ?)";
  $sth = $db->prepare($query);

  $sth->execute(array(1, 'foobar'))

} catch (Exception $e) {
  die("Exception at line " . $e->getLine() . " of file " .
$e->getFile() . ": " . $e->getMessage() . "\n");
}


Expected result:

a row is inserted with the values of 1, and foobar in the a and b
columns

Actual result:
--
Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133)

and no row is inserted.





-- 
Edit this bug report at http://bugs.php.net/?id=35830&edit=1


#35830 [NoF->Opn]: Type mismatch with bind variables

2006-05-07 Thread nate-php at seekio dot com
 ID:   35830
 User updated by:  nate-php at seekio dot com
 Reported By:  nate-php at seekio dot com
-Status:   No Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Debian 3.1 Sarge
 PHP Version:  5CVS-2005-12-29 (snap)
 Assigned To:  wez
 New Comment:

I just tested with php5.1-200605051830.tar.gz which shows up as
PHP/5.1.5-dev in the server banner, and all seems to be working well. 
I'll re-open the bug if we see this error again.

Thank you very much for getting this fixed!

Thanks,
Nate


Previous Comments:


[2006-04-17 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2006-04-09 07:41:21] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip





[2005-12-29 10:08:59] [EMAIL PROTECTED]

Assigned to the PDO maintainer.



[2005-12-29 01:32:54] nate-php at seekio dot com

Same thing:

Exception at line 19 of file testdb.php: SQLSTATE[22005]: Error in
assignment: -9 [IBM][CLI Driver] CLI0112E  Error in assignment.
SQLSTATE=22005 (SQLExecute[-9] at
/usr/local/src/php5.1-200512282330/ext/pdo_odbc/odbc_stmt.c:133)



[2005-12-29 01:20:26] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35830

-- 
Edit this bug report at http://bugs.php.net/?id=35830&edit=1