Address quoteIdentifier() deprecation#11811
Conversation
We should be using quoteSingleIdentifier(), assuming we only ever pass single identifiers here. See doctrine/dbal#6590
5e5ee5d to
aa141bf
Compare
There was a problem hiding this comment.
The tests pass, but I'm not sure if e.g. $tableName really is always going to be a single identifier here, and what to do if it isn't. That being said, if quoted is set, then… maybe we should treat everything as a single identifier?
There was a problem hiding this comment.
To preserve the existing behavior, table names should be split into schema name and unqualified name and quoted individually (basically, what quoteIdentifier() would do). Even if the identifier is quoted (e.g. "inventory.products"), AbstractAsset::_setName() in DBAL 4 would parse it and consider inventory to be the schema name.
I guess it's better to add or find an existing test that covers this case (e.g. create a schema in Postgres and and use a qualified table name on an entity).
There was a problem hiding this comment.
After attempting what you suggested, I now believe that name will never contain the schema part, which means such a test cannot be written.
There was a problem hiding this comment.
I came to the opposite conclusion in #11812 (comment). But maybe we're talking about the same thing.
My understanding is that if the name contains a dot, the part before the dot will be considered the schema name.
In any event, quoting all values as "single identifier" looks right to me.
There was a problem hiding this comment.
I was wrong, #12041 shows how to end up in such a situation. I should be able to write a test now.
We should be using
quoteSingleIdentifier(), assuming we only ever pass single identifiers here.See doctrine/dbal#6590