Переглянути джерело

! Session ids longer than 32 chars would have problems in storing their value into the database (thanks postgre) and few other install/upgrade fixes

emanuele 12 роки тому
батько
коміт
708ce3d69a

+ 3 - 3
other/install_2-1_mysql.sql

@@ -841,7 +841,7 @@ CREATE TABLE {$db_prefix}log_errors (
   ip char(16) NOT NULL default '                ',
   url text NOT NULL,
   message text NOT NULL,
-  session char(32) NOT NULL default '                                ',
+  session char(64) NOT NULL default '                                                                ',
   error_type char(15) NOT NULL default 'general',
   file varchar(255) NOT NULL default '',
   line mediumint(8) unsigned NOT NULL default '0',
@@ -929,7 +929,7 @@ CREATE TABLE {$db_prefix}log_notify (
 #
 
 CREATE TABLE {$db_prefix}log_online (
-  session varchar(32) NOT NULL default '',
+  session varchar(64) NOT NULL default '',
   log_time int(10) NOT NULL default '0',
   id_member mediumint(8) unsigned NOT NULL default '0',
   id_spider smallint(5) unsigned NOT NULL default '0',
@@ -1813,7 +1813,7 @@ VALUES ('smfVersion', '{$smf_version}'),
 #
 
 CREATE TABLE {$db_prefix}sessions (
-  session_id char(32) NOT NULL,
+  session_id char(64) NOT NULL,
   last_update int(10) unsigned NOT NULL,
   data text NOT NULL,
   PRIMARY KEY (session_id)

+ 3 - 3
other/install_2-1_postgresql.sql

@@ -1099,7 +1099,7 @@ CREATE TABLE {$db_prefix}log_errors (
   ip varchar(16) NOT NULL default '',
   url text NOT NULL,
   message text NOT NULL,
-  session char(32) NOT NULL default '                                ',
+  session char(64) NOT NULL default '                                                                ',
   error_type varchar(15) NOT NULL default 'general',
   file varchar(255) NOT NULL,
   line int NOT NULL default '0',
@@ -1219,7 +1219,7 @@ CREATE INDEX {$db_prefix}log_notify_id_topic ON {$db_prefix}log_notify (id_topic
 #
 
 CREATE TABLE {$db_prefix}log_online (
-  session varchar(32) NOT NULL default '',
+  session varchar(64) NOT NULL default '',
   log_time int NOT NULL default '0',
   id_member int NOT NULL default '0',
   id_spider smallint NOT NULL default '0',
@@ -2302,7 +2302,7 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('avatar_paranoid', '0
 #
 
 CREATE TABLE {$db_prefix}sessions (
-  session_id char(32) NOT NULL,
+  session_id char(64) NOT NULL,
   last_update int NOT NULL,
   data text NOT NULL,
   PRIMARY KEY (session_id)

+ 3 - 3
other/install_2-1_sqlite.sql

@@ -880,7 +880,7 @@ CREATE TABLE {$db_prefix}log_errors (
   ip char(16) NOT NULL default '                ',
   url text NOT NULL,
   message text NOT NULL,
-  session char(32) NOT NULL default '                                ',
+  session char(64) NOT NULL default '                                                                ',
   error_type char(15) NOT NULL default 'general',
   file varchar(255) NOT NULL,
   line int NOT NULL default '0'
@@ -985,7 +985,7 @@ CREATE INDEX {$db_prefix}log_notify_id_topic ON {$db_prefix}log_notify (id_topic
 #
 
 CREATE TABLE {$db_prefix}log_online (
-  session varchar(32) NOT NULL default '',
+  session varchar(64) NOT NULL default '',
   log_time int(10) NOT NULL default '0',
   id_member int NOT NULL default '0',
   id_spider smallint NOT NULL default '0',
@@ -1960,7 +1960,7 @@ COMMIT;
 #
 
 CREATE TABLE {$db_prefix}sessions (
-  session_id char(32) NOT NULL,
+  session_id char(64) NOT NULL,
   last_update int NOT NULL,
   data text NOT NULL,
   PRIMARY KEY (session_id)

+ 22 - 8
other/upgrade_2-1_mysql.sql

@@ -112,14 +112,14 @@ ADD COLUMN ip_high8 smallint(255) unsigned NOT NULL DEFAULT '0';
 
 ---# Changing existing columns to ban items...
 ALTER TABLE {$db_prefix}ban_items
-CHANGE ip_low1 ip_low1 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high1 ip_high1 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low2 ip_low2 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high2 ip_high2 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low3 ip_low3 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high3 ip_high3 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low4 ip_low4 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high4 ip_high4 tinyint(3) unsigned NOT NULL DEFAULT '0';
+CHANGE ip_low1 ip_low1 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high1 ip_high1 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low2 ip_low2 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high2 ip_high2 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low3 ip_low3 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high3 ip_high3 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low4 ip_low4 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high4 ip_high4 smallint(255) unsigned NOT NULL DEFAULT '0';
 ---#
 
 /******************************************************************************/
@@ -130,6 +130,20 @@ ALTER TABLE {$db_prefix}log_packages
 ADD COLUMN credits varchar(255) NOT NULL DEFAULT '';
 ---#
 
+/******************************************************************************/
+--- Adding more space for session ids
+/******************************************************************************/
+---# Altering the session_id columns...
+ALTER TABLE {$db_prefix}log_online
+CHANGE `session` varchar(64) NOT NULL DEFAULT '';
+
+ALTER TABLE {$db_prefix}log_errors
+CHANGE `session` char(64) NOT NULL default '                                                                ';
+
+ALTER TABLE {$db_prefix}sessions
+CHANGE `session_id` char(64) NOT NULL default '';
+---#
+
 /******************************************************************************/
 --- Adding new scheduled tasts
 /******************************************************************************/

+ 22 - 8
other/upgrade_2-1_postgresql.sql

@@ -116,14 +116,14 @@ ADD COLUMN ip_high8 smallint(255) unsigned NOT NULL DEFAULT '0';
 
 ---# Changing existing columns to ban items...
 ALTER TABLE {$db_prefix}ban_items
-CHANGE ip_low1 ip_low1 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high1 ip_high1 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low2 ip_low2 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high2 ip_high2 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low3 ip_low3 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high3 ip_high3 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low4 ip_low4 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high4 ip_high4 tinyint(3) unsigned NOT NULL DEFAULT '0';
+CHANGE ip_low1 ip_low1 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high1 ip_high1 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low2 ip_low2 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high2 ip_high2 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low3 ip_low3 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high3 ip_high3 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low4 ip_low4 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high4 ip_high4 smallint(255) unsigned NOT NULL DEFAULT '0';
 ---#
 
 /******************************************************************************/
@@ -134,6 +134,20 @@ ALTER TABLE {$db_prefix}log_packages
 ADD COLUMN credits varchar(255) NOT NULL DEFAULT '';
 ---#
 
+/******************************************************************************/
+--- Adding more space for session ids
+/******************************************************************************/
+---# Altering the session_id columns...
+ALTER TABLE {$db_prefix}log_online
+CHANGE `session` varchar(64) NOT NULL DEFAULT '';
+
+ALTER TABLE {$db_prefix}log_errors
+CHANGE `session` char(64) NOT NULL default '                                                                ';
+
+ALTER TABLE {$db_prefix}sessions
+CHANGE `session_id` char(64) NOT NULL default '';
+---#
+
 /******************************************************************************/
 --- Adding new scheduled tasts
 /******************************************************************************/

+ 22 - 8
other/upgrade_2-1_sqlite.sql

@@ -112,14 +112,14 @@ ADD COLUMN ip_high8 smallint(255) unsigned NOT NULL DEFAULT '0';
 
 ---# Changing existing columns to ban items...
 ALTER TABLE {$db_prefix}ban_items
-CHANGE ip_low1 ip_low1 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high1 ip_high1 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low2 ip_low2 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high2 ip_high2 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low3 ip_low3 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high3 ip_high3 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_low4 ip_low4 tinyint(3) unsigned NOT NULL DEFAULT '0',
-CHANGE ip_high4 ip_high4 tinyint(3) unsigned NOT NULL DEFAULT '0';
+CHANGE ip_low1 ip_low1 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high1 ip_high1 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low2 ip_low2 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high2 ip_high2 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low3 ip_low3 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high3 ip_high3 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_low4 ip_low4 smallint(255) unsigned NOT NULL DEFAULT '0',
+CHANGE ip_high4 ip_high4 smallint(255) unsigned NOT NULL DEFAULT '0';
 ---#
 
 /******************************************************************************/
@@ -130,6 +130,20 @@ ALTER TABLE {$db_prefix}log_packages
 ADD COLUMN credits varchar(255) NOT NULL DEFAULT '';
 ---#
 
+/******************************************************************************/
+--- Adding more space for session ids
+/******************************************************************************/
+---# Altering the session_id columns...
+ALTER TABLE {$db_prefix}log_online
+CHANGE `session` varchar(64) NOT NULL DEFAULT '';
+
+ALTER TABLE {$db_prefix}log_errors
+CHANGE `session` char(64) NOT NULL default '                                                                ';
+
+ALTER TABLE {$db_prefix}sessions
+CHANGE `session_id` char(64) NOT NULL default '';
+---#
+
 /******************************************************************************/
 --- Adding new scheduled tasts
 /******************************************************************************/