Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0-ALPHA4
-
Fix Version/s: 2.0-BETA2
-
Component/s: Mapping Drivers, ORM
-
Security Level: All
-
Labels:None
-
Environment:Doctrine trunk (r7479)
Description
I need to quote several table names (because of reserved words within MySQL) like so:
/** * @Entity * @Table(name="`Column`") */ class Column extends OptionAbstract
Another entity Question is related one-to-many to these entities, however, when trying to fetch the relation I get SQL errors because it seems to use the backtick as the table alias, which is illegal. An example of the query it's generating:
SELECT `0.id AS id1, `0.name AS name2, `0.sequence AS sequence3, `0.question_id AS question_id4 FROM `Column` `0 WHERE question_id = ?
Activity
Menno Luiten
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | DDC-481.patch [ 10525 ] |
Roman S. Borschel
made changes -
| Affects Version/s | 2.0-ALPHA4 [ 10036 ] | |
| Fix Version/s | 2.0-BETA1 [ 10030 ] |
Roman S. Borschel
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Roman S. Borschel
made changes -
| Fix Version/s | 2.0-BETA2 [ 10050 ] | |
| Fix Version/s | 2.0-BETA1 [ 10030 ] |
Roman S. Borschel
made changes -
| Priority | Major [ 3 ] | Critical [ 2 ] |
Roman S. Borschel
made changes -
| Status | In Progress [ 3 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] |
Roman S. Borschel
made changes -
| Component/s | ORM [ 10012 ] | |
| Component/s | DBAL [ 10011 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 11148 ] | jira-feedback [ 15603 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 15603 ] | jira-feedback2 [ 17467 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 17467 ] | jira-feedback3 [ 19724 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-481, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Here's a patch that works for me; looping through the table name until there is a character in the range a-z (case insensitive) to use as an alias.
Might need some more error-reporting and endless loop protection etc.