empty array on insert/update, store as NULL, or if not allowed whatever value NULL is casted to

This commit is contained in:
Ralf Becker 2014-04-15 08:15:23 +00:00
parent 3a004a2672
commit cf6ae6ee77

View File

@ -1524,7 +1524,9 @@ class egw_db
}
$data[$k] = $this->quote($v,$column_type,$not_null,$maxlength);
}
$values[] = ($or_null?'(':'').(!count($data) ? '' :
$values[] = ($or_null?'(':'').(!count($data) ?
// empty array on insert/update, store as NULL, or if not allowed whatever value NULL is casted to
$this->quote(null, $column_type, $not_null) :
($use_key===True ? $this->name_quote($key).' IN ' : '') .
'('.implode(',',$data).')'.($or_null ? ' OR ' : '')).$or_null;
}