Skip to content

Commit

Permalink
[MySQL][MariaDB] Dbz crashes on DDL statement (non Latin chars in var…
Browse files Browse the repository at this point in the history
…iables) (antlr#3672)
  • Loading branch information
harveyyue authored Aug 24, 2023
1 parent 946f4cd commit 559019c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sql/mariadb/MariaDBLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -1351,14 +1351,14 @@ STRING_USER_NAME_MARIADB: (
) '@';
LOCAL_ID: '@'
(
[A-Z0-9._$]+
[A-Z0-9._$\u0080-\uFFFF]+
| SQUOTA_STRING
| DQUOTA_STRING
| BQUOTA_STRING
);
GLOBAL_ID: '@' '@'
(
[A-Z0-9._$]+
[A-Z0-9._$\u0080-\uFFFF]+
| BQUOTA_STRING
);

Expand Down
12 changes: 11 additions & 1 deletion sql/mariadb/examples/fast/ddl_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -627,4 +627,14 @@ WITH my_values(val1, val2) AS (
(2, 'Two')
)
SELECT v.val1, v.val2 FROM my_values v;
#end
#end

#begin
CREATE DEFINER=`peuser`@`%` PROCEDURE `test_utf`()
BEGIN
SET @Ν_greece := 1, @N_latin := 'test';
SELECT
@Ν_greece
,@N_latin;
END
#end
4 changes: 2 additions & 2 deletions sql/mysql/Positive-Technologies/MySqlLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -1324,14 +1324,14 @@ IP_ADDRESS: (
);
LOCAL_ID: '@'
(
[A-Z0-9._$]+
[A-Z0-9._$\u0080-\uFFFF]+
| SQUOTA_STRING
| DQUOTA_STRING
| BQUOTA_STRING
);
GLOBAL_ID: '@' '@'
(
[A-Z0-9._$]+
[A-Z0-9._$\u0080-\uFFFF]+
| BQUOTA_STRING
);

Expand Down
10 changes: 10 additions & 0 deletions sql/mysql/Positive-Technologies/examples/ddl_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -672,3 +672,13 @@ SELECT 1;

END
#end

#begin
CREATE DEFINER=`peuser`@`%` PROCEDURE `test_utf`()
BEGIN
SET @Ν_greece := 1, @N_latin := 'test';
SELECT
@Ν_greece
,@N_latin;
END
#end

0 comments on commit 559019c

Please sign in to comment.