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

[Ruby] The 'type_name' obtained from stmt.column_info doesn't returns data type of the column

    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 (20130917)

      Description

      • Brief: The 'type_name' retrieved from stmt.column_info doesn't return the column's data type
      • Test Case {code}
        con = Cubrid.connect('demodb','localhost',33000,'dba','')
        if con
        con.query("DROP TABLE IF EXISTS tbl")
        con.query("CREATE TABLE tbl (col_1 INT, col_2 STRING)")
        con.query("INSERT INTO tbl VALUES(1, 'aa')")

        stmt = con.query("SELECT * FROM tbl")

        stmt.column_info.each { |col| puts col['name'] puts col['type_name'] }
        else
        puts "Connection could not be established"
        end{code}

      Expected Result

      col_1 INT
      col_2 STRING
      

      Actual Result

      col_1 8
      col_2 2
      

        Activity

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

        test code

        {code}
        require 'rubygems'
        require 'cubrid'
        con = Cubrid.connect('demodb','127.0.0.1',33000,'dba','')
        if con
        con.query("DROP TABLE IF EXISTS tbl")
        con.query("CREATE TABLE tbl (col_1 INT, col_2 STRING)")

        stmt = con.query("SELECT * FROM tbl")

        stmt.column_info.each { |col| puts col['name'] puts col['type_name'] }
        else
        puts "Connection could not be established"
        end{code}

        output

        {code}
        col_1
        INT
        col_2
        STRING{code}
        Show
        cn15800 谢韦华[Bert] added a comment - test code {code} require 'rubygems' require 'cubrid' con = Cubrid.connect('demodb','127.0.0.1',33000,'dba','') if con con.query("DROP TABLE IF EXISTS tbl") con.query("CREATE TABLE tbl (col_1 INT, col_2 STRING)") stmt = con.query("SELECT * FROM tbl") stmt.column_info.each { |col| puts col['name'] puts col['type_name'] } else puts "Connection could not be established" end{code} output {code} col_1 INT col_2 STRING{code}
        Hide
        ryin005 Ray Yin added a comment -

        Added a test case for this issue

        RB-8.4.4

        [ruby@NC-PL-QA-012 _13_issues]$ svn ci --username cn14323 -m "[APIS-680]Added a case to test the stmt.column_info type_name value"
        Adding         _13_issues/bug_apis_680
        Adding         _13_issues/bug_apis_680/cases
        Adding         _13_issues/bug_apis_680/cases/bug_api_680.rb
        Transmitting file data .
        Committed revision 35440.
        

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

        Show
        ryin005 Ray Yin added a comment - Added a test case for this issue RB-8.4.4 [ruby@NC-PL-QA-012 _13_issues]$ svn ci --username cn14323 -m "[APIS-680]Added a case to test the stmt.column_info type_name value" Adding _13_issues/bug_apis_680 Adding _13_issues/bug_apis_680/cases Adding _13_issues/bug_apis_680/cases/bug_api_680.rb Transmitting file data . Committed revision 35440. Link: http://svn.bds.nhncorp.com/xdbms/cubridqa/branches/RB-8.4.4/interface/Ruby/qa_test/ruby/_13_issues/bug_apis_680/
        Hide
        ryin005 Ray Yin added a comment - - edited
        • Test OS: Linux 64, Windows 32
        • CUBRID: 8.4.4.0227
        • Ruby: 1.8.7
        • Driver: cubrid-ruby 8.4.4.0002 (2013-10-17)

        Test Result: Pass

        Close the issue

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