The bugfieldpermission and permission tables' mask field needs to be an int instead...
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 15 Jan 2009 16:34:00 +0000 (11:34 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 15 Jan 2009 16:34:00 +0000 (11:34 -0500)
* install/schema.php: Change smallinto to int
* install/upgrade18.php: Add to ALTER queries to make the change in existing installations

docs/changes.txt
install/schema.php
install/upgrade18.php

index 563139b3a404139ef43a0387d0a00fd9305bc34f..20dc002f1f3634b84ba88b4adf96f139ef2b11b5 100644 (file)
@@ -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
 ===============================
index ca607a525a3418639d35ae2422cf4c190c80b930..21a4c91f1a9bbe76b6afefed22fe1462d0381131 100644 (file)
@@ -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)
 );";
 
index fd31e2e8b542df58e92fa94e646be035f4dbad81..bc55e38a8d8c0fcafc39e225ccb08d86b823266d 100644 (file)
@@ -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)
 {
 ?>
+<h1>Schema Fixes</h1>
+
+<p>Making minor schema changes so that permission mask fields are large enough for the high integer values.</p>
+<?php
+       
+       $db->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)
+{
+?>
 <h1>Version Number Change</h1>
 
 <p>This step finishes the upgrade by inreasing your version number.</p>