Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 MySQL: DEFAULT value for auto_increment fields
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 25 September 2004 :  23:44:29  Show Profile
During the setup of the Snitz Forum tables using mysql, the auto_increment fields for each table has a DEFAULT value of ''. MySQL didn't give an error about this in older versions, but newer versions of the database server is complaining about it.

Auto_increment fields do no need a DEFAULT value set in MySQL. And not to mention, auto_increment fields are INTEGERs so a value of '' would be invalid.

Newer versions of the mysql database gives an error about the DEFAULT value.

Error: -2147467259 [MySQL][ODBC 3.51 Driver][mysqld-4.1.4-gamma-nt]Invalid default value for 'CAT_ID'
strSql: CREATE TABLE FORUM_CATEGORY ( CAT_ID INT (11) DEFAULT '' NOT NULL auto_increment, CAT_STATUS SMALLINT (6) DEFAULT '1' NOT NULL , CAT_NAME VARCHAR (100) DEFAULT '', CAT_MODERATION int (11) DEFAULT '0', CAT_SUBSCRIPTION int (11) DEFAULT '0', CAT_ORDER int (11) DEFAULT '1', PRIMARY KEY (CAT_ID), KEY FORUM_CATEGORY_CAT_ID(CAT_ID), KEY FORUM_CATEGORY_CAT_STATUS (CAT_STATUS) )

So I would suggest removing the DEFAULT '' from all auto_increment fields in inc_create_forum_mysql.asp

For example, the code in red should be removed:
strSql = "CREATE TABLE " & strTablePrefix & "CATEGORY ( "
strSql = strSql & "CAT_ID INT (11) DEFAULT '' NOT NULL auto_increment, "
strSql = strSql & "CAT_STATUS SMALLINT (6) DEFAULT '1' NOT NULL , "
strSql = strSql & "CAT_NAME VARCHAR (100) DEFAULT '', "
strSql = strSql & "CAT_MODERATION int (11) DEFAULT '0', "
strSql = strSql & "CAT_SUBSCRIPTION int (11) DEFAULT '0', "
strSql = strSql & "CAT_ORDER int (11) DEFAULT '1', "
strSql = strSql & "PRIMARY KEY (CAT_ID), "
strSql = strSql & "KEY " & strTablePrefix & "CATEGORY_CAT_ID(CAT_ID), "
strSql = strSql & "KEY " & strTablePrefix & "CATEGORY_CAT_STATUS (CAT_STATUS) )"

Support Snitz Forums

Edited by - Davio on 25 September 2004 23:47:40

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 29 September 2004 :  12:48:26  Show Profile
fixed in v3.4.05
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07