Ticket #3355 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

phpBB table prefix

Reported by: esycat Assigned to: pacopablo
Priority: normal Component: PhpBbAuthPlugin
Severity: normal Keywords: database, options
Cc: Trac Release: 0.11

Description

Currently the name of phpBB users table is hardcoded in all SQL queries with default prefix. I believe, it should be an option, that allows set this prefix.

Attachments

3355_table_prefix.patch (2.5 kB) - added by pacopablo on 07/19/08 12:04:52.
Patch to allow specifying of the table prefix for PhpBB tables

Change History

(follow-up: ↓ 2 ) 07/09/08 10:00:05 changed by pacopablo

  • status changed from new to assigned.

I'll admit to not being a phpBB expert, but does phpBB actually allow you to rename or specify which table is the users table? Do you have a specific use case for this?

(in reply to: ↑ 1 ; follow-up: ↓ 3 ) 07/09/08 10:55:51 changed by esycat

Replying to pacopablo:

You can't change main part of the table names (e. g. "users", "posts"), but prefix "phpbb_" is customizable.

Usually prefix is used in order to names of tables from one project don't overlap with tables from others. But I, for example, have a separate database for forums, therefore during the installation I've set empty prefix, and tables are called just "users" and "posts" without "phpbb_".

07/19/08 12:04:52 changed by pacopablo

  • attachment 3355_table_prefix.patch added.

Patch to allow specifying of the table prefix for PhpBB tables

(in reply to: ↑ 2 ) 07/19/08 12:07:21 changed by pacopablo

Replying to esycat:

Replying to pacopablo: You can't change main part of the table names (e. g. "users", "posts"), but prefix "phpbb_" is customizable. Usually prefix is used in order to names of tables from one project don't overlap with tables from others. But I, for example, have a separate database for forums, therefore during the installation I've set empty prefix, and tables are called just "users" and "posts" without "phpbb_".

OK, I just attached a patch that adds the ini option: phpbb_table_prefix to the [account-manager] section. In there you can specify whatever prefix you want, or leave it blank if you don't want. By default I have it set to phpbb_ which should preserve existing behavior.

Will you please test it out and let me know how it works?

(follow-up: ↓ 5 ) 07/19/08 23:48:43 changed by esycat

Works correctly, thanks. One note — default prefix must be fully in lower case.

(in reply to: ↑ 4 ) 07/20/08 00:45:46 changed by pacopablo

Replying to esycat:

Works correctly, thanks. One note — default prefix must be fully in lower case.

Does phpBB lowercase the prefix? Am I guaranteed to never have a mixed case prefix? If so, I can change the patch fairly easily to always force a lowercase prefix.

07/20/08 00:57:42 changed by esycat

No, I mean that default prefix is "phpbb_", not "phpBB_". User might use any case.

I propose change this line in the patch:

+    table_prefix = Option('account-manager', 'phpbb_table_prefix', 'phpBB_',

with:

+    table_prefix = Option('account-manager', 'phpbb_table_prefix', 'phpbb_',

07/20/08 01:08:47 changed by pacopablo

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [4041])

  • Fixes #3355 - Indeed the default prefix should have been lowercase. This is fixed in the applied patch. Thanks for the report and the suggestion.

Add/Change #3355 (phpBB table prefix)




Change Properties
Action