Closed (duplicate)
Project:
Taxonomy context
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2004 at 09:17 UTC
Updated:
2 Jan 2005 at 05:27 UTC
Jump to comment: Most recent file
The number of SQL errors is growing after new updates of drupal or contibuted modules.
some examples :
Submit personal blog entry
warning: pg_query(): Query failed: ERROR: pg_atoi: error in "blog": can't parse "blog"
. in /usr/local/apache/drupal/includes/database.pgsql.inc on line 104.
user error:
query: SELECT n.*, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid WHERE n.nid = 'blog' in /usr/local/apache/drupal/includes/database.pgsql.inc on line 121.
what can I do to fix these SQL errors in drupal?
Some errors are mentioned here as issues before and are stil not fixed !
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | taxonomy_context.module_0.patch | 1.06 KB | paulgear |
| #9 | taxonomy_context.module.patch | 1.06 KB | Anonymous (not verified) |
Comments
Comment #1
erwin commentedAfter selecting a node I get these errors.
warning: pg_query(): Query failed: ERROR: parser: parse error at or near "'1'" at character 219
. in /usr/local/apache/drupal/includes/database.pgsql.inc on line 104.
user error:
query: SELECT DISTINCT(n.nid), n.title, n.body, n.type, n.created, n.changed, n.uid, n.sticky, u.name FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE r.tid = 55 AND n.status = '1' '1' ORDER BY sticky DESC, created DESC in /usr/local/apache/drupal/includes/database.pgsql.inc on line 121.
warning: pg_query(): Query failed: ERROR: parser: parse error at or near "'1'" at character 218
. in /usr/local/apache/drupal/includes/database.pgsql.inc on line 104.
user error:
query: SELECT DISTINCT(n.nid), n.title, n.body, n.type, n.created, n.changed, n.uid, n.sticky, u.name FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE r.tid = 1 AND n.status = '1' '1' ORDER BY sticky DESC, created DESC in /usr/local/apache/drupal/includes/database.pgsql.inc on line 121.
warning: pg_query(): Query failed: ERROR: parser: parse error at or near "'1'" at character 218
. in /usr/local/apache/drupal/includes/database.pgsql.inc on line 104.
user error:
query: SELECT DISTINCT(n.nid), n.title, n.body, n.type, n.created, n.changed, n.uid, n.sticky, u.name FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE r.tid = 0 AND n.status = '1' '1' ORDER BY sticky DESC, created DESC in /usr/local/apache/drupal/includes/database.pgsql.inc on line 121.
Comment #2
jeremy commentedThis is mis-filed as a dba.module bug - but the examples given are with other modules, such as the core's blog.module, and simply viewing nodes. Moving to 'Drupal' project, 'postgresql database' component. Marking as 'bug report'. (It's not clear what version of what modules are being used, though it was marked as a 4.4.2 bug)
Comment #3
jeremy commentedSwitching back to cvs version against which it was originally filed.
Comment #4
killes@www.drop.org commentedIt appears to me that you have some contrib module sinstalled which might be buggy. I did not find the queries in the Drupal core. Please send a list of modules.
Comment #5
(not verified) commentedAre you sure you're running an up-to-date version of 4.5? Although these queries look vaguely familiar, I think they've been changed / fixed several months ago. Make sure you replace all 4.4 files with the new 4.5 ones... also, see if you can reproduce the problem with a clean install. That would rule out any old files accidentially left hanging around.
As killes suggested, these bad queries might still exist in a contributed module. A list of any you're using would also be helpful.
Comment #6
erwin commentedIt seems that taxonomy_context is the touble maker here.
I'm using the latest version from cvs, the version information is like :
// $Id: taxonomy_context.module,v 1.26 2004/10/01 00:08:36 uwe Exp $
If I remove this module it seems that all sql errors are gone.
The aggregator module stil has an error.
warning: pg_query(): Query failed: ERROR: Attribute f.title must be GROUPed or used in an aggregate function
. in /usr/local/apache/drupal/includes/database.pgsql.inc on line 104.
user error:
query: SELECT f.fid, f.title, f.description, f.image, MAX(i.timestamp) AS last FROM aggregator_feed f LEFT JOIN aggregator_item i ON f.fid = i.fid GROUP BY f.fid in /usr/local/apache/drupal/includes/database.pgsql.inc on line 121.
and can be solved by the following line
SELECT f.fid, f.title, f.description, f.image, MAX(i.timestamp) AS last FROM aggregator_feed f LEFT JOIN aggregator_item i ON f.fid = i.fid GROUP BY f.fid, f.title, f.description, f.image
Comment #7
dries commentedI moved this bug report to the 'taxonomy_content' project.
Comment #8
nedjoThis is likely a duplicate of http://drupal.org/node/11337, "SQL error for anonymous users", which has been fixed in the 4.5 release (though the changes hadn't been merged into the head version).
Comment #9
(not verified) commentedI'm not sure whether this is the same problem or a different one, but i was receiving errors like these:
warning: pg_query(): Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /var/www/drupal/includes/database.pgsql.inc on line 104.
user error:
query: SELECT DISTINCT(n.nid), n.title, n.teaser, n.sticky FROM node n LEFT JOIN term_node r ON n.nid = r.nid LEFT JOIN users u ON n.uid = u.uid WHERE r.tid = 4 AND n.status = '1' AND '1' ORDER BY n.sticky DESC, n.created DESC in /var/www/drupal/includes/database.pgsql.inc on line 121.
This appears to be a very similar problem to that described in http://drupal.org/node/12250, and i fixed it with the attached patch.
Comment #10
paulgear commentedWhoops - wasn't logged in. You can contact me via this login if you need any further information about the errors or the patch...
Comment #11
paulgear commentedSorry - that was a bit cut off, wasn't it? :-)