From 436c563da7d89f368cf9415ba7bfc438a5059f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 21 Mar 2018 00:19:48 +0200 Subject: [PATCH] MXS-1729: Allow global routeQuery to return values The `lua_pcall` parameters were incorrect, the second number signifies the number of parameters the function can return. --- server/modules/filter/luafilter/luafilter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/filter/luafilter/luafilter.c b/server/modules/filter/luafilter/luafilter.c index 3606d5cd2..1527471e8 100644 --- a/server/modules/filter/luafilter/luafilter.c +++ b/server/modules/filter/luafilter/luafilter.c @@ -584,7 +584,7 @@ static int32_t routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *session, GWB lua_pushlstring(my_instance->global_lua_state, fullquery, strlen(fullquery)); - if (lua_pcall(my_instance->global_lua_state, 1, 0, 0)) + if (lua_pcall(my_instance->global_lua_state, 1, 1, 0)) { MXS_ERROR("Global scope call to 'routeQuery' failed: '%s'.", lua_tostring(my_instance->global_lua_state, -1));