summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class6
1 files changed, 2 insertions, 4 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 156c487..cee004a 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -263,7 +263,7 @@ function _set($tags, $force = false)
if (!$this->_fields[$f] && $this->_fields['dyncols'])
{
if (substr($field, 0, 1) === "-")
- $newdyns[] = $unquoteddyn = "'\$.$f', " . $value;
+ $newdyns[] = "'\$.$f', " . $value;
else if ($force || isset($value) && isset($dyndata[$f]) ? strval($value) !== strval($dyndata[$f]) : $value !== $dyndata[$f] || !array_key_exists($f, $dyndata))
$newdyns[] = "'\$.$f', " . $this->escape_string($value);
@@ -280,10 +280,8 @@ function _set($tags, $force = false)
{
if ($force == "insert") # INSERT/REPLACE
$result[] = "dyncols = JSON_OBJECT(" . join(", ", (array)$alldyns) . ")";
- else if ($force || $unquoteddyn) # UPDATE with WHERE
+ else if ($newdyns)
$result[] = "dyncols = JSON_SET(dyncols, " . join(", ", $newdyns) .")";
- else if ($newdyns) # UPDATE. Write all fields even if just one changed. FIXME 2018-10 UM this works around a JSON_SET bug
- $result[] = "dyncols = " . $this->escape_string(json_encode($dyndata, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
$this->_writes += $result ? 1 : 0;