Vice City: Multiplayer

Community Projects => SLC's Squirrel Plugin => Bug Reports => Topic started by: EK.IceFlake on March 5th, 2017, 08:33 AM

Title: [ERR] Unable to prepare statement. Invalid query string
Post by: EK.IceFlake on March 5th, 2017, 08:33 AM
I'm trying to create a select query
Code: [Select]
SQLd <- SQLite.Connection("sqli.db");
...
Code: [Select]
local stmt = SQLd.Query("select * from [players] where lower(name) = '" + SQLite.Escape(player.Name.tolower()) + "'");

But I get this error:
[ERR] Unable to prepare statement. Invalid query string

Why does this occur?
Title: Re: [ERR] Unable to prepare statement. Invalid query string
Post by: . on March 5th, 2017, 10:51 AM
Yep. There's a bug in the validation process(https://github.com/iSLC/VCMP-SqMod/blob/master/modules/sqlite/Handle/Statement.cpp#L54). It was supposed to be *query == '\0' instead of just *query because the latter always yields true when there's a valid query.

I'll try to push some binaries as soon as possible.

EDIT: A fix was pushed. Waiting to get some free time and build for linux. Should be done in a couple hours.
Title: Re: [ERR] Unable to prepare statement. Invalid query string
Post by: . on March 5th, 2017, 02:04 PM
UPDATE: Fixed binaries are now available.