Commit c95032d
committed
SET options (parse-and-discard for session / connection / planner state): expanded
Simulation.Set.cs from a 2-option switch (NOCOUNT, IMPLICIT_TRANSACTIONS) into a closed accept-list covering the full standard SET surface. ANSI / session-state OnOff toggles: ANSI_NULLS, QUOTED_IDENTIFIER, ANSI_WARNINGS, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, ARITHABORT, ARITHIGNORE, NUMERIC_ROUNDABORT, XACT_ABORT, FMTONLY, NOEXEC, FORCEPLAN, PARSEONLY, CURSOR_CLOSE_ON_COMMIT, ANSI_DEFAULTS, REMOTE_PROC_TRANSACTIONS, NO_BROWSETABLE, NOCOUNT, IMPLICIT_TRANSACTIONS, SHOWPLAN_ALL, SHOWPLAN_TEXT, SHOWPLAN_XML, DISABLE_DEF_CNST_CHK. Value-taking options: LOCK_TIMEOUT / TEXTSIZE / DATEFIRST / ROWCOUNT / QUERY_GOVERNOR_COST_LIMIT (integer); DATEFORMAT / LANGUAGE (identifier or string-literal); DEADLOCK_PRIORITY (integer-or-identifier); CONTEXT_INFO (binary literal). Multi-word sub-forms: SET TRANSACTION ISOLATION LEVEL {READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SNAPSHOT|SERIALIZABLE} and SET STATISTICS {IO|TIME|XML|PROFILE} ON|OFF — both flagged "not parsed" in CLAUDE.md previously, now ship as parse-and-discard since the underlying state (locking / IO accounting) isn't modeled anyway. ReservedKeyword-named options (ROWCOUNT / TEXTSIZE / STATISTICS / TRANSACTION) dispatch separately because they tokenize as ReservedKeyword rather than UnquotedString. **Multi-option comma form** (SET ANSI_NULLS, QUOTED_IDENTIFIER, CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING ON) — the canonical EF Core SqlServer-provider session-bootstrap shape — restricted to OnOff-shaped options; unknown name inside the chain raises Msg 195 immediately. New UnrecognizedSetOption(name) factory mirrors probe wording verbatim: 'BANANA' is not a recognized SET option. (Msg 195, severity 15 state 1). Probe-confirmed split for unknown-option fall-throughs: SET BANANA ON raises Msg 195 (recognizable as SET-option-shape); SET BANANA with no trailing tokens raises Msg 102 generic syntax error (matching the real-server probe exactly — no dedicated rejection code when there's nothing to disambiguate). The simulator's Msg 102 path uses a checkpoint/restore so the rejection wording reports Incorrect syntax near 'BANANA' (the offending name) rather than near '' (post-EOF cursor). 50 new SetOptionTests cover every accepted entry plus both rejection paths plus the multi-option-with-unknown-in-the-middle chain. CLAUDE.md "Not modeled" rewritten to reflect the new shipping surface: SET TRANSACTION ISOLATION LEVEL and XACT_ABORT removed from the "not parsed" list; the closed accept-list and Msg 195 / Msg 102 split documented inline. BEGIN DISTRIBUTED TRANSACTION / BEGIN TRANSACTION ... WITH MARK continue to raise NotSupportedException at dispatch — the SET-side parse-and-discard doesn't apply to BEGIN-side multi-word transaction shapes.1 parent 3efc41e commit c95032d
4 files changed
Lines changed: 337 additions & 23 deletions
File tree
- SqlServerSimulator.Tests
- SqlServerSimulator
- Errors
- Simulation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
| |||
0 commit comments