Skip to content

Commit 64684c7

Browse files
author
Nathan Gabrielson
committed
better err msg
1 parent a0c55f4 commit 64684c7

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

server/connection_data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func checkCompatibleTypes(existingOid, newOid uint32, newName string) error {
230230
existing := pgtypes.GetTypeByID(id.Type(id.Cache().ToInternal(existingOid)))
231231
newType := pgtypes.GetTypeByID(id.Type(id.Cache().ToInternal(newOid)))
232232
if _, _, err = framework.FindCommonType([]*pgtypes.DoltgresType{existing, newType}); err != nil {
233-
err = errors.Errorf("double placeholder given for %s", newName)
233+
err = errors.Errorf("parameter %s is used for incompatible types: %s and %s", newName, existing.String(), newType.String())
234234
}
235235
return err
236236
}

testing/go/prepared_statement_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,12 +1343,7 @@ var preparedStatementTests = []ScriptTest{
13431343
{
13441344
Query: "SELECT * FROM text_test where fullname = $1 and id = $1",
13451345
BindVars: []any{1},
1346-
ExpectedErr: "double placeholder given for v1",
1347-
},
1348-
{
1349-
Query: "SELECT * FROM text_test where fullname = $1 and id = $1",
1350-
BindVars: []any{"foo"},
1351-
ExpectedErr: "double placeholder given for v1",
1346+
ExpectedErr: "parameter v1 is used for incompatible types: text and integer",
13521347
},
13531348
},
13541349
},

0 commit comments

Comments
 (0)