Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2022-10-04 03:00:20 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2022-10-04 03:00:20 +0300
commit9cdf0b1cd9bcd876a5ea2f6b83b8362f27c3566d (patch)
tree6f9370c29d99e5345ba19cb8a1cbd29b4419d056
parent6e14811a0512955e83f4afb1f0f4c4e86c3803fa (diff)
parenta3926fc48cfff779c713f0a4ada41e99a9e40a43 (diff)
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r--ChangeLog1
-rw-r--r--libraries/classes/Query/Compatibility.php14
-rw-r--r--libraries/classes/Types.php12
-rw-r--r--libraries/classes/Util.php11
-rw-r--r--test/classes/UtilTest.php15
5 files changed, 52 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6355d5f3e6..cf1f559d04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,7 @@ phpMyAdmin - ChangeLog
- issue #17369 Fix server error when blowfish_secret is not exactly 32 bytes long
- issue #17736 Add utf8mb3 as an alias of utf8 on the charset description page
- issue #16418 Fix FAQ 1.44 about manually removing vendor folders
+- issue #12359 Setup page now sends the Content-Security-Policy headers
5.2.0 (2022-05-10)
- issue #16521 Upgrade Bootstrap to version 5
diff --git a/libraries/classes/Query/Compatibility.php b/libraries/classes/Query/Compatibility.php
index aa1ab6829f..5f995951f6 100644
--- a/libraries/classes/Query/Compatibility.php
+++ b/libraries/classes/Query/Compatibility.php
@@ -214,6 +214,20 @@ class Compatibility
}
/**
+ * Returns whether the database server supports compressed columns
+ */
+ public static function supportsCompressedColumns(int $serverVersion): bool
+ {
+ // @see https://mariadb.com/kb/en/innodb-page-compression/#comment_1992
+ // Comment: Page compression is only available in MariaDB >= 10.1. [...]
+ if (self::isMariaDb()) {
+ return $serverVersion >= 100100;
+ }
+
+ return false;
+ }
+
+ /**
* @see https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-6.html#mysqld-5-7-6-account-management
* @see https://mariadb.com/kb/en/mariadb-1042-release-notes/#notable-changes
*
diff --git a/libraries/classes/Types.php b/libraries/classes/Types.php
index 12f7a7e4cf..4c2b2eeb78 100644
--- a/libraries/classes/Types.php
+++ b/libraries/classes/Types.php
@@ -7,6 +7,8 @@ declare(strict_types=1);
namespace PhpMyAdmin;
+use PhpMyAdmin\Query\Compatibility;
+
use function __;
use function _pgettext;
use function array_diff;
@@ -713,13 +715,21 @@ class Types
*/
public function getAttributes()
{
- return [
+ $serverVersion = $this->dbi->getVersion();
+
+ $attributes = [
'',
'BINARY',
'UNSIGNED',
'UNSIGNED ZEROFILL',
'on update CURRENT_TIMESTAMP',
];
+
+ if (Compatibility::supportsCompressedColumns($serverVersion)) {
+ $attributes[] = 'COMPRESSED=zlib';
+ }
+
+ return $attributes;
}
/**
diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php
index 6cd6342ecf..f6df6466a7 100644
--- a/libraries/classes/Util.php
+++ b/libraries/classes/Util.php
@@ -1320,6 +1320,7 @@ class Util
$binary = false;
$unsigned = false;
$zerofill = false;
+ $compressed = false;
} else {
$enumSetValues = [];
@@ -1341,6 +1342,8 @@ class Util
$zerofill = ($zerofillCount > 0);
$printType = (string) preg_replace('@unsigned@', '', $printType, -1, $unsignedCount);
$unsigned = ($unsignedCount > 0);
+ $printType = (string) preg_replace('@\/\*!100301 compressed\*\/@', '', $printType, -1, $compressedCount);
+ $compressed = ($compressedCount > 0);
$printType = trim($printType);
}
@@ -1357,6 +1360,14 @@ class Util
$attribute = 'UNSIGNED ZEROFILL';
}
+ if ($compressed) {
+ // With InnoDB page compression, multiple compression algorithms are supported.
+ // In contrast, with InnoDB's COMPRESSED row format, zlib is the only supported compression algorithm.
+ // This means that the COMPRESSED row format has less compression options than InnoDB page compression does.
+ // @see https://mariadb.com/kb/en/innodb-page-compression/#comparison-with-the-compressed-row-format
+ $attribute = 'COMPRESSED=zlib';
+ }
+
$canContainCollation = false;
if (! $binary && preg_match('@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@', $type)) {
$canContainCollation = true;
diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php
index 6e5e315474..d833c01b1b 100644
--- a/test/classes/UtilTest.php
+++ b/test/classes/UtilTest.php
@@ -685,6 +685,21 @@ class UtilTest extends AbstractTestCase
'displayed_type' => 'varbinary(255)',
],
],
+ [
+ 'varchar(11) /*!100301 COMPRESSED*/',
+ [
+ 'type' => 'varchar',
+ 'print_type' => 'varchar(11)',
+ 'binary' => false,
+ 'unsigned' => false,
+ 'zerofill' => false,
+ 'spec_in_brackets' => '11',
+ 'enum_set_values' => [],
+ 'attribute' => 'COMPRESSED=zlib',
+ 'can_contain_collation' => true,
+ 'displayed_type' => 'varchar(11)',
+ ],
+ ],
];
}