Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-624

[Perl] The execute_array() doesn't work correctly with a binding INT array

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Perl 9.2.0.0001
    • Fix Version/s: Perl 9.2.0.0001
    • Component/s: Perl Driver
    • Labels:
    • Environment:
      • OS: Linux 64bit, Win 32bit
      • CUBRID: 9.2.0.0115
      • Perl: v5.18.0
      • Driver: cubrid-perl 9.2.0.0001 (20130726)

      Description

      • Brief: The execute_array() throws a segmentation error when worked with a binding INT array
      • Test Code {code}
        #!perl -w
        use DBI;
        use Test::More;
        use strict;

        my $dsn="dbi:cubrid:database=demodb;host=localhost;port=33000";
        my $dbh=DBI->connect($dsn, "dba", "");

        $dbh->do("DROP TABLE IF EXISTS test_cubrid");
        $dbh->do("CREATE TABLE test_cubrid (id INT)");

        my $sth = $dbh->prepare ("INSERT INTO test_cubrid VALUES ");
        ok $sth->bind_param_array (1, [1, 2]);
        ok $sth->execute_array( { ArrayTupleStatus => \my @tuple_status } );{code}

      Expected Result:

      $ csql -u dba -c "select * from test_cubrid"
      
        id                  
      ======================
        1                
        2        
      

      Actual Result: Segmentation fault

      if we use execute_array with a binding VARCHAR array, it works correctly

      {code}
      #!perl -w
      use DBI;
      use Test::More;
      use strict;

      my $dsn="dbi:cubrid:database=demodb;host=localhost;port=33000";
      my $dbh=DBI->connect($dsn, "dba", "");

      $dbh->do("DROP TABLE IF EXISTS test_cubrid");
      $dbh->do("CREATE TABLE test_cubrid (id VARCHAR)");

      my $sth = $dbh->prepare ("INSERT INTO test_cubrid VALUES ");
      ok $sth->bind_param_array (1, ['aaa', 'bbb']);
      ok $sth->execute_array( { ArrayTupleStatus => \my @tuple_status } );{code}

      Result

      $ csql -u dba -c "select * from test_cubrid"
      
        id                  
      ======================
        'aaa'                
        'bbb'        
      

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        It is same with apis-622.

        Show
        cn15800 谢韦华[Bert] added a comment - It is same with apis-622.
        Hide
        ryin005 Ray Yin added a comment -
        • Test OS: Linux 64bit, Win 32bit
        • CUBRID: 9.2.0.0115
        • Perl: v5.18.0
        • Driver: cubrid-perl 9.2.0.0001 (20130806)

        Test Result: Pass

        Close the issue

        Show
        ryin005 Ray Yin added a comment - Test OS: Linux 64bit, Win 32bit CUBRID: 9.2.0.0115 Perl: v5.18.0 Driver: cubrid-perl 9.2.0.0001 (20130806) Test Result: Pass Close the issue

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            ryin005 Ray Yin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: