DDC-49: Incomplete MySQL Query Generator (MySQL Syntax error) #61

Closed
opened 2026-01-22 12:25:40 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 15, 2009).

Jira issue originally created by user purnama:

i checkout the HEAD version. and try to write this DQL

$query = utilities\DataAccess::getEntityManager()->createQuery("SELECT
p, t FROM ".models\Phrase::CLASS_NAME." p join p.type t WHERE p.phrase
= '$phrase'");

i commented out the $config->setAllowPartialObjects(false);

and have PDO error that my MySQL statement sytax is invalid.

i check the Query that the Doctrine create and its like this :
SELECT p0_.phrase_id AS phrase_id0, p0_.phrase_name AS phrase_name1,
p1_.phrase_type_id AS phrase_type_id2, p1_.phrase_type_name AS
phrase_type_name3, p1_.phrase_type_abbreviation AS
phrase_type_abbreviation4 FROM phrase p0_ INNER JOIN phrase_type p1_
ON p0_.phrase_type_id = p1_. WHERE p0_.phrase_name = 'abu'

as you can si at the ON statement it writes p0_.phrase_type_id = p1_.

the p1_. is not completed. i think my DocAnnotation is OK, because i
look at the Doctrine Tests Models that test the OneToMany Function
(the one with the ECommerce models, product and features). I have
followed all the doc annotation writes there.

Originally created by @doctrinebot on GitHub (Oct 15, 2009). Jira issue originally created by user purnama: i checkout the HEAD version. and try to write this DQL $query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, t FROM ".models\Phrase::CLASS_NAME." p join p.type t WHERE p.phrase = '$phrase'"); i commented out the $config->setAllowPartialObjects(false); and have PDO error that my MySQL statement sytax is invalid. i check the Query that the Doctrine create and its like this : SELECT p0_.phrase_id AS phrase_id0, p0_.phrase_name AS phrase_name1, p1_.phrase_type_id AS phrase_type_id2, p1_.phrase_type_name AS phrase_type_name3, p1_.phrase_type_abbreviation AS phrase_type_abbreviation4 FROM phrase p0_ INNER JOIN phrase_type p1_ ON p0_.phrase_type_id = p1_. WHERE p0_.phrase_name = 'abu' as you can si at the ON statement it writes p0_.phrase_type_id = p1_. the p1_. is not completed. i think my DocAnnotation is OK, because i look at the Doctrine Tests Models that test the OneToMany Function (the one with the ECommerce models, product and features). I have followed all the doc annotation writes there.
admin added the Bug label 2026-01-22 12:25:40 +01:00
admin closed this issue 2026-01-22 12:25:41 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 15, 2009):

Comment created by romanb:

Should be fixed now in HEAD.

@doctrinebot commented on GitHub (Oct 15, 2009): Comment created by romanb: Should be fixed now in HEAD.
Author
Owner

@doctrinebot commented on GitHub (Oct 15, 2009):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Oct 15, 2009): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 2 attachments from Jira into https://gist.github.com/67473e863ef0250517a4

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 2 attachments from Jira into https://gist.github.com/67473e863ef0250517a4 - [10072_PhraseType.php](https://gist.github.com/67473e863ef0250517a4#file-10072_PhraseType-php) - [10073_Lexical.php](https://gist.github.com/67473e863ef0250517a4#file-10073_Lexical-php)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#61