-
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-57: ManyToMany PDOException MySQL Syntax Error #5076
Comments
Comment created by purnama: This is the SQL statement produce by on line 474: SELECT type_id, type_name, type_abbreviation FROM type INNER JOIN lemma_type ON type. = lemma_type.type_id WHERE lemma_type.lemma_id = NULL; as you can see the syntax after ON is failure its type. with dot. |
Comment created by purnama: Hallo, I try to fix this issue myself. i send you the patch code right after this. for the info. i change my manytomany mapping like this /**** as you cann see the referencedColumnName did not referenced to column name in the database, but the member variable of the Entity class. or something like that. i dont understand :) but this is incosequent. maybe on later fix.. but i go on with this right now. |
Comment created by romanb: This should be fixed now in trunk. If not, please reopen this issue with new information. Thanks for reporting! |
Comment created by purnama: Hello, Thank You for the patch. But its still not functioning. I think you need to see my patch file that is attached to this issue. There is two other problems that to be fix on many to many. the first one is ambigous table name problem (my relation table have the same column name as his parent table for foreign key. the secod problem is the referencedColumnId name must be a class name or something. only if i do this patch i can go on. please take a look. regards, |
Comment created by romanb: Just to be sure, did you revert your local changes, using only the original latest code from trunk and changing back your annotations to the "right way" (column names)? Like I said, I reproduced the issue in our tests and fixed it. I am no longer able to reproduce it. Please add a new, failing test here: http://trac.doctrine-project.org/browser/trunk/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php Add missing models, if necessary, and then attach a diff to this ticket. Thanks! |
Comment created by romanb: I think I see the issue with the ambigious table name but the other problem should be fixed already. |
Comment created by romanb: I'm working on it and will get back to you shortly. Thanks for your patience. |
Comment created by romanb: Please try the latest code from trunk now and report back. Thanks! |
Comment created by purnama: Hello, Hier i send you a patch file for testing the ManyToMany problem. i hope this help. Thank you very much. |
Comment created by purnama: Ok it works, Thank You. |
Comment created by romanb: I added your new test to our suite! Thank you! |
Issue was closed with resolution "Fixed" |
Imported 3 attachments from Jira into https://gist.github.com/a99f4746a2a2ea525902 |
Jira issue originally created by user purnama:
For ManyToMany Relation I have an MySQL Sytax Error from the StandardEntityPersister.php
Hier is my error code:
2009-10-22T09:39:31+02:00 ERR (3): exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= lemma_type.type_id WHERE lemma_type.lemma_id = NULL' at line 1' in /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:475
Stack trace:
#0 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php(475): PDOStatement->execute(Array)
#1 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Mapping/ManyToManyMapping.php(186): Doctrine\ORM\Persisters\StandardEntityPersister->loadManyToManyCollection(Object(Doctrine\ORM\Mapping\ManyToManyMapping), Array, Object(Doctrine\ORM\PersistentCollection))
#2 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/PersistentCollection.php(233): Doctrine\ORM\Mapping\ManyToManyMapping->load(Object(kateglo\application\models\Lemma), Object(Doctrine\ORM\PersistentCollection), Object(Doctrine\ORM\EntityManager))
#3 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/PersistentCollection.php(495): Doctrine\ORM\PersistentCollection->_initialize()
#4 /usr/local/zend/apache2/htdocs/kateglo/application/views/scripts/search/index.phtml(24): Doctrine\ORM\PersistentCollection->getIterator()
@roman: i send you the new database structure and the php code (models etc..)
The text was updated successfully, but these errors were encountered: