Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing test with parametrised view #906

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions create_view_with_parameters_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package pq

import (
"testing"
)

func TestFoo(t *testing.T) {
db := openTestConn(t)
defer db.Close()

//_, err := db.Exec("CREATE VIEW foo1 AS SELECT 100") // works
//if err != nil {
// t.Fatal(err)
//}
//_, err = db.Exec("CREATE TABLE foo2 AS SELECT $1", 100) // works
//if err != nil {
// t.Fatal(err)
//}
_, err := db.Exec("CREATE VIEW foo3 AS SELECT $1", 100) // doesn't work
if err != nil {
t.Fatal(err)
}
// Error: Received unexpected error:
// pq: got 1 parameters but the statement requires 0
// Test: TestFoo
}