php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70820 Insert to TEXT or CLOB Datatype Problem in Informix
Submitted: 2015-10-30 09:10 UTC Modified: 2021-08-29 04:22 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: yan at unisza dot edu dot my Assigned: cmb (profile)
Status: No Feedback Package: PDO_INFORMIX (PECL)
PHP Version: 5.6Git-2015-10-30 (Git) OS: CentOS7 / Fedora 21
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-10-30 09:10 UTC] yan at unisza dot edu dot my
Description:
------------
I'm using PHP 5.6.14, IBM Informix CSDK 4.10, PDO Informix 1.3.1. Always got Segmentation Error when insert something to table that have TEXT or CLOB datatype. Error from log : 

[Fri Oct 30 01:08:41.704142 2015] [core:notice] [pid 27963] AH00052: child pid 27967 exit signal Segmentation fault (11)

Before that at compile the pdo informix, no error only warnings when run the "make test" command. The warnings are like below :

[root@localhost PDO_INFORMIX-1.3.1]# make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: Unable to load dynamic library '/home/yan/Downloads/PDO_INFORMIX-1.3.1/modules/pdo_informix.so' - /home/yan/Downloads/PDO_INFORMIX-1.3.1/modules/pdo_informix.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/home/yan/Downloads/PDO_INFORMIX-1.3.1/modules/pdo_informix.so' - /home/yan/Downloads/PDO_INFORMIX-1.3.1/modules/pdo_informix.so: undefined symbol: pdo_parse_params in Unknown on line 0

=====================================================================
PHP         : /usr/bin/php
Warning: PHP Startup: Unable to load dynamic library '/home/yan/Downloads/PDO_INFORMIX-1.3.1/modules/pdo_informix.so' - /home/yan/Downloads/PDO_INFORMIX-1.3.1/modules/pdo_informix.so: undefined symbol: pdo_parse_params in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 5.6.14
ZEND_VERSION: 2.6.0
PHP_OS      : Linux - Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64
INI actual  : /home/yan/Downloads/PDO_INFORMIX-1.3.1/tmp-php.ini
More .INIs  :
CWD         : /home/yan/Downloads/PDO_INFORMIX-1.3.1
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2015-10-30 07:58:41
=====================================================================
  

Test script:
---------------
<?php

class Test {

        public $db = null;
        public $dsn = null;
        public $user = null;
        public $pass = null;

        public function __construct( $_dsn = null , $_user = null , $_pass = null )

        {

                $this->user = "informix";
                $this->pass = "informix";
                $this->db = "uji_sismak";
                $this->svr = "ol_informix1210";
        }


        public function connect($autoCommit=true)

        {

                $this->db = new PDO("informix:host=localhost; service=16339; database=". $this->db ."; server=". $this->svr ."; protocol=onsoctcp;EnableScrollableCursors=1", $this->user, $this->pass );


                $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                $this->db->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
                $this->db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
                return $this->db;

        }

        public function runTest()

        {

                $this->connect();

                try {

                        /* Drop the test table, in case it exists */

                        $drop = 'DROP TABLE animals';
                        $result = $this->db->exec( $drop );

                } catch( Exception $e ){}


                try {

                /* Create the test table */

                $server_info = $this->db->getAttribute(PDO::ATTR_SERVER_INFO);
                $create = 'CREATE TABLE animals (id INTEGER, my_clob CLOB, my_blob byte)';
                $res = $this->db->exec( $create );


                $stmt = $this->db->prepare('insert into animals (id,my_clob,my_blob) values (:id,:my_clob,:my_blob)');


                $clob = "test clob data\n //testing //testing2 ";
                $blob = "test blob data\n";
                print "inserting from php variable<br>";
                $stmt->bindValue( ':id' , 0 );
                $stmt->bindParam( ':my_clob' , $clob , PDO::PARAM_LOB , strlen($clob) );
                $stmt->bindParam( ':my_blob' , $blob , PDO::PARAM_LOB , strlen($blob) );
                $stmt->execute();

                $stmt = $this->db->prepare( 'select id,my_clob,my_blob from animals' );
                $res = $stmt->execute();
                $res = $stmt->fetchAll();
                var_dump(
                $clob = "test clob data\n //testing //testing2 ... //test lagi ...dan lagi ";
                $blob = "test blob data\n";
                print "inserting from php variable<br>";
                $stmt->bindValue( ':id' , 0 );
                $stmt->bindParam( ':my_clob' , $clob , PDO::PARAM_LOB , strlen($clob) );
                $stmt->bindParam( ':my_blob' , $blob , PDO::PARAM_LOB , strlen($blob) );
                $stmt->execute();

                $stmt = $this->db->prepare( 'select id,my_clob,my_blob from animals' );
                $res = $stmt->execute();
                $res = $stmt->fetchAll();
                var_dump( $res );

        }

        catch (Exception $e ) {
                print $e->getMessage();
        }

                print "done\n";

        }

}

        $testcase = new Test();
        $testcase->runTest();
?>

Expected result:
----------------
inserting from php variable<br>array(1) {
  [0]=>
  array(6) {
    ["ID"]=>
    string(1) "0"
    [0]=>
    string(1) "0"
    ["MY_CLOB"]=>
    string(37) "test clob data
 //testing //testing2 "
    [1]=>
    string(37) "test clob data
 //testing //testing2 "
    ["MY_BLOB"]=>
    string(15) "test blob data
"
    [2]=>
    string(15) "test blob data
"
  }
}

inserting from php variable<br>array(1) {
  [0]=>
  array(6) {
    ["ID"]=>
    string(1) "0"
    [0]=>
    string(1) "0"
    ["MY_CLOB"]=>
    string(37) "test clob data
 //testing //testing2 //test lagi ...dan lagi"
    [1]=>
    string(37) "test clob data
 //testing //testing2 //test lagi ...dan lagi"
    ["MY_BLOB"]=>
    string(15) "test blob data
"
    [2]=>
    string(15) "test blob data
"
  }
}

Actual result:
--------------
inserting from php variable<br>array(1) {
  [0]=>
  array(6) {
    ["ID"]=>
    string(1) "0"
    [0]=>
    string(1) "0"
    ["MY_CLOB"]=>
    string(37) "test clob data
 //testing //testing2 "
    [1]=>
    string(37) "test clob data
 //testing //testing2 "
    ["MY_BLOB"]=>
    string(15) "test blob data
"
    [2]=>
    string(15) "test blob data
"
  }
}
inserting from php variable<br>Segmentation fault (core dumped)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-19 12:53 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-19 12:53 UTC] cmb@php.net
Is this still an issue with latest pdo_informix (1.3.4)?
 [2021-08-29 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 12:03:38 2021 UTC