[ERR] Unable to prepare statement. Invalid query string

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761
[ERR] Unable to prepare statement. Invalid query string
« 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?

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,804
[ERR] Re: Unable to prepare statement. Invalid query string
« Reply #1, on March 5th, 2017, 10:51 AM »Last edited on March 5th, 2017, 11:04 AM
Yep. There's a bug in the validation process. 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.
.