@@ -100,8 +100,7 @@ discard block |
||
100 | 100 | $maxlength = (!\preg_match('~int~', $field->type) && |
101 | 101 | \preg_match('~^(\d+)(,(\d+))?$~', $field->length, $match) ? |
102 | 102 | ((\preg_match("~binary~", $field->type) ? 2 : 1) * $match[1] + (($match[3] ?? null) ? 1 : 0) + |
103 | - (($match[2] ?? false) && !$unsigned ? 1 : 0)) : |
|
104 | - ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
103 | + (($match[2] ?? false) && !$unsigned ? 1 : 0)) : ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
105 | 104 | if ($this->driver->jush() == 'sql' && $this->driver->minVersion(5.6) && \preg_match('~time~', $field->type)) { |
106 | 105 | $maxlength += 7; // microtime |
107 | 106 | } |
@@ -241,12 +240,8 @@ discard block |
||
241 | 240 | // } |
242 | 241 | $value = ($row !== null ? |
243 | 242 | ($row[$name] != "" && $this->driver->jush() == "sql" && \preg_match("~enum|set~", $field->type) ? |
244 | - (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : |
|
245 | - (\is_bool($row[$name]) ? +$row[$name] : $row[$name])) : |
|
246 | - (!$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default))); |
|
247 | - $function = ($queryOptions["save"] ? (string)$queryOptions["function"][$name] : |
|
248 | - ($update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) ? "now" : |
|
249 | - ($value === false ? null : ($value !== null ? '' : 'NULL')))); |
|
243 | + (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : (\is_bool($row[$name]) ? +$row[$name] : $row[$name])) : (!$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default))); |
|
244 | + $function = ($queryOptions["save"] ? (string) $queryOptions["function"][$name] : ($update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) ? "now" : ($value === false ? null : ($value !== null ? '' : 'NULL')))); |
|
250 | 245 | if (!$update && $value == $field->default && \preg_match('~^[\w.]+\(~', $value)) { |
251 | 246 | $function = "SQL"; |
252 | 247 | } |