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:
4
4
5
5
- Logging of critical errors is configurable with ` SetLogger `
6
6
7
+ Bugfixes:
8
+
9
+ - Allow more than 32 parameters in prepared statements
10
+
11
+
7
12
## Version 1.1 (2013-11-02)
8
13
9
14
Changes:
Original file line number Diff line number Diff line change @@ -1210,20 +1210,21 @@ func TestStmtMultiRows(t *testing.T) {
1210
1210
})
1211
1211
}
1212
1212
1213
+ // Regression test for
1214
+ // * more than 32 NULL parameters (issue 209)
1215
+ // * more parameters than fit into the buffer (issue 201)
1213
1216
func TestPreparedManyCols (t * testing.T ) {
1214
1217
const numParams = defaultBufSize
1215
1218
runTests (t , dsn , func (dbt * DBTest ) {
1216
1219
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
- }
1222
1220
stmt , err := dbt .db .Prepare (query )
1223
1221
if err != nil {
1224
1222
dbt .Fatal (err )
1225
1223
}
1226
1224
defer stmt .Close ()
1225
+ // create more parameters than fit into the buffer
1226
+ // which will take nil-values
1227
+ params := make ([]interface {}, numParams )
1227
1228
rows , err := stmt .Query (params ... )
1228
1229
if err != nil {
1229
1230
stmt .Close ()
You can’t perform that action at this time.
0 commit comments