You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse multiple result sets will be block when use NextResultSet()
if the procedure has no select , error will be return in Query().
but if it has select, error will be nil and NextResultSet() function will be block in the end
Example mysql procedure
-- first procedure
CREATE DEFINER=`root`@`%` PROCEDURE `test_proc1`()
BEGIN
SIGNAL SQLSTATE '10000' SET MESSAGE_TEXT = "some error", MYSQL_ERRNO = 10000;
END;
-- second procedure
CREATE DEFINER=`root`@`%` PROCEDURE `test_proc2`()
BEGIN
SELECT 1,2;
SELECT 3,4;
SIGNAL SQLSTATE '10000' SET MESSAGE_TEXT = "some error", MYSQL_ERRNO = 10000;
END;
Example code
dsn:="usr:passwd@tcp(127.0.0.1:3306)/database?charset=utf8mb4&parseTime=True"db, _:=sql.Open("mysql", dsn)
_, err:=db.Query("CALL test_proc1()")
iferr!=nil { // err is not nillog.Println(err.Error())
}
rows, err:=db.Query("CALL test_proc2()")
iferr!=nil { // err is nilpanic(err.Error())
}
deferrows.Close()
forrows.Next() {
log.Println(rows.Columns())
}
forrows.NextResultSet() { // thread will be blocked when exec rs.Close()forrows.Next() {
log.Println(rows.Columns())
}
}
Issue description
Parse multiple result sets will be block when use NextResultSet()
if the procedure has no select , error will be return in Query().
but if it has select, error will be nil and NextResultSet() function will be block in the end
Example mysql procedure
Example code
Error log
Configuration
Driver version (or git SHA): 1.6.0
Go version: 1.18
Server version: MySQL 5.7
Server OS: Windows 10
The text was updated successfully, but these errors were encountered: