diff options
author | Sadie Powell <sadie@witchery.services> | 2024-11-08 13:21:06 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-11-08 13:21:06 +0000 |
commit | b6e4c7302ed45c59f6bb7e28a5281a7dd73be4d0 (patch) | |
tree | c97cefdbf7dc67cc87d7cc07711dbf73160229a6 /modules | |
parent | b7590e20c116313a70e11b3b3eff19670acef479 (diff) |
Remove the integer width from chanstats and irc2sql columns.
These are ignored by MySQL so specifying them is meaningless.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/chanstats.cpp | 78 | ||||
-rw-r--r-- | modules/irc2sql/tables.cpp | 28 |
2 files changed, 53 insertions, 53 deletions
diff --git a/modules/chanstats.cpp b/modules/chanstats.cpp index 010014b48..5c7cfca62 100644 --- a/modules/chanstats.cpp +++ b/modules/chanstats.cpp @@ -278,45 +278,45 @@ class MChanstats final if (!this->HasTable(prefix +"chanstats")) { query = "CREATE TABLE `" + prefix + "chanstats` (" - "`id` int(11) NOT NULL AUTO_INCREMENT," + "`id` int NOT NULL AUTO_INCREMENT," "`chan` varchar(64) NOT NULL DEFAULT ''," "`nick` varchar(64) NOT NULL DEFAULT ''," "`type` ENUM('total', 'monthly', 'weekly', 'daily') NOT NULL," "`letters` bigint unsigned NOT NULL DEFAULT '0'," "`words` bigint unsigned NOT NULL DEFAULT '0'," - "`line` int(10) unsigned NOT NULL DEFAULT '0'," - "`actions` int(10) unsigned NOT NULL DEFAULT '0'," - "`smileys_happy` int(10) unsigned NOT NULL DEFAULT '0'," - "`smileys_sad` int(10) unsigned NOT NULL DEFAULT '0'," - "`smileys_other` int(10) unsigned NOT NULL DEFAULT '0'," - "`kicks` int(10) unsigned NOT NULL DEFAULT '0'," - "`kicked` int(10) unsigned NOT NULL DEFAULT '0'," - "`modes` int(10) unsigned NOT NULL DEFAULT '0'," - "`topics` int(10) unsigned NOT NULL DEFAULT '0'," - "`time0` int(10) unsigned NOT NULL default '0'," - "`time1` int(10) unsigned NOT NULL default '0'," - "`time2` int(10) unsigned NOT NULL default '0'," - "`time3` int(10) unsigned NOT NULL default '0'," - "`time4` int(10) unsigned NOT NULL default '0'," - "`time5` int(10) unsigned NOT NULL default '0'," - "`time6` int(10) unsigned NOT NULL default '0'," - "`time7` int(10) unsigned NOT NULL default '0'," - "`time8` int(10) unsigned NOT NULL default '0'," - "`time9` int(10) unsigned NOT NULL default '0'," - "`time10` int(10) unsigned NOT NULL default '0'," - "`time11` int(10) unsigned NOT NULL default '0'," - "`time12` int(10) unsigned NOT NULL default '0'," - "`time13` int(10) unsigned NOT NULL default '0'," - "`time14` int(10) unsigned NOT NULL default '0'," - "`time15` int(10) unsigned NOT NULL default '0'," - "`time16` int(10) unsigned NOT NULL default '0'," - "`time17` int(10) unsigned NOT NULL default '0'," - "`time18` int(10) unsigned NOT NULL default '0'," - "`time19` int(10) unsigned NOT NULL default '0'," - "`time20` int(10) unsigned NOT NULL default '0'," - "`time21` int(10) unsigned NOT NULL default '0'," - "`time22` int(10) unsigned NOT NULL default '0'," - "`time23` int(10) unsigned NOT NULL default '0'," + "`line` int unsigned NOT NULL DEFAULT '0'," + "`actions` int unsigned NOT NULL DEFAULT '0'," + "`smileys_happy` int unsigned NOT NULL DEFAULT '0'," + "`smileys_sad` int unsigned NOT NULL DEFAULT '0'," + "`smileys_other` int unsigned NOT NULL DEFAULT '0'," + "`kicks` int unsigned NOT NULL DEFAULT '0'," + "`kicked` int unsigned NOT NULL DEFAULT '0'," + "`modes` int unsigned NOT NULL DEFAULT '0'," + "`topics` int unsigned NOT NULL DEFAULT '0'," + "`time0` int unsigned NOT NULL default '0'," + "`time1` int unsigned NOT NULL default '0'," + "`time2` int unsigned NOT NULL default '0'," + "`time3` int unsigned NOT NULL default '0'," + "`time4` int unsigned NOT NULL default '0'," + "`time5` int unsigned NOT NULL default '0'," + "`time6` int unsigned NOT NULL default '0'," + "`time7` int unsigned NOT NULL default '0'," + "`time8` int unsigned NOT NULL default '0'," + "`time9` int unsigned NOT NULL default '0'," + "`time10` int unsigned NOT NULL default '0'," + "`time11` int unsigned NOT NULL default '0'," + "`time12` int unsigned NOT NULL default '0'," + "`time13` int unsigned NOT NULL default '0'," + "`time14` int unsigned NOT NULL default '0'," + "`time15` int unsigned NOT NULL default '0'," + "`time16` int unsigned NOT NULL default '0'," + "`time17` int unsigned NOT NULL default '0'," + "`time18` int unsigned NOT NULL default '0'," + "`time19` int unsigned NOT NULL default '0'," + "`time20` int unsigned NOT NULL default '0'," + "`time21` int unsigned NOT NULL default '0'," + "`time22` int unsigned NOT NULL default '0'," + "`time23` int unsigned NOT NULL default '0'," "PRIMARY KEY (`id`)," "UNIQUE KEY `chan` (`chan`,`nick`,`type`)," "KEY `nick` (`nick`)," @@ -332,9 +332,9 @@ class MChanstats final this->RunQuery(query); } query = "CREATE PROCEDURE `" + prefix + "chanstats_proc_update`" - "(chan_ VARCHAR(255), nick_ VARCHAR(255), line_ INT(10), letters_ INT(10)," - "words_ INT(10), actions_ INT(10), sm_h_ INT(10), sm_s_ INT(10), sm_o_ INT(10)," - "kicks_ INT(10), kicked_ INT(10), modes_ INT(10), topics_ INT(10))" + "(chan_ VARCHAR(255), nick_ VARCHAR(255), line_ int, letters_ int," + "words_ int, actions_ int, sm_h_ int, sm_s_ int, sm_o_ int," + "kicks_ int, kicked_ int, modes_ int, topics_ int)" "BEGIN " "DECLARE time_ VARCHAR(20);" "SET time_ = CONCAT('time', hour(now()));" @@ -368,7 +368,7 @@ class MChanstats final query = "CREATE PROCEDURE `" + prefix + "chanstats_proc_chgdisplay`" "(old_nick varchar(255), new_nick varchar(255))" "BEGIN " - "DECLARE res_count int(10) unsigned;" + "DECLARE res_count int unsigned;" "SELECT COUNT(nick) INTO res_count FROM `" + prefix + "chanstats` WHERE nick = new_nick;" "IF res_count = 0 THEN " "UPDATE `" + prefix + "chanstats` SET `nick` = new_nick WHERE `nick` = old_nick;" @@ -381,7 +381,7 @@ class MChanstats final "smileys_sad_, smileys_other_, kicks_, kicked_, modes_, topics_," "time0_, time1_, time2_, time3_, time4_, time5_, time6_, time7_, time8_, time9_," "time10_, time11_, time12_, time13_, time14_, time15_, time16_, time17_, time18_," - "time19_, time20_, time21_, time22_, time23_ INT(10) unsigned;" + "time19_, time20_, time21_, time22_, time23_ int unsigned;" "DECLARE stats_cursor CURSOR FOR " "SELECT chan, type, letters, words, line, actions, smileys_happy," "smileys_sad, smileys_other, kicks, kicked, modes, topics, time0, time1," diff --git a/modules/irc2sql/tables.cpp b/modules/irc2sql/tables.cpp index 807c7c8cd..dc7f90088 100644 --- a/modules/irc2sql/tables.cpp +++ b/modules/irc2sql/tables.cpp @@ -80,14 +80,14 @@ void IRC2SQL::CheckTables() if (!this->HasTable(prefix + "server")) { query = "CREATE TABLE `" + prefix + "server` (" - "`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT," + "`id` int UNSIGNED NOT NULL AUTO_INCREMENT," "`name` varchar(64) NOT NULL," - "`hops` tinyint(3) NOT NULL," + "`hops` tinyint NOT NULL," "`comment` varchar(255) NOT NULL," "`link_time` datetime DEFAULT NULL," "`split_time` datetime DEFAULT NULL," "`version` varchar(127) DEFAULT NULL," - "`currentusers` int(15) DEFAULT 0," + "`currentusers` int DEFAULT 0," "`online` enum('Y','N') NOT NULL DEFAULT 'Y'," "`ulined` enum('Y','N') NOT NULL DEFAULT 'N'," "PRIMARY KEY (`id`)," @@ -98,7 +98,7 @@ void IRC2SQL::CheckTables() if (!this->HasTable(prefix + "chan")) { query = "CREATE TABLE `" + prefix + "chan` (" - "`chanid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT," + "`chanid` int UNSIGNED NOT NULL AUTO_INCREMENT," "`channel` varchar(255) NOT NULL," "`topic` varchar(512) DEFAULT NULL," "`topicauthor` varchar(255) DEFAULT NULL," @@ -112,7 +112,7 @@ void IRC2SQL::CheckTables() if (!this->HasTable(prefix + "user")) { query = "CREATE TABLE `" + prefix + "user` (" - "`nickid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT," + "`nickid` int UNSIGNED NOT NULL AUTO_INCREMENT," "`nick` varchar(255) NOT NULL DEFAULT ''," "`host` varchar(255) NOT NULL DEFAULT ''," "`vhost` varchar(255) NOT NULL DEFAULT ''," @@ -127,7 +127,7 @@ void IRC2SQL::CheckTables() "`fingerprint` varchar(128) NOT NULL DEFAULT ''," "`signon` datetime DEFAULT NULL," "`server` varchar(255) NOT NULL DEFAULT ''," - "`servid` int(11) UNSIGNED NOT NULL DEFAULT '0'," + "`servid` int UNSIGNED NOT NULL DEFAULT '0'," "`uuid` varchar(32) NOT NULL DEFAULT ''," "`oper` enum('Y','N') NOT NULL DEFAULT 'N'," "`away` enum('Y','N') NOT NULL DEFAULT 'N'," @@ -147,8 +147,8 @@ void IRC2SQL::CheckTables() if (!this->HasTable(prefix + "ison")) { query = "CREATE TABLE `" + prefix + "ison` (" - "`nickid` int(11) unsigned NOT NULL default '0'," - "`chanid` int(11) unsigned NOT NULL default '0'," + "`nickid` int unsigned NOT NULL default '0'," + "`chanid` int unsigned NOT NULL default '0'," "`modes` varchar(255) NOT NULL default ''," "PRIMARY KEY (`nickid`,`chanid`)," "KEY `modes` (`modes`)" @@ -159,7 +159,7 @@ void IRC2SQL::CheckTables() { query = "CREATE TABLE `" + prefix + "maxusers` (" "`name` VARCHAR(255) NOT NULL," - "`maxusers` INT(15) NOT NULL," + "`maxusers` int NOT NULL," "`maxtime` DATETIME NOT NULL," "`lastused` DATETIME NOT NULL," "UNIQUE KEY `name` (`name`)" @@ -200,12 +200,12 @@ void IRC2SQL::CheckTables() "(nick_ varchar(255), host_ varchar(255), vhost_ varchar(255), " "chost_ varchar(255), realname_ varchar(255), ip_ varchar(255), " "ident_ varchar(255), vident_ varchar(255), account_ varchar(255), " - "secure_ enum('Y','N'), fingerprint_ varchar(255), signon_ int(15), " + "secure_ enum('Y','N'), fingerprint_ varchar(255), signon_ int, " "server_ varchar(255), uuid_ varchar(32), modes_ varchar(255), " "oper_ enum('Y','N')) " "BEGIN " - "DECLARE cur int(15);" - "DECLARE max int(15);" + "DECLARE cur int;" + "DECLARE max int;" "INSERT INTO `" + prefix + "user` " "(nick, host, vhost, chost, realname, ip, ident, vident, account, " "secure, fingerprint, signon, server, uuid, modes, oper) " @@ -304,8 +304,8 @@ void IRC2SQL::CheckTables() query = "CREATE PROCEDURE `"+ prefix + "JoinUser`" "(nick_ varchar(255), channel_ varchar(255), modes_ varchar(255)) " "BEGIN " - "DECLARE cur int(15);" - "DECLARE max int(15);" + "DECLARE cur int;" + "DECLARE max int;" "INSERT INTO `" + prefix + "ison` (nickid, chanid, modes) " "SELECT u.nickid, c.chanid, modes_ " "FROM " + prefix + "user AS u, " + prefix + "chan AS c " |