Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
21 Dec 2010 at 01:49 UTC
Updated:
11 Jan 2011 at 19:00 UTC
Jump to comment: Most recent file
PDO's SQLite extention has an odd bug whereby expressions with arguments are broken: General error: 25 bind or column index out of range. Damien has filed a bug report: http://bugs.php.net/bug.php?id=52746
However, EFQ still uses expressions with arguments in propertyQuery, and so that's broken. Since we can't fix the PHP bug, I've created a very small (and unfortunately ugly) workaround, that eliminates use of addExpression in EFQ.
Major as per http://drupal.org/node/45111:
An example would be a PHP error which is only triggered under rare circumstances or which affects only a small percentage of all users.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 1003860-fix-groupby-fields_0.patch | 2.97 KB | dmitrig01 |
| #20 | test_only.patch | 2.21 KB | dmitrig01 |
| #18 | 1003860-fix-groupby-fields.patch | 592 bytes | dawehner |
| #17 | 1003860-fix-groupby-fields.patch | 942 bytes | dawehner |
| #13 | someone_screwed_up_the_logic_not_to_point_any_fingers_2.patch | 2.43 KB | dmitrig01 |
Comments
Comment #1
dmitrig01 commentedok, wtf. the logic around removing fields and expressions in count queries was inverted. Much saner patch now, no hacking around, just real fixing
Comment #2
dmitrig01 commentedExplanation:
Before, count queries looked like this:
After:
While this in itself is not inherently buggy, just unnecessary, it was causing breakage on SQLite because of an obscure PHP bug.
Comment #3
chx commented<humble mode> This happens when I am not involved with a DBTNG issue </humble mode>
To test, you can try to select a nonexisting field -- countquery should still work. Same with expression.
Comment #4
dmitrig01 commentedTests fail in head and pass with patch, even with MySQL
Comment #5
dmitrig01 commentedchx++, btw
Comment #6
dmitrig01 commentedwith less spelling fail
Comment #7
chx commented#4 shows how the patch fixed the issue, #6 just fixed a typo.
Comment #8
dmitrig01 commentedoh wait, had a bit of redundancy
Comment #9
dmitrig01 commentedComment #10
chx commentedyeah right that does not affect the code flow though so still RTBC :)
Comment #12
dmitrig01 commentedComment #13
dmitrig01 commentedAnd with comments
Comment #14
webchickMassaged the comment a bit (which I asked for in IRC cos I couldn't figure out what the heck that test was testing) and committed to HEAD.
Comment #15
dmitrig01 commentedawesome -- thanks
Comment #16
damien tournoud commentedew. That was a nasty one. I wonder, are we supporting DISTINCT properly for count queries? It feels to me that we shouldn't remove the fields for DISTINCT queries either.
Comment #17
dawehnerIf you look at $group_by it is array(0, 1)
Comment #18
dawehnerNew version of the patch without debug code.
The problem was reported at #1005690: Argument summaries throw errors when combined with pagers
Comment #19
dawehnerThis needs testing
Comment #20
dmitrig01 commentedComment #22
dmitrig01 commentedstupid bot, that was supposed to fail
Comment #23
chx commentedThis is the problem reported by dereine, proven by the test, fixed by the patch.
Comment #24
quicksketchI've marked my report at #1005690: Argument summaries throw errors when combined with pagers as duplicate. This patch corrects the original problem (Views arguments failing) for me also.
Comment #25
chx commentedI have reproduced the bug as described in #1005690: Argument summaries throw errors when combined with pagers , applied the patch, the problem went away. Video at http://drupal4hu.com/desktop_video.ogv
Comment #26
webchickCommitted to HEAD. Thanks a lot, folks. SO happy to not have another D7 RC that breaks Views. :P~
Comment #27
Crell commentedAnd I be glad if I didn't have to remind people that we don't put Drupal-specific global functions into the middle of a DB layer class unless there is absolutely no other option. I don't believe this qualifies as "absolutely no other option".
I am not re-opening this issue because there's another follow-up already, but I am really getting sick and tired of being ignored. #1005674: SelectQuery::countQuery() fails with a group by expression
Comment #28
webchickI believe Crell's #27 is addressed by #1005674: SelectQuery::countQuery() fails with a group by expression, which I just committed.
Tentatively marking this back to fixed.
Crell, I don't think anyone is ignoring you. We just wanted to fix Views before RC3 and weren't taking all ramifications of the fix into consideration.