[X] I'm sure both client and server are on the latest update.
[X] I have read the console error message carefully (if applicable).
Your Environment
Version: 1.61.0
Operating System: Windows 11
Description
When calling a function that returns multiple values in the varargs of ExecuteAsync (those you send to be escaped) it throws an error saying
ERROR Failed to execute Execute query: 'INSERT INTO `my_cool_table` (`field_a`,`field_b`) VALUES (:1,:2);'.
Error: invalid vector subscript
I know that's how lua works and that's why i put quotes in the title, but it doesn't seems right to keep this behaviour in this specific case imo
Steps to reproduce the behavior
Connect to your database with the Database class, and replace my_db by your database object once connected
-- Create a new table in your database
my_db:Execute("CREATE TABLE IF NOT EXISTS `my_cool_table` (`field_a` TEXT, `field_b` TEXT);")
-- Create a function that returns multiple values
local function someFunc()
return "B", true
end
-- Insert something in the table
my_db:ExecuteAsync(
"INSERT INTO `my_cool_table` (`field_a`, `field_b`) VALUES (:1, :2)",
nil,
"A",
someFunc() -- Here I expect the first parameter to be evaluated ("B")
)
Expected behavior
In the exemple above only the value "B" should be considered
Actual behavior
In the exemple above both returned values of my function are passed as varargs to be escaped
Prerequisites
Your Environment
Description
When calling a function that returns multiple values in the varargs of
ExecuteAsync
(those you send to be escaped) it throws an error sayingI know that's how lua works and that's why i put quotes in the title, but it doesn't seems right to keep this behaviour in this specific case imo
Steps to reproduce the behavior
Connect to your database with the
Database
class, and replacemy_db
by your database object once connectedExpected behavior
In the exemple above only the value
"B"
should be consideredActual behavior
In the exemple above both returned values of my function are passed as varargs to be escaped