[FEAT MERGE]4_1_sql_feature

Co-authored-by: leslieyuchen <leslieyuchen@gmail.com>
Co-authored-by: Charles0429 <xiezhenjiang@gmail.com>
Co-authored-by: raywill <hustos@gmail.com>
This commit is contained in:
obdev
2023-01-28 16:01:26 +08:00
committed by ob-robot
parent 3080f2b66f
commit 2d19a9d8f5
846 changed files with 161957 additions and 116661 deletions

View File

@ -6,75 +6,111 @@ ERROR HY000: unmatched parentheses in regular expression
select * from t1 where a regexp 'a(b';
ERROR HY000: unmatched parentheses in regular expression
select * from t1 where a regexp '*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '?';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '(*a)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 2.' from regexp
select * from t1 where a regexp '(+a)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 2.' from regexp
select * from t1 where a regexp '(?a)';
ERROR HY000: invalid embedded option in regular expression
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp '({1}a)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 2.' from regexp
select * from t1 where a regexp '(a|*b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '(a|+b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '(a|?b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '(a|{1}b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '^*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '^+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '^?';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '^{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '{1';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp 'a{1';
ERROR HY000: braces {} not balanced in in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1a';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1a}';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1,x}';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1,x';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{300}';
ERROR HY000: invalid repetition count(s) in regular expression
a b
select * from t1 where a regexp 'a{1,0}';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_MAX_LT_MIN' from regexp
select * from t1 where a regexp 'a++';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
select * from t1 where a regexp 'a*+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp 'a+*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a?*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a?+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp 'a{1}{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 5.' from regexp
select * from t1 where a regexp 'a*{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a+{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a?{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a{1}*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 5.' from regexp
select * from t1 where a regexp 'a{1}+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
drop table t1;
drop table if exists t1;
create table t1 (a datetime primary key);
@ -1367,11 +1403,9 @@ id name
524 abcd
573 ab
select * from t1 where name regexp 'a{,2}';
id name
299 a{,2}
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where name regexp 'a{,}';
id name
301 a{,}
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where name regexp 'ab{0,0}c';
id name
311 abcac
@ -1732,8 +1766,7 @@ id name
567 A1
573 ab
select * from t1 where name regexp 'a*{b}';
id name
344 a{b}
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where name regexp '[[:alnum:]]+';
id name
1 hello
@ -6287,3 +6320,11 @@ insert into t values ('');
select c1 regexp 'ddd' from t;
c1 regexp 'ddd'
0
drop table if exists t1;
create table t1(c1 blob);
insert into t1 values('UNPRESS123');
insert into t1 values('UNPRESS456');
select * from t1 where c1 regexp '^U';
c1
UNPRESS123
UNPRESS456

View File

@ -1,8 +1,7 @@
--disable_query_log
set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log
# owner: guoyun.lgy
# modifier: jiangxiu.wt
# owner: jiangxiu.wt
# owner group: SQL1
# description: regexp的测试
@ -19,75 +18,75 @@ insert into t1 (a) values ('a'),('abc'),('abcd'),('hello'),('test');
select * from t1 where a regexp 'a(';
--error 5813
select * from t1 where a regexp 'a(b';
--error 5820
--error 1139
select * from t1 where a regexp '*';
--error 5820
--error 1139
select * from t1 where a regexp '+';
--error 5820
--error 1139
select * from t1 where a regexp '?';
--error 5820
--error 1139
select * from t1 where a regexp '(*a)';
--error 5820
--error 1139
select * from t1 where a regexp '(+a)';
--error 5824
--error 1139
select * from t1 where a regexp '(?a)';
--error 5820
--error 1139
select * from t1 where a regexp '({1}a)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|*b)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|+b)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|?b)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|{1}b)';
--error 5820
select * from t1 where a regexp '^*';
--error 5820
select * from t1 where a regexp '^+';
--error 5820
select * from t1 where a regexp '^?';
--error 5820
select * from t1 where a regexp '^{1}';
--error 5820
--error 1139
select * from t1 where a regexp '{1';
--error 5820
--error 1139
select * from t1 where a regexp '{1}';
--error 5818
--error 1139
select * from t1 where a regexp 'a{1';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1a';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1a}';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1,x}';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1,x';
--error 5819
select * from t1 where a regexp 'a{300}';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1,0}';
--error 5820
select * from t1 where a regexp 'a++';
--error 5820
select * from t1 where a regexp 'a*+';
--error 5820
--error 1139
select * from t1 where a regexp 'a+*';
--error 5820
--error 1139
select * from t1 where a regexp 'a?*';
--error 5820
select * from t1 where a regexp 'a?+';
--error 5820
--error 1139
select * from t1 where a regexp 'a{1}{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a*{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a+{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a?{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a{1}*';
--error 5820
select * from t1 where a regexp 'a{1}+';
drop table t1;
@ -280,7 +279,9 @@ select * from t1 where name regexp 'ab?c';
select * from t1 where name regexp 'a{1}b';
select * from t1 where name regexp 'a{1,}b';
select * from t1 where name regexp 'a{1,2}b';
--error 1139
select * from t1 where name regexp 'a{,2}';
--error 1139
select * from t1 where name regexp 'a{,}';
select * from t1 where name regexp 'ab{0,0}c';
select * from t1 where name regexp 'ab{0,1}c';
@ -290,6 +291,7 @@ select * from t1 where name regexp 'ab{1,3}c';
select * from t1 where name regexp 'ab{2,2}c';
select * from t1 where name regexp 'ab{2,4}c';
select * from t1 where name regexp '((a{1,10}){1,10}){1,10}';
--error 1139
select * from t1 where name regexp 'a*{b}';
select * from t1 where name regexp '[[:alnum:]]+';
select * from t1 where name regexp '[[:alpha:]]+';
@ -443,3 +445,13 @@ drop table if exists t;
create table t (c1 char(20));
insert into t values ('');
select c1 regexp 'ddd' from t;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(c1 blob);
insert into t1 values('UNPRESS123');
insert into t1 values('UNPRESS456');
select * from t1 where c1 regexp '^U';