We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


SQLSTATE[HY000]: General error: 50240 [Vertica][Support] (50240) Invalid buffer position. — Vertica Forum

SQLSTATE[HY000]: General error: 50240 [Vertica][Support] (50240) Invalid buffer position.

I have a very simple PHP query that return an error: 50240 Invalid buffer position.

This is the code I am using to test:

$query = "select * from category where name = :nome";       
$sth = $this->_lnk->prepare($query);       
$category = 'Hardcore';       
$sth->bindParam(':nome', $category);       
$sth->execute();


- This is the trace from vertica_odbc.log:

Oct 18 13:05:59 INFO  -723515456 VDataEngine::Prepare: Original Query: select * from category where name = ?Oct 18 13:05:59 INFO  -723515456 VDataEngine::Prepare: Query: select * from category where name = ?Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::VQueryExecutor: +++++ enter +++++Oct 18 13:05:59 INFO  -723515456 VDataEngine::Prepare: Initializing prepared statement: _PLAN0x284c960_0Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::InitializePreparedExecutor: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VBaseResultSet::VBaseResultSet: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VPQResultSet::VPQResultSet: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::ClearCancel: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::PopulateParameters: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::GetResults: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VPQResultSet::GetSelectColumns: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::GetResults: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 Statement::SQLDescribeParam: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 StatementStatePrepared::SQLDescribeParam: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 Statement::SQLBindParameter: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 StatementState::SQLBindParameter: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 Connection::SQLExecute: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 ConnectionState5::SQLExecute: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 ConnectionState::SQLExecute: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 Statement::SQLExecute: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 StatementState3::SQLExecute: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::ClearCancel: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::GetNumParams: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::GetNumParams: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::GetNumParams: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::FinalizePushedParamData: +++++ enter +++++Oct 18 13:05:59 TRACE -723515456 VQueryExecutor::Execute: +++++ enter +++++Oct 18 13:05:59 ERROR -723515456 Statement::SQLExecute: [Vertica][Support] (50240) Invalid buffer position.




- This is the vertica.log of the database:

2013-10-18 13:08:23.278 Init Session:0x7f1558010ac0 <LOG> @v_crakrevenue_node0001: 00000/2609: Client pid: 157592013-10-18 13:08:23.278 Init Session:0x7f1558010ac0 [Session] <INFO> [Query] TX:0(avert01.verticatest.l-3305:0x17fad) set session autocommit to on2013-10-18 13:08:23.279 Init Session:0x7f1558010ac0 [Session] <INFO> [Query] TX:0(avert01.verticatest.l-3305:0x17fad) set session characteristics as transaction read write2013-10-18 13:08:23.279 Init Session:0x7f1558010ac0 [Command] <INFO> Setting SESSION CHARACTERISTICS to: mode 1, isolation 12013-10-18 13:08:23.279 Init Session:0x7f1558010ac0 [Session] <INFO> [Query] TX:0(avert01.verticatest.l-3305:0x17fad) set session autocommit to on2013-10-18 13:08:23.281 Init Session:0x7f1558010ac0 [Session] <INFO> [PQuery] TX:0(avert01.verticatest.l-3305:0x17fad) select * from category where name = ?2013-10-18 13:08:23.282 Init Session:0x7f1558010ac0-a0000000005949 [Txn] <INFO> Begin Txn: a0000000005949 'select * from category where name = ?'2013-10-18 13:08:23.285 Init Session:0x7f1558010ac0-a0000000005949 <LOG> @v_crakrevenue_node0001: 00000/4719: Session avert01.verticatest.l-3305:0x17fad ended; closing connection (connCnt 6)2013-10-18 13:08:23.285 Init Session:0x7f1558010ac0-a0000000005949 [Txn] <INFO> Rollback Txn: a0000000005949 'select * from category where name = ?'



- This is the 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.20/ext/pdo_odbc/odbc_stmt.c:254)' in /admin_vertica_report.class.php on line 39


The unique solution we found was not use the prepared statement.

Any thoughts?

tkx


Comments

  • So, if I use "ODBC Functions" instead of "PDO ODBC" it works but I would like to use PDO as it is an Object. 
  • I have the same problem with PDO in centos 6 using vertica 6.1.2, I have not tested on 6.1.3 for now.
    But, as Wils, odbc_* works fine
  • +1 here. I'm having the same issue.
  • Hi, please, is there any update on this?
    Is possible to have a section in the Vertica documentation with a example using PDO?

    Thank you.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file