luasql
luasql copied to clipboard
Can not fetch result after calling procedure
local res=assert(con:execute("CALL Procedure_name
('"..parameter.."')"))
while row do
row = res:fetch ({}, "a")
end
After this calling another query and see: LuaSQL: error executing query. MySQL: Commands out of sync; you can't run this command now
This error means that driver can not free result and next query can not be executed, This happens only with procedures.
I tried res:close() but it is not works for this too. So as I cnow it automaticly closes when fetched null value.
Hi
On 2015-12-31 17:05, ovoshlook wrote:
local res=assert(con:execute("CALL Procedure_name('"..parameter.."')")) while row do
row = res:fetch ({}, "a") end
After this call another query and see: LuaSQL: error executing query. MySQL: Commands out of sync; you can't run this command now
This error means that driver can not free result and next query can not be executed, This happens only with procedures.
I tried res:close() but it is not works for this too. So as I cnow it automaticly closes when fetched null value.
Reply to this email directly or view it on GitHub [1].
Links:
[1] https://github.com/keplerproject/luasql/issues/41
LuaSQL drivers are not designed to work that way. I think they will have to be adapted...
Regards, Tomás