php-activerecord icon indicating copy to clipboard operation
php-activerecord copied to clipboard

test eager loading belongs to nested with same foreign key

Open jihunleekr opened this issue 8 years ago • 3 comments

This is belongs to #537

jihunleekr avatar May 19 '16 02:05 jihunleekr

This PR's test must fail

jihunleekr avatar May 19 '16 02:05 jihunleekr

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

visavi avatar May 19 '16 07:05 visavi

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.

jihunleekr avatar May 20 '16 01:05 jihunleekr