Repository navigation
SELECT's clauses in any order, and _TALLY - #10
Merged
RandomChirp merged 2 commits intoSep 24, 2026
Merged
Conversation
USE IN SELECT('alias'), ?name parameters in SELECT-SQL, INSERT INTO ... SELECT,
UNION [ALL], and a quoted name after DO and CREATE TABLE (with its NAME clause).
Every one was found in a 60,000-line CodeMine application, none of them rare
there, and each was measured in Visual FoxPro 9 before being written: ?name is
taken only by SELECT and is an ordinary expression, field first; INSERT ...
SELECT goes by position to the fields named; a UNION's columns are the first
SELECT's and its rows fold unless every UNION said ALL.
Two faults in the VM came out on the way and are fixed here because the new
forms could not be tested without them: a select list of nothing but `*` read
blank rows from a freshly opened table, since no field read had fetched the
page (SqlTouch now reads each starred source); and INTO ARRAY put the program
back in the last source's work area rather than its own, because the area was
noted after the sources were opened.
The sql_forms golden is written from the product. Two gaps it exposed are
recorded in the parity plan rather than fixed: a LOCAL shadows a field of the
same name here where the product reads the field, and _TALLY is never set.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Measured in Visual FoxPro 9, and written into the select_clause_order golden whose .expected vfp9.exe produced: the clauses after the select list may come in any order - Microsoft's own wbmain.prg writes `INTO ARRAY ... ORDER BY name GROUP BY name`, and a WHERE after INTO CURSOR, or an ORDER BY before WHERE, is the same query written the usual way round. INTO CURSOR and INTO TABLE no longer swallow the rest of the line, only their own option words. _TALLY is set to the number of rows a SELECT answered with (it was never set); wbmain.prg tests it straight after that query. Builds on FoxDevCommunity#2 (UNION is read by the same loop). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RandomChirp
approved these changes
Sep 24, 2026
RandomChirp
left a comment
Contributor
There was a problem hiding this comment.
The clause loop reads the same query in any order, the golden select_clause_order.prg agrees with vfp9.exe, the UNION path keeps an INTO written before it, and cargo test -p foxvm is green on a merge with main (main already has #2, which this needed).
_TALLY is now set by SELECT; INSERT, UPDATE and DELETE still leave it at 0, which is where it was before this change, so that is a later PR, not this one.
The ubuntu check failed only on the stale instructions.json guard that main no longer has; a rebase clears it.
Review generated with Claude Code (Claude Fable 5.1), run against vfp9.exe and the test suites on a merge with main.
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.
Measured in Visual FoxPro 9, and written into the select_clause_order golden
whose .expected vfp9.exe produced: the clauses after the select list may come
in any order - Microsoft's own wbmain.prg writes
INTO ARRAY ... ORDER BY name GROUP BY name, and a WHERE after INTO CURSOR, or an ORDER BY before WHERE,is the same query written the usual way round. INTO CURSOR and INTO TABLE no
longer swallow the rest of the line, only their own option words.
_TALLY is set to the number of rows a SELECT answered with (it was never set);
wbmain.prg tests it straight after that query.
Builds on #2 (UNION is read by the same loop).
Verification. The
select_clause_ordergolden, whose.expectedvfp9.exewrote. The full VM suite passes on this branch.Depends on #2, whose UNION handling this reorganises: until #2 is merged this pull request's diff includes it too. Only the last commit is new here.
🤖 Generated with Claude Code