add None type support in sql.py.

This commit is contained in:
Shuduo Sang 2020-04-26 15:34:15 +08:00
parent 1971c6301a
commit 238879bc80
2 changed files with 25 additions and 4 deletions

View File

@ -1,9 +1,25 @@
#!/bin/bash
python3 ./test.py -f insert/basic.py $1
python3 ./test.py $1 -f insert/basic.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py -f insert/int.py $1
python3 ./test.py $1 -f insert/int.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py -f insert/float.py $1
python3 ./test.py $1 -f insert/float.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py $1 -f insert/bigint.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py $1 -f insert/bool.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py $1 -f insert/double.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py $1 -f insert/smallint.py
python3 ./test.py -s $1
sleep 1
python3 ./test.py $1 -f insert/tinyint.py
python3 ./test.py -s $1
sleep 1

View File

@ -89,6 +89,11 @@ class TDSql:
tdLog.exit(
"sql:%.40s row:%d col:%d data:%s != expect:%s" %
(self.sql, row, col, self.queryResult[row][col], data))
if data is None:
tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%s" %
(self.sql, row, col, self.queryResult[row][col], data))
else:
tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%d" %
(self.sql, row, col, self.queryResult[row][col], data))