Merge pull request #4399 from dolthub/james/bindvars

adding prepared tests for dolt stored procedures
This commit is contained in:
James Cor
2022-09-23 12:35:41 -07:00
committed by GitHub
3 changed files with 26 additions and 2 deletions

View File

@@ -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))
}

View File

@@ -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"},
},
},
},
},
}

View File

@@ -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)