Fixed bug 688290 "NULL values with converters error on fetch."
parent
32c64c47c7
commit
83fede1f8d
|
|
@ -266,9 +266,10 @@ class Cursor(object):
|
||||||
for col in range(1, self._meta.getColumnCount() + 1):
|
for col in range(1, self._meta.getColumnCount() + 1):
|
||||||
sqltype = self._meta.getColumnType(col)
|
sqltype = self._meta.getColumnType(col)
|
||||||
v = self._rs.getObject(col)
|
v = self._rs.getObject(col)
|
||||||
converter = _converters.get(sqltype)
|
if v:
|
||||||
if converter:
|
converter = _converters.get(sqltype)
|
||||||
v = converter(v)
|
if converter:
|
||||||
|
v = converter(v)
|
||||||
row.append(v)
|
row.append(v)
|
||||||
return tuple(row)
|
return tuple(row)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ create table konto (
|
||||||
"KONTO_ID" TIMESTAMP default CURRENT_TIMESTAMP not null,
|
"KONTO_ID" TIMESTAMP default CURRENT_TIMESTAMP not null,
|
||||||
"KONTO_NR" INTEGER not null,
|
"KONTO_NR" INTEGER not null,
|
||||||
"SALDO" DECIMAL default 0.0 not null,
|
"SALDO" DECIMAL default 0.0 not null,
|
||||||
|
"SPERRE" DECIMAL,
|
||||||
primary key ("KONTO_ID")
|
primary key ("KONTO_ID")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
insert into Konto values ('2009-09-10 14:15:22.123456', 18, 12.4);
|
insert into Konto values ('2009-09-10 14:15:22.123456', 18, 12.4, null);
|
||||||
insert into Konto values ('2009-09-11 14:15:22.123456', 19, 12.9);
|
insert into Konto values ('2009-09-11 14:15:22.123456', 19, 12.9, 1);
|
||||||
|
|
|
||||||
|
|
@ -93,20 +93,20 @@ class IntegrationTest(TestCase):
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor()
|
||||||
cursor.execute("select * from konto")
|
cursor.execute("select * from konto")
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4),
|
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None),
|
||||||
(u'2009-09-11 14:15:22.123456', 19, 12.9)] == result
|
(u'2009-09-11 14:15:22.123456', 19, 12.9, 1)] == result
|
||||||
|
|
||||||
def test_execute_and_fetch_parameter(self):
|
def test_execute_and_fetch_parameter(self):
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor()
|
||||||
cursor.execute("select * from konto where konto_nr = ?", 18)
|
cursor.execute("select * from konto where konto_nr = ?", 18)
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4)] == result
|
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None)] == result
|
||||||
|
|
||||||
def test_execute_and_fetchone(self):
|
def test_execute_and_fetchone(self):
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor()
|
||||||
cursor.execute("select * from konto order by konto_nr")
|
cursor.execute("select * from konto order by konto_nr")
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
assert (u'2009-09-10 14:15:22.123456', 18, 12.4) == result
|
assert (u'2009-09-10 14:15:22.123456', 18, 12.4, None) == result
|
||||||
|
|
||||||
def test_execute_reset_description_without_execute_result(self):
|
def test_execute_reset_description_without_execute_result(self):
|
||||||
"""Excpect the descriptions property being reset when no query
|
"""Excpect the descriptions property being reset when no query
|
||||||
|
|
@ -130,7 +130,7 @@ class IntegrationTest(TestCase):
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor()
|
||||||
cursor.execute("select * from konto order by konto_nr")
|
cursor.execute("select * from konto order by konto_nr")
|
||||||
result = cursor.fetchmany()
|
result = cursor.fetchmany()
|
||||||
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4)] == result
|
assert [(u'2009-09-10 14:15:22.123456', 18, 12.4, None)] == result
|
||||||
|
|
||||||
def test_executemany(self):
|
def test_executemany(self):
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue