fix: issue #9 reserved keyword 'key' + issue #10 empty string treated as NULL
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled

Issue 9: Add backtick-quoted identifier support in lexer.nim
- Users can now write `key` to use reserved keywords as column/table names

Issue 10: Use \N as internal NULL marker instead of empty string
- isNull() now checks for \N instead of value.len == 0
- Empty strings can now be stored in NOT NULL columns
- NULL values properly distinguished from empty strings in storage, wire protocol, and HTTP JSON responses
This commit is contained in:
2026-05-17 01:59:25 +03:00
parent 58b7598155
commit 073ec41652
6 changed files with 111 additions and 45 deletions
+3 -3
View File
@@ -47,13 +47,13 @@ suite "JOIN execution":
check r.rows[0]["name"] == "Alice"
check r.rows[1]["name"] == "Alice"
check r.rows[2]["name"] == "Bob"
check r.rows[2]["total"] == "" # NULL represented as empty string
check r.rows[2]["total"] == "\\N" # NULL represented as \N
test "RIGHT JOIN keeps unmatched right rows":
let r = execSql(ctx, "SELECT * FROM users u RIGHT JOIN orders o ON u.id = o.user_id")
check r.rows.len == 3
check r.rows[2]["id"] == "30"
check r.rows[2]["name"] == "" # NULL
check r.rows[2]["name"] == "\\N" # NULL
check r.rows[2]["total"] == "150.0"
test "FULL JOIN keeps all rows":
@@ -100,7 +100,7 @@ suite "JOIN execution":
var foundBob = false
for row in r.rows:
if row["u.name"] == "Bob":
check row["x.total"] == ""
check row["x.total"] == "\\N"
foundBob = true
check foundBob