pg: fix array init warnings (#6163)

pull/6164/head
jhuntos 2020-08-19 07:10:09 +02:00 committed by GitHub
parent e69f091bbd
commit c42ca84850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ pub fn (db DB) exec_param_many(query string, params []string) []Row {
}
pub fn (db DB) exec_param2(query string, param, param2 string) []Row {
mut param_vals := [2]byteptr
mut param_vals := [2]byteptr{}
param_vals[0] = param.str
param_vals[1] = param2.str
res := C.PQexecParams(db.conn, query.str, 2, 0, param_vals, 0, 0, 0)
@ -150,7 +150,7 @@ pub fn (db DB) exec_param2(query string, param, param2 string) []Row {
}
pub fn (db DB) exec_param(query string, param string) []Row {
mut param_vals := [1]byteptr
mut param_vals := [1]byteptr{}
param_vals[0] = param.str
res := C.PQexecParams(db.conn, query.str, 1, 0, param_vals, 0, 0, 0)
return db.handle_error_or_result(res, 'exec_param')