Skip to content

Commit 0b57097

Browse files
committedMay 23, 2021
test: add test for Android NULL column issue
1 parent c81edcb commit 0b57097

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎test/test.main.js

+20
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,26 @@ describe('dedicated db test suite - in-memory', function () {
10621062
});
10631063
});
10641064

1065+
it('issue #43 - nulls and strings in arrays', function () {
1066+
var create = 'CREATE TABLE table1 (text1 string, text2 string)';
1067+
var insert = 'INSERT INTO table1 VALUES ("1337", "1337")';
1068+
var update = 'UPDATE table1 SET text1=? WHERE text2=?';
1069+
var select = 'SELECT * from table1;';
1070+
return transactionPromise(db, create).then(function () {
1071+
return transactionPromise(db, insert);
1072+
}).then(function () {
1073+
return transactionPromise(db, update, [null, 1337]);
1074+
}).then(function () {
1075+
return transactionPromise(db, select);
1076+
}).then(function (res) {
1077+
assert.equal(res.rows.length, 1, 'rows.length');
1078+
assert.deepEqual(res.rows.item(0), {
1079+
text1: null,
1080+
text2: '1337'
1081+
});
1082+
});
1083+
});
1084+
10651085
it('valid read transaction', function () {
10661086
var sql = 'CREATE TABLE table1 (text1 string, text2 string)';
10671087
return transactionPromise(db, sql).then(function () {

0 commit comments

Comments
 (0)