Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.5.4
-
None
-
Windows 10 1909
intel i7
Description
Double backslashes get reduced to one in routine definition in information_schema.routines
1. create routine with literal strings
CREATE |
PROCEDURE testprocedure(OUT `out1` VARCHAR(255)) |
BEGIN
|
# double backslash in regex literal |
# becomes single backslash in information_schema.routines ROUTINE_DEFINITION |
SET out1 = REGEXP_SUBSTR('abc1234ddef', '\\d+'); |
END |
2. Routine returns 1234
3. select definition record in information_schema.ROUTINES
SELECT * FROM information_schema.ROUTINES |
WHERE routine_name = 'testprocedure' |
Column ROUTINE_DEFINITION shows routine definition as
BEGIN
|
# double backslash in regex literal |
# becomes single backslash in information_schema.routines ROUTINE_DEFINITION |
SET out1 = REGEXP_SUBSTR('abc1234ddef', '\d+'); |
END |
Routine would return 'dd'.
I read in MDEV-6508 that the ROUTINE_DEFINITION "may not always be used to recreate the routine and won't necessarily be valid SQL" but this missing backslash seems to be a bug anyway.
Attachments
Issue Links
- relates to
-
MDEV-23170 Characterset missing in routine definition in information_schema.routines
- Closed