mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1695: SQLs for PostgreSQL case sensite tables/fields are wrongly generated #2124
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Mar 9, 2012).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user ignaciolarranaga:
The SQLs for case sensitive schemas in postgreSQL are wronly generated.
Example:
Schema:
Object (I added quotes trying to generate the SQLs quoted.:
DQL:
Generated SQL:
Notice there are unmattched " in the SQL.
@doctrinebot commented on GitHub (Mar 9, 2012):
Comment created by ignaciolarranaga:
If there is another approach to specify the table/column names are case sensitive in PGSQL please let me know.
@doctrinebot commented on GitHub (Mar 9, 2012):
Comment created by ignaciolarranaga:
Just to comment. I also tried the normal quoting.
Example: @ORM\Column(name="
IdNews", type="integer", nullable=false)And does not work too because of the same reason.
@doctrinebot commented on GitHub (Mar 9, 2012):
Comment created by ignaciolarranaga:
Hi, I generate this patch and seems to be working for me (at least what I'm testing right now).
I used ´ to quote tables and single attributes (not relationships) and the SQLs are correctly generated.
@doctrinebot commented on GitHub (Mar 9, 2012):
Comment created by ignaciolarranaga:
Adding a new patch for another files I need to change.
@doctrinebot commented on GitHub (Mar 11, 2012):
Comment created by @beberlei:
Formatted code
@doctrinebot commented on GitHub (Mar 11, 2012):
Comment created by @beberlei:
Fixed and merged into 2.1.x and 2.2 branches
@doctrinebot commented on GitHub (Aug 5, 2014):
Comment created by julian:
This bug still unresolved for version 2.3.6-DEV included in Symfony 2.3.18.
The patches does not work with this version.
Generated query:
SELECT "0_.id AS id0, "0_."verFirmware" AS verfirmware1, "0_."idEstacion" AS idestacion2, "0_."fechaHora" AS fechahora3, "0_.global AS global4, "0_.directa AS directa5, "0_.difusa AS difusa6, "0_."tempSensDirecta" AS tempsensdirecta7, "0_.vbat1 AS vbat18, "0_.vbat2 AS vbat29, "0_.flags AS flags10, "0_."Estacion" AS estacion11 FROM "RegistroRS" "0_ WHERE "0_."idEstacion" = '1' AND "0_."fechaHora" >= '2014-02-01 03:00:00' AND "0_."fechaHora" <= '2014-08-01 03:00:00'
Notice there are unmattched " in the SQL.
@doctrinebot commented on GitHub (Aug 5, 2014):
Comment created by @ocramius:
[~julian] why are you using
2.3.6-DEV? Shouldn't you use a stable version? Is the bug reproducible also with later versions?@doctrinebot commented on GitHub (Aug 6, 2014):
Comment created by julian:
After changing to version 2.4.2 the bug still there. The same SQL query was generated.
@doctrinebot commented on GitHub (Aug 6, 2014):
Comment created by julian:
The error occurs when try to get an alias based on case sensitive table name, because the alias is generated with the first character of table's name which is ".
Ex:
Table: car Alias: c0_
Table: "Car" Alias: "0_
Is in file SqlWalker.php line 295 in Doctrine 2.4.4:
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 2 attachments from Jira into https://gist.github.com/a1404730255435c27e91
@malukenho commented on GitHub (Jan 5, 2017):
@Ocramius @lcobucci it was fixed on commit
0a78f7bc11