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:35:37 +0000 (11:35 -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 f9e668e4f80f509e1cc4a79e1949ecf7f67aad87..b47ed8076ee4b366408b06666e81a00cbb4cf329 100644 (file)
@@ -5,6 +5,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 10a3401161976f1399147b475a52ac0127a6c157..fd25b1cbedd2d9a423780d06f650361721cb8895 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>