Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query.onError missing 3rd sql arg #115

Closed
2048khz-gachi-rmx opened this issue Sep 1, 2022 · 1 comment
Closed

Query.onError missing 3rd sql arg #115

2048khz-gachi-rmx opened this issue Sep 1, 2022 · 1 comment

Comments

@2048khz-gachi-rmx
Copy link

Functionality seems to have been lost between 9.6 and 9.7, but the docs still reference the sql argument.

9.6:

case QUERY_ERROR:
if (data->getErrorReference() != 0) {
this->runFunction(LUA, data->getErrorReference(), "ss", data->getError().c_str(), this->m_query.c_str());
} else if (data->isFirstData()) {

9.7:

void LuaIQuery::runErrorCallback(ILuaBase *LUA, const std::shared_ptr<IQueryData> &data) {
if (data->m_tableReference == 0) return;
if (!LuaIQuery::pushCallbackReference(LUA, data->m_errorReference, data->m_tableReference,
"onError", data->isFirstData())) {
return;
}
LUA->ReferencePush(data->m_tableReference);
auto error = data->getError();
LUA->PushString(error.c_str());
LuaObject::pcallWithErrorReporter(LUA, 2);
}

Docs:

MySQLOO/README.md

Lines 217 to 218 in b1d29b5

Query.onError( q, err, sql )
-- Called when the query errors, [String] err is the error and [String] sql is the SQL query that caused it.

@FredyH
Copy link
Owner

FredyH commented Sep 1, 2022

This was indeed lost with the latest major update, I fixed it in 9.7.6.
Thanks for reporting it!

@FredyH FredyH closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants