-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
DDC-1360: Reserved words escaping fails when using multiple reserved words #1979
Comments
Comment created by @guilhermeblanco: By now, it's currently impossible to do cross database joins in an easy way. I'll be working on this support for 2.2, but until there, my only recommendation is to not use a keyword as a table name. Cheers, |
Comment created by elnur: It's not cross database; it's just |
Comment created by @beberlei: How much of this ticket does your commit from some weeks ago cover guilherme? |
Comment created by @beberlei: Fixed for 2.2 |
Comment created by elnur: It still doesn't work. Tried on |
Comment created by @beberlei: what kind of error do you get? |
Comment created by @beberlei: could reproduce the problem with table names and sequence names. |
Comment created by @beberlei: Fixed. |
Comment created by elnur: I've just got fresh clones of My entity has this annotation:
I'm getting the following exception:
So, it's translating |
Comment created by elnur: What changed is that earlier I saw the commit related to this ticket (959a686) and I want to note that I'm getting this error not when creating a table, but when querying it. I don't use Doctrine for creating tables anyway — I do it via plain SQL. |
Comment created by @beberlei: I keep trying until i fixed this, now with a commit into DBAL: doctrine/dbal@4cb8a99 Will be included in Beta 2 |
Issue was closed with resolution "Fixed" |
Comment created by elnur: Now
Good job, thanks. |
Jira issue originally created by user elnur:
Everything works fine when I use the
@Table
annotation like this:@Table(name="
user")
. But when theuser
table is in theuser
schema and I try to use the annotion in this way:@Table(name="
user.
user")
— everything falls apart.A quick look into the code showed that it checks if the table name starts with
, and if it does, it sets the
quotedparameter to
trueand removes the
characters on the both sides. So, if I quote the both words like@Table(name="
user.
user")
, the table name becomes"user
.user"
and it, of course, fails. If I quote it just like@Table(name="
user.user")
, the table name becomes"user.user"
, which fails too.If Doctrine allows to escape the reserved words, it should take into account this kind of usage as well.
The text was updated successfully, but these errors were encountered: