summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorDavid Flatz2018-08-13 11:52:28 +0200
committerDavid Flatz2018-08-13 11:52:28 +0200
commit3db4daffff1cbb6d2262a1caa873569b0d0a315a (patch)
tree5bfffb3835c98104736494c4e3d8c05a3af2ec1e /it_dbi.class
parentf8aabe317e7a7997594bc124aa17fd4d6442dfd1 (diff)
downloaditools-3db4daffff1cbb6d2262a1caa873569b0d0a315a.tar.gz
itools-3db4daffff1cbb6d2262a1caa873569b0d0a315a.tar.bz2
itools-3db4daffff1cbb6d2262a1caa873569b0d0a315a.zip
disable dyncols in WHERE when we have multiple tables because we can't trust _fields anymore and columns might be prefixed with tablename
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index be802b7..156c487 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -326,6 +326,7 @@ function _from($params, $omit_from = false)
*/
function _where($params)
{
+ $dyncols_enabled = !strlen($params['JOIN'] . $params['FROM']);
unset($params['JOIN'], $params['FROM']);
if (is_array($params) && (count($params) > 0))
@@ -372,7 +373,7 @@ function _where($params)
$qval = $this->escape_string((string)$value);
}
- if ($this->_fields['dyncols'] && !$this->_fields[$field])
+ if ($dyncols_enabled && $this->_fields['dyncols'] && !$this->_fields[$field])
$field = "JSON_EXTRACT(dyncols, " . $this->escape_string('$.' . $field) . ")";
switch ($op)