Add more type casts for #16634
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
9d62b14cfb
commit
7d3a3cd74c
@ -592,8 +592,12 @@ class Table
|
||||
// but DEFAULT 0 works
|
||||
$query .= ' DEFAULT 0';
|
||||
} elseif ($is_timestamp
|
||||
&& preg_match('/^\'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{1,6})?\'$/', $default_value)) {
|
||||
$query .= ' DEFAULT ' . $default_value;
|
||||
&& preg_match(
|
||||
'/^\'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d{1,6})?\'$/',
|
||||
(string) $default_value
|
||||
)
|
||||
) {
|
||||
$query .= ' DEFAULT ' . (string) $default_value;
|
||||
} elseif ($type === 'BIT') {
|
||||
$query .= ' DEFAULT b\''
|
||||
. preg_replace('/[^01]/', '0', (string) $default_value)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user