Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect value fetched while selecting NULL values #13

Closed
shabbir10july opened this issue Sep 14, 2020 · 0 comments
Closed

Incorrect value fetched while selecting NULL values #13

shabbir10july opened this issue Sep 14, 2020 · 0 comments
Assignees

Comments

@shabbir10july
Copy link
Contributor

Incorrect value fetched while selecting NULL values. Instead of NULL/None, 0.0 and 0 values are returned for float and int datatype.

Repro:

    def test_InsertNull(self):
        self.cursor.execute("CREATE TABLE t1 (c1 float4, c2 double, c3 int1, c4 int2, c5 int4, c6 int8, c7 char(5), c8 varchar(10),c9 nchar(50), c10 nvarchar(120),c11 varbinary(12), c12 ST_GEOMETRY(12), DATE_PROD DATE, TIME_PROD TIME, INTERVAL_PROD INTERVAL,TIMESTMP TIMESTAMP,TIMETZ_PROD TIME WITH TIME ZONE, c18 bool)")
        self.cursor.execute("INSERT INTO t1 VALUES(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL))
        self.assertEqual(1, self.cursor.rowcount, "ERROR: Data Difference")
        self.cursor.execute("SELECT * FROM t1")
        results = self.cursor.fetchall()
        for c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18 in results:
            print(c1)
            print(c2)
            print(c3)
            print(c4)
            print(c5)
            print(c6)
            print(c7)
            print(c8)
            print(c9)
            print(c10)
            print(c11)
            print(c12)
            print(c13)
            print(c14)
            print(c15)
            print(c16)
            print(c17)
            print(c18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant