jpfuentes2 / php-activerecord

ActiveRecord implementation for PHP
http://www.phpactiverecord.org/
Other
1.32k stars 443 forks source link

test eager loading belongs to nested with same foreign key #538

Open jihunleekr opened 8 years ago

jihunleekr commented 8 years ago

This is belongs to #537

jihunleekr commented 8 years ago

This PR's test must fail

visavi commented 8 years ago

SELECT * FROM awesome_people WHERE author_id=?' contains "WHERE author_id IN(?,?)

jihunleekr commented 8 years ago
SHOW COLUMNS FROM `books`
SELECT * FROM `books` WHERE `book_id` IN('2','3')
SHOW COLUMNS FROM `authors`
SHOW COLUMNS FROM `authors`
SELECT * FROM `authors` WHERE `author_id` IN('2','2')
SHOW COLUMNS FROM `awesome_people`
SELECT * FROM `awesome_people` WHERE `author_id` IN('2')
SELECT * FROM `awesome_people` WHERE `author_id`='2'

above is a query log of running added test.

the last query is unnecessary.