summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_dbi.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/it_dbi.t b/test/it_dbi.t
index bf5d0f0..6b89db2 100755
--- a/test/it_dbi.t
+++ b/test/it_dbi.t
@@ -364,6 +364,14 @@ is($r->_dyndata, [], '_dyndata for record with empty dyncols should be empty');
$r->update(['key3' => 'c']);
is($r->key3, 'c', 'dynamic column for record with empty dyncols whould be correctly created');
+$r->clear(false);
+is($r->select(['-key1 IS NOT' => 'NULL']), 1, 'only one entry has a value for key1');
+is($r->select(['-key2 IS' => 'NULL']), 2, "two entries don't have a value for key1");
+$r->read(1);
+$r->update(['key1' => null]);
+is($r->key1, null, 'setting dyncol to null should make it be null');
+is($r->select(['-key1 IS NOT' => 'NULL']), 0, 'no entry should have a value for key1 anymore');
+
# don't do dyncols stuff in where when we select form multiple tables (column names are unknown then)
is($r->_where(['FROM' => 'it_dbi_test AS a, it_dbi_test AS b', '-a.ID' => 'b.ID']), 'WHERE a.ID = b.ID', "don't do JSON_EXTRACT when we have multiple tables in FROM");
is($r->_where(['JOIN' => 'it_dbi_test AS b', '-a.ID' => 'b.ID']), 'WHERE a.ID = b.ID', "don't do JSON_EXTRACT when we JOIN");