From 3f9fc232708ac1632de159116d06473ea2750e87 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 11 May 2024 18:08:57 +0100 Subject: Remove some unnecessary advice. --- data/example.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/data/example.conf b/data/example.conf index 1ccadcd31..043fa4366 100644 --- a/data/example.conf +++ b/data/example.conf @@ -1153,11 +1153,6 @@ module * This is only useful with very large databases, with hundreds * of thousands of objects, that have a noticeable delay from * writing databases. - * - * If your database is large enough cause a noticeable delay when - * saving you should consider a more powerful alternative such - * as db_sql or db_redis, which incrementally update their - * databases asynchronously in real time. */ fork = no } -- cgit From 05e6df23a2d7df4bb1e2abba296433b4395c2c44 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 16 May 2024 16:50:41 +0100 Subject: Mark boolean columns as DT_INT in bs_kick. --- modules/commands/bs_kick.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 185fdaa9c..9e4e135b2 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -51,17 +51,16 @@ struct KickerDataImpl : KickerData if (kd == NULL) return; - data["kickerdata:amsgs"] << kd->amsgs; - data["kickerdata:badwords"] << kd->badwords; - data["kickerdata:bolds"] << kd->bolds; - data["kickerdata:caps"] << kd->caps; - data["kickerdata:colors"] << kd->colors; - data["kickerdata:flood"] << kd->flood; - data["kickerdata:italics"] << kd->italics; - data["kickerdata:repeat"] << kd->repeat; - data["kickerdata:reverses"] << kd->reverses; - data["kickerdata:underlines"] << kd->underlines; - + data.SetType("kickerdata:amsgs", Serialize::Data::DT_INT); data["kickerdata:amsgs"] << kd->amsgs; + data.SetType("kickerdata:badwords", Serialize::Data::DT_INT); data["kickerdata:badwords"] << kd->badwords; + data.SetType("kickerdata:bolds", Serialize::Data::DT_INT); data["kickerdata:bolds"] << kd->bolds; + data.SetType("kickerdata:caps", Serialize::Data::DT_INT); data["kickerdata:caps"] << kd->caps; + data.SetType("kickerdata:colors", Serialize::Data::DT_INT); data["kickerdata:colors"] << kd->colors; + data.SetType("kickerdata:flood", Serialize::Data::DT_INT); data["kickerdata:flood"] << kd->flood; + data.SetType("kickerdata:italics", Serialize::Data::DT_INT); data["kickerdata:italics"] << kd->italics; + data.SetType("kickerdata:repeat", Serialize::Data::DT_INT); data["kickerdata:repeat"] << kd->repeat; + data.SetType("kickerdata:reverses", Serialize::Data::DT_INT); data["kickerdata:reverses"] << kd->reverses; + data.SetType("kickerdata:underlines", Serialize::Data::DT_INT); data["kickerdata:underlines"] << kd->underlines; data.SetType("capsmin", Serialize::Data::DT_INT); data["capsmin"] << kd->capsmin; data.SetType("capspercent", Serialize::Data::DT_INT); data["capspercent"] << kd->capspercent; data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines; -- cgit From a9e9ac32a0837ba86b25374a5fa2e685f9e73bdf Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 16 May 2024 17:11:22 +0100 Subject: Store boolean extension items as DT_INT. --- include/extensible.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/extensible.h b/include/extensible.h index f28e52f27..0b3b1f1f4 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -190,6 +190,7 @@ class SerializableExtensibleItem : public PrimitiveExtensibleItem void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override { + data.SetType(this->name, Serialize::Data::DT_INT); data[this->name] << true; } -- cgit From da99a53dfac278cdf5ca37f7f104fb2c9aa58336 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 16 May 2024 17:12:50 +0100 Subject: Don't specify a width for DT_INT columns. This isn't actually used by MySQL for the column width. --- modules/extra/m_mysql.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 85b18f151..82e2873b8 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -400,7 +400,7 @@ std::vector MySQLService::CreateTable(const Anope::string &table, const D query_text += ", `" + it->first + "` "; if (data.GetType(it->first) == Serialize::Data::DT_INT) - query_text += "int(11)"; + query_text += "int"; else query_text += "text"; } @@ -417,7 +417,7 @@ std::vector MySQLService::CreateTable(const Anope::string &table, const D Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + it->first + "` "; if (data.GetType(it->first) == Serialize::Data::DT_INT) - query_text += "int(11)"; + query_text += "int"; else query_text += "text"; -- cgit From 8bb83f6b1a667121ba68f5c191b9f953af6f22bd Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 16 May 2024 17:13:47 +0100 Subject: Explicitly specify ROW_FORMAT=DYNAMIC when creating tables. Resolves the issues some people were having with extremely wide rows. --- modules/extra/m_mysql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 82e2873b8..bb9ee8444 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -404,7 +404,7 @@ std::vector MySQLService::CreateTable(const Anope::string &table, const D else query_text += "text"; } - query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`))"; + query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC"; queries.push_back(query_text); } else -- cgit