Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions server/functions/current_setting.go
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
package functions

import (
"github.com/cockroachdb/errors"
"fmt"

"github.com/cockroachdb/errors"
"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/doltgresql/server/functions/framework"
Expand All @@ -42,7 +43,7 @@ var current_setting = framework.Function1{
}

if variable != nil {
return variable, nil
return fmt.Sprintf("%v", variable), nil
}

variable, err = ctx.GetSessionVariable(ctx, s)
Expand All @@ -51,7 +52,7 @@ var current_setting = framework.Function1{
}

if variable != nil {
return variable, nil
return fmt.Sprintf("%v", variable), nil
}

return nil, errors.Errorf("unrecognized configuration parameter %s", s)
Expand Down
5 changes: 5 additions & 0 deletions testing/go/dolt_functions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ func TestDoltFunctions(t *testing.T) {
{"public.t1", "f", "new table"},
},
},
{
Skip: true, // TODO: function dolt_clean() does not exist
Query: "SELECT DOLT_CLEAN();",
Expected: []sql.Row{{"{0}"}},
},
{
Query: "SELECT DOLT_CLEAN('t1');",
Expected: []sql.Row{{"{0}"}},
Expand Down
19 changes: 19 additions & 0 deletions testing/go/prepared_statement_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ func TestPreparedPgCatalog(t *testing.T) {
}

var preparedStatementTests = []ScriptTest{

{
Name: "Expressions without tables",
Assertions: []ScriptTestAssertion{

{
Query: "SELECT CONCAT($1::text, $2::text)",
BindVars: []any{"hello", "world"},
Expand All @@ -50,6 +52,23 @@ var preparedStatementTests = []ScriptTest{
},
},
},
{
Name: "Expressions with tables",
Assertions: []ScriptTestAssertion{
{
Skip: true, // TODO: expected 0 arguments, got 1
Query: "SELECT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = $1);",
BindVars: []any{"public"},
Expected: []sql.Row{{1}},
},
{
Skip: true, // TODO: could not determine OID for placeholder v1: unsupported type: EXPRESSION
Query: "SELECT nspname FROM pg_namespace LIMIT $1;",
BindVars: []any{1},
Expected: []sql.Row{{"dolt"}},
},
},
},
{
Name: "Integer insert",
SetUpScript: []string{
Expand Down
Loading