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

[Perl] The execute() throws a segmentation fault when the bind values contains INT data

    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:
      None
    • Environment:
      • OS: Linux 64bit, Win32bit
      • CUBRID: 9.2.0.0115
      • Perl: v5.18.0
      • Driver: cubrid-perl 9.2.0.0001 (20130726)

      Description

      • Brief: The execute() throws a segmentation fault when the bind values contains INT data
      • Test Code {code}
        #!perl -w
        use DBI;
        use Test::More;
        use strict;

        my $dsn="dbi:cubrid:database=demodb;host=localhost;port=33139";
        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 ");
        $sth->execute(1);{code}

      Expected Result: ok, insert the data successfully

      Actual Result:

      Segmentation fault
      

      Related issue: APIS-621

        Activity

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

        Before bind param, we need to get data type first:
        SvTYPE(SvRV(value))
        If data type is int, program(SvTYPE) maybe crash, we need to call SvROK(value) first, if it is not ok,we can't call SvTYPE.

        Show
        cn15800 谢韦华[Bert] added a comment - Before bind param, we need to get data type first: SvTYPE(SvRV(value)) If data type is int, program(SvTYPE) maybe crash, we need to call SvROK(value) first, if it is not ok,we can't call SvTYPE.
        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: