This directory contains regression tests for specific bugs that were fixed in the parser.
Issue: After removing builtin_function_name tokens, mathematical and string function names should be usable as regular identifiers.
Tests:
- Using function names (exp, div, floor, mod, power, sqrt, log, reverse) as column names
- Using function names as table names
- SELECT statements with these identifiers
Related PR: #40 - Remove non-standard builtin_function_name tokens
Issue: Missing jsontype rule caused ::json and ::jsonb typecasts to fail with "mismatched input ';' expecting '%'"
Tests:
- Basic JSON/JSONB typecast syntax
- JSON with unicode escape sequences
- JSON with surrogate pairs
- JSON type in CREATE TABLE
- JSON typecast with -> operator
Related PR: #40 - Add jsontype rule for proper JSON type support
Issue: Complex multi-table JOINs with multiple LEFT JOINs and ORDER BY clauses
Tests:
- Multiple LEFT JOIN statements
- Column aliases with AS keyword
- WHERE clause filtering
- ORDER BY with multiple columns and mixed ASC/DESC
Related PR: #40 - General regression test for complex query patterns
These tests are automatically included when running the full test suite:
cd postgresql
make testTo run only regression tests:
go test -run "TestPostgreSQLParser/examples/regression" -vWhen fixing a parser bug:
- Create a new
.sqlfile in this directory - Add a comment at the top describing the issue and fix
- Include minimal test cases that reproduce the bug
- The test will be automatically picked up by the test runner