File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ New Features:
44
55 - Logging of critical errors is configurable with ` SetLogger `
66
7+ Bugfixes:
8+
9+ - Allow more than 32 parameters in prepared statements
10+
11+
712## Version 1.1 (2013-11-02)
813
914Changes:
Original file line number Diff line number Diff line change @@ -1210,20 +1210,21 @@ func TestStmtMultiRows(t *testing.T) {
12101210 })
12111211}
12121212
1213+ // Regression test for
1214+ // * more than 32 NULL parameters (issue 209)
1215+ // * more parameters than fit into the buffer (issue 201)
12131216func TestPreparedManyCols (t * testing.T ) {
12141217 const numParams = defaultBufSize
12151218 runTests (t , dsn , func (dbt * DBTest ) {
12161219 query := "SELECT ?" + strings .Repeat (",?" , numParams - 1 )
1217- values := make ([]sql.NullString , numParams )
1218- params := make ([]interface {}, numParams )
1219- for i := range values {
1220- params [i ] = & values [i ]
1221- }
12221220 stmt , err := dbt .db .Prepare (query )
12231221 if err != nil {
12241222 dbt .Fatal (err )
12251223 }
12261224 defer stmt .Close ()
1225+ // create more parameters than fit into the buffer
1226+ // which will take nil-values
1227+ params := make ([]interface {}, numParams )
12271228 rows , err := stmt .Query (params ... )
12281229 if err != nil {
12291230 stmt .Close ()
You can’t perform that action at this time.
0 commit comments