Merge #16643 - Fix #16641 - query generation bug which allowing JSON to have length

Pull-request: #16643
Fixes: #16641

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2021-02-14 13:06:59 +01:00
commit c1e2f387e1
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -534,7 +534,7 @@ class Table
// MySQL permits a non-standard syntax for FLOAT and DOUBLE,
// see https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html
$pattern = '@^(DATE|TINYBLOB|TINYTEXT|BLOB|TEXT|'
. 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID)$@i';
. 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID|JSON)$@i';
if (strlen($length) !== 0 && ! preg_match($pattern, $type)) {
// Note: The variable $length here can contain several other things
// besides length - ENUM/SET value or length of DECIMAL (eg. 12,3)