diff options
| -rw-r--r-- | it_dbi.class | 2 | ||||
| -rwxr-xr-x | test/it_dbi.t | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index 0c20095..a3d2c31 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -287,7 +287,7 @@ function _expressions($tags, $force = false) if ($alldyns) { - if ($force == "insert") # INSERT/REPLACE + if (strval($force) == "insert") # INSERT/REPLACE $result['dyncols'] = $this->_json_object($alldyns); else if ($newdyns || $deldyns) { diff --git a/test/it_dbi.t b/test/it_dbi.t index 083047f..1140c55 100755 --- a/test/it_dbi.t +++ b/test/it_dbi.t @@ -439,6 +439,8 @@ $r->iterate(); 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->update(['key3' => null], ['ID' => 3]); +is($r->key3, null, 'remove dynamic column completely if where-clause is given'); $r->clear(false); is($r->select(['-key1 IS NOT' => 'NULL']), 1, 'only one entry has a value for key1'); |