findFirst() broken with long string

I've got a standard model I'm running findFirst(). When I pass a really weird string:


as the sole argument, I get an exception:

Phalcon\Mvc\Model\Exception: Syntax error, unexpected token LIMIT, near to ' :APL0:', when parsing: SELECT [Model\Student].* FROM [Model\Student] WHERE -1020[string trimmed]----------- LIMIT :APL0: (1089)

As far as I know, the query should resolve to a comparison against the primary key, but it appears the argument is being treated as the entire condition. Is this a bug in Phalcon or me?

Will be able to test soon. Perhaps you can try with findFirstByColumnName() meanwhile?

I did - same behaviour. Trimming the string to 13 characters fixed the problem. 13 is a length chosen for internal reasons - I don't know what the actual cutoff would be.


find(["conditions" => "my_col = "?0" , bind => [0 => "that creepy string"]]) ?

find(["conditions" => "my_col = "?0" , bind => [0 => "that creepy string"]]) ?

Same result.

why not mysql is good Java. Java decreased in popularity by about 6,000 job postings in 2018 compared to 2017, but is still extremely well-established. ... Python. Python grew in popularity by about 5,000 job postings over 2017. ... JavaScript. ... C++ ... C# ... PHP. ... Perl.