-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHQL replaces field names in where #12971
Comments
Without alias |
From @FaimMedia on January 7, 2016 11:10 Indeed, if I don't use an alias, but just use |
From @adamdama on October 18, 2016 9:51 I have just run into this issue as well. Surely if I specify the aliased in the where they should not be rewritten? I am trying to use a JOIN to populate my model from two tables so changing the name of the alias I select will break the population. |
I also encountered the same problem, PHQL replaces field sourceno in where .
PHQL:
sqlStatement:
|
Fixed in the |
From @FaimMedia on January 6, 2016 15:37
I've created the following query using the query builder:
Probably because I have specified
name
as an alias formatch.name
PHQL thinks it can just usename
in theWHERE
clause and removed the table prefix, which results in executing this query:Note the where clause. This shouldn't be a problem if you have non-ambiguous column names, but I do, resulting in an
error.
I could just rename the alias to an unique name and it doesn't occur anymore. However I'm questioning if this is by design?
Gr. Tim
Copied from original issue: phalcon-orphanage/docs#765
The text was updated successfully, but these errors were encountered: