You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue likely originated in the following commit 7972f60
SQL placeholders are being misinterpreted during query compilation, resulting in invalid syntax.
Steps To Reproduce
The following code is a simplified excerpt from a larger query, but it still demonstrates the issue
This behavior seems quite inconsistent with how the other part of nette/database behave - such as what's documented in Explorer docs:
// WHERE (`age` > 18) AND (ROUND(`score`, 2) > 75.5)$table->where([
'age > ?' => 18,
'ROUND(score, ?) > ?' => [2, 75.5], // two parameters are passed as an array
]);
... where the question marks are processed correctly. This new behavior of Connection::query() does feel like a bug. 🤔 And even more so if this behavior (resulting in doubling of the question marks) ultimately results in a badly formed SQL and is not intercepted by nette/database itself.
Couldn't (shouldn't) the parameter-passing-through-assoc-array-with-question-marks-in-keys API be unified?
Activity
dg commentedon Jun 18, 2025
It is assumed that there will be no question mark, i.e.
'sublog.id >=' => $oldestRowId- https://doc.nette.org/en/database/sql-way#toc-where-conditionsThis seems to have worked by mistake before - it threw away everything after the operator.
smuuf commentedon Jun 24, 2025
This behavior seems quite inconsistent with how the other part of
nette/databasebehave - such as what's documented in Explorer docs:... where the question marks are processed correctly. This new behavior of
Connection::query()does feel like a bug. 🤔 And even more so if this behavior (resulting in doubling of the question marks) ultimately results in a badly formed SQL and is not intercepted bynette/databaseitself.Couldn't (shouldn't) the parameter-passing-through-assoc-array-with-question-marks-in-keys API be unified?