#6245: HABTM primaryKey identified in one direction only, bad DELETE queries ---------------------------------+------------------------------------------ Reporter: cuppett | Owner: Type: Test Case | Status: reopened Priority: High | Milestone: 1.2.x.x Component: General | Version: 1.2 Final Severity: Major | Resolution: Keywords: HABTM primaryKey | Php_version: PHP 5 Cake_version: 1.2.2.8120 | ---------------------------------+------------------------------------------ Comment (by cuppett):
Ok. With my patch, I still get the odd varchar<->int error (that I've never seen before on my regular app), but the DELETE queries on PostgreSQL are:[[BR]] [[BR]] 26: DELETE FROM "posts_tags" WHERE "tag_id" = ('1')[[BR]] 32: DELETE FROM "posts_tags" WHERE "post_id" = ('2')[[BR]] [[BR]] Which is fine for the operation, passes with the other exceptions (if not equivalent to MySQL below).[[BR]] [[BR]] From MySQL, I get:[[BR]] [[BR]] 13: DELETE `TagsPost` FROM `posts_tags` AS `TagsPost` WHERE `TagsPost`.`tag_id` = '1' AND `TagsPost`.`post_id` IN (1, 2)[[BR]] 18: DELETE `PostsTag` FROM `posts_tags` AS `PostsTag` WHERE `PostsTag`.`post_id` = 2 AND `PostsTag`.`tag_id` = ('3')[[BR]] [[BR]] Which is comparable to before the patch and still producing valid results.[[BR]] [[BR]] Not sure if my patch should be the end result, curious why MySQL gets two query predicates and PostgreSQL only has the one, but my directional join models seem to do the trick. -- Ticket URL: <https://trac.cakephp.org/ticket/6245#comment:10> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---