From cda610d3af3e287bc15909ccdfbab15b8f3e7ecf Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Tue, 16 Feb 2021 22:22:26 +0000
Subject: [PATCH] Remove two hopefully unnecessary HyperDB patches

---
 composer.patches.json                       |  2 --
 patches/hyperdb/0126-awful-workaround.patch | 32 ---------------------
 patches/hyperdb/show-tables-like.patch      | 17 -----------
 3 files changed, 51 deletions(-)
 delete mode 100644 patches/hyperdb/0126-awful-workaround.patch
 delete mode 100644 patches/hyperdb/show-tables-like.patch

diff --git a/composer.patches.json b/composer.patches.json
index fafa5cee..80d1f384 100644
--- a/composer.patches.json
+++ b/composer.patches.json
@@ -18,9 +18,7 @@
         },
         "wpackagist-plugin/hyperdb": {
 	    "A few fixes to the global wpdb_hash instance (moved into wpdb)": "patches/hyperdb/0106-a-few-fixes-to-the-global-wpdb_hash-instance-moved-i.patch",
-	    "Awful workaround (?)": "patches/hyperdb/0126-awful-workaround.patch",
 	    "Added optional logging": "patches/hyperdb/0158-Added-optional-logging.patch",
-	    "Add support for SHOW TABLES LIKE queries": "patches/hyperdb/show-tables-like.patch"
         },
         "wpackagist-plugin/more-privacy-options": {
             "Do send mail on privacy setting change": "patches/plugins/more-privacy-options.patch"
diff --git a/patches/hyperdb/0126-awful-workaround.patch b/patches/hyperdb/0126-awful-workaround.patch
deleted file mode 100644
index 86e300ad..00000000
--- a/patches/hyperdb/0126-awful-workaround.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4d3f75875c9b27016d9314cb14db1469a9b0b987 Mon Sep 17 00:00:00 2001
-From: Joe Oblivian <0blivian@insiberia.net>
-Date: Tue, 1 Nov 2011 18:32:23 +0100
-Subject: [PATCH 126/229] awful workaround
-
----
- wp-content/db.php | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/wp-content/db.php b/wp-content/db.php
-index 79c189e5..abc3353e 100644
---- a/wp-content/db.php
-+++ b/wp-content/db.php
-@@ -723,6 +723,15 @@ class hyperdb extends wpdb {
- 			$collate = null;
- 
- 		$this->set_charset($this->dbhs[$dbhname], $charset, $collate);
-+		
-+		if ( !isset( $charset ) ) 
-+			$charset = null;
-+
-+		if ( !isset( $collate ) )
-+			$collate = null;
-+
-+        // AI workaround: set all queries to latin1
-+		$this->set_charset($this->dbhs[$dbhname], 'latin1');
- 
- 		$this->dbh = $this->dbhs[$dbhname]; // needed by $wpdb->_real_escape()
- 
--- 
-2.17.1
-
diff --git a/patches/hyperdb/show-tables-like.patch b/patches/hyperdb/show-tables-like.patch
deleted file mode 100644
index 66042dd2..00000000
--- a/patches/hyperdb/show-tables-like.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/wp-content/db.php b/wp-content/db.php
-index f900d305..f819e225 100644
---- a/wp-content/db.php
-+++ b/wp-content/db.php
-@@ -306,6 +312,12 @@ class hyperdb extends wpdb {
-                                . ')\W([\w-]+)\W/is', $q, $maybe) )
-                        return $maybe[1];
- 
-+        // SHOW TABLES LIKE (used in some plugins)
-+        if ( preg_match('/^\s*'
-+                . 'SHOW\s+TABLES\s+LIKE\s+'
-+                . '\W(\w+)\W/is', $q, $maybe) )
-+            return $maybe[1];
-+
-                // Big pattern for the rest of the table-related queries in MySQL 5.0
-                if ( preg_match('/^\s*(?:'
-                                . '(?:EXPLAIN\s+(?:EXTENDED\s+)?)?SELECT.*?\s+FROM'
-- 
GitLab