PostgreSQL Bug

Want to share what MODs you've gotten to work with EM? Happy about all the time your're saving? Want to say "thanks"? Here's the place.
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

PostgreSQL Bug

Post by GPHemsley »

I think this is more of a bug than anything else, but I can't post in the Bug Tracker forum, so oh well. Anyway, here goes....

arrow I was browsing through the SQL code for EasyMOD, and I noticed the following

Code: Select all

$sql[] = \\"CREATE SEQUENCE \\" . EASYMOD_TABLE . \\"_mod_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1\\" ;

			$sql[] = \\"CREATE TABLE \\" . EASYMOD_TABLE . \\" (
				mod_id int4 NOT NULL DEFAULT nextval('phpbb_easymod_mod_id_seq'text),
				CONSTRAINT PK_phpbb_easymod PRIMARY KEY (mod_id),
(Code continues, but this is enough for my point.)

As you can see, the created sequence is properly named

Code: Select all

EASYMOD_TABLE . \\"_mod_id_seq
but when referred to for auto increment, it is called

Code: Select all

phpbb_easymod_mod_id_seq
. Now if someone uses PostgreSQL and doesn't use the phpbb_ prefix, then EasyMOD will not install correctly (AFAICT).

Cursed 2.2 bugs. :x [/size:]

morpheus2matrix
Registered User
Posts: 82
Joined: Sun Mar 02, 2003 11:54 am
Contact:

Re: PostgreSQL Bug

Post by morpheus2matrix »

yes, this could be a bug if the prefix of the tables is not phpbb_
phpBB MOD-Team Member - Check my MOD's

Support For my MOD's

Attachment MOD User Guide || Log Actions MOD User Guide

No support by PM/Email - Thanks - You want to help me ? Click here

User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: PostgreSQL Bug

Post by GPHemsley »

I was posting more as a message to Nuttzy than anything else, but thanks for the confirmation. ;)

User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: PostgreSQL Bug

Post by GPHemsley »

Reposted because the BBCode works again. :mrgreen:
GPHemsley wrote:I think this is more of a bug than anything else, but I can't post in the Bug Tracker forum, so oh well. Anyway, here goes....

arrow I was browsing through the SQL code for EasyMOD, and I noticed the following

Code: Select all

$sql[] = "CREATE SEQUENCE " . EASYMOD_TABLE . "_mod_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1" ;

			$sql[] = "CREATE TABLE " . EASYMOD_TABLE . " (
				mod_id int4 NOT NULL DEFAULT nextval('phpbb_easymod_mod_id_seq'text),
				CONSTRAINT PK_phpbb_easymod PRIMARY KEY (mod_id),
(Code continues, but this is enough for my point.)

As you can see, the created sequence is properly named

Code: Select all

EASYMOD_TABLE . "_mod_id_seq
but when referred to for auto increment, it is called

Code: Select all

phpbb_easymod_mod_id_seq
. Now if someone uses PostgreSQL and doesn't use the phpbb_ prefix, then EasyMOD will not install correctly (AFAICT).

Cursed 2.2 bugs. :x

morpheus2matrix
Registered User
Posts: 82
Joined: Sun Mar 02, 2003 11:54 am
Contact:

Re: PostgreSQL Bug

Post by morpheus2matrix »

correct code should be :

Code: Select all

$sql[] = "CREATE SEQUENCE " . EASYMOD_TABLE . "_mod_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1" ;

         $sql[] = "CREATE TABLE " . EASYMOD_TABLE . " (
            mod_id int4 NOT NULL DEFAULT nextval('" . EASYMOD_TABLE . "_mod_id_seq'text),
            CONSTRAINT PK_" . EASYMOD_TABLE . " PRIMARY KEY (mod_id),
i think but i'm not sure (i don't know PostgreSQL :? )
phpBB MOD-Team Member - Check my MOD's

Support For my MOD's

Attachment MOD User Guide || Log Actions MOD User Guide

No support by PM/Email - Thanks - You want to help me ? Click here

User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: PostgreSQL Bug

Post by GPHemsley »

Yeah, that seems about right. 8)

morpheus2matrix
Registered User
Posts: 82
Joined: Sun Mar 02, 2003 11:54 am
Contact:

Re: PostgreSQL Bug

Post by morpheus2matrix »

Cool :P
phpBB MOD-Team Member - Check my MOD's

Support For my MOD's

Attachment MOD User Guide || Log Actions MOD User Guide

No support by PM/Email - Thanks - You want to help me ? Click here

Xore
Registered User
Posts: 80
Joined: Mon Jul 21, 2003 11:44 pm
Location: The desert
Contact:

Re: PostgreSQL Bug

Post by Xore »

to be honest, i don't think it matters. it's a constraint name, not the name of a table anyone will get confused over, or cause code to bork.

Has anyone actually experienced problems with this "bug" ?

Edit: actually, i'm partially mistaken here. I didn't realize there were two statements. As long as both statements use the same standard, it shouldn't matter if it's phpbb_ or some other user-defined prefix stored in the constant.

Locked