Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fresh install without content. On page admin/content/comment I have this error and nothing more.
Error message
PDOException: SQLSTATE[HY000]: General error: 1 ambiguous column name: changed: SELECT n.title AS node_title, c.cid AS cid, c.subject AS subject, c.name AS name, c.changed AS changed FROM {comment} c INNER JOIN {node} n ON n.nid = c.nid WHERE (c.status = :db_condition_placeholder_0) ORDER BY changed DESC LIMIT 50 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 ) in PagerDefault->execute() (line 93 of /Users/simon/Sites/drupal-7.0-alpha2/includes/pager.inc).
Comment | File | Size | Author |
---|---|---|---|
#12 | 731044_comment-admin-ambiguous-column-12.patch | 887 bytes | Sivaji_Ganesh_Jojodae |
Comments
Comment #1
Crell CreditAttribution: Crell commentedSounds like someone is running a bad query on that page.
Comment #2
scottrouse CreditAttribution: scottrouse commentedI'm still getting this error with a fresh install of 7.0-alpha7. When I click on Content in the admin menu, then click the Comments tab.
The website encountered an unexpected error. Please try again later.
Should this be a critical bug?
Comment #3
gagarine CreditAttribution: gagarine commentedI tried with the head today and I have no more error.
Comment #4
pheudo CreditAttribution: pheudo commentedHere the same error.
Maybe could it be SQLite?
Comment #5
Crell CreditAttribution: Crell commentedWhat configuration are you running when you get the error? Is it only on SQLite? Can you try on MySQL and see if it still breaks?
Actually, looking at the query more closely it looks like the ORDER BY clause is the culprit. Both node and comment have a "changed" column, so the DB doesn't know which one to use. It could be that MySQL is smarter about figuring it out than SQLite is. Sounds like we need a patch for that query to be explicit about which one is intended.
Comment #6
webchickI can't reproduce on MySQL. Must be a SQLite thing.
And fwiw we do have test coverage for this condition, it looks like:
Comment #7
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedTested against beta and dev release with MySQL and sqlite3. I can not reproduce any error.
Comment #8
pheudo CreditAttribution: pheudo commentedI can't reproduce on MySQL too. Maybe a SQLite thing.
Comment #9
pheudo CreditAttribution: pheudo commentedIt looks some matter with the changed field because is present into the node table too...
It's really strange.
If I comment changed header it works.
If I use c.changed instead it works too...
Comment #10
Crell CreditAttribution: Crell commentedHm. Let's try specifying c.changed in the header array and see if that fixes it. pheudo, can you roll a patch?
Comment #11
pheudo CreditAttribution: pheudo commentedBut it doesn't explain why in some installation it works and in other we got error.
Maybe the PHP version (and the OCI sqlite extension bundled)?
I'm using 5.2.9 and I tried with the latest 5.2.14.
I didn't try with 5.3...
Comment #12
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedAttached is the patch replacing "changed" to "c.changed" in the header array.
Comment #13
Crell CreditAttribution: Crell commented#12 should go in either way for cleanliness if nothing else. Let's do that and see if SQLite is fixed as a result.
Comment #14
webchickCommitted to HEAD. Thanks!