Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 12.3.1
-
ubuntu22.04
Description
Summary
On MariaDB 12.3.1 (rev 21a0714a), REGEXP behaves inconsistently when the left-hand side is a binary hex literal. A string-literal pattern works, but the identical pattern stored in a user variable or passed as a prepared-statement parameter raises ERROR 1300.
Minimal Reproducer
SET NAMES utf8mb3; |
|
|
SELECT 0xE001 REGEXP '\\xE0\\x01'; |
-- 1
|
|
|
SET @pat='\\xE0\\x01'; |
SELECT HEX(@pat); |
-- 5C7845305C783031
|
|
|
SELECT 0xE001 REGEXP @pat; |
-- ERROR 1300 (HY000): Invalid utf8mb3 character string: 'E001'
|
|
|
PREPARE st FROM 'SELECT 0xE001 REGEXP ?'; |
EXECUTE st USING @pat; |
-- ERROR 1300 (HY000): Invalid utf8mb3 character string: 'E001'
|
DEALLOCATE PREPARE st; |
Expected
The user-variable and PS-parameter forms should behave like the literal form and return 1, not ERROR 1300.
Environment
| Item | Value |
|---|---|
| Version | 12.3.1-MariaDB-asan-log |
| Revision | 21a0714a118614982d20bfa504763d7247800091 |
| Charset | utf8mb3 |