Bug #65952 [NEW]: Invalid buffer position in Prepared Statement
| From: | wils dot solutions at gmail dot com | Date: | Wed, 23 Oct 2013 15:36:45 +0000 |
| Subject: | Bug #65952 [NEW]: Invalid buffer position in Prepared Statement | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182408@lists.php.net to get a copy of this message | ||
From: wils dot solutions at gmail dot com
Operating system: Centos6
PHP version: 5.4.21
Package: PDO related
Bug Type: Bug
Bug description:Invalid buffer position in Prepared Statement
Description:
------------
I was trying to use PDO_ODBC with HP Vertica but it returns the "Invalid
buffer position" error.
I don't have this problem using ODBC Functions and I am using it now
instead of PDO_ODBC but decided to report the issue anyways...
By looking at the ODBC trace files, I see that when pdo_odbc binds
parameter, it always sets the BufferLength argument of the
SQLBindParameter() function to 0. I believe this is wrong, since the
input is a character type, and as a result there is a buffer overrun.
Test script:
---------------
$query = "select * from category where name = :nome";
$sth = $this->_lnk->prepare($query);
$category = 'Hardcore';
$sth->bindParam(':nome', $category);
$sth->execute();
Expected result:
----------------
The query result
Actual result:
--------------
Fails with error:
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000]: General error: 50240 [Vertica][Support] (50240)
Invalid buffer position. (SQLExecute[50240] at
/builddir/build/BUILD/php-5.4.21/ext/pdo_odbc/odbc_stmt.c:254)' in
/admin_vertica_report.class.php on line 39
--
Edit bug report at https://bugs.php.net/bug.php?id=65952&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65952&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=65952&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65952&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65952&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65952&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65952&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65952&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65952&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65952&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65952&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65952&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65952&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65952&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65952&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65952&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65952&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65952&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65952&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65952&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65952&r=mysqlcfg