Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Python Driver
-
Labels:None
-
Environment:
- CUBRID: 2008 R4.1 (8.4.1.0561) (64bit release build for linux_gnu)
- OS: Linux 64bit
Description
- Brief:
- Use fetchone method to get numeric data from db, including float,double,numeric and monetary, but the return data type is string.
- Test Steps:
- insert a double data 1.1 into table
- select the data and check it
- Result:
- Expect result is 1.1
- Actual result is '1.1'
- Code reference:
import CUBRIDdb import unittest class FetchoneTest(unittest.TestCase): def test_numeric(self): print "test_num" self.con = CUBRIDdb.connect("CUBRID:localhost:33000:demodb", "dba","") self.cur = self.con.cursor() sqlCreate = "create table numeric_db(c_int int, c_short short,c_numeric numeric,c_float float,c_double double,c_monetary monetary)" self.cur.execute(sqlCreate) data1 = 1.1 sqlInsert = "insert into numeric_db(c_double) values (" +'%s'%data1 +")" self.cur.execute(sqlInsert) sqlSelect = "select * from numeric_db" self.cur.execute(sqlSelect) data2 = self.cur.fetchone() self.assertEquals(data1, data2[4]) if __name__ == '__main__': unittest.main()
Commit rev: 388