fix column_data_explode or update $col => array() gives SQL error

writing it now as NULL (or "" if column is NOT NULL)
This commit is contained in:
Ralf Becker 2019-03-03 15:13:44 +01:00
parent 36e9984be3
commit 86444c5dff

View File

@ -1567,7 +1567,7 @@ class Db
$maxlength = in_array($column_definitions[$col]['type'], array('varchar','ascii')) ? $column_definitions[$col]['precision'] : null; $maxlength = in_array($column_definitions[$col]['type'], array('varchar','ascii')) ? $column_definitions[$col]['precision'] : null;
} }
// dont use IN ( ), if there's only one value, it's slower for MySQL // dont use IN ( ), if there's only one value, it's slower for MySQL
if (is_array($data) && count($data) == 1) if (is_array($data) && count($data) <= 1)
{ {
$data = array_shift($data); $data = array_shift($data);
} }