diff --git a/package.json b/package.json index e20b0512..0d981f55 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "build": "tsc", "build:test": "tsc -p tsconfig.json", "test": "mocha \"test/**/*.test.js\"", + "record-corpus": "node test/contract/record.js", "test:improved": "mocha test/connection-improved.test.js --reporter spec", "test:webstorm": "mocha test/connection-webstorm.test.js --config test/.mocharc.webstorm.js", "test:connection": "mocha test/connect*.js --reporter spec --timeout 30000", diff --git a/test/common/fake-native.js b/test/common/fake-native.js index 855cd691..8ece1e77 100644 --- a/test/common/fake-native.js +++ b/test/common/fake-native.js @@ -191,12 +191,14 @@ function fakeSql (native, { version = 18 } = {}) { conn.setDriverVersion(version) native.open(connectionString, 0, err => setImmediate(() => cb(Array.isArray(err) ? err[0] : err, conn))) } - return { - open, - promises: { - open: connectionString => new Promise((resolve, reject) => open(connectionString, (e, c) => e ? reject(e) : resolve(c))) - } - } + // everything else (PollingQuery, the types, ...) is the real module's + const real = require(root) + const fake = Object.create(real) + fake.open = open + fake.promises = Object.assign(Object.create(real.promises ?? {}), { + open: connectionString => new Promise((resolve, reject) => open(connectionString, (e, c) => e ? reject(e) : resolve(c))) + }) + return fake } module.exports = { ReplayNative, fakeSql } diff --git a/test/contract/HANDOVER.md b/test/contract/HANDOVER.md index cb0711f3..12e267c1 100644 --- a/test/contract/HANDOVER.md +++ b/test/contract/HANDOVER.md @@ -83,8 +83,9 @@ at execute, the error comes with `more=false` and the rest of the batch is lost: `rowcount`, no following result set, no `done`. Windows gives `more=true`, then the rest. So the #475 fix in 5.6.0 (`odbc_statement_legacy.cpp`, the look-ahead after a failed execute) does not hold on Linux. The same 4 scenarios differ with the base commit's `lib/`, so it is -older than the queue work. Pinned as `errors/{raiserror-then-result,dup-key-d}.*.linux.txt`, -`# status: known-bug`, so that CI is green and the fix shows up as a diff. +older than the queue work. Pinned as `errors/{raiserror-then-result,dup-key-d}.*.linux.txt` +and `scripts/issue-478.linux.txt` (its case D), `# status: known-bug`, so that CI is green +and the fix shows up as a diff. Filed as #483. To run the corpus on WSL: a `git worktree` under `/tmp//node_modules/msnodesqlv8` (the tests `require('msnodesqlv8')`), `npx node-gyp rebuild`, copy `.env-cmdrc`, symlink diff --git a/test/contract/README.md b/test/contract/README.md index 0e8cf4ce..116d5794 100644 --- a/test/contract/README.md +++ b/test/contract/README.md @@ -12,6 +12,8 @@ event order shows up as a diff in review, and the contract can be discussed line | File | What it is | |---|---| | `scenarios.js` | the scenarios: query, setup, actions (pause / resume / cancel at row n, at start, after n ms, after free), follow-up queries | +| `scripts/` | scripted scenarios, for what one query can't say: the issue repros (`issue-478.js` ...), several cases in sequence. See `scripts/README.md` | +| `record.js` | `npm run record-corpus -- `: copies a script into `scripts/` and records its transcript and native log | | `recorder.js` | runs a scenario and records the transcript; line format documented at the top | | `corpus.js` | reads / writes / diffs corpus files | | `capture.js` | CLI to record and compare | diff --git a/test/contract/capture.js b/test/contract/capture.js index c1c4dc2b..ec1bd80a 100644 --- a/test/contract/capture.js +++ b/test/contract/capture.js @@ -8,6 +8,7 @@ // node test/contract/capture.js --repeat 10 [filter] run each scenario 10 times (default 3) // node test/contract/capture.js --root use the msnodesqlv8 in , e.g. an // older release, to see how it differs +// node test/contract/capture.js --exact only the scenario with exactly that name // node test/contract/capture.js --native [filter] also record each scenario's native calls // into native/.json, for the fake // driver to replay (a run whose transcript @@ -24,12 +25,13 @@ const { captureScenario, runIsolated } = require('./recorder') const corpus = require('./corpus') function parseArgs (argv) { - const opts = { update: false, print: false, native: false, repeat: 3, root: path.join(__dirname, '../..'), filters: [] } + const opts = { update: false, print: false, native: false, exact: false, repeat: 3, root: path.join(__dirname, '../..'), filters: [] } for (let i = 0; i < argv.length; i++) { const a = argv[i] if (a === '--update') opts.update = true else if (a === '--print') opts.print = true else if (a === '--native') opts.native = true + else if (a === '--exact') opts.exact = true else if (a === '--repeat') opts.repeat = Number(argv[++i]) else if (a === '--root') opts.root = path.resolve(argv[++i]) else opts.filters.push(a) @@ -41,7 +43,8 @@ async function main () { const opts = parseArgs(process.argv.slice(2)) const version = require(path.join(opts.root, 'package.json')).version const connectionString = new TestEnv().connectionString - const selected = scenarios.filter(s => opts.filters.length === 0 || opts.filters.some(f => s.name.includes(f))) + const chosen = s => opts.exact ? opts.filters.includes(s.name) : opts.filters.some(f => s.name.includes(f)) + const selected = scenarios.filter(s => opts.filters.length === 0 || chosen(s)) console.log(`msnodesqlv8 ${version} (${opts.root}) - ${selected.length} scenarios, ${opts.repeat} runs each`) const summary = { same: 0, different: 0, missing: 0, nondeterministic: [] } diff --git a/test/contract/corpus.js b/test/contract/corpus.js index be610b06..092049b0 100644 --- a/test/contract/corpus.js +++ b/test/contract/corpus.js @@ -46,7 +46,8 @@ function read (name, platform = process.platform) { function header (scenario, status) { const lines = [`# scenario: ${scenario.name}`, `# status: ${status}`] for (const statement of scenario.setup ?? []) lines.push(`# setup: ${statement}`) - lines.push(`# sql: ${scenario.sql}`) + if (scenario.script) lines.push(`# script: test/contract/scripts/${path.basename(scenario.script)}`) + else lines.push(`# sql: ${scenario.sql}`) if (scenario.params) lines.push(`# params: ${JSON.stringify(scenario.params, (k, v) => typeof v === 'number' && !isFinite(v) ? String(v) : v)}`) if (scenario.at) lines.push(`# at: ${JSON.stringify(scenario.at)}`) for (const f of scenario.followUps ?? []) { diff --git a/test/contract/corpus/scripts/issue-478.linux.txt b/test/contract/corpus/scripts/issue-478.linux.txt new file mode 100644 index 00000000..503edef2 --- /dev/null +++ b/test/contract/corpus/scripts/issue-478.linux.txt @@ -0,0 +1,37 @@ +# scenario: scripts/issue-478 +# status: known-bug +# script: test/contract/scripts/issue-478.js +setup: submitted +setup: rowcount 1 +setup: cb ok rows=0 more=false +setup: done +setup: free +== A insert #t values (1) +A: submitted +A: info 01000 3621 The statement has been terminated. +A: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false +A: free +== B select 1 as n; insert #t values (1) +B: submitted +B: meta n +B: row +B: info 01000 3621 The statement has been terminated. +B: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false +B: free +== C select 1 as n; insert #t values (1); select 2 as m +C: submitted +C: meta n +C: row +C: info 01000 3621 The statement has been terminated. +C: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=true +C: rowcount 0 +C: meta m +C: row +C: done +C: free +== D insert #t values (1); select 2 as m +D: submitted +D: info 01000 3621 The statement has been terminated. +D: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false +D: free +check ok diff --git a/test/contract/corpus/scripts/issue-478.txt b/test/contract/corpus/scripts/issue-478.txt new file mode 100644 index 00000000..d29b3240 --- /dev/null +++ b/test/contract/corpus/scripts/issue-478.txt @@ -0,0 +1,41 @@ +# scenario: scripts/issue-478 +# status: unreviewed +# script: test/contract/scripts/issue-478.js +setup: submitted +setup: rowcount 1 +setup: cb ok rows=0 more=false +setup: done +setup: free +== A insert #t values (1) +A: submitted +A: info 01000 3621 The statement has been terminated. +A: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false +A: free +== B select 1 as n; insert #t values (1) +B: submitted +B: meta n +B: row +B: info 01000 3621 The statement has been terminated. +B: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false +B: free +== C select 1 as n; insert #t values (1); select 2 as m +C: submitted +C: meta n +C: row +C: info 01000 3621 The statement has been terminated. +C: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=true +C: rowcount 0 +C: meta m +C: row +C: done +C: free +== D insert #t values (1); select 2 as m +D: submitted +D: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=true +D: info 01000 3621 The statement has been terminated. +D: rowcount 0 +D: meta m +D: row +D: done +D: free +check ok diff --git a/test/contract/corpus/scripts/issue-479.txt b/test/contract/corpus/scripts/issue-479.txt new file mode 100644 index 00000000..09b06b1c --- /dev/null +++ b/test/contract/corpus/scripts/issue-479.txt @@ -0,0 +1,82 @@ +# scenario: scripts/issue-479 +# status: unreviewed +# script: test/contract/scripts/issue-479.js +== A running cancel, at row 100 +A: submitted +A: meta name +A: row x100 +A: action cancel +A: done +A: cancel-cb ok +A: error HY008 0 Operation canceled more=false +A: free +A.check: submitted +A.check: meta n +A.check: row +A.check: cb ok rows=1 more=false +A.check: done +A.check: free +== B late cancel, after free +B: submitted +B: meta n +B: row +B: done +B: free +B: action cancel +B: done +B: cancel-cb error Error: [msnodesql] cannot cancel query (empty queue) id 2 +B.check: submitted +B.check: meta n +B.check: row +B.check: cb ok rows=1 more=false +B.check: done +B.check: free +== C running cancel after a print, at row 100 +C: submitted +C: info 01000 0 start +C: rowcount 0 +C: meta name +C: row x100 +C: action cancel +C: done +C: cancel-cb ok +C: row x4900 +C: done +C: free +C.check: submitted +C.check: meta n +C.check: row +C.check: cb ok rows=1 more=false +C.check: done +C.check: free +== 4 a polling query, paused and cancelled at row 100 +P4: submitted +P4: meta name +P4: row x100 +P4: action pause +P4: action cancel +P4: done +P4: cancel-cb ok +P4: error HY008 0 Operation canceled more=false +P4: free +P4.check: submitted +P4.check: meta n +P4.check: row +P4.check: cb ok rows=1 more=false +P4.check: done +P4.check: free +== 5 paused and cancelled before it executes +P5: action pause +P5: action cancel +P5: submitted +P5: done +P5: cancel-cb ok +P5: error HY008 0 Operation canceled more=false +P5: free +P5.check: submitted +P5.check: meta n +P5.check: row +P5.check: cb ok rows=1 more=false +P5.check: done +P5.check: free +check ok diff --git a/test/contract/corpus/scripts/issue-480.txt b/test/contract/corpus/scripts/issue-480.txt new file mode 100644 index 00000000..6763504a --- /dev/null +++ b/test/contract/corpus/scripts/issue-480.txt @@ -0,0 +1,36 @@ +# scenario: scripts/issue-480 +# status: unreviewed +# script: test/contract/scripts/issue-480.js +== pause at row 50, resume 50 ms later +at50: submitted +at50: meta a +at50: row x50 +at50: action pause +at50: action resume +at50: row +at50: meta b +at50: row x51 +at50: done +at50: free +== pause at row 51, resume 50 ms later +at51: submitted +at51: meta a +at51: row x51 +at51: action pause +at51: action resume +at51: meta b +at51: row x51 +at51: done +at51: free +== pause at row 52, resume 50 ms later +at52: submitted +at52: meta a +at52: row x51 +at52: meta b +at52: row +at52: action pause +at52: action resume +at52: row x50 +at52: done +at52: free +check ok diff --git a/test/contract/corpus/scripts/issue-481.txt b/test/contract/corpus/scripts/issue-481.txt new file mode 100644 index 00000000..8831ce7b --- /dev/null +++ b/test/contract/corpus/scripts/issue-481.txt @@ -0,0 +1,116 @@ +# scenario: scripts/issue-481 +# status: unreviewed +# script: test/contract/scripts/issue-481.js +== A1 ok: q2 and q3 queued at once +A1 ok.q1: submitted +A1 ok.q1: meta v +A1 ok.q1: row +A1 ok.q1: cb ok rows=1 more=false +A1 ok.q1: done +A1 ok.q1: free +A1 ok.q2: submitted +A1 ok.q2: meta n +A1 ok.q2: row +A1 ok.q2: cb ok rows=1 more=false +A1 ok.q2: done +A1 ok.q2: free +A1 ok.q3: submitted +A1 ok.q3: meta n +A1 ok.q3: row +A1 ok.q3: cb ok rows=1 more=false +A1 ok.q3: done +A1 ok.q3: free +== A2 bind failure: q2 and q3 queued at once +A2 bind failure.q1: submitted +A2 bind failure.q1: done +A2 bind failure.q1: free +A2 bind failure.q2: submitted +A2 bind failure.q1: cb error - - IMNOD: [msnodesql] Parameter 1: Invalid number parameter more=false +A2 bind failure.q2: meta n +A2 bind failure.q2: row +A2 bind failure.q2: cb ok rows=1 more=false +A2 bind failure.q2: done +A2 bind failure.q2: free +A2 bind failure.q3: submitted +A2 bind failure.q3: meta n +A2 bind failure.q3: row +A2 bind failure.q3: cb ok rows=1 more=false +A2 bind failure.q3: done +A2 bind failure.q3: free +== A3 ok: q2 and q3 queued from q1 free +A3 ok.q1: submitted +A3 ok.q1: meta n +A3 ok.q1: row +A3 ok.q1: cb ok rows=1 more=false +A3 ok.q1: done +A3 ok.q1: free +A3 ok.q2: submitted +A3 ok.q2: meta n +A3 ok.q2: row +A3 ok.q2: cb ok rows=1 more=false +A3 ok.q2: done +A3 ok.q2: free +A3 ok.q3: submitted +A3 ok.q3: meta n +A3 ok.q3: row +A3 ok.q3: cb ok rows=1 more=false +A3 ok.q3: done +A3 ok.q3: free +== A4 error at execute: q2 and q3 queued from q1 free +A4 error at execute.q1: submitted +A4 error at execute.q1: free +A4 error at execute.q1: cb error 42000 50000 boom more=false +A4 error at execute.q2: submitted +A4 error at execute.q2: meta n +A4 error at execute.q2: row +A4 error at execute.q2: cb ok rows=1 more=false +A4 error at execute.q2: done +A4 error at execute.q2: free +A4 error at execute.q3: submitted +A4 error at execute.q3: meta n +A4 error at execute.q3: row +A4 error at execute.q3: cb ok rows=1 more=false +A4 error at execute.q3: done +A4 error at execute.q3: free +== A5 error after a result: q2 and q3 queued from q1 free +A5 error after a result.q1: submitted +A5 error after a result.q1: meta n +A5 error after a result.q1: row +A5 error after a result.q1: cb error 42000 50000 boom more=false +A5 error after a result.q1: free +A5 error after a result.q2: submitted +A5 error after a result.q2: meta n +A5 error after a result.q2: row +A5 error after a result.q2: cb ok rows=1 more=false +A5 error after a result.q2: done +A5 error after a result.q2: free +A5 error after a result.q3: submitted +A5 error after a result.q3: meta n +A5 error after a result.q3: row +A5 error after a result.q3: cb ok rows=1 more=false +A5 error after a result.q3: done +A5 error after a result.q3: free +== B1 ok: from q1 free, a slow q2 cancelled after 300 ms +B1 ok.q1: submitted +B1 ok.q1: meta n +B1 ok.q1: row +B1 ok.q1: cb ok rows=1 more=false +B1 ok.q1: done +B1 ok.q1: free +B1 ok.q2: submitted +B1 ok.q2: action cancel +B1 ok.q2: done +B1 ok.q2: cancel-cb ok +B1 ok.q2: free +B1 ok.q2: cb error HY008 0 Operation canceled more=false +== B2 error at execute: from q1 free, a slow q2 cancelled after 300 ms +B2 error at execute.q1: submitted +B2 error at execute.q1: free +B2 error at execute.q1: cb error 42000 50000 boom more=false +B2 error at execute.q2: submitted +B2 error at execute.q2: action cancel +B2 error at execute.q2: done +B2 error at execute.q2: cancel-cb ok +B2 error at execute.q2: free +B2 error at execute.q2: cb error HY008 0 Operation canceled more=false +check ok diff --git a/test/contract/native/scripts/issue-478.win32.json b/test/contract/native/scripts/issue-478.win32.json new file mode 100644 index 00000000..6612996e --- /dev/null +++ b/test/contract/native/scripts/issue-478.win32.json @@ -0,0 +1 @@ +{"scenario":"scripts/issue-478","transcript":["setup: submitted","setup: rowcount 1","setup: cb ok rows=0 more=false","setup: done","setup: free","== A insert #t values (1)","A: submitted","A: info 01000 3621 The statement has been terminated.","A: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false","A: free","== B select 1 as n; insert #t values (1)","B: submitted","B: meta n","B: row","B: info 01000 3621 The statement has been terminated.","B: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=false","B: free","== C select 1 as n; insert #t values (1); select 2 as m","C: submitted","C: meta n","C: row","C: info 01000 3621 The statement has been terminated.","C: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=true","C: rowcount 0","C: meta m","C: row","C: done","C: free","== D insert #t values (1); select 2 as m","D: submitted","D: error 23000 2627 Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1). more=true","D: info 01000 3621 The statement has been terminated.","D: rowcount 0","D: meta m","D: row","D: done","D: free","check ok"],"log":[{"ev":"call","id":0,"t":10.4,"name":"open","args":["",0]},{"ev":"return","of":0,"t":30.2,"result":[null,{"success":true}]},{"ev":"call","id":2,"t":31.5,"name":"query","args":[0,{"query_str":"create table #t (id int constraint pk_t primary key); insert #t values (1)","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":2,"t":31.7,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":2,"t":32,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":2,"t":32.9,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":2,"t":33,"result":[null,{"meta":[],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":false,"rowCount":1},true]},{"ev":"call","id":7,"t":33.2,"name":"nextResultSet","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"return","of":7,"t":33.2,"result":[null,{"meta":[],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":true,"rowCount":1}]},{"ev":"call","id":9,"t":33.5,"name":"releaseStatement","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"state","of":2,"t":33.6,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":9,"t":33.6,"result":[null,true]},{"ev":"call","id":12,"t":189.9,"name":"query","args":[1,{"query_str":"insert #t values (1)","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":12,"t":190.1,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":12,"t":190.1,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":12,"t":191.2,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"state","of":12,"t":191.2,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":12,"t":191.2,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1).","sqlstate":"23000","code":2627,"severity":14,"serverName":"","procName":"","lineNumber":1},{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The statement has been terminated.","sqlstate":"01000","code":3621,"severity":0,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":18,"t":191.5,"name":"releaseStatement","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"state","of":12,"t":191.5,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":18,"t":191.6,"result":[null,true]},{"ev":"call","id":21,"t":346.1,"name":"query","args":[2,{"query_str":"select 1 as n; insert #t values (1)","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":21,"t":346.3,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":21,"t":346.3,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":21,"t":347.4,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":21,"t":347.5,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":26,"t":347.6,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":26,"t":347.7,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":28,"t":347.8,"name":"nextResultSet","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"state","of":21,"t":347.9,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":28,"t":347.9,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1).","sqlstate":"23000","code":2627,"severity":14,"serverName":"","procName":"","lineNumber":1},{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The statement has been terminated.","sqlstate":"01000","code":3621,"severity":0,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":31,"t":348,"name":"releaseStatement","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"state","of":21,"t":348.1,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":31,"t":348.1,"result":[null,true]},{"ev":"call","id":34,"t":502.4,"name":"query","args":[3,{"query_str":"select 1 as n; insert #t values (1); select 2 as m","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":34,"t":502.5,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":34,"t":502.5,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":34,"t":503.6,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":34,"t":503.6,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":39,"t":503.7,"name":"fetchRows","args":[3,{"connectionId":0,"statementId":3},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":39,"t":503.7,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":41,"t":503.8,"name":"nextResultSet","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"state","of":34,"t":503.8,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":41,"t":503.8,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1).","sqlstate":"23000","code":2627,"severity":14,"serverName":"","procName":"","lineNumber":1},{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The statement has been terminated.","sqlstate":"01000","code":3621,"severity":0,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":44,"t":503.9,"name":"nextResultSet","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"return","of":44,"t":504,"result":[null,{"meta":[{"name":"m","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":false,"rowCount":0}]},{"ev":"call","id":46,"t":504,"name":"fetchRows","args":[3,{"connectionId":0,"statementId":3},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":46,"t":504.1,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":48,"t":504.1,"name":"nextResultSet","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"return","of":48,"t":504.1,"result":[null,{"meta":[{"name":"m","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":50,"t":504.1,"name":"releaseStatement","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"state","of":34,"t":504.2,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":50,"t":504.2,"result":[null,true]},{"ev":"call","id":53,"t":658.9,"name":"query","args":[4,{"query_str":"insert #t values (1); select 2 as m","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":53,"t":659,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":53,"t":659.1,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":53,"t":660.2,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"state","of":53,"t":660.2,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":53,"t":660.2,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Violation of PRIMARY KEY constraint 'pk_t'. Cannot insert duplicate key in object 'dbo.#t'. The duplicate key value is (1).","sqlstate":"23000","code":2627,"severity":14,"serverName":"","procName":"","lineNumber":1},{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The statement has been terminated.","sqlstate":"01000","code":3621,"severity":0,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":59,"t":660.4,"name":"nextResultSet","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"return","of":59,"t":660.4,"result":[null,{"meta":[{"name":"m","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":false,"rowCount":0}]},{"ev":"call","id":61,"t":660.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":61,"t":660.5,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":63,"t":660.6,"name":"nextResultSet","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"return","of":63,"t":660.6,"result":[null,{"meta":[{"name":"m","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":65,"t":660.7,"name":"releaseStatement","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"state","of":53,"t":660.7,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":65,"t":660.7,"result":[null,true]},{"ev":"call","id":68,"t":969.9,"name":"query","args":[5,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":68,"t":970,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":68,"t":970.1,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":68,"t":971.1,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":68,"t":971.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":5},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":73,"t":971.3,"name":"fetchRows","args":[5,{"connectionId":0,"statementId":5},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":73,"t":971.3,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":75,"t":971.4,"name":"nextResultSet","args":[5,{"connectionId":0,"statementId":5}]},{"ev":"return","of":75,"t":971.5,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":5},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":77,"t":971.5,"name":"releaseStatement","args":[5,{"connectionId":0,"statementId":5}]},{"ev":"state","of":68,"t":971.6,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":77,"t":971.6,"result":[null,true]},{"ev":"call","id":80,"t":971.8,"name":"close","args":[]},{"ev":"return","of":80,"t":971.9,"result":[null,true]}]} \ No newline at end of file diff --git a/test/contract/native/scripts/issue-479.win32.json b/test/contract/native/scripts/issue-479.win32.json new file mode 100644 index 00000000..b23160d9 --- /dev/null +++ b/test/contract/native/scripts/issue-479.win32.json @@ -0,0 +1 @@ +{"scenario":"scripts/issue-479","transcript":["== A running cancel, at row 100","A: submitted","A: meta name","A: row x100","A: action cancel","A: done","A: cancel-cb ok","A: error HY008 0 Operation canceled more=false","A: free","A.check: submitted","A.check: meta n","A.check: row","A.check: cb ok rows=1 more=false","A.check: done","A.check: free","== B late cancel, after free","B: submitted","B: meta n","B: row","B: done","B: free","B: action cancel","B: done","B: cancel-cb error Error: [msnodesql] cannot cancel query (empty queue) id 2","B.check: submitted","B.check: meta n","B.check: row","B.check: cb ok rows=1 more=false","B.check: done","B.check: free","== C running cancel after a print, at row 100","C: submitted","C: info 01000 0 start","C: rowcount 0","C: meta name","C: row x100","C: action cancel","C: done","C: cancel-cb ok","C: row x4900","C: done","C: free","C.check: submitted","C.check: meta n","C.check: row","C.check: cb ok rows=1 more=false","C.check: done","C.check: free","== 4 a polling query, paused and cancelled at row 100","P4: submitted","P4: meta name","P4: row x100","P4: action pause","P4: action cancel","P4: done","P4: cancel-cb ok","P4: error HY008 0 Operation canceled more=false","P4: free","P4.check: submitted","P4.check: meta n","P4.check: row","P4.check: cb ok rows=1 more=false","P4.check: done","P4.check: free","== 5 paused and cancelled before it executes","P5: action pause","P5: action cancel","P5: submitted","P5: done","P5: cancel-cb ok","P5: error HY008 0 Operation canceled more=false","P5: free","P5.check: submitted","P5.check: meta n","P5.check: row","P5.check: cb ok rows=1 more=false","P5.check: done","P5.check: free","check ok"],"log":[{"ev":"call","id":0,"t":10.5,"name":"open","args":["",0]},{"ev":"return","of":0,"t":30.3,"result":[null,{"success":true}]},{"ev":"call","id":2,"t":31.9,"name":"query","args":[0,{"query_str":"select top 5000 a.name from sys.all_objects a cross join sys.all_objects b","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":2,"t":32,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":2,"t":32.2,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":2,"t":33.2,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":2,"t":33.3,"result":[null,{"meta":[{"name":"name","nullable":false,"type":"text","sqlType":"nvarchar","size":128}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":7,"t":33.6,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":7,"t":33.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":9,"t":33.9,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":9,"t":34,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":11,"t":34.3,"name":"cancelQuery","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"call","id":12,"t":34.3,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"state","of":2,"t":34.9,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_READING","newState":"STATEMENT_CANCEL_HANDLE"}},{"ev":"return","of":11,"t":34.9,"result":[null,true]},{"ev":"state","of":2,"t":35,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_CANCEL_HANDLE","newState":"STATEMENT_ERROR"}},{"ev":"return","of":12,"t":35.1,"result":[[{"$":"error","message":"[msnodesql] Operation canceled","sqlstate":"HY008","code":0,"severity":0,"serverName":"","procName":"","lineNumber":0}],{"meta":[{"name":"name","nullable":false,"type":"text","sqlType":"nvarchar","size":128}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":17,"t":35.5,"name":"releaseStatement","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"state","of":2,"t":35.5,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":17,"t":35.5,"result":[null,true]},{"ev":"call","id":20,"t":187.9,"name":"query","args":[1,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":20,"t":188.1,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":20,"t":188.1,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":20,"t":189,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":20,"t":189,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":25,"t":189.1,"name":"fetchRows","args":[1,{"connectionId":0,"statementId":1},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":25,"t":189.1,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":27,"t":189.3,"name":"nextResultSet","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"return","of":27,"t":189.3,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":29,"t":189.5,"name":"releaseStatement","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"state","of":20,"t":189.5,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":29,"t":189.5,"result":[null,true]},{"ev":"call","id":32,"t":345.7,"name":"query","args":[2,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":32,"t":345.8,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":32,"t":345.8,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":32,"t":346.8,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":32,"t":346.8,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":37,"t":346.8,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":37,"t":346.9,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":39,"t":346.9,"name":"nextResultSet","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"return","of":39,"t":346.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":41,"t":347,"name":"releaseStatement","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"state","of":32,"t":347,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":41,"t":347,"result":[null,true]},{"ev":"call","id":44,"t":611.9,"name":"query","args":[3,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":44,"t":612,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":44,"t":612,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":44,"t":613,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":44,"t":613,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":49,"t":613.1,"name":"fetchRows","args":[3,{"connectionId":0,"statementId":3},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":49,"t":613.1,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":51,"t":613.1,"name":"nextResultSet","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"return","of":51,"t":613.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":53,"t":613.2,"name":"releaseStatement","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"state","of":44,"t":613.2,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":53,"t":613.2,"result":[null,true]},{"ev":"call","id":56,"t":769.3,"name":"query","args":[4,{"query_str":"print 'start'; select top 5000 a.name from sys.all_objects a cross join sys.all_objects b","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":56,"t":769.4,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":56,"t":769.4,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":56,"t":770.9,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"state","of":56,"t":771,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":56,"t":771,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]start","sqlstate":"01000","code":0,"severity":0,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":4},"endOfRows":false,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":62,"t":771.1,"name":"nextResultSet","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"return","of":62,"t":771.2,"result":[null,{"meta":[{"name":"name","nullable":false,"type":"text","sqlType":"nvarchar","size":128}],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":false,"rowCount":0}]},{"ev":"call","id":64,"t":771.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":64,"t":771.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":66,"t":771.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":66,"t":771.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":68,"t":771.5,"name":"cancelQuery","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"return","of":68,"t":771.5,"result":[null,false]},{"ev":"call","id":70,"t":771.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":70,"t":771.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":72,"t":771.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":72,"t":771.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":74,"t":771.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":74,"t":771.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":76,"t":771.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":76,"t":772,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":78,"t":772.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":78,"t":772.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":80,"t":772.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":80,"t":772.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":82,"t":772.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":82,"t":772.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":84,"t":772.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":84,"t":772.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":86,"t":772.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":86,"t":772.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":88,"t":772.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":88,"t":772.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":90,"t":772.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":90,"t":772.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":92,"t":773,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":92,"t":773,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":94,"t":773.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":94,"t":773.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":96,"t":773.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":96,"t":773.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":98,"t":773.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":98,"t":773.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":100,"t":773.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":100,"t":773.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":102,"t":773.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":102,"t":773.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":104,"t":773.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":104,"t":773.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":106,"t":773.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":106,"t":773.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":108,"t":773.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":108,"t":773.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":110,"t":773.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":110,"t":774,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":112,"t":774.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":112,"t":774.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":114,"t":774.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":114,"t":774.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":116,"t":774.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":116,"t":774.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":118,"t":774.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":118,"t":774.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":120,"t":774.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":120,"t":774.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":122,"t":774.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":122,"t":774.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":124,"t":774.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":124,"t":774.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":126,"t":774.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":126,"t":774.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":128,"t":774.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":128,"t":774.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":130,"t":774.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":130,"t":775,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":132,"t":775,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":132,"t":775.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":134,"t":775.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":134,"t":775.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":136,"t":775.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":136,"t":775.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":138,"t":775.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":138,"t":775.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":140,"t":775.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":140,"t":775.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":142,"t":775.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":142,"t":775.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":144,"t":775.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":144,"t":775.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":146,"t":775.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":146,"t":776,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":148,"t":776,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":148,"t":776.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":150,"t":776.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":150,"t":776.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":152,"t":776.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":152,"t":776.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":154,"t":776.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":154,"t":776.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":156,"t":776.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":156,"t":776.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":158,"t":776.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":158,"t":776.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":160,"t":776.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":160,"t":776.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":162,"t":776.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":162,"t":776.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":164,"t":776.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":164,"t":776.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":166,"t":776.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":166,"t":777,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":168,"t":777,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":168,"t":777.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":170,"t":777.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":170,"t":777.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":172,"t":777.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":172,"t":777.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":174,"t":777.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":174,"t":777.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":176,"t":777.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":176,"t":777.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":178,"t":777.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":178,"t":777.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":180,"t":777.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":180,"t":777.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":182,"t":777.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":182,"t":777.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":184,"t":777.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":184,"t":777.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":186,"t":777.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":186,"t":777.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":188,"t":777.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":188,"t":777.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":190,"t":777.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":190,"t":777.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":192,"t":778,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":192,"t":778,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":194,"t":778,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":194,"t":778.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":196,"t":778.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":196,"t":778.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":198,"t":778.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":198,"t":778.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":200,"t":778.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":200,"t":778.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":202,"t":778.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":202,"t":778.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":204,"t":778.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":204,"t":778.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":206,"t":778.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":206,"t":778.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":208,"t":778.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":208,"t":778.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":210,"t":778.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":210,"t":778.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":212,"t":778.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":212,"t":779,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":214,"t":779,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":214,"t":779.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":216,"t":779.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":216,"t":779.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":218,"t":779.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":218,"t":779.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":220,"t":779.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":220,"t":779.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":222,"t":779.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":222,"t":779.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":224,"t":779.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":224,"t":779.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":226,"t":779.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":226,"t":779.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":228,"t":779.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":228,"t":779.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":230,"t":779.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":230,"t":780,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":232,"t":780,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":232,"t":780.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":234,"t":780.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":234,"t":780.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":236,"t":780.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":236,"t":780.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":238,"t":780.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":238,"t":780.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":240,"t":780.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":240,"t":780.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":242,"t":780.6,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":242,"t":780.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":244,"t":780.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":244,"t":780.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":246,"t":780.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":246,"t":780.8,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":248,"t":780.8,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":248,"t":780.9,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":250,"t":780.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":250,"t":781,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":252,"t":781,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":252,"t":781.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":254,"t":781.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":254,"t":781.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":256,"t":781.1,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":256,"t":781.2,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":258,"t":781.2,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":258,"t":781.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":260,"t":781.3,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":260,"t":781.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":262,"t":781.4,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":262,"t":781.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":264,"t":781.5,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":264,"t":781.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test2"]}}]},{"ev":"call","id":266,"t":781.7,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":266,"t":781.7,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":[]}]},{"ev":"call","id":268,"t":781.7,"name":"nextResultSet","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"return","of":268,"t":781.8,"result":[null,{"meta":[{"name":"name","nullable":false,"type":"text","sqlType":"nvarchar","size":128}],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":270,"t":781.8,"name":"releaseStatement","args":[4,{"connectionId":0,"statementId":4}]},{"ev":"state","of":56,"t":781.8,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":270,"t":781.9,"result":[null,true]},{"ev":"call","id":273,"t":942.1,"name":"query","args":[5,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":273,"t":942.2,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":273,"t":942.2,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":273,"t":943.1,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":273,"t":943.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":5},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":278,"t":943.2,"name":"fetchRows","args":[5,{"connectionId":0,"statementId":5},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":278,"t":943.2,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":280,"t":943.3,"name":"nextResultSet","args":[5,{"connectionId":0,"statementId":5}]},{"ev":"return","of":280,"t":943.3,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":5},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":282,"t":943.4,"name":"releaseStatement","args":[5,{"connectionId":0,"statementId":5}]},{"ev":"state","of":273,"t":943.4,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":282,"t":943.4,"result":[null,true]},{"ev":"call","id":285,"t":1098.1,"name":"query","args":[6,{"query_str":"select top 5000 a.name from sys.all_objects a cross join sys.all_objects b","query_timeout":0,"query_polling":true,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":285,"t":1098.2,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":285,"t":1098.3,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":285,"t":1098.3,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"state","of":285,"t":1098.3,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_READING","newState":"STATEMENT_POLLING"}},{"ev":"return","of":285,"t":1113.3,"result":[null,{"meta":[{"name":"name","nullable":false,"type":"text","sqlType":"nvarchar","size":128}],"handle":{"connectionId":0,"statementId":6},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":291,"t":1113.4,"name":"fetchRows","args":[6,{"connectionId":0,"statementId":6},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":291,"t":1113.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":293,"t":1113.6,"name":"fetchRows","args":[6,{"connectionId":0,"statementId":6},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":293,"t":1113.7,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":["__test"]}}]},{"ev":"call","id":295,"t":1113.9,"name":"cancelQuery","args":[6,{"connectionId":0,"statementId":6}]},{"ev":"return","of":295,"t":1113.9,"result":[null,true]},{"ev":"call","id":297,"t":1114.1,"name":"releaseStatement","args":[6,{"connectionId":0,"statementId":6}]},{"ev":"state","of":285,"t":1114.1,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_POLLING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":297,"t":1114.7,"result":[null,true]},{"ev":"call","id":300,"t":1269.1,"name":"query","args":[7,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":300,"t":1269.3,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":300,"t":1269.3,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":300,"t":1270.2,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":300,"t":1270.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":7},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":305,"t":1270.3,"name":"fetchRows","args":[7,{"connectionId":0,"statementId":7},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":305,"t":1270.4,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":307,"t":1270.4,"name":"nextResultSet","args":[7,{"connectionId":0,"statementId":7}]},{"ev":"return","of":307,"t":1270.4,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":7},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":309,"t":1270.5,"name":"releaseStatement","args":[7,{"connectionId":0,"statementId":7}]},{"ev":"state","of":300,"t":1270.5,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":309,"t":1270.5,"result":[null,true]},{"ev":"call","id":312,"t":1426.3,"name":"query","args":[8,{"query_str":"waitfor delay '00:00:05'; select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":312,"t":1426.5,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"call","id":314,"t":1426.5,"name":"cancelQuery","args":[8,{"connectionId":0,"statementId":8}]},{"ev":"state","of":312,"t":1426.5,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":312,"t":1467.1,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_CANCEL_HANDLE"}},{"ev":"state","of":312,"t":1467.1,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_CANCEL_HANDLE","newState":"STATEMENT_ERROR"}},{"ev":"return","of":314,"t":1467.1,"result":[null,true]},{"ev":"return","of":312,"t":1467.1,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server]Operation canceled","sqlstate":"HY008","code":0,"severity":0,"serverName":"","procName":"","lineNumber":0}],{"meta":[],"handle":{"connectionId":0,"statementId":8},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":320,"t":1467.3,"name":"releaseStatement","args":[8,{"connectionId":0,"statementId":8}]},{"ev":"state","of":312,"t":1467.4,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":320,"t":1467.4,"result":[null,true]},{"ev":"call","id":323,"t":1631.9,"name":"query","args":[9,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":323,"t":1632,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":323,"t":1632,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":323,"t":1633,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":323,"t":1633,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":9},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":328,"t":1633,"name":"fetchRows","args":[9,{"connectionId":0,"statementId":9},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":328,"t":1633.1,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":330,"t":1633.1,"name":"nextResultSet","args":[9,{"connectionId":0,"statementId":9}]},{"ev":"return","of":330,"t":1633.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":9},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":332,"t":1633.2,"name":"releaseStatement","args":[9,{"connectionId":0,"statementId":9}]},{"ev":"state","of":323,"t":1633.2,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":332,"t":1633.2,"result":[null,true]},{"ev":"call","id":335,"t":1947,"name":"query","args":[10,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":335,"t":1947.1,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":335,"t":1947.1,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":335,"t":1948.2,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":335,"t":1948.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":10},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":340,"t":1948.3,"name":"fetchRows","args":[10,{"connectionId":0,"statementId":10},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":340,"t":1948.3,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":342,"t":1948.4,"name":"nextResultSet","args":[10,{"connectionId":0,"statementId":10}]},{"ev":"return","of":342,"t":1948.5,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":10},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":344,"t":1948.5,"name":"releaseStatement","args":[10,{"connectionId":0,"statementId":10}]},{"ev":"state","of":335,"t":1948.5,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":344,"t":1948.5,"result":[null,true]},{"ev":"call","id":347,"t":1948.8,"name":"close","args":[]},{"ev":"return","of":347,"t":1948.9,"result":[null,true]}]} \ No newline at end of file diff --git a/test/contract/native/scripts/issue-480.win32.json b/test/contract/native/scripts/issue-480.win32.json new file mode 100644 index 00000000..7b8cd2b4 --- /dev/null +++ b/test/contract/native/scripts/issue-480.win32.json @@ -0,0 +1 @@ +{"scenario":"scripts/issue-480","transcript":["== pause at row 50, resume 50 ms later","at50: submitted","at50: meta a","at50: row x50","at50: action pause","at50: action resume","at50: row","at50: meta b","at50: row x51","at50: done","at50: free","== pause at row 51, resume 50 ms later","at51: submitted","at51: meta a","at51: row x51","at51: action pause","at51: action resume","at51: meta b","at51: row x51","at51: done","at51: free","== pause at row 52, resume 50 ms later","at52: submitted","at52: meta a","at52: row x51","at52: meta b","at52: row","at52: action pause","at52: action resume","at52: row x50","at52: done","at52: free","check ok"],"log":[{"ev":"call","id":0,"t":10.9,"name":"open","args":["",0]},{"ev":"return","of":0,"t":30.2,"result":[null,{"success":true}]},{"ev":"call","id":2,"t":31.8,"name":"query","args":[0,{"query_str":"select top 51 object_id as a from sys.all_objects; select top 51 object_id as b from sys.all_objects","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":2,"t":31.9,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":2,"t":32.1,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":2,"t":32.7,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":2,"t":32.7,"result":[null,{"meta":[{"name":"a","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":7,"t":33,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":7,"t":33.1,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":[109268936]}}]},{"ev":"call","id":9,"t":92.9,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":9,"t":93,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[518903749]}}]},{"ev":"call","id":11,"t":93.1,"name":"nextResultSet","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"return","of":11,"t":93.1,"result":[null,{"meta":[{"name":"b","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":false,"rowCount":0}]},{"ev":"call","id":13,"t":93.4,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":13,"t":93.4,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":[109268936]}}]},{"ev":"call","id":15,"t":93.5,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":15,"t":93.5,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[518903749]}}]},{"ev":"call","id":17,"t":93.5,"name":"nextResultSet","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"return","of":17,"t":93.5,"result":[null,{"meta":[{"name":"b","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":19,"t":93.8,"name":"releaseStatement","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"state","of":2,"t":93.8,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":19,"t":93.8,"result":[null,true]},{"ev":"call","id":22,"t":249.2,"name":"query","args":[1,{"query_str":"select top 51 object_id as a from sys.all_objects; select top 51 object_id as b from sys.all_objects","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":22,"t":249.3,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":22,"t":249.4,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":22,"t":250.4,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":22,"t":250.4,"result":[null,{"meta":[{"name":"a","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":27,"t":250.5,"name":"fetchRows","args":[1,{"connectionId":0,"statementId":1},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":27,"t":250.5,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":[109268936]}}]},{"ev":"call","id":29,"t":250.6,"name":"fetchRows","args":[1,{"connectionId":0,"statementId":1},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":29,"t":250.6,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[518903749]}}]},{"ev":"call","id":31,"t":311.3,"name":"nextResultSet","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"return","of":31,"t":311.5,"result":[null,{"meta":[{"name":"b","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":false,"rowCount":0}]},{"ev":"call","id":33,"t":311.5,"name":"fetchRows","args":[1,{"connectionId":0,"statementId":1},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":33,"t":311.6,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":[109268936]}}]},{"ev":"call","id":35,"t":311.7,"name":"fetchRows","args":[1,{"connectionId":0,"statementId":1},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":35,"t":311.7,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[518903749]}}]},{"ev":"call","id":37,"t":311.7,"name":"nextResultSet","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"return","of":37,"t":311.8,"result":[null,{"meta":[{"name":"b","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":39,"t":311.8,"name":"releaseStatement","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"state","of":22,"t":311.8,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":39,"t":311.9,"result":[null,true]},{"ev":"call","id":42,"t":466.7,"name":"query","args":[2,{"query_str":"select top 51 object_id as a from sys.all_objects; select top 51 object_id as b from sys.all_objects","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":42,"t":466.8,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":42,"t":466.9,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":42,"t":467.9,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":42,"t":467.9,"result":[null,{"meta":[{"name":"a","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":47,"t":467.9,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":47,"t":468,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":[109268936]}}]},{"ev":"call","id":49,"t":468.1,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":49,"t":468.1,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[518903749]}}]},{"ev":"call","id":51,"t":468.1,"name":"nextResultSet","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"return","of":51,"t":468.2,"result":[null,{"meta":[{"name":"b","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":false,"rowCount":0}]},{"ev":"call","id":53,"t":468.2,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":53,"t":468.3,"result":[null,{"endOfRows":false,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":50,"first":[109268936]}}]},{"ev":"call","id":55,"t":528.4,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":55,"t":528.5,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[518903749]}}]},{"ev":"call","id":57,"t":528.6,"name":"nextResultSet","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"return","of":57,"t":528.6,"result":[null,{"meta":[{"name":"b","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":59,"t":528.7,"name":"releaseStatement","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"state","of":42,"t":528.8,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":59,"t":528.8,"result":[null,true]},{"ev":"call","id":62,"t":841.8,"name":"query","args":[3,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":62,"t":841.9,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":62,"t":841.9,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":62,"t":842.8,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":62,"t":842.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":67,"t":842.9,"name":"fetchRows","args":[3,{"connectionId":0,"statementId":3},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":67,"t":843,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":69,"t":843,"name":"nextResultSet","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"return","of":69,"t":843.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":71,"t":843.1,"name":"releaseStatement","args":[3,{"connectionId":0,"statementId":3}]},{"ev":"state","of":62,"t":843.1,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":71,"t":843.2,"result":[null,true]},{"ev":"call","id":74,"t":843.4,"name":"close","args":[]},{"ev":"return","of":74,"t":843.4,"result":[null,true]}]} \ No newline at end of file diff --git a/test/contract/native/scripts/issue-481.win32.json b/test/contract/native/scripts/issue-481.win32.json new file mode 100644 index 00000000..90223a63 --- /dev/null +++ b/test/contract/native/scripts/issue-481.win32.json @@ -0,0 +1 @@ +{"scenario":"scripts/issue-481","transcript":["== A1 ok: q2 and q3 queued at once","A1 ok.q1: submitted","A1 ok.q1: meta v","A1 ok.q1: row","A1 ok.q1: cb ok rows=1 more=false","A1 ok.q1: done","A1 ok.q1: free","A1 ok.q2: submitted","A1 ok.q2: meta n","A1 ok.q2: row","A1 ok.q2: cb ok rows=1 more=false","A1 ok.q2: done","A1 ok.q2: free","A1 ok.q3: submitted","A1 ok.q3: meta n","A1 ok.q3: row","A1 ok.q3: cb ok rows=1 more=false","A1 ok.q3: done","A1 ok.q3: free","== A2 bind failure: q2 and q3 queued at once","A2 bind failure.q1: submitted","A2 bind failure.q1: done","A2 bind failure.q1: free","A2 bind failure.q2: submitted","A2 bind failure.q1: cb error - - IMNOD: [msnodesql] Parameter 1: Invalid number parameter more=false","A2 bind failure.q2: meta n","A2 bind failure.q2: row","A2 bind failure.q2: cb ok rows=1 more=false","A2 bind failure.q2: done","A2 bind failure.q2: free","A2 bind failure.q3: submitted","A2 bind failure.q3: meta n","A2 bind failure.q3: row","A2 bind failure.q3: cb ok rows=1 more=false","A2 bind failure.q3: done","A2 bind failure.q3: free","== A3 ok: q2 and q3 queued from q1 free","A3 ok.q1: submitted","A3 ok.q1: meta n","A3 ok.q1: row","A3 ok.q1: cb ok rows=1 more=false","A3 ok.q1: done","A3 ok.q1: free","A3 ok.q2: submitted","A3 ok.q2: meta n","A3 ok.q2: row","A3 ok.q2: cb ok rows=1 more=false","A3 ok.q2: done","A3 ok.q2: free","A3 ok.q3: submitted","A3 ok.q3: meta n","A3 ok.q3: row","A3 ok.q3: cb ok rows=1 more=false","A3 ok.q3: done","A3 ok.q3: free","== A4 error at execute: q2 and q3 queued from q1 free","A4 error at execute.q1: submitted","A4 error at execute.q1: free","A4 error at execute.q1: cb error 42000 50000 boom more=false","A4 error at execute.q2: submitted","A4 error at execute.q2: meta n","A4 error at execute.q2: row","A4 error at execute.q2: cb ok rows=1 more=false","A4 error at execute.q2: done","A4 error at execute.q2: free","A4 error at execute.q3: submitted","A4 error at execute.q3: meta n","A4 error at execute.q3: row","A4 error at execute.q3: cb ok rows=1 more=false","A4 error at execute.q3: done","A4 error at execute.q3: free","== A5 error after a result: q2 and q3 queued from q1 free","A5 error after a result.q1: submitted","A5 error after a result.q1: meta n","A5 error after a result.q1: row","A5 error after a result.q1: cb error 42000 50000 boom more=false","A5 error after a result.q1: free","A5 error after a result.q2: submitted","A5 error after a result.q2: meta n","A5 error after a result.q2: row","A5 error after a result.q2: cb ok rows=1 more=false","A5 error after a result.q2: done","A5 error after a result.q2: free","A5 error after a result.q3: submitted","A5 error after a result.q3: meta n","A5 error after a result.q3: row","A5 error after a result.q3: cb ok rows=1 more=false","A5 error after a result.q3: done","A5 error after a result.q3: free","== B1 ok: from q1 free, a slow q2 cancelled after 300 ms","B1 ok.q1: submitted","B1 ok.q1: meta n","B1 ok.q1: row","B1 ok.q1: cb ok rows=1 more=false","B1 ok.q1: done","B1 ok.q1: free","B1 ok.q2: submitted","B1 ok.q2: action cancel","B1 ok.q2: done","B1 ok.q2: cancel-cb ok","B1 ok.q2: free","B1 ok.q2: cb error HY008 0 Operation canceled more=false","== B2 error at execute: from q1 free, a slow q2 cancelled after 300 ms","B2 error at execute.q1: submitted","B2 error at execute.q1: free","B2 error at execute.q1: cb error 42000 50000 boom more=false","B2 error at execute.q2: submitted","B2 error at execute.q2: action cancel","B2 error at execute.q2: done","B2 error at execute.q2: cancel-cb ok","B2 error at execute.q2: free","B2 error at execute.q2: cb error HY008 0 Operation canceled more=false","check ok"],"log":[{"ev":"call","id":0,"t":10.6,"name":"open","args":["",0]},{"ev":"return","of":0,"t":30.5,"result":[null,{"success":true}]},{"ev":"call","id":2,"t":32.1,"name":"query","args":[0,{"query_str":"select ? as v","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[1]]},{"ev":"state","of":2,"t":32.3,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":2,"t":32.4,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":2,"t":34.1,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":2,"t":34.2,"result":[null,{"meta":[{"name":"v","nullable":true,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":7,"t":34.4,"name":"fetchRows","args":[0,{"connectionId":0,"statementId":0},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":7,"t":34.5,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":9,"t":34.6,"name":"nextResultSet","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"return","of":9,"t":34.7,"result":[null,{"meta":[{"name":"v","nullable":true,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":0},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":11,"t":35,"name":"releaseStatement","args":[0,{"connectionId":0,"statementId":0}]},{"ev":"state","of":2,"t":35.1,"change":{"handle":{"connectionId":0,"statementId":0},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":11,"t":35.1,"result":[null,true]},{"ev":"call","id":14,"t":35.4,"name":"query","args":[1,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":14,"t":35.4,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":14,"t":35.4,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":14,"t":1148.8,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":14,"t":1148.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":19,"t":1149,"name":"fetchRows","args":[1,{"connectionId":0,"statementId":1},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":19,"t":1149,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":21,"t":1149.1,"name":"nextResultSet","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"return","of":21,"t":1149.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":1},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":23,"t":1149.1,"name":"releaseStatement","args":[1,{"connectionId":0,"statementId":1}]},{"ev":"state","of":14,"t":1149.2,"change":{"handle":{"connectionId":0,"statementId":1},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":23,"t":1149.2,"result":[null,true]},{"ev":"call","id":26,"t":1149.3,"name":"query","args":[2,{"query_str":"select 3 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":26,"t":1149.3,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":26,"t":1149.3,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":26,"t":1150.1,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":26,"t":1150.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":31,"t":1150.1,"name":"fetchRows","args":[2,{"connectionId":0,"statementId":2},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":31,"t":1150.2,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[3]}}]},{"ev":"call","id":33,"t":1150.2,"name":"nextResultSet","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"return","of":33,"t":1150.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":2},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":35,"t":1150.3,"name":"releaseStatement","args":[2,{"connectionId":0,"statementId":2}]},{"ev":"state","of":26,"t":1150.3,"change":{"handle":{"connectionId":0,"statementId":2},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":35,"t":1150.3,"result":[null,true]},{"ev":"call","id":38,"t":1458.6,"name":"query","args":[3,{"query_str":"select ? as v","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[null]]},{"ev":"return","of":38,"t":1458.7,"result":[{"$":"error","message":"IMNOD: [msnodesql] Parameter 1: Invalid number parameter"},{"meta":[],"handle":{"connectionId":-1,"statementId":-1},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":40,"t":1458.9,"name":"query","args":[4,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":40,"t":1459.1,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":40,"t":1459.1,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":40,"t":2571.8,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":40,"t":2571.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":45,"t":2571.9,"name":"fetchRows","args":[4,{"connectionId":0,"statementId":3},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":45,"t":2572,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":47,"t":2572,"name":"nextResultSet","args":[4,{"connectionId":0,"statementId":3}]},{"ev":"return","of":47,"t":2572.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":3},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":49,"t":2572.1,"name":"releaseStatement","args":[4,{"connectionId":0,"statementId":3}]},{"ev":"state","of":40,"t":2572.1,"change":{"handle":{"connectionId":0,"statementId":3},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":49,"t":2572.1,"result":[null,true]},{"ev":"call","id":52,"t":2572.2,"name":"query","args":[5,{"query_str":"select 3 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":52,"t":2572.3,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":52,"t":2572.3,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":52,"t":2573,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":52,"t":2573,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":57,"t":2573.1,"name":"fetchRows","args":[5,{"connectionId":0,"statementId":4},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":57,"t":2573.1,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[3]}}]},{"ev":"call","id":59,"t":2573.1,"name":"nextResultSet","args":[5,{"connectionId":0,"statementId":4}]},{"ev":"return","of":59,"t":2573.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":4},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":61,"t":2573.2,"name":"releaseStatement","args":[5,{"connectionId":0,"statementId":4}]},{"ev":"state","of":52,"t":2573.2,"change":{"handle":{"connectionId":0,"statementId":4},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":61,"t":2573.2,"result":[null,true]},{"ev":"call","id":64,"t":2888.1,"name":"query","args":[6,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":64,"t":2888.2,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":64,"t":2888.2,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":64,"t":2889.2,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":64,"t":2889.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":5},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":69,"t":2889.2,"name":"fetchRows","args":[6,{"connectionId":0,"statementId":5},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":69,"t":2889.3,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":71,"t":2889.3,"name":"nextResultSet","args":[6,{"connectionId":0,"statementId":5}]},{"ev":"return","of":71,"t":2889.4,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":5},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":73,"t":2889.4,"name":"releaseStatement","args":[6,{"connectionId":0,"statementId":5}]},{"ev":"state","of":64,"t":2889.4,"change":{"handle":{"connectionId":0,"statementId":5},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":73,"t":2889.4,"result":[null,true]},{"ev":"call","id":76,"t":2889.6,"name":"query","args":[7,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":76,"t":2889.6,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":76,"t":2889.6,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":76,"t":4002.6,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":76,"t":4002.6,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":6},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":81,"t":4002.7,"name":"fetchRows","args":[7,{"connectionId":0,"statementId":6},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":81,"t":4002.8,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":83,"t":4002.8,"name":"nextResultSet","args":[7,{"connectionId":0,"statementId":6}]},{"ev":"return","of":83,"t":4002.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":6},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":85,"t":4002.9,"name":"releaseStatement","args":[7,{"connectionId":0,"statementId":6}]},{"ev":"state","of":76,"t":4003,"change":{"handle":{"connectionId":0,"statementId":6},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":85,"t":4003,"result":[null,true]},{"ev":"call","id":88,"t":4003.1,"name":"query","args":[8,{"query_str":"select 3 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":88,"t":4003.2,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":88,"t":4003.2,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":88,"t":4003.8,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":88,"t":4003.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":7},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":93,"t":4003.9,"name":"fetchRows","args":[8,{"connectionId":0,"statementId":7},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":93,"t":4003.9,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[3]}}]},{"ev":"call","id":95,"t":4003.9,"name":"nextResultSet","args":[8,{"connectionId":0,"statementId":7}]},{"ev":"return","of":95,"t":4004,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":7},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":97,"t":4004,"name":"releaseStatement","args":[8,{"connectionId":0,"statementId":7}]},{"ev":"state","of":88,"t":4004,"change":{"handle":{"connectionId":0,"statementId":7},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":97,"t":4004,"result":[null,true]},{"ev":"call","id":100,"t":4324.3,"name":"query","args":[9,{"query_str":"raiserror('boom', 16, 1)","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":100,"t":4324.4,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":100,"t":4324.4,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":100,"t":4325.3,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"state","of":100,"t":4325.4,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":100,"t":4325.4,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]boom","sqlstate":"42000","code":50000,"severity":16,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":8},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":106,"t":4325.5,"name":"releaseStatement","args":[9,{"connectionId":0,"statementId":8}]},{"ev":"state","of":100,"t":4325.5,"change":{"handle":{"connectionId":0,"statementId":8},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":106,"t":4325.5,"result":[null,true]},{"ev":"call","id":109,"t":4325.7,"name":"query","args":[10,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":109,"t":4325.7,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":109,"t":4325.7,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":109,"t":5438.7,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":109,"t":5438.8,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":9},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":114,"t":5438.9,"name":"fetchRows","args":[10,{"connectionId":0,"statementId":9},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":114,"t":5438.9,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":116,"t":5438.9,"name":"nextResultSet","args":[10,{"connectionId":0,"statementId":9}]},{"ev":"return","of":116,"t":5439.1,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":9},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":118,"t":5439.2,"name":"releaseStatement","args":[10,{"connectionId":0,"statementId":9}]},{"ev":"state","of":109,"t":5439.2,"change":{"handle":{"connectionId":0,"statementId":9},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":118,"t":5439.2,"result":[null,true]},{"ev":"call","id":121,"t":5439.3,"name":"query","args":[11,{"query_str":"select 3 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":121,"t":5439.4,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":121,"t":5439.4,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":121,"t":5440.2,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":121,"t":5440.2,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":10},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":126,"t":5440.2,"name":"fetchRows","args":[11,{"connectionId":0,"statementId":10},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":126,"t":5440.3,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[3]}}]},{"ev":"call","id":128,"t":5440.3,"name":"nextResultSet","args":[11,{"connectionId":0,"statementId":10}]},{"ev":"return","of":128,"t":5440.3,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":10},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":130,"t":5440.3,"name":"releaseStatement","args":[11,{"connectionId":0,"statementId":10}]},{"ev":"state","of":121,"t":5440.4,"change":{"handle":{"connectionId":0,"statementId":10},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":130,"t":5440.4,"result":[null,true]},{"ev":"call","id":133,"t":5748,"name":"query","args":[12,{"query_str":"select 1 as n; raiserror('boom', 16, 1)","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":133,"t":5748.2,"change":{"handle":{"connectionId":0,"statementId":11},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":133,"t":5748.2,"change":{"handle":{"connectionId":0,"statementId":11},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":133,"t":5749.3,"change":{"handle":{"connectionId":0,"statementId":11},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":133,"t":5749.3,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":11},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":138,"t":5749.4,"name":"fetchRows","args":[12,{"connectionId":0,"statementId":11},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":138,"t":5749.5,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":140,"t":5749.5,"name":"nextResultSet","args":[12,{"connectionId":0,"statementId":11}]},{"ev":"state","of":133,"t":5749.6,"change":{"handle":{"connectionId":0,"statementId":11},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":140,"t":5749.6,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]boom","sqlstate":"42000","code":50000,"severity":16,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":11},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":143,"t":5749.8,"name":"releaseStatement","args":[12,{"connectionId":0,"statementId":11}]},{"ev":"state","of":133,"t":5749.8,"change":{"handle":{"connectionId":0,"statementId":11},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":143,"t":5749.8,"result":[null,true]},{"ev":"call","id":146,"t":5749.9,"name":"query","args":[13,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":146,"t":5749.9,"change":{"handle":{"connectionId":0,"statementId":12},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":146,"t":5749.9,"change":{"handle":{"connectionId":0,"statementId":12},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":146,"t":6862.2,"change":{"handle":{"connectionId":0,"statementId":12},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":146,"t":6862.3,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":12},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":151,"t":6862.4,"name":"fetchRows","args":[13,{"connectionId":0,"statementId":12},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":151,"t":6862.5,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[2]}}]},{"ev":"call","id":153,"t":6862.5,"name":"nextResultSet","args":[13,{"connectionId":0,"statementId":12}]},{"ev":"return","of":153,"t":6862.6,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":12},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":155,"t":6862.7,"name":"releaseStatement","args":[13,{"connectionId":0,"statementId":12}]},{"ev":"state","of":146,"t":6862.7,"change":{"handle":{"connectionId":0,"statementId":12},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":155,"t":6862.7,"result":[null,true]},{"ev":"call","id":158,"t":6862.8,"name":"query","args":[14,{"query_str":"select 3 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":158,"t":6862.8,"change":{"handle":{"connectionId":0,"statementId":13},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":158,"t":6862.8,"change":{"handle":{"connectionId":0,"statementId":13},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":158,"t":6863.6,"change":{"handle":{"connectionId":0,"statementId":13},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":158,"t":6863.7,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":13},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":163,"t":6863.8,"name":"fetchRows","args":[14,{"connectionId":0,"statementId":13},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":163,"t":6863.8,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[3]}}]},{"ev":"call","id":165,"t":6863.9,"name":"nextResultSet","args":[14,{"connectionId":0,"statementId":13}]},{"ev":"return","of":165,"t":6863.9,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":13},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":167,"t":6863.9,"name":"releaseStatement","args":[14,{"connectionId":0,"statementId":13}]},{"ev":"state","of":158,"t":6864,"change":{"handle":{"connectionId":0,"statementId":13},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":167,"t":6864,"result":[null,true]},{"ev":"call","id":170,"t":7181.5,"name":"query","args":[15,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":170,"t":7181.7,"change":{"handle":{"connectionId":0,"statementId":14},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":170,"t":7181.7,"change":{"handle":{"connectionId":0,"statementId":14},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":170,"t":7182.7,"change":{"handle":{"connectionId":0,"statementId":14},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":170,"t":7182.8,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":14},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":175,"t":7182.8,"name":"fetchRows","args":[15,{"connectionId":0,"statementId":14},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":175,"t":7182.9,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":177,"t":7182.9,"name":"nextResultSet","args":[15,{"connectionId":0,"statementId":14}]},{"ev":"return","of":177,"t":7183,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":14},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":179,"t":7183,"name":"releaseStatement","args":[15,{"connectionId":0,"statementId":14}]},{"ev":"state","of":170,"t":7183,"change":{"handle":{"connectionId":0,"statementId":14},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":179,"t":7183,"result":[null,true]},{"ev":"call","id":182,"t":7183.3,"name":"query","args":[16,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":182,"t":7183.3,"change":{"handle":{"connectionId":0,"statementId":15},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":182,"t":7183.4,"change":{"handle":{"connectionId":0,"statementId":15},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"call","id":185,"t":7492.1,"name":"cancelQuery","args":[16,{"connectionId":0,"statementId":15}]},{"ev":"state","of":182,"t":7493.2,"change":{"handle":{"connectionId":0,"statementId":15},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_CANCEL_HANDLE"}},{"ev":"state","of":182,"t":7493.2,"change":{"handle":{"connectionId":0,"statementId":15},"oldState":"STATEMENT_CANCEL_HANDLE","newState":"STATEMENT_ERROR"}},{"ev":"return","of":185,"t":7493.2,"result":[null,true]},{"ev":"return","of":182,"t":7493.3,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server]Operation canceled","sqlstate":"HY008","code":0,"severity":0,"serverName":"","procName":"","lineNumber":0}],{"meta":[],"handle":{"connectionId":0,"statementId":15},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":190,"t":7493.4,"name":"releaseStatement","args":[16,{"connectionId":0,"statementId":15}]},{"ev":"state","of":182,"t":7493.4,"change":{"handle":{"connectionId":0,"statementId":15},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":190,"t":7493.4,"result":[null,true]},{"ev":"call","id":193,"t":7649.3,"name":"query","args":[17,{"query_str":"raiserror('boom', 16, 1)","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":193,"t":7649.4,"change":{"handle":{"connectionId":0,"statementId":16},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":193,"t":7649.4,"change":{"handle":{"connectionId":0,"statementId":16},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":193,"t":7650.5,"change":{"handle":{"connectionId":0,"statementId":16},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"state","of":193,"t":7650.5,"change":{"handle":{"connectionId":0,"statementId":16},"oldState":"STATEMENT_READING","newState":"STATEMENT_ERROR"}},{"ev":"return","of":193,"t":7650.6,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]boom","sqlstate":"42000","code":50000,"severity":16,"serverName":"","procName":"","lineNumber":1}],{"meta":[],"handle":{"connectionId":0,"statementId":16},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":199,"t":7650.6,"name":"releaseStatement","args":[17,{"connectionId":0,"statementId":16}]},{"ev":"state","of":193,"t":7650.6,"change":{"handle":{"connectionId":0,"statementId":16},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":199,"t":7650.6,"result":[null,true]},{"ev":"call","id":202,"t":7650.7,"name":"query","args":[18,{"query_str":"waitfor delay '00:00:01'; select 2 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":202,"t":7650.8,"change":{"handle":{"connectionId":0,"statementId":17},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":202,"t":7650.8,"change":{"handle":{"connectionId":0,"statementId":17},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"call","id":205,"t":7959,"name":"cancelQuery","args":[18,{"connectionId":0,"statementId":17}]},{"ev":"state","of":202,"t":7960.1,"change":{"handle":{"connectionId":0,"statementId":17},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_CANCEL_HANDLE"}},{"ev":"state","of":202,"t":7960.2,"change":{"handle":{"connectionId":0,"statementId":17},"oldState":"STATEMENT_CANCEL_HANDLE","newState":"STATEMENT_ERROR"}},{"ev":"return","of":205,"t":7960.2,"result":[null,true]},{"ev":"return","of":202,"t":7960.2,"result":[[{"$":"error","message":"[Microsoft][ODBC Driver 18 for SQL Server]Operation canceled","sqlstate":"HY008","code":0,"severity":0,"serverName":"","procName":"","lineNumber":0}],{"meta":[],"handle":{"connectionId":0,"statementId":17},"endOfRows":true,"endOfResults":true,"rowCount":0},false]},{"ev":"call","id":210,"t":7960.3,"name":"releaseStatement","args":[18,{"connectionId":0,"statementId":17}]},{"ev":"state","of":202,"t":7960.3,"change":{"handle":{"connectionId":0,"statementId":17},"oldState":"STATEMENT_ERROR","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":210,"t":7960.3,"result":[null,true]},{"ev":"call","id":213,"t":8273.8,"name":"query","args":[19,{"query_str":"select 1 as n","query_timeout":0,"query_polling":false,"query_tz_adjustment":0,"numeric_string":false,"bigint_as_native":false,"stateChangeCallback":{"$":"function"}},[]]},{"ev":"state","of":213,"t":8273.9,"change":{"handle":{"connectionId":0,"statementId":18},"oldState":"STATEMENT_CREATED","newState":"STATEMENT_BINDING"}},{"ev":"state","of":213,"t":8273.9,"change":{"handle":{"connectionId":0,"statementId":18},"oldState":"STATEMENT_BINDING","newState":"STATEMENT_SUBMITTED"}},{"ev":"state","of":213,"t":8275,"change":{"handle":{"connectionId":0,"statementId":18},"oldState":"STATEMENT_SUBMITTED","newState":"STATEMENT_READING"}},{"ev":"return","of":213,"t":8275,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":18},"endOfRows":true,"endOfResults":false,"rowCount":0},true]},{"ev":"call","id":218,"t":8275.1,"name":"fetchRows","args":[19,{"connectionId":0,"statementId":18},{"asArrays":true,"batchSize":50,"asObjects":false}]},{"ev":"return","of":218,"t":8275.2,"result":[null,{"endOfRows":true,"endOfResults":false,"rowCount":0,"data":{"$":"rows","n":1,"first":[1]}}]},{"ev":"call","id":220,"t":8275.3,"name":"nextResultSet","args":[19,{"connectionId":0,"statementId":18}]},{"ev":"return","of":220,"t":8275.4,"result":[null,{"meta":[{"name":"n","nullable":false,"type":"number","sqlType":"int","size":10}],"handle":{"connectionId":0,"statementId":18},"endOfRows":true,"endOfResults":true,"rowCount":0}]},{"ev":"call","id":222,"t":8275.4,"name":"releaseStatement","args":[19,{"connectionId":0,"statementId":18}]},{"ev":"state","of":213,"t":8275.4,"change":{"handle":{"connectionId":0,"statementId":18},"oldState":"STATEMENT_READING","newState":"STATEMENT_CLOSED"}},{"ev":"return","of":222,"t":8275.5,"result":[null,true]},{"ev":"call","id":225,"t":8275.7,"name":"close","args":[]},{"ev":"return","of":225,"t":8275.8,"result":[null,true]}]} \ No newline at end of file diff --git a/test/contract/record.js b/test/contract/record.js new file mode 100644 index 00000000..3c9cd42f --- /dev/null +++ b/test/contract/record.js @@ -0,0 +1,67 @@ +'use strict' + +// records a tester script into the event contract corpus: +// +// npm run record-corpus -- [--name ] [--repeat 3] [--force] +// +// 1. copies the script to scripts/.js (name: the file's own name), so its source is +// kept beside what it recorded - it is then the scenario scripts/ +// 2. runs it --repeat times, each in its own process, and reports whether it is +// deterministic +// 3. writes corpus/scripts/.txt and its native recording, native/scripts/..json, +// which replay.test.js and explore.js then pick up +// +// a script already in scripts/ is recorded again in place. see scripts/README.md for how +// to write one. + +const fs = require('fs') +const path = require('path') +const { execFileSync } = require('child_process') + +const SCRIPTS_DIR = path.join(__dirname, 'scripts') + +function parseArgs (argv) { + const opts = { file: null, name: null, repeat: 3, force: false } + for (let i = 0; i < argv.length; i++) { + const a = argv[i] + if (a === '--name') opts.name = argv[++i] + else if (a === '--repeat') opts.repeat = Number(argv[++i]) + else if (a === '--force') opts.force = true + else opts.file = a + } + return opts +} + +function main () { + const opts = parseArgs(process.argv.slice(2)) + if (!opts.file) { + console.error('usage: npm run record-corpus -- [--name ] [--repeat 3] [--force]') + process.exit(2) + } + const source = path.resolve(opts.file) + if (!fs.existsSync(source)) { + console.error(`no such file ${source}`) + process.exit(2) + } + const name = opts.name ?? path.basename(source, '.js') + if (!/^[a-z0-9][a-z0-9-]*$/.test(name)) { + console.error(`'${name}' is not a usable scenario name: lower case letters, digits and '-' (use --name)`) + process.exit(2) + } + const target = path.join(SCRIPTS_DIR, `${name}.js`) + if (path.resolve(target) !== source) { + if (fs.existsSync(target) && fs.readFileSync(target, 'utf8') !== fs.readFileSync(source, 'utf8') && !opts.force) { + console.error(`${path.relative(process.cwd(), target)} exists and differs; --force to replace it`) + process.exit(2) + } + fs.mkdirSync(SCRIPTS_DIR, { recursive: true }) + fs.copyFileSync(source, target) + console.log(`copied to ${path.relative(process.cwd(), target)}`) + } + // the scenario list is read afresh by capture.js, so the new script is in it + execFileSync(process.execPath, [path.join(__dirname, 'capture.js'), '--update', '--native', '--exact', '--repeat', String(opts.repeat), `scripts/${name}`], { stdio: 'inherit' }) + console.log(`\nreview corpus/scripts/${name}.txt: it pins what happens now (status: unreviewed).`) + console.log('edit it to what the contract should be and mark it agreed - the tests then hold the driver to it.') +} + +main() diff --git a/test/contract/recorder.js b/test/contract/recorder.js index 0e92b6a8..f2ebb276 100644 --- a/test/contract/recorder.js +++ b/test/contract/recorder.js @@ -99,8 +99,26 @@ class Run { this.queries = new Map() } + // in a scripted scenario every line carries its label: there is no main query log (label, line) { - this.t.push(label === 'q1' ? line : `${label}: ${line}`) + this.t.push(label === 'q1' && !this.scenario.script ? line : `${label}: ${line}`) + } + + // what a script (scripts/*.js) is given: see scripts/README.md + scriptApi () { + return { + sql: this.sql, + conn: this.conn, + query: (label, sql, params, options = {}) => this.start(label, { sql, params, ...options }), + act: (label, actions) => this.act(label, this.queries.get(label), actions), + freed: label => this.pending.get(label), + // freed, and the time after it in which late events still belong to the transcript + settled: label => this.pending.get(label).then(() => delay(SETTLE_MS)), + note: line => this.t.push(`-- ${line}`), + section: title => this.t.push(`== ${title}`), + log: (label, line) => this.log(label, line), + delay + } } start (label, def) { @@ -180,8 +198,12 @@ class Run { for (const statement of s.setup ?? []) { await this.conn.promises.query(statement) } - this.start('q1', s) - this.startFollowUps('start') + if (s.script) { + await require(s.script)(this.scriptApi()) + } else { + this.start('q1', s) + this.startFollowUps('start') + } const timeoutMs = s.timeoutMs ?? 6000 const deadline = Date.now() + timeoutMs diff --git a/test/contract/replay.test.js b/test/contract/replay.test.js index d98fd76e..103fd75b 100644 --- a/test/contract/replay.test.js +++ b/test/contract/replay.test.js @@ -39,12 +39,13 @@ describe('event contract, replayed over the fake driver', function () { // the same recordings with jittered timing, at fixed seeds so that a failure here can be // replayed exactly: node test/contract/explore.js --seed --runs 1 . -// the groups where timing matters most: pause, cancel and the queue. +// the groups where timing matters most: pause, cancel, the queue, and the scripts (the +// issue repros, mostly about those). describe('event contract, replayed over the fake driver with varied timing', function () { this.timeout(60000) const SEED = 1000 const RUNS = 2 - const timingSensitive = recordings().filter(r => /^(pause|cancel|queue)\//.test(r.scenario.name)) + const timingSensitive = recordings().filter(r => /^(pause|cancel|queue|scripts)\//.test(r.scenario.name)) for (const { scenario, platform, recorded, expected } of timingSensitive) { it(`${scenario.name} (${platform}) holds over seeds ${SEED}..${SEED + RUNS - 1}`, async () => { diff --git a/test/contract/scenarios.js b/test/contract/scenarios.js index 8f67237d..8fa07984 100644 --- a/test/contract/scenarios.js +++ b/test/contract/scenarios.js @@ -26,6 +26,14 @@ // callback also pass a callback // // polling queries (sql.PollingQuery) are not covered: the contract is for ordinary queries. +// +// a scenario can also be a script, for what a scenario cannot say: several queries in +// sequence, several cases in one transcript, a repro taken from an issue. each file in +// scripts/ is the scenario scripts/; see scripts/README.md for what it gets. +// npm run record-corpus copies a script there and records it. + +const fs = require('fs') +const path = require('path') const BIG = 'select top 5000 a.name from sys.all_objects a cross join sys.all_objects b' const SLOW = "waitfor delay '00:00:01'; select 2 as n" @@ -147,6 +155,15 @@ function expand (s) { })) } -const scenarios = base.flatMap(expand) +const SCRIPTS_DIR = path.join(__dirname, 'scripts') +function scripted () { + if (!fs.existsSync(SCRIPTS_DIR)) return [] + return fs.readdirSync(SCRIPTS_DIR) + .filter(f => f.endsWith('.js')) + .sort() + .map(f => ({ name: `scripts/${f.slice(0, -3)}`, script: path.join(SCRIPTS_DIR, f) })) +} + +const scenarios = [...base.flatMap(expand), ...scripted()] module.exports = { scenarios } diff --git a/test/contract/scripts/README.md b/test/contract/scripts/README.md new file mode 100644 index 00000000..08725543 --- /dev/null +++ b/test/contract/scripts/README.md @@ -0,0 +1,46 @@ +# Scripted scenarios + +A scenario in `scenarios.js` is one query and what is done to it. A script is for everything +else: several queries in sequence, several cases in one transcript, a repro from an issue. +Each `.js` file here is the scenario `scripts/`, with its transcript in +`corpus/scripts/.txt`. It is run, compared and replayed like any other scenario. + +## Recording one + +```sh +npm run record-corpus -- path/to/tester.js # copies it here, records it +npm run record-corpus -- path/to/tester.js --name x # under another name +npm run record-corpus -- test/contract/scripts/x.js # record one that is here again +``` + +The script is run 3 times, each in its own process. The command reports whether every run +gave the same transcript, then writes it (`# status: unreviewed`) and its native recording. +Read the transcript, edit it to what the contract should be, and mark it `agreed`. + +## Writing one + +A script exports one async function. It gets one connection, opened for it, and helpers +that log in the corpus's format: + +```js +module.exports = async t => { + t.section('A running cancel') + t.query('A', BIG, null, { at: { row: { 100: ['cancel'] } } }) + await t.settled('A') +} +``` + +| | | +|---|---| +| `t.query(label, sql, params, options)` | runs a query on the connection and logs its events as `label: `. Returns the query (its event emitter). `options`: `callback` (also pass a callback and log it), `columns` (log column values), `at` (actions, as in `scenarios.js`: `start`, `row: { n: [...] }`, `later: { ms: [...] }`, `free`) | +| `t.act(label, actions)` | do `pause`, `resume`, `resume:` or `cancel` to that query now | +| `t.freed(label)` | resolves on the query's `free` | +| `t.settled(label)` | its `free`, plus the time in which late events still belong to the transcript (a cancel callback after `free`, say) | +| `t.section(title)` | a `== title` line, to divide cases | +| `t.note(text)` | a `-- text` line | +| `t.log(label, line)` | any other line, as `label: line` | +| `t.delay(ms)`, `t.sql`, `t.conn` | a delay, the module, the connection | + +Labels have to be unique within a script. Wait for each case (`settled`) before the next, +so the transcript doesn't depend on timing. A transcript has to come out the same every +run, or it isn't a contract. diff --git a/test/contract/scripts/issue-478.js b/test/contract/scripts/issue-478.js new file mode 100644 index 00000000..689127e5 --- /dev/null +++ b/test/contract/scripts/issue-478.js @@ -0,0 +1,22 @@ +'use strict' + +// #478: a failed statement's info messages are emitted before its error. dhensby's repro: +// a duplicate key insert raises 2627, and the server follows it with 3621 "The statement +// has been terminated." The error should come first, as the driver gives them. the +// constraint is named, so the message is the same on every server. + +module.exports = async t => { + t.query('setup', 'create table #t (id int constraint pk_t primary key); insert #t values (1)', null, { callback: true }) + await t.settled('setup') + const cases = { + A: 'insert #t values (1)', + B: 'select 1 as n; insert #t values (1)', + C: 'select 1 as n; insert #t values (1); select 2 as m', + D: 'insert #t values (1); select 2 as m' + } + for (const [label, sql] of Object.entries(cases)) { + t.section(`${label} ${sql}`) + t.query(label, sql) + await t.settled(label) + } +} diff --git a/test/contract/scripts/issue-479.js b/test/contract/scripts/issue-479.js new file mode 100644 index 00000000..b969a87c --- /dev/null +++ b/test/contract/scripts/issue-479.js @@ -0,0 +1,41 @@ +'use strict' + +// #479: on cancel, 'done' is emitted before the query has ended, and also when nothing was +// cancelled. dhensby's repro, A to C; and the two points from his comment on it: 4, a +// paused polling query cancelled, and 5, a query paused and cancelled before it executes. +// each case ends with a follow-up query, to show the connection is usable after it. + +const BIG = 'select top 5000 a.name from sys.all_objects a cross join sys.all_objects b' + +module.exports = async t => { + const followUp = async label => { + t.query(label, 'select 1 as n', null, { callback: true }) + await t.settled(label) + } + + t.section('A running cancel, at row 100') + t.query('A', BIG, null, { at: { row: { 100: ['cancel'] } } }) + await t.settled('A') + await followUp('A.check') + + t.section('B late cancel, after free') + t.query('B', 'select 1 as n', null, { at: { free: ['cancel'] } }) + await t.settled('B') + await t.delay(100) // the cancel is made 20 ms after free + await followUp('B.check') + + t.section('C running cancel after a print, at row 100') + t.query('C', `print 'start'; ${BIG}`, null, { at: { row: { 100: ['cancel'] } } }) + await t.settled('C') + await followUp('C.check') + + t.section('4 a polling query, paused and cancelled at row 100') + t.query('P4', t.sql.PollingQuery(BIG), null, { at: { row: { 100: ['pause', 'cancel'] } } }) + await t.settled('P4') + await followUp('P4.check') + + t.section('5 paused and cancelled before it executes') + t.query('P5', "waitfor delay '00:00:05'; select 1 as n", null, { at: { start: ['pause', 'cancel'] } }) + await t.settled('P5') + await followUp('P5.check') +} diff --git a/test/contract/scripts/issue-480.js b/test/contract/scripts/issue-480.js new file mode 100644 index 00000000..042b77d2 --- /dev/null +++ b/test/contract/scripts/issue-480.js @@ -0,0 +1,16 @@ +'use strict' + +// #480: pausing on the last row of a result set's final batch skipped the next result set. +// dhensby's repro: two result sets of 51 rows (a batch of 50, then one of 1), paused for +// 50 ms at rows 50, 51 and 52. every run should give both result sets, 51 rows each. + +const TWO_51 = 'select top 51 object_id as a from sys.all_objects; select top 51 object_id as b from sys.all_objects' + +module.exports = async t => { + for (const at of [50, 51, 52]) { + const label = `at${at}` + t.section(`pause at row ${at}, resume 50 ms later`) + t.query(label, TWO_51, null, { at: { row: { [at]: ['pause', 'resume:50'] } } }) + await t.settled(label) + } +} diff --git a/test/contract/scripts/issue-481.js b/test/contract/scripts/issue-481.js new file mode 100644 index 00000000..f742f579 --- /dev/null +++ b/test/contract/scripts/issue-481.js @@ -0,0 +1,48 @@ +'use strict' + +// #481: after a query fails, the connection's work queue advanced once too often, so later +// queries could overlap. dhensby's repro: q1 ends one way or another, then q2 (slow) and +// q3 are queued, at once or from q1's 'free'. q3 must not be submitted until q2 is done. +// B: from q1's 'free', a slow q2 that is cancelled 300 ms after it starts - it must still +// be cancellable when q1 failed. + +const SLOW = "waitfor delay '00:00:01'; select 2 as n" + +module.exports = async t => { + const overlap = async (name, sql, params, when) => { + t.section(`${name}: q2 and q3 queued ${when === 'now' ? 'at once' : 'from q1 free'}`) + const follow = () => { + t.query(`${name}.q2`, SLOW, null, { callback: true }) + t.query(`${name}.q3`, 'select 3 as n', null, { callback: true }) + } + const q1 = t.query(`${name}.q1`, sql, params, { callback: true }) + if (when === 'now') follow() + else q1.once('free', follow) + await t.settled(`${name}.q1`) + await t.settled(`${name}.q2`) + await t.settled(`${name}.q3`) + } + + await overlap('A1 ok', 'select ? as v', [1], 'now') + await overlap('A2 bind failure', 'select ? as v', [Infinity], 'now') + await overlap('A3 ok', 'select 1 as n', null, 'free') + await overlap('A4 error at execute', "raiserror('boom', 16, 1)", null, 'free') + await overlap('A5 error after a result', "select 1 as n; raiserror('boom', 16, 1)", null, 'free') + + const cancelLater = async (name, sql) => { + t.section(`${name}: from q1 free, a slow q2 cancelled after 300 ms`) + const q1 = t.query(`${name}.q1`, sql, null, { callback: true }) + let q2started + const q2 = new Promise(resolve => { q2started = resolve }) + q1.once('free', () => { + t.query(`${name}.q2`, SLOW, null, { callback: true, at: { later: { 300: ['cancel'] } } }) + q2started() + }) + await t.settled(`${name}.q1`) + await q2 + await t.settled(`${name}.q2`) + } + + await cancelLater('B1 ok', 'select 1 as n') + await cancelLater('B2 error at execute', "raiserror('boom', 16, 1)") +}