[CP] fix regexp binary match bug

This commit is contained in:
wangt1xiuyi 2024-05-24 04:27:06 +00:00 committed by ob-robot
parent 824f103958
commit a9c2c92acb
3 changed files with 10 additions and 1 deletions

View File

@ -849,7 +849,9 @@ int ObExprRegexContext::check_need_utf8(ObRawExpr *expr, bool &need_utf8)
} else {
need_utf8 = real_expr->get_result_type().is_nchar() ||
real_expr->get_result_type().is_nvarchar2() ||
real_expr->get_result_type().is_blob();
real_expr->get_result_type().is_blob() ||
real_expr->get_result_type().is_binary() ||
real_expr->get_result_type().is_varbinary();
}
return ret;
}

View File

@ -6420,4 +6420,7 @@ TRIM( SUBSTRING( SUBSTRING( '
1
1
1
select cast('NAMEXX' as BINARY) regexp BINARY '^[A-Z]+$', cast('NAME66' as BINARY) regexp BINARY '^[A-Z]+$';
cast('NAMEXX' as BINARY) regexp BINARY '^[A-Z]+$' cast('NAME66' as BINARY) regexp BINARY '^[A-Z]+$'
1 0
drop database ly;

View File

@ -534,4 +534,8 @@ set names GB18030;
SELECT TRIM( SUBSTRING( SUBSTRING( '∷ ∶ ∫ ∮ ∝ ∞ ∧ ∨ ∑ ∏ ∪ ∩ ∈ ∵ ∴ ⊥ ∥ ∠ ⌒ ⊙ √∟⊿ ㏒ ㏑ % ‰' , 1, LEAST( 228, 20 ) ) , 1 , LEAST( 228, 20 ) ) ) NOT REGEXP CONCAT( 'tu', '%' ) FROM table10_bigint WHERE col_int NOT IN ( 5387431054241955840 , 13633803446934044672 , 65066 , 45808 , 6755399441055744000 ) ORDER BY col_char_20 DESC , pk ASC LIMIT 6 OFFSET 1;
##bug:
select cast('NAMEXX' as BINARY) regexp BINARY '^[A-Z]+$', cast('NAME66' as BINARY) regexp BINARY '^[A-Z]+$';
drop database ly;