|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-01-15 04:45 UTC] abhargav at in dot ibm dot com
[2009-01-15 10:24 UTC] tom at advancedatatools dot com
[2009-01-16 09:00 UTC] opendev at us dot ibm dot com
[2014-02-25 19:33 UTC] dbeecher at dmsgs dot com
[2014-02-25 19:36 UTC] dbeecher at dmsgs dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Description: ------------ When trying to use a bound parameter with the bts search datablade it gives the string data right truncated error. Reproduce code: --------------- <? #create table fh_trees(id serial, fht_name char(60) ); #insert into fh_trees(fht_name) values ('test record'); #CREATE INDEX idx_fht_fht_name ON fh_trees (fht_name bts_char_ops) using bts in extdbs; putenv("INFORMIXDIR=/opt/informix"); putenv("INFORMIXSERVER=servertcp"); putenv("ODBCINI=/opt/informix/etc/odbc.ini"); try { $dbh = new PDO("informix:DSN=fht", "informix_account", "password"); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); } catch (Exception $e) { echo "Failed: " . $e->getMessage(); } $sqlline = "select id, fht_name from fh_trees where bts_contains(fht_name, :search , score # REAL)"; $sth = $dbh->prepare($sqlline); $sa = "test"; $sth->bindParam('search',$sa); $sth->execute(); $row = $sth->fetch(); print_r($row); Expected result: ---------------- Array ( [id] => 5 [0] => 5 [fht_name] => Test Tree [1] => Test Tree ) Actual result: -------------- Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[22001]: String data, right truncated: -11023 [Informix][Informix ODBC Driver]String data right truncation. (SQLExecute[-11023] at /usr/src/php-5.2.5/ext/pdo_informix/informix_statement.c:730)' in /web/test_case.php:28 Stack trace: #0 /web/test_case.php(28): PDOStatement->execute() #1 {main} thrown in /web/test_case.php on line 28