Skip to content

Commit 978f805

Browse files
authored
Lexer fix: comment character missing (#6465)
* add dbtype adb_mysql * Presto/Trino parser fix * add CTE visit for insertNode * add keyword config for spark/hive * support synapse parser * support synapse parser * lexer fix: comment character missing * lexer fix: comment character missing
1 parent 9253b6d commit 978f805

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/com/alibaba/druid/sql/dialect/sqlserver/parser/SQLServerLexer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void scanComment() {
129129

130130
if (ch == '/' || ch == '-') {
131131
scanChar();
132-
bufPos++;
132+
bufPos = 2;
133133

134134
for (; ; ) {
135135
if (ch == '\r') {
@@ -154,7 +154,7 @@ public void scanComment() {
154154
bufPos++;
155155
}
156156

157-
stringVal = subString(mark + 1, bufPos);
157+
stringVal = subString(mark, bufPos);
158158
token = Token.LINE_COMMENT;
159159
commentCount++;
160160
if (keepComments) {

0 commit comments

Comments
 (0)