Support comments in statements in RDbPopulator
Prior to this commit, executing an SQL script via ResourceDatabasePopulator would fail if a statement in the script contained a line comment within the statement. This commit ensures that standard SQL comments (i.e., any text beginning with two hyphens and extending to the end of the line) are properly omitted from the statement before executing it. In addition, multiple adjacent whitespace characters within a statement, but outside a literal, are now collapsed into a single space. Issue: SPR-10075
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- The next comment line has no text after the '--' prefix.
|
||||
--
|
||||
-- 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.
|
||||
INSERT INTO
|
||||
users(first_name, last_name)
|
||||
VALUES( 'Sam' -- first_name
|
||||
, 'Brannen' -- last_name
|
||||
);--
|
||||
Reference in New Issue
Block a user