Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-9062 now.

Global announcements do not work on Firebird (fix completed in vcs)

On firebird, global announcements cannot be accessed. The login box or an authorisation denied message is being displayed.

Discovered on phpBB.de: http://www.phpbb.de/community/viewtopic ... 4&t=202656

Comments / History

Changed ticket severity from "Uncategorised/normal" to "Severe"

Action performed by bantu (3.0 Release Manager) on Feb 9th 2010, 13:13

Linked ticket with changeset: r9983

Action performed by bantu (3.0 Release Manager) on Feb 9th 2010, 19:29

Posted by bantu (3.0 Release Manager) on Feb 9th 2010, 19:36

The thing is ... we select "t.*, f.*"

t.forum_id is 0 for global topics
f.forum_id can be passed via the f= parameter

Firebird sets forum_id to t.forum_id = 0
and sets forum_id_01 to f.forum_id.

Assigned ticket to user "ToonArmy"

Action performed by bantu (3.0 Release Manager) on Feb 9th 2010, 19:41

Posted by Programmiernutte on Feb 10th 2010, 13:18

Every set, t.* and f.* contains a field named FORUM_ID, while f.forum_id is the field we want.
This is asking for trouble. I wonder why this works on MySQL.

I'd recommend specifiying the exact fields you need so FORUM_ID will contain f.forum_id and there will be no forum_id_01

I did all the lazywork for you.
Just replace viewtopic.php, line 185, with:

'SELECT' => 'f.forum_last_poster_colour,f.forum_rules,f.forum_desc,f.forum_parents,f.prune_freq,f.prune_viewed,f.prune_days,f.prune_next,f.enable_prune,f.enable_icons,f.enable_indexing,f.display_on_index,f.display_subforum_list,f.forum_options,f.forum_flags,f.forum_last_post_time,f.forum_last_poster_id,f.forum_last_post_id,f.forum_topics_real,f.forum_topics,f.forum_posts,f.forum_status,f.forum_type,f.forum_topics_per_page,f.forum_rules_options,f.forum_style,f.forum_desc_options,f.right_id,f.left_id,f.parent_id,f.forum_id,f.forum_last_poster_name,f.forum_last_post_subject,f.forum_rules_uid,f.forum_rules_link,f.forum_password,f.forum_link,f.forum_desc_uid,f.forum_name,f.forum_rules_bitfield,f.forum_image,f.forum_desc_bitfield, t.topic_last_poster_colour,t.topic_first_poster_colour,t.poll_vote_change,t.poll_last_vote,t.poll_max_options,t.poll_length,t.poll_start,t.topic_bumper,t.topic_bumped,t.topic_moved_id,t.topic_last_view_time,t.topic_last_post_time,t.topic_last_poster_id,t.topic_last_post_id,t.topic_first_post_id,t.topic_type,t.topic_status,t.topic_replies_real,t.topic_replies,t.topic_views,t.topic_time_limit,t.topic_time,t.topic_poster,t.topic_reported,t.topic_approved,t.topic_attachment,t.icon_id,t.topic_id,t.poll_title,t.topic_last_post_subject,t.topic_last_poster_name,t.topic_first_poster_name,t.topic_title',

Posted by bantu (3.0 Release Manager) on Feb 10th 2010, 13:32

I guess we do want to use SELECT t.*, f.*

Posted by Programmiernutte on Feb 10th 2010, 13:39

Then do at least "select f.*, t.*" to make the "real" forum_id go into the array index "FORUM_ID".

It would remove the symptom, but not the cause, which is a nameclash between the two FORUM_ID-Fields which can be resolved by not selecting the one you don't need.

Posted by bantu (3.0 Release Manager) on Feb 10th 2010, 13:42

f.*, t.* doesn't work on other DBMSes.

Posted by Programmiernutte on Feb 10th 2010, 13:46

I see. I'm still opting for avoiding that nameclash at all.

Posted by bantu (3.0 Release Manager) on Feb 10th 2010, 13:49

I wonder what the SQL specifications say about this. Any bug reports against Firebird?

Posted by Programmiernutte on Feb 10th 2010, 13:58

Don't know about SQL specs here. I think it's okay to have same field identifiers in a result set as long as they are prefixed with a table alias. Otherwise the query would not execute at all.

I'd say, it's the PHP-Firebird-Driver. If it is a bug after all.
My guess is that each PHP-Database-Driver might behave differently in resolving such situations. This could be the reason that f.*, t.* doesn't work on other DBMSes.

I'm gonna do some research here.

Ticket details

Related SVN changesets