Fatal SQL error

kmv - May 22, 2008 - 19:55
Project:Views Tagadelic
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Error reported in the log:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;) GROUP BY term_data.tid, term_data.name, term_data.vid ORDER BY count DESC LIMI&#039; at line 1 query: SELECT term_data.tid, COUNT(*) AS count, term_data.name, term_data.vid FROM node node INNER JOIN term_node term_node ON term_node.nid = node.nid INNER JOIN term_data term_data ON term_data.tid = term_node.tid WHERE term_data.vid IN (17625%) GROUP BY term_data.tid, term_data.name, term_data.vid ORDER BY count DESC LIMIT 0, 20 in <my path>/includes/database.mysql.inc on line 172.

The above line is in 'tagadelic_views.module' line 53.

Happens on every page that has a Tagadelic view.

My details:
Drupal: v5.7
MySQL: v5.0.27
PHP: v5.1.6

Problem seems to have turned up in the last update.

#1

kmv - May 25, 2008 - 13:41
Status:active» needs review

...and here is the patch - it is a single character change. Clearly a typo.

AttachmentSize
tagadelic_views.module.diff 2.46 KB

#2

douggreen - June 16, 2008 - 11:43
Status:needs review» fixed

I applied a slightly different patch, but thanks for pointing this out.

#3

kmv - June 21, 2008 - 00:31
Status:fixed» active

Nice patch, but there is a typo in it that will cause a NIL result:
$placeholders = implode(',', array_fill(0, count($vid), "%d"));

Should actually be:
$placeholders = implode(',', array_fill(0, count($vids), "%d"));

You want $vids instead of $vid
Do you want a patch?

#4

douggreen - June 23, 2008 - 13:00
Status:active» fixed

@kmv, Thanks for catching the typo! I checked in the updated fix.

#5

Anonymous (not verified) - July 7, 2008 - 13:15
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.