From aaf0aa5c7fe69d60f60d0a890f87a68cbf0ce49c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 15 Jan 2009 11:34:00 -0500 Subject: [PATCH] The bugfieldpermission and permission tables' mask field needs to be an int instead of smallint. Fixes bug #148. * install/schema.php: Change smallinto to int * install/upgrade18.php: Add to ALTER queries to make the change in existing installations --- docs/changes.txt | 1 + install/schema.php | 4 ++-- install/upgrade18.php | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 563139b..20dc002 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -9,6 +9,7 @@ - Fixed: #134: Column headers (defined in includes/definitions.php) were not marked with T() for translation - Change: Required custom select fields will no longer show the empty option (these fields could not be saved as empty, though, because they wouldn't validate -- this is purely an interface change) - Change: The description (first comment) is now stored in a separate variable from the rest of the comments, allowing for one to move its placement in templates/showreport.tpl +- Fixed: #148: The permission mask fields were smallint, when they should be int to hold larger int values that permission masks have 1.2.2 =============================== diff --git a/install/schema.php b/install/schema.php index ca607a5..21a4c91 100644 --- a/install/schema.php +++ b/install/schema.php @@ -107,7 +107,7 @@ CREATE TABLE " . TABLE_PREFIX . "bugfieldpermission ( usergroupid int unsigned NOT NULL, fieldid int unsigned NOT NULL, - mask smallint unsigned NOT NULL, + mask int unsigned NOT NULL, PRIMARY KEY (usergroupid, fieldid) );"; @@ -193,7 +193,7 @@ CREATE TABLE " . TABLE_PREFIX . "permission ( usergroupid int unsigned NOT NULL, productid int unsigned NOT NULL, - mask smallint NOT NULL, + mask int NOT NULL, PRIMARY KEY (usergroupid, productid) );"; diff --git a/install/upgrade18.php b/install/upgrade18.php index fd31e2e..bc55e38 100644 --- a/install/upgrade18.php +++ b/install/upgrade18.php @@ -19,7 +19,7 @@ || ################################################################### \*=====================================================================*/ -define('STOP_MARK', 1); +define('STOP_MARK', 2); define('ACTIVE_SITE', 'upgrade18.php'); require_once('./global.php'); @@ -45,6 +45,20 @@ if ($bugsys->in['mark'] == 0) if ($bugsys->in['mark'] == 1) { ?> +

Schema Fixes

+ +

Making minor schema changes so that permission mask fields are large enough for the high integer values.

+query("ALTER TABLE " . TABLE_PREFIX . "bugfieldpermission CHANGE mask mask int unsigned NOT NULL DEFAULT 0"); + $db->query("ALTER TABLE " . TABLE_PREFIX . "permission CHANGE mask mask int unsigned NOT NULL DEFAULT 0"); +} + +// ################################################################### + +if ($bugsys->in['mark'] == 2) +{ +?>

Version Number Change

This step finishes the upgrade by inreasing your version number.

-- 2.22.5