php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58505 String Data Right Truncated with BTS search
Submitted: 2009-01-13 11:11 UTC Modified: 2009-01-16 09:00 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: tom at advancedatatools dot com Assigned:
Status: Open Package: PDO_INFORMIX (PECL)
PHP Version: 5.2.5 OS: Linux (suse)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom at advancedatatools dot com
New email:
PHP Version: OS:

 

 [2009-01-13 11:11 UTC] tom at advancedatatools dot com
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-15 04:45 UTC] abhargav at in dot ibm dot com
Hi,

I need following information on this:
1. What is the version of Informix?
2. What is the version of CSDK?
3. What is the version of PDO_INFORMIX extension?
4. I got "9845: Access method (bts) does not exist in database." error, when I tried to execute "CREATE INDEX idx_fht_fht_name ON fh_trees (fht_name  bts_char_ops)using bts in extdbs;". Any comment on this?

Regards,
Ambrish Bhargava
 [2009-01-15 10:24 UTC] tom at advancedatatools dot com
1.) Informix 11.50.UC1
2.) CSDK 3.00.uc3
3.) PDO version: 1.2.6
For 4.) you need to set up the bts blade.
run blademgr 
run register bts.1.10 <database> 
(The bts version will be different depending on you version of Informix)
Then add a vpclass to your onconfig by adding the following to the onconfig file:
VPCLASS    bts,noyield,num=1

Next you need an extspace so create a directory to use (770, informix:informix) , then run:
onspaces -c -x extdbs -l <path_to_directory>

Then restart the engine and it should work properly.
The BTS search is a new feature with the Informix 11 engine, and is being highly publicized as one of the key new features. Here is a developer works article on the setup and use of BTS:
http://www-128.ibm.com/developerworks/blogs/page/idsteam?entry=bts_blade_part_two_setup
 [2009-01-16 09:00 UTC] opendev at us dot ibm dot com
Hi Tom,

Thanks for the info. We are able to repro the problem. 

We are currently working on this.

P.S: - Will keep you updated.

Thanks

Praveen
 [2014-02-25 19:33 UTC] dbeecher at dmsgs dot com
Using PDO_INFORMIX-1.2.0, PHP 5.3.0, Linux, redhat.  INFORMIX CSDK:  2.8.0 or 2.9.0_U4R1 linux.

Everything works great except when fetching a blob.

Have been using this for 2 years with PHP 5.2, no problem.  Upgraded to php 5.3.0 and recompiled the PDO_INFORMIX_1.2.0 (because 1.3.1 doesn't work with this CSDK) and now have this problem.
 [2014-02-25 19:36 UTC] dbeecher at dmsgs dot com
Forgot to mention-- Informix Dynamic Server Online v7 FD6.

fyi--  https://bugs.php.net/bug.php?id=58870

DID NOT solve the issue.

Thanks,
David
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 22:01:28 2024 UTC