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

[Ruby] The prepare function doesn't work properly with STRING/VARCHAR data type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Ruby 8.4.4.0002
    • Fix Version/s: Ruby 8.4.4.0002
    • Component/s: Ruby Driver
    • Labels:
    • Environment:
      • OS: Linux 64
      • CUBRID: 8.4.4.0227
      • Ruby: 1.8.7, 1.9.3
      • Driver: cubrid-ruby 8.4.4.0002 (20130907)

      Description

      The string/varchar data can not be inserted correctly when we using con.prepare function

      • Test Case {code}
        con = Cubrid.connect('demodb','localhost',30439,'dba','')
        if con
        con.query("DROP TABLE IF EXISTS tbl")
        con.query("CREATE TABLE tbl (a INT, b STRING)")

        stmt = con.prepare('insert into tbl values (?, ?)')
        stmt.execute(1,"aa")

        stmt = con.prepare('insert into tbl values (?, ?)')
        stmt.bind(1,2)
        stmt.bind(2,'bb')
        stmt.execute

        con.close()
        else
        puts "Connection could not be established"
        end{code}

      Expected Result

                  a  b                   
      ===================================
                  1  'aa'                 
                  2  'bb'                 
      

      Actual Result

                  a  b                   
      ===================================
                  1  ''                 
                  2  ''                 
      

        Activity

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

        test output

        {code}

        a b
        ===================================
        1 'aa'
        2 'bb'
        {code}
        Show
        cn15800 谢韦华[Bert] added a comment - test output {code} a b =================================== 1 'aa' 2 'bb' {code}
        Hide
        cn15800 谢韦华[Bert] added a comment -

        fixed

        Show
        cn15800 谢韦华[Bert] added a comment - fixed
        Hide
        ryin005 Ray Yin added a comment - - edited

        Added a test case for this issue

        RB-8.4.4

        [ruby@NC-PL-QA-012 _13_issues]$ svn ci --username cn14323 -m "[APIS-678]Added a case to test the scenario that using prepare statement with STRING/VARCHAR datatype"
        Adding         _13_issues/bug_apis_678
        Adding         _13_issues/bug_apis_678/cases
        Adding         _13_issues/bug_apis_678/cases/bug_api_678.rb
        Transmitting file data .
        Committed revision 35438.
        

        Link: http://svn.bds.nhncorp.com/xdbms/cubridqa/branches/RB-8.4.4/interface/Ruby/qa_test/ruby/_13_issues/bug_apis_678/

        Show
        ryin005 Ray Yin added a comment - - edited Added a test case for this issue RB-8.4.4 [ruby@NC-PL-QA-012 _13_issues]$ svn ci --username cn14323 -m "[APIS-678]Added a case to test the scenario that using prepare statement with STRING/VARCHAR datatype" Adding _13_issues/bug_apis_678 Adding _13_issues/bug_apis_678/cases Adding _13_issues/bug_apis_678/cases/bug_api_678.rb Transmitting file data . Committed revision 35438. Link: http://svn.bds.nhncorp.com/xdbms/cubridqa/branches/RB-8.4.4/interface/Ruby/qa_test/ruby/_13_issues/bug_apis_678/
        Hide
        ryin005 Ray Yin added a comment - - edited
        • Test OS: Linux 64bit, Windows 32 bit
        • CUBRID: 8.4.4.0227
        • Ruby: 1.8.7
        • Driver: cubrid-ruby 8.4.4.0002 (2013-10-18)

        Test Result: Pass

        Close the issue

        Show
        ryin005 Ray Yin added a comment - - edited Test OS: Linux 64bit, Windows 32 bit CUBRID: 8.4.4.0227 Ruby: 1.8.7 Driver: cubrid-ruby 8.4.4.0002 (2013-10-18) 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: