Fix for ScriptUtils failure when '--' occurs inside a multi-line comment on the same line as '*/' (#22392)

* Test for multi-line comment block where the comment end delimiter occurs on a line starting with the single-line comment prefix
* ScriptUtils successfully parses a SQL script containing a multi-line comment block where the comment-end delimiter occurs on a line starting with the single-line comment prefix.
This commit is contained in:
Mansur Mustaquim
2019-02-08 20:20:51 +05:00
committed by Juergen Hoeller
parent a698adf125
commit 82dbde13b6
3 changed files with 48 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
/* This is a multi line comment
* The next comment line has no text
* The next comment line starts with a space.
* x, y, z...
*/
INSERT INTO users(first_name, last_name) VALUES('Juergen', 'Hoeller');
-- This is also a comment.
/*-------------------------------------------
-- A fancy multi-line comments that puts
-- single line comments inside of a multi-line
-- comment block.
Moreover, the block commend end delimiter
appears on a line that can potentially also
be a single-line comment if we weren't
already inside a multi-line comment run.
-------------------------------------------*/
INSERT INTO
users(first_name, last_name) -- This is a single line comment containing the block-end-comment sequence here */ but it's still a single-line comment
VALUES( 'Sam' -- first_name
, 'Brannen' -- last_name
);--