You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enh(Data): SQLParser test coverage and integration assertions #5370
Adds tests that lock down the parser-layer behaviour POCO's production
code relies on, plus reproductions of recent fix motivations so any
upstream sql-parser sync that regresses them fails loudly in the test
layer rather than silently in MemoryDB / Utility.
Data/testsuite/src/SQLParserTest:
- testResetClearsParameters: reparse loop with reset() between
iterations - the lifecycle the upstream sval-leak fix hardened.
- testNamedParameter: :name placeholders parse to kExprParameterNamed
with names {user, age}.
- testAlterDropColumnIfExists: down-casts to AlterStatement +
DropColumnAction and asserts columnName, ifExists, table name.
- testDropDiscrimination: DROP TABLE vs DROP INDEX dispatch.
- testDeleteShape: DeleteStatement::expr nullptr distinguishes truncate
from filtered delete - what MemoryDB branches on for the truncate
optimization.
- testComments: -- line comments survive parsing across statements.
- testTokenize: backstops the SQLParser::tokenize loop the upstream
sval-leak fix rewrote.
- Inline fix to the pre-existing testSQLParser failure formatter: L13
was rendering with no separator between line and column; replaced
with L<line>:C<col> and switched bare fail() to failmsg() so the
formatted message actually surfaces on the CppUnit report.
Data/SQLite/testsuite/src/UtilityTest:
- testBoundSQLNamed: pins the current pass-through behaviour of :name
placeholders in Utility::boundSQL (Utility.cpp kExprParameterNamed
branch sets paramIndex=npos so the span is copied verbatim and the
supplied args are silently ignored). If this branch is ever taught
to substitute values, the test must be rewritten.
Data/SQLite/testsuite/src/MemoryDBTest:
- testCommentPrefixedWithoutRowidRejected: covers both operator<< and
session() bypass paths with a leading -- comment. Pins the motivation
for the leading-comment-skip rewrite in onStatement; the previous
single-char trigger-marker check let -- prefixed CREATE bypass the
trace-hook backstop.
- testDropTableClassified: DROP TABLE survives close-reopen via the
schema log, proving the kStmtDrop + kDropTable dispatch.
- testAlterTableClassified: ALTER TABLE ADD COLUMN survives close-
reopen. ADD COLUMN is not modelled as an AlterAction by hsql so this
exercises the first-keyword DDL fallback in onStatement.
0 commit comments