Problem reports with Drupal 5.1 and Postgresql 8.1

LeVA - April 28, 2007 - 00:25
Project:Advanced User
Version:5.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:earnie
Status:active
Description

Problem #1:

After filling in the registration form on my (Drupal 5.1) and clicking the "Create new account" button, I get the:
"Your password and further instructions have been sent to your e-mail address."
message, but with some warnings unfortunately:
* warning: pg_query() [function.pg-query]: Query failed: ERROR:
argument of OR must be type boolean, not type integer in /site/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT u.mail, u.name FROM users u LEFT JOIN
users_roles ur on u.uid = ur.uid WHERE 0 OR ur.rid = 3 in /site/includes/database.pgsql.inc on line 144.

Problem #2:
Administer / User management / Advanced managment (<< BTW, this is "managEment")

* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of AND must be type boolean, not type integer in /site/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT COUNT(*) FROM users u LEFT JOIN profile_values pv ON u.uid = pv.uid LEFT JOIN profile_fields pf on pv.fid = pf.fid WHERE u.uid > 1 AND 1 GROUP BY u.uid HAVING SUM(IF(0,1,0)) = 0 in /site/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of AND must be type boolean, not type integer in /site/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT u.* FROM users u LEFT JOIN profile_values pv ON u.uid = pv.uid LEFT JOIN profile_fields pf on pv.fid = pf.fid WHERE u.uid > 1 AND 1 GROUP BY u.uid HAVING SUM(IF(0,1,0)) = 0 ORDER BY u.login DESC LIMIT 200 OFFSET 0 in /site/includes/database.pgsql.inc on line 144.

#1

earnie - May 3, 2007 - 22:21

@LeVA: Can you check to see if this http://drupal.org/files/issues/advuser-5.x-1.x-dev.patch.txt might perchance fix the DB issues? I don't have a pgDB to test with.

#2

LeVA - May 7, 2007 - 11:18

Applied the patch, the warnings are the following now:

After the Create new account:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of OR must be type boolean, not type integer in /site/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT u.mail, u.name FROM users u LEFT JOIN users_roles ur on u.uid = ur.uid WHERE 0 OR ur.rid = 3 in /site/includes/database.pgsql.inc on line 144.

Administer / User management / Advanced managment:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of AND must be type boolean, not type integer in /sites/www.antimlm.hu/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT COUNT(*) FROM users u LEFT JOIN profile_values pv ON u.uid = pv.uid LEFT JOIN profile_fields pf on pv.fid = pf.fid WHERE u.uid > 1 AND 1 GROUP BY u.uid HAVING SUM(IF(0,1,0)) = 0 in /sites/www.antimlm.hu/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of AND must be type boolean, not type integer in /sites/www.antimlm.hu/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT u.* FROM users u LEFT JOIN profile_values pv ON u.uid = pv.uid LEFT JOIN profile_fields pf on pv.fid = pf.fid WHERE u.uid > 1 AND 1 GROUP BY u.uid HAVING SUM(IF(0,1,0)) = 0 ORDER BY u.login DESC LIMIT 200 OFFSET 0 in /sites/www.antimlm.hu/includes/database.pgsql.inc on line 144.

#3

earnie - May 7, 2007 - 13:21
Priority:normal» critical

@LeVA: Are you savvy enough to provide a patch for the Postgresql for the queries? Since I don't have pg running it will be a while for me to get to it.

#4

LeVA - May 7, 2007 - 14:48

For the first problem I can just come up with a guess, that it might be:

SELECT u.mail, u.name FROM users u LEFT JOIN users_roles ur on u.uid = ur.uid WHERE ur.uid = 0 OR ur.rid = 3
and not
SELECT u.mail, u.name FROM users u LEFT JOIN users_roles ur on u.uid = ur.uid WHERE 0 OR ur.rid = 3

But don't know what to change in the module to fix this query.

For the second problem, I don't even understand that query :)

#5

cojones - September 11, 2007 - 15:24

I too am having problems using this module with postgresql

I can help with the errors, but I need to know what the queries are supposed to be doing

I get an error on these two queries:
SELECT COUNT(*)
FROM users u
LEFT JOIN profile_values pv ON u.uid = pv.uid
LEFT JOIN profile_fields pf ON pv.fid = pf.fid
WHERE u.uid > 1
AND (u.status = 0)
AND 1
GROUP BY u.uid
HAVING SUM(IF (0, 1, 0)) = 0

SELECT u.*
FROM users u
LEFT JOIN profile_values pv ON u.uid = pv.uid
LEFT JOIN profile_fields pf ON pv.fid = pf.fid
WHERE u.uid > 1
AND (u.status = 0)
AND 1
GROUP BY u.uid
HAVING SUM(IF (0, 1, 0)) = 0
ORDER BY u.login DESC LIMIT 200 offset 0

What are the lines "AND 1" and HAVING SUM(IF (0, 1, 0)) = 0 supposed to do in those two queries
Also the LIMIT keyword is specific to MySQL

#6

earnie - September 11, 2007 - 15:46

I'm sorry, I just don't know. I've taken over maintenance from someone else and haven't spent the time to learn all of the little bits. Looks funny enough to remove to me. It's possible that some conditional PHP parts isn't efficient enough but I don't know. I don't know PG so you'll have to do what is needed. Provide a patch that works for you and we can see where that goes.

#7

earnie - March 14, 2008 - 20:06
Version:5.x-1.x-dev» 5.x-2.x-dev
Assigned to:Anonymous» earnie
 
 

Drupal is a registered trademark of Dries Buytaert.