From 9533217d82467ebfe045f36d5c696f862552e822 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 14 Nov 2020 17:21:10 +0000 Subject: [PATCH] change some mysql tables and columns character sets, this is close to patch at mantis 8707, but that is not correct. This should have no impact on current dbs. Many of those are now too large to do this change automaticl,, but they should. Some columns as utf8 (4 bytes in future) are pure waste of space, in fact some are used as indexes and can violate max index size. Namelly on groups V2, reason why we are forced to use utf8mb3 mostly likely to be dropped by new mysql/maria versions --- .../MySQL/Resources/GridUserStore.migrations | 2 +- .../MySQL/Resources/HGTravelStore.migrations | 2 +- .../MySQL/Resources/MuteListStore.migrations | 2 +- .../MySQL/Resources/UserAccount.migrations | 4 +-- .../Resources/os_groups_Store.migrations | 28 +++++++++---------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations index d08e096364..494d6a2074 100644 --- a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations +++ b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations @@ -14,7 +14,7 @@ CREATE TABLE `GridUser` ( `Login` CHAR(16) NOT NULL DEFAULT '0', `Logout` CHAR(16) NOT NULL DEFAULT '0', PRIMARY KEY (`UserID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations b/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations index 91a01c812d..62b99870cc 100644 --- a/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations +++ b/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations @@ -12,7 +12,7 @@ CREATE TABLE `hg_traveling_data` ( `TMStamp` timestamp NOT NULL, PRIMARY KEY (`SessionID`), KEY (`UserID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/MuteListStore.migrations b/OpenSim/Data/MySQL/Resources/MuteListStore.migrations index 5bde63edd8..156578bf6f 100644 --- a/OpenSim/Data/MySQL/Resources/MuteListStore.migrations +++ b/OpenSim/Data/MySQL/Resources/MuteListStore.migrations @@ -11,6 +11,6 @@ CREATE TABLE `MuteList` ( `Stamp` int(11) NOT NULL, UNIQUE KEY `AgentID_2` (`AgentID`,`MuteID`,`MuteName`), KEY `AgentID` (`AgentID`) -); +) ENGINE=InnoDB DEFAULT CHARSET=latin1; COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/UserAccount.migrations b/OpenSim/Data/MySQL/Resources/UserAccount.migrations index 98be09712e..51202092fe 100644 --- a/OpenSim/Data/MySQL/Resources/UserAccount.migrations +++ b/OpenSim/Data/MySQL/Resources/UserAccount.migrations @@ -12,13 +12,13 @@ CREATE TABLE IF NOT EXISTS `UserAccounts` ( `Created` int(11) DEFAULT NULL, `UserLevel` int(11) NOT NULL DEFAULT '0', `UserFlags` int(11) NOT NULL DEFAULT '0', - `UserTitle` varchar(64) NOT NULL DEFAULT '', + `UserTitle` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '', UNIQUE KEY `PrincipalID` (`PrincipalID`), KEY `Email` (`Email`), KEY `FirstName` (`FirstName`), KEY `LastName` (`LastName`), KEY `Name` (`FirstName`,`LastName`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations b/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations index 96f001a62b..ef797a70b7 100644 --- a/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations +++ b/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations @@ -5,8 +5,8 @@ BEGIN; CREATE TABLE `os_groups_groups` ( `GroupID` char(36) NOT NULL default '', `Location` varchar(255) NOT NULL default '', - `Name` varchar(255) NOT NULL default '', - `Charter` text NOT NULL, + `Name` varchar(255) CHARACTER SET utf8 NOT NULL default '', + `Charter` text CHARACTER SET utf8 NOT NULL, `InsigniaID` char(36) NOT NULL default '', `FounderID` char(36) NOT NULL default '', `MembershipFee` int(11) NOT NULL default '0', @@ -18,7 +18,7 @@ CREATE TABLE `os_groups_groups` ( PRIMARY KEY (`GroupID`), UNIQUE KEY `Name` (`Name`), FULLTEXT KEY `Name_2` (`Name`) -) ENGINE=MyISAM; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `os_groups_membership` ( @@ -31,19 +31,19 @@ CREATE TABLE `os_groups_membership` ( `AccessToken` char(36) NOT NULL default '', PRIMARY KEY (`GroupID`,`PrincipalID`), KEY `PrincipalID` (`PrincipalID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `os_groups_roles` ( `GroupID` char(36) NOT NULL default '', `RoleID` char(36) NOT NULL default '', - `Name` varchar(255) NOT NULL default '', - `Description` varchar(255) NOT NULL default '', - `Title` varchar(255) NOT NULL default '', + `Name` varchar(255) CHARACTER SET utf8 NOT NULL default '', + `Description` varchar(255) CHARACTER SET utf8 NOT NULL default '', + `Title` varchar(255) CHARACTER SET utf8 NOT NULL default '', `Powers` bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (`GroupID`,`RoleID`), KEY `GroupID` (`GroupID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `os_groups_rolemembership` ( @@ -52,7 +52,7 @@ CREATE TABLE `os_groups_rolemembership` ( `PrincipalID` VARCHAR(255) NOT NULL default '', PRIMARY KEY (`GroupID`,`RoleID`,`PrincipalID`), KEY `PrincipalID` (`PrincipalID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `os_groups_invites` ( @@ -63,7 +63,7 @@ CREATE TABLE `os_groups_invites` ( `TMStamp` timestamp NOT NULL, PRIMARY KEY (`InviteID`), UNIQUE KEY `PrincipalGroup` (`GroupID`,`PrincipalID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `os_groups_notices` ( @@ -71,8 +71,8 @@ CREATE TABLE `os_groups_notices` ( `NoticeID` char(36) NOT NULL default '', `TMStamp` int(10) unsigned NOT NULL default '0', `FromName` varchar(255) NOT NULL default '', - `Subject` varchar(255) NOT NULL default '', - `Message` text NOT NULL, + `Subject` varchar(255) CHARACTER SET utf8 NOT NULL default '', + `Message` text CHARACTER SET utf8 NOT NULL, `HasAttachment` int(4) NOT NULL default '0', `AttachmentType` int(4) NOT NULL default '0', `AttachmentName` varchar(128) NOT NULL default '', @@ -81,13 +81,13 @@ CREATE TABLE `os_groups_notices` ( PRIMARY KEY (`NoticeID`), KEY `GroupID` (`GroupID`), KEY `TMStamp` (`TMStamp`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `os_groups_principals` ( `PrincipalID` VARCHAR(255) NOT NULL default '', `ActiveGroupID` char(36) NOT NULL default '', PRIMARY KEY (`PrincipalID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; COMMIT;