mirror of
https://github.com/dolthub/dolt.git
synced 2026-03-13 19:29:58 -05:00
Merge pull request #4399 from dolthub/james/bindvars
adding prepared tests for dolt stored procedures
This commit is contained in:
@@ -46,7 +46,7 @@ var skipPrepared bool
|
||||
// SkipPreparedsCount is used by the "ci-check-repo CI workflow
|
||||
// as a reminder to consider prepareds when adding a new
|
||||
// enginetest suite.
|
||||
const SkipPreparedsCount = 80
|
||||
const SkipPreparedsCount = 79
|
||||
|
||||
const skipPreparedFlag = "DOLT_SKIP_PREPARED_ENGINETESTS"
|
||||
|
||||
@@ -1230,6 +1230,13 @@ func TestDoltCommit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDoltCommitPrepared(t *testing.T) {
|
||||
harness := newDoltHarness(t)
|
||||
for _, script := range DoltCommitTests {
|
||||
enginetest.TestScriptPrepared(t, harness, script)
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueriesPrepared(t *testing.T) {
|
||||
enginetest.TestQueriesPrepared(t, newDoltHarness(t))
|
||||
}
|
||||
|
||||
@@ -6313,4 +6313,21 @@ var DoltCommitTests = []queries.ScriptTest{
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "dolt commit works with arguments",
|
||||
SetUpScript: []string{
|
||||
"CREATE table t (pk int primary key);",
|
||||
"INSERT INTO t VALUES (1);",
|
||||
"CALL DOLT_ADD('t');",
|
||||
"CALL DOLT_COMMIT('-m', concat('author: ','somebody'));",
|
||||
},
|
||||
Assertions: []queries.ScriptTestAssertion{
|
||||
{
|
||||
Query: "SELECT message from dolt_log where message = 'author: somebody'",
|
||||
Expected: []sql.Row{
|
||||
{"author: somebody"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ async function insertAuthor(name) {
|
||||
try {
|
||||
await conn.execute('start transaction');
|
||||
await conn.execute('INSERT INTO users (name) VALUES(?);', [name]);
|
||||
await conn.execute(`call dolt_commit('-am', 'created author ?')`, [name]);
|
||||
await conn.execute(`call dolt_commit('-am', concat('created author', ?))`, [name]);
|
||||
} catch (err) {
|
||||
console.error(`Error committing ${name}:`, err);
|
||||
process.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user