Test failures with SQLite 3.5.9 (default on Ubuntu Intrepid)

John Morahan - November 29, 2008 - 16:57
Project:Drupal
Version:7.x-dev
Component:database system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I ran the simpletests on Intrepid and got three kinds of failures. One was due to #338184: Don't avoid serialize() in the registry. One was in search and I traced it back to this Debian bug which is in Intrepid too. The others were in dblog, profile, and tracker, and they were due to queries that do SELECT DISTINCT(field) FROM {table} ... - db_fetch_object is using "(field)" instead of "field" as the key.

#1

Damien Tournoud - November 29, 2008 - 17:06

Yeah, confirmed that this is a SQLite "bug":

SQLite version 3.5.9
Enter ".help" for instructions
sqlite> .headers on
sqlite> SELECT DISTINCT(uid) FROM users;
(uid)
0
1
sqlite> SELECT DISTINCT uid FROM users;
uid
0
1

#2

Damien Tournoud - November 29, 2008 - 17:15

Here is a workaround.

AttachmentSize
340568-fix-distinct-field-sqlite.patch 1.2 KB
Testbed results
340568-fix-distinct-field-sqlite.patchpassedPassed: 103 passes, 0 fails, 0 exceptions a href=http://testing.drupal.org/pifr/file/1/340568-fix-distinct-field-sqlite.patchDetailed results/a

#3

John Morahan - November 29, 2008 - 18:02
Status:active» reviewed & tested by the community

I installed the 3.5.9-6 package from jaunty and that fixed the search bug, but the others remained. I then applied this patch and #338184: Don't avoid serialize() in the registry and ran the full test suite on SQLite. Restult: 7423 passes, 0 fails, and 0 exceptions.

#4

webchick - November 30, 2008 - 01:32
Status:reviewed & tested by the community» fixed

Excellent. Thanks for testing, John Morahan! Always lovely when people stick around to test patches for bugs they report. :D

I had two questions when reviewing this patch:

1. Does "SELECT DISTINCT (uid) ..." return " (uid)" which we'd need to also check for? Answer: no, it only returns "(uid)"
2. Won't $this->columnNames[$k] = $matches[1]; cause this to re-iterate through a column that it has already checked? Answer: No, although we should add checking later to make sure that the two rewrites are compatible.

Committed to HEAD. Thanks!

#5

System Message - December 14, 2008 - 01:41
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.