Skip to content

Commit d64a5fa

Browse files
committed
Add comprehensive INSERT parser tests with round-trip verification
32 new tests covering MySQL and PostgreSQL INSERT/REPLACE: - Basic VALUES, multi-row, column list, INSERT SELECT, INSERT SET - ON DUPLICATE KEY UPDATE, IGNORE, LOW_PRIORITY, DELAYED, HIGH_PRIORITY - REPLACE with various options - PostgreSQL ON CONFLICT DO NOTHING/UPDATE, RETURNING, DEFAULT VALUES - Bulk data-driven tests (24 MySQL + 16 PostgreSQL variants) - Round-trip emitter tests (7 MySQL + 5 PostgreSQL) Also fixes is_alias_start() to block TK_LPAREN which was incorrectly treated as a valid implicit alias token. Total test count: 268 (was 236, +32 new)
1 parent 40cbcd2 commit d64a5fa

File tree

3 files changed

+422
-1
lines changed

3 files changed

+422
-1
lines changed

Makefile.new

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ TEST_SRCS = $(TEST_DIR)/test_main.cpp \
2727
$(TEST_DIR)/test_set.cpp \
2828
$(TEST_DIR)/test_select.cpp \
2929
$(TEST_DIR)/test_emitter.cpp \
30-
$(TEST_DIR)/test_stmt_cache.cpp
30+
$(TEST_DIR)/test_stmt_cache.cpp \
31+
$(TEST_DIR)/test_insert.cpp
3132
TEST_OBJS = $(TEST_SRCS:.cpp=.o)
3233
TEST_TARGET = $(PROJECT_ROOT)/run_tests
3334

include/sql_parser/table_ref_parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ class TableRefParser {
208208
case TokenType::TK_UNION:
209209
case TokenType::TK_SEMICOLON:
210210
case TokenType::TK_RPAREN:
211+
case TokenType::TK_LPAREN:
211212
case TokenType::TK_EOF:
212213
case TokenType::TK_COMMA:
213214
case TokenType::TK_SET:

0 commit comments

Comments
 (0)