diff options
author | David Flatz | 2018-10-08 15:23:07 +0200 |
---|---|---|
committer | David Flatz | 2018-10-08 15:24:10 +0200 |
commit | 9e9565b9b29696bae8f74e02b0457208380caaef (patch) | |
tree | 4c0f8441fe90b9030ca3e3e1734a6865f559fe90 /test/it_dbi.t | |
parent | 51ed968a13e1664bd256e2adafcb1d5e3c4f4095 (diff) | |
download | itools-9e9565b9b29696bae8f74e02b0457208380caaef.tar.gz itools-9e9565b9b29696bae8f74e02b0457208380caaef.tar.bz2 itools-9e9565b9b29696bae8f74e02b0457208380caaef.zip |
handle setting a dyncol to null by removing the field in dyncols
Diffstat (limited to 'test/it_dbi.t')
-rwxr-xr-x | test/it_dbi.t | 8 |
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"); |