Repository navigation
Five SQL and name forms real applications write - #2
Merged
RandomChirp merged 1 commit 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>
Collaborator
Author
|
Hi! I had Claude/Fable 5.1 try to help me get a fairly large project working, and this is what it did. No worries if you don't want it! I am also working on a Windows machine running under Parallels Desktop, so there may be some ARM64 improvements or specific configs. I've still got a few issues so I may follow up with another pull request or two. If you want me to stop making pull requests, just let me know. Neat project! Have a great day! |
Contributor
|
@jefflroberts looks great, this was born out of experimentation so any help is greatly appreciated! If it works for you thats enough! Please keep them coming! |
This was referenced Sep 24, 2026
RandomChirp
added a commit
that referenced
this pull request
Sep 24, 2026
…itted PR #2 changed bytecode.rs and the site's stale-data check turned main red, which no outside contributor could have foreseen. The data is derived from a file in this same repository, so prebuild and predev write it and git does not carry it.
RandomChirp
pushed a commit
that referenced
this pull request
Sep 24, 2026
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). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
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.
Five spellings a real Visual FoxPro application uses that the reference examples do not. All were found while importing a 60,000-line CodeMine application (Shutter Ace) into FoxDev, and none of them is rare there:
USE IN SELECT('alias')- a name with a bracket after it in anINclause is a call whose answer is the work area. About 180 uses in the app.?nameparameters in SELECT-SQL. Measured in VFP 9: accepted only by SELECT (INSERT, UPDATE and DELETE - SQL each refuse it with a syntax error), and read as an ordinary expression - a name that is both a field and a variable is the field,?m.nameasks for the variable.INSERT INTO t [(fields)] SELECT ...- the query runs into a cursor of its own and each row goes by position to the fields named, or to the table's fields in order.UNION [ALL]- each SELECT runs into its own cursor, later rows are appended under the first, and the whole is one finalSELECT [DISTINCT] *carrying the union's ORDER BY and INTO. Columns are the first SELECT's; rows fold unless every UNION said ALL.DO "path"andCREATE TABLE 'file.dbf' NAME x- a quoted name where the grammar took only a bare one. The NAME clause is read and dropped, since the container lists a table by its file stem.Two VM faults came out on the way and are fixed here because the new forms could not be tested without them:
*read blank rows from a freshly opened table: no field read had fetched the page. ASqlTouchinstruction now reads each starred source before the row is made.INTO ARRAYput the program back in the last source's work area rather than its own, because the area was noted after the sources were opened.Verification.
crates/foxvm/tests/sql_forms.rs(15 tests) and thesql_formsgolden, whose.expectedwas written byvfp9.exe. The full VM suite passes (311 tests).npm run argforms:checkpasses.Recorded, not fixed (added to the parity plan under "Open, reported from the IDE"): a LOCAL shadows a field of the same name here where the product reads the field, and
_TALLYis never set by any statement. Both belong to the resolver (system 3).Effect on the application that prompted this: forms and class libraries compiling clean went from 26 of 47 to 36 of 47; parse issues across them from 463 to 229.
🤖 Generated with Claude Code