mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-30 08:50:01 -06:00
fix missing bind var err on bats
This commit is contained in:
@@ -122,7 +122,7 @@ func (dtf *DiffTableFunction) WithExpressions(expressions ...sql.Expression) (sq
|
||||
// TODO: For now, we will only support literal / fully-resolved arguments to the
|
||||
// DiffTableFunction to avoid issues where the schema is needed in the analyzer
|
||||
// before the arguments could be resolved.
|
||||
var literalArgs []string
|
||||
var exprStrs []string
|
||||
strToExpr := map[string]sql.Expression{}
|
||||
for _, expr := range expressions {
|
||||
if !expr.Resolved() {
|
||||
@@ -133,14 +133,14 @@ func (dtf *DiffTableFunction) WithExpressions(expressions ...sql.Expression) (sq
|
||||
return nil, ErrInvalidNonLiteralArgument.New(dtf.Name(), expr.String())
|
||||
}
|
||||
strVal := expr.String()
|
||||
if lit, ok := expr.(*expression.Literal); ok { // we only support literals for parsing
|
||||
if lit, ok := expr.(*expression.Literal); ok { // rm quotes from string literals
|
||||
strVal = fmt.Sprintf("%v", lit.Value())
|
||||
literalArgs = append(literalArgs, strVal)
|
||||
}
|
||||
exprStrs = append(exprStrs, strVal) // args extracted from apr later to filter out options
|
||||
strToExpr[strVal] = expr
|
||||
}
|
||||
|
||||
apr, err := cli.CreateDiffArgParser(true).Parse(literalArgs)
|
||||
apr, err := cli.CreateDiffArgParser(true).Parse(exprStrs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -945,6 +945,6 @@ SQL
|
||||
[ "$status" -eq 1 ]
|
||||
|
||||
run dolt sql -q "SELECT * FROM dolt_diff('-sk', '--skinny', 'HEAD~1', 'HEAD', 'test')"
|
||||
[[ "$output" =~ "multiple values provided for \`skinny" ]]
|
||||
[[ "$output" =~ "multiple values provided for \`skinny" ]] || false
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user