FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » SQL bug in default theme
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
SQL bug in default theme [message #34873] Tue, 21 November 2006 15:49 Go to previous message
jyoder is currently offline  jyoder   United States
Messages: 5
Registered: November 2006
Location: Michigan, USA
Karma:
Junior Member
I stumbled across this bug in 2.7.6 when trying to register a new test user on my new forum. I've never used FUDforum before so this is a fresh install using Postgres as the database.

The SQL error was a bit cryptic, but it looks like the fix is pretty simple. Basically it looks like the parenthesis in the WHILE statement got a bit mixed up. I'm pretty confident my patch fixes both cases, but the COALESCE is what executes in my case so I couldn't test both.

What I did was remove the second closing parenthesis after the COALESCE (so the >0 applies to that and not the entire WHILE statement), added a second opening parenthesis before the (g1.group_cache_opt so that I could add a closing parenthesis after the >0. Okay, maybe I shouldn't have tried to explain it in english Smile

Here's a diff between the original index.php and my patched one:

diff -ru ./forum.orig/theme/default/index.php ./forum/theme/default/index.php
--- ./forum.orig/theme/default/index.php   2006-11-21 08:26:40.000000000 -0700
+++ ./forum/theme/default/index.php    2006-11-21 08:22:43.000000000 -0700
@@ -147,7 +147,7 @@
                        ((!$is_a || $cat_id) ?  ' WHERE ' : '') .
-                       ($is_a ? '' : (_uid ? ' (mo.id IS NOT NULL OR (COALESCE(g2.group_cache_opt, g1.group_cache_opt))' : ' (g1.group_cache_opt').' & 1)>0') .
+                       ($is_a ? '' : (_uid ? ' (mo.id IS NOT NULL OR (COALESCE(g2.group_cache_opt, g1.group_cache_opt)' : ' ((g1.group_cache_opt').' & 1)>0)') .
                        ($cat_id ? ($is_a ? '' : ' AND ') . ' v.c IN('.implode(',', ($cf = $cidxc[$cat_id][5])).') ' : '').' ORDER BY v.id');

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problems with CSS after changing document root for FUDforum
Next Topic: Inbox - Sort by xxxxxxx
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 04 19:41:26 GMT 2024

Total time taken to generate the page: 0.04033 seconds