-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-21058 CREATE TABLE with generated column and RLIKE results in si…
…gabrt Regexp_processor_pcre::fix_owner() called Regexp_processor_pcre::compile(), which could fail on the regex syntax error in the pattern and put an error into the diagnostics area. However, the callers: - Item_func_regex::fix_length_and_dec() - Item_func_regexp_instr::fix_length_and_dec() still returned "false" in such cases, which made the code crash later inside Diagnostics_area::set_ok_status(). Fix: - Change the return type of fix_onwer() from "void" to "bool" and return "true" whenever an error is put to the DA (e.g. on the syntax error in the pattern). - Fixing fix_length_and_dec() of the mentioned Item_func_xxx classes to return "true" if fix_onwer() returned "true".
- Loading branch information
Showing
6 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Start of 10.5 tests | ||
# | ||
# | ||
# MDEV-21058 CREATE TABLE with generated column and RLIKE results in sigabrt | ||
# | ||
CREATE TABLE t1 (c0 INT AS(('' RLIKE '['))); | ||
ERROR 42000: Regex error 'missing terminating ] for character class at offset 1' | ||
CREATE TABLE t1 (c0 INT AS(REGEXP_INSTR('','['))); | ||
ERROR 42000: Regex error 'missing terminating ] for character class at offset 1' | ||
CREATE TABLE t1 | ||
( | ||
c0 INT, | ||
c1 INT AS(('' RLIKE NULL)), | ||
c2 INT AS(REGEXP_INSTR('',NULL)) | ||
); | ||
INSERT INTO t1 (c0) VALUES (0); | ||
SELECT * FROM t1; | ||
c0 c1 c2 | ||
0 NULL NULL | ||
DROP TABLE t1; | ||
# | ||
# End of 10.5 tests | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--source inc/vcol_init_vars.pre | ||
--source inc/vcol_cleanup.inc | ||
|
||
--echo # | ||
--echo # Start of 10.5 tests | ||
--echo # | ||
|
||
--echo # | ||
--echo # MDEV-21058 CREATE TABLE with generated column and RLIKE results in sigabrt | ||
--echo # | ||
|
||
--error ER_REGEXP_ERROR | ||
CREATE TABLE t1 (c0 INT AS(('' RLIKE '['))); | ||
|
||
--error ER_REGEXP_ERROR | ||
CREATE TABLE t1 (c0 INT AS(REGEXP_INSTR('','['))); | ||
|
||
CREATE TABLE t1 | ||
( | ||
c0 INT, | ||
c1 INT AS(('' RLIKE NULL)), | ||
c2 INT AS(REGEXP_INSTR('',NULL)) | ||
); | ||
INSERT INTO t1 (c0) VALUES (0); | ||
SELECT * FROM t1; | ||
DROP TABLE t1; | ||
|
||
--echo # | ||
--echo # End of 10.5 tests | ||
--echo # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters