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
SELECT * FROM "Grades" WHERE (("Courses"."name" = $1) AND ("Courses"."credit" = $2)) AND ("Courses"."teacher" IN (SELECT "Courses"."teacher" FROM "Courses" WHERE "Courses"."teacher" = $1))
Notice that in the last part of the request, teacher is assigned the value $1 instead of $3.
Or name is assigned the value $1 instead of $3 (depending on the order that should make sense here.
The request cannot be run if we provide 3 arguments, as this is checked before.
As far as I can tell, this is coming from the fact that requests are resolved independently, hence the reset of the index.
For reference, MySQL is not suffering from the same issue, as it doesn't use numbered parameters. The same request returns:
SELECT * FROM `Grades` WHERE ((`Courses`.`name` = ?) AND (`Courses`.`credit` = ?)) AND (`Courses`.`teacher` IN (SELECT `Courses`.`teacher` FROM `Courses` WHERE `Courses`.`teacher` = ?))
The text was updated successfully, but these errors were encountered:
When using the
Parameter
type to avoid SQL injection, thequeryBuilder
is not working with sub-request, restarting the counter to 1 each time.If building the following query (from the README tables)
We get with PostgreSQL the following SQL request:
Notice that in the last part of the request,
teacher
is assigned the value$1
instead of$3
.Or
name
is assigned the value$1
instead of$3
(depending on the order that should make sense here.The request cannot be run if we provide 3 arguments, as this is checked before.
As far as I can tell, this is coming from the fact that requests are resolved independently, hence the reset of the index.
For reference, MySQL is not suffering from the same issue, as it doesn't use numbered parameters. The same request returns:
The text was updated successfully, but these errors were encountered: