Skip to content

Commit

Permalink
fixed wrong type for session data field in mysql, enabled feedback wh…
Browse files Browse the repository at this point in the history
…en dropping old session table during upgrade
  • Loading branch information
skodak committed Aug 30, 2006
1 parent 393e7cc commit e9d5166
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/db/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ function main_upgrade($oldversion=0) {
}

if ($oldversion < 2006082900) {
execute_sql("DROP TABLE {$CFG->prefix}sessions", false);
execute_sql("DROP TABLE {$CFG->prefix}sessions", true);
execute_sql("
CREATE TABLE {$CFG->prefix}sessions2 (
sesskey VARCHAR(64) NOT NULL default '',
Expand All @@ -2160,6 +2160,10 @@ function main_upgrade($oldversion=0) {
execute_sql("
CREATE INDEX {$CFG->prefix}sess_exp2_ix ON {$CFG->prefix}sessions2 (expireref);", true);
}

if ($oldversion < 2006083001) {
table_column('sessions2', 'sessdata', 'sessdata', 'LONGTEXT', '', '', '', '', '');
}

return $result;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/db/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ CREATE TABLE prefix_sessions2 (
expireref VARCHAR(250),
created DATETIME NOT NULL,
modified DATETIME NOT NULL,
sessdata TEXT,
sessdata LONGTEXT,
CONSTRAINT PRIMARY KEY (sesskey)
) COMMENT='Optional database session storage in new format, not used by default';

Expand Down
2 changes: 1 addition & 1 deletion lib/db/postgres7.php
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ function main_upgrade($oldversion=0) {
}

if ($oldversion < 2006082900) {
execute_sql("DROP TABLE {$CFG->prefix}sessions", false);
execute_sql("DROP TABLE {$CFG->prefix}sessions", true);
execute_sql("
CREATE TABLE {$CFG->prefix}sessions2 (
sesskey VARCHAR(255) NOT NULL default '',
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2006082900; // YYYYMMDD = date
$version = 2006083001; // YYYYMMDD = date
// XY = increments within a single day

$release = '1.7 dev'; // Human-friendly version name
Expand Down

0 comments on commit e9d5166

Please sign in to comment.