Repository navigation
Parse floating column declarations with a precision argument - #7
Merged
Merged
Conversation
Adapt the single-precision length rule from Vitess 7314463f4658. FLOAT(24), DOUBLE(24), and REAL(24) previously fell back to partial DDL without a TableSpec, hiding following defaults from consumer checks. Preserve the SQLite-compatible type spellings and two-number forms. This changes the DDL AST and exposes CURRENT_TIMESTAMP defaults to the CovenantSQL sanitizer, intentionally tightening consensus acceptance.
Complete parsing of a single-precision column declaration also keeps semicolons inside default strings within the statement. Cover FLOAT, DOUBLE, and REAL through ParseMultiple, preserving the original query and string value. This acceptance expansion accompanies the stricter stateful-default checks documented for the grammar change.
Keep INSERT comment handling and the single-argument floating precision production together. Regenerate sql.go with the pinned goyacc revision.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FLOAT(24), DOUBLE(24), and REAL(24) fall back to partial DDL without a column specification. Following defaults are consequently absent from CovenantSQL's column-default checks, as the new AST regression demonstrates.
Adapt the single-precision production from Vitess 7314463f4658 and regenerate sql.go. Consensus impact: the fuller DDL AST exposes CURRENT_TIMESTAMP defaults to the sanitizer and tightens consumer acceptance. Acceptance also widens: declarations with a default such as 'a;b' now remain one statement instead of failing at the embedded semicolon. Master can also rewrite accepted DDL by splitting inside a default string and letting the consumer rejoin with
;(for example,'a;select 1 --'is stored as'a; select 1 --'); this branch keeps the string intact. No MySQL type aliases are added.Testing
Linux/amd64, Docker Go 1.27.3, 4 CPUs. The precision and semicolon-default regressions fail for all three declarations on master and pass on this branch. After merging master, build and vet pass, and all 87 tests pass. CovenantSQL develop and a scratch branch replacement pass the build and xenomint tests. Commands run in their respective repositories: