Skip to content

Commit

Permalink
not ready for $
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Sep 6, 2024
1 parent f278c04 commit 424c65a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/ch/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,9 @@ defmodule Ch.Types do
defguardp is_alpha(a) when (a >= ?a and a <= ?z) or (a >= ?A and a <= ?Z)
defguardp is_numeric(char) when char >= ?0 and char <= ?9

# TODO add ?$
defp decode_identifier(<<a, rest::bytes>>, len, original, stack, acc)
when is_alpha(a) or is_numeric(a) or a == ?_ or a == ?$ do
when is_alpha(a) or is_numeric(a) or a == ?_ do
decode_identifier(rest, len + 1, original, stack, acc)
end

Expand Down
3 changes: 2 additions & 1 deletion test/ch/query_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ defmodule Ch.QueryTest do
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello', 123)").rows
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a, 123 as b)").rows
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a_, 123 as b)").rows
assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a$, 123 as b)").rows
# TODO
# assert [[{"Hello", 123}]] = Ch.query!(conn, "select ('Hello' as a$, 123 as b)").rows
end

test "decode network types", %{conn: conn} do
Expand Down

0 comments on commit 424c65a

Please sign in to comment.