Skip to content

Commit

Permalink
Fixing bug in identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
torcato committed Jan 23, 2024
1 parent a34072b commit 006d386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions sql-client/src/main/scala/raw/client/sql/SqlCodeUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ object SqlCodeUtils {
}
}
}
// If we were checking for a second quote and we reached the end, then add the quote to the identifier
if (state == CheckQuote) {
idn += '"'
}

// We reached the end of the string append what is left
idns += SqlIdentifier(idn.toString(), quoted)
idns.toSeq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ class TestSqlCodeUtils extends AnyFunSuite {
|""".stripMargin

val values = Seq(
Pos(1, 16) -> Seq(SqlIdentifier("e", quoted = false)),
Pos(1, 19) -> Seq(SqlIdentifier("exam", quoted = false)),
Pos(1, 28) -> Seq(SqlIdentifier("example", quoted = false), SqlIdentifier("airpo", quoted = false)),
Pos(1, 16) -> Seq(SqlIdentifier("ex", quoted = false)),
Pos(1, 19) -> Seq(SqlIdentifier("examp", quoted = false)),
Pos(1, 28) -> Seq(SqlIdentifier("example", quoted = false), SqlIdentifier("airpor", quoted = false)),
)
val analyzer = new SqlCodeUtils(code)
for((pos, expected) <- values ) {
Expand Down

0 comments on commit 006d386

Please sign in to comment.