Mark all read button does not work under PostgreSQL :
* warning: pg_query() [function.pg-query]: Query failed: ERREUR: erreur de syntaxe sur ou près de « h » LINE 1: DELETE h ^ in /home/html/manifestation-contre-hadopi/includes/database.pgsql.inc on line 139.
* user warning: ERREUR: erreur de syntaxe sur ou près de « h » LINE 1: DELETE h ^ query: DELETE h FROM history AS h INNER JOIN term_node AS tn ON (h.nid = tn.nid) INNER JOIN term_data AS td ON (td.tid = tn.tid) WHERE h.uid = 2067 AND td.vid = 2 in /home/html/manifestation-contre-hadopi/sites/all/modules/advanced_forum/advanced_forum.module on line 1090.
* warning: pg_query() [function.pg-query]: Query failed: ERREUR: la valeur d'une clé dupliquée rompt la contrainte unique « history_pkey » in /home/html/manifestation-contre-hadopi/includes/database.pgsql.inc on line 139.
* user warning: ERREUR: la valeur d'une clé dupliquée rompt la contrainte unique « history_pkey » query: INSERT INTO history (uid, nid, timestamp) SELECT DISTINCT 2067, n.nid, 1242042956 FROM node AS n INNER JOIN term_node AS tn ON n.nid=tn.nid INNER JOIN node_comment_statistics AS ncs ON ncs.nid = n.nid INNER JOIN term_data AS td ON tn.tid = td.tid WHERE (n.created > 1239450956 OR ncs.last_comment_timestamp > 1239450956) AND td.vid = 2 in /home/html/manifestation-contre-hadopi/sites/all/modules/advanced_forum/advanced_forum.module on line 1103.
PostgreSQL does not allow nested delete queries.
Instead use this SQL92 variant :
DELETE FROM foo WHERE id IN (SELECT CLAUSE).
This will work on any database system.
Please apply this patch safely.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | patch-adv-forum-pgsql-0.diff | 0 bytes | grub3 |
| advanced_forum_pgsql.diff | 1.05 KB | grub3 |
Comments
Comment #1
grub3 commentedComment #2
grub3 commentedPlease apply this patch. Seeting status to Reviewed by community.
Comment #3
michelle@jmpoure: I will. I'm not working on AF right now.
Michelle
Comment #4
michelleThis breaks the mark read functionality on MySQL. I get these errors when trying to use it after applying the patch:
Michelle
Comment #5
michelleIs anyone interested in working on this? Otherwise I'm going to won't fix it. I'm willing to support PG if I get patches that don't break MySQL but I don't have any set up to fix PG issues myself.
Michelle
Comment #6
michelleGoing to get this off my active list for now. If anyone wants to work on it, set it active again. Otherwise I'll give it a while before closing it.
Michelle
Comment #7
adzio commentedThis is bound to not work in MySQL, as documented at http://dev.mysql.com/doc/refman/5.1/en/delete.html:
Comment #8
michelleOk, no one has stepped up for this and there's an issue to fix other problems with MAR anyway, which could make this moot, so just going to close this one out.
Michelle
Comment #9
grub3 commentedCould we reopen this issue to find a suitable solution?
It seems that DELETE on JOINs require the using syntax: http://drupal.org/node/555562
I will propose a solution shortly.
Comment #10
grub3 commentedIt seems that DELETE on JOINs require the using syntax: http://drupal.org/node/555562
The correct syntax line 455 is:
I tested successfully under PostgreSQL. Please test under MySQL and apply.
Thanks !
Comment #11
grub3 commentedHere is a second patch fixing line 425.
The correct syntax is:
Comment #12
michelleThanks for the patch. I will try it out next time I work on AF.
Michelle
Comment #13
grub3 commentedAny progress, please apply, it is a safe patch.
Comment #14
michelleNo, I haven't had time to work on AF and probably won't until the end of the month. The best I can do right now is triage the queue.
Michelle
Comment #15
michelleLooking at this now and there isn't anything in the patch. Could you please repost?
Michelle
Comment #16
grub3 commentedBasically, you may use:
and
This is the correct syntax as explained in the developer doc:
http://drupal.org/node/555562
Comment #17
grub3 commentedComment #18
michelleThis gives me "user warning: Unknown table 'history' in MULTI DELETE query" which doesn't make any sense to me as history is the correct table name and the brackets are there.
Michelle
Comment #19
michelleIf someone gives me a working patch that doesn't break MySQL, I'll add it but there's not likely to be another 1.x release of AF so I'm not putting any work into it.
Michelle