From 89db6392acd9fd5c86b1601ec1d66d92fb5b2718 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 16 Dec 2019 11:08:15 +0100 Subject: [PATCH] [jOOQ/jOOQ#9651] Support parsing // as a single line comment token ... in plain SQL templatin --- jOOQ/src/main/java/org/jooq/impl/Tools.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Tools.java b/jOOQ/src/main/java/org/jooq/impl/Tools.java index c1d4b231c3..b680014966 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Tools.java +++ b/jOOQ/src/main/java/org/jooq/impl/Tools.java @@ -706,6 +706,7 @@ final class Tools { }; private static final char[] TOKEN_SINGLE_LINE_COMMENT = { '-', '-' }; + private static final char[] TOKEN_SINGLE_LINE_COMMENT_C = { '/', '/' }; private static final char[] TOKEN_HASH = { '#' }; private static final char[] TOKEN_MULTI_LINE_COMMENT_OPEN = { '/', '*' }; private static final char[] TOKEN_MULTI_LINE_COMMENT_CLOSE = { '*', '/' }; @@ -2234,11 +2235,12 @@ final class Tools { characterLoop: for (int i = 0; i < sqlChars.length; i++) { - // [#1797] Skip content inside of single-line comments, e.g. + // [#1797] [#9651] Skip content inside of single-line comments, e.g. // select 1 x -- what's this ?'? // from t_book -- what's that ?'? // where id = ? if (peek(sqlChars, i, TOKEN_SINGLE_LINE_COMMENT) || + peek(sqlChars, i, TOKEN_SINGLE_LINE_COMMENT_C) || // [#4182] MySQL also supports # as a comment character, and requires // -- to be followed by a whitespace, although the latter is also not