Skip to content

db.Query() can not return the query result on ubuntu14.04 64bit system #348

Closed
@niechaoya

Description

@niechaoya

import(
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
func DBQuery() []map[string]string{
var db *sql.DB
var err error
db, err = sql.Open("mysql", dbServer) //dbServer is my local mysql database
str:=call user_list(); //user_list() is a procedure of mysql database,it return the list of all user
rows,err:=db.Query(str)
if err!=nil{
fmt.Println("err=",err)
}
}

where i call this function ,the error is:Error 1312: PROCEDURE mytestdb.user_list can't return a result set in the given context

this function can work on win7 64bit and centos 64bit system,but it can not work on ubuntu 14.04 64bit system

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions