From e0c204e9712716af3a6ef65d13b6683fdd8d0413 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 15 Feb 2020 01:22:04 +0100 Subject: [PATCH 1/6] Fix CR vs CRLF issue for testGetPageBufferpool on Windows Signed-off-by: William Desportes --- test/classes/Engines/InnodbTest.php | 150 ++++++++++++++-------------- 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/test/classes/Engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php index 10e72bd2bd..2e32a66acc 100644 --- a/test/classes/Engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -181,82 +181,80 @@ class InnodbTest extends PmaTestCase public function testGetPageBufferpool() { $this->assertEquals( - ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Buffer Pool Usage -
- Total - : 4,096 pages / 65,536 KiB -
Free pages0
Dirty pages0
Pages containing data0 -
Pages to be flushed0 -
Busy pages0 -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Buffer Pool Activity -
Read requests64 -
Write requests64 -
Read misses32 -
Write waits0 -
Read misses in %50 % -
Write waits in %0 % -
-', + '' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + '
' . "\n" . + ' Buffer Pool Usage' . "\n" . + '
' . "\n" . + ' Total' . "\n" . + ' : 4,096 pages / 65,536 KiB' . "\n" . + '
Free pages0
Dirty pages0
Pages containing data0' . "\n" . + '
Pages to be flushed0' . "\n" . + '
Busy pages0' . "\n" . + '
' . "\n" . "\n" . + '' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + '
' . "\n" . + ' Buffer Pool Activity' . "\n" . + '
Read requests64' . "\n" . + '
Write requests64' . "\n" . + '
Read misses32' . "\n" . + '
Write waits0' . "\n" . + '
Read misses in %50 %' . "\n" . + '
Write waits in %0 %' . "\n" . + '
' . "\n", $this->object->getPageBufferpool() ); } From a865a641b0eadc8256ccb53e7b67836f430e09b6 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 15 Feb 2020 01:31:23 +0100 Subject: [PATCH 2/6] Fix CR vs CRLF issue for testGetSQLQuery on Windows Signed-off-by: William Desportes --- test/classes/Database/QbeTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/classes/Database/QbeTest.php b/test/classes/Database/QbeTest.php index 80c26be0e7..d0393ae5f5 100644 --- a/test/classes/Database/QbeTest.php +++ b/test/classes/Database/QbeTest.php @@ -599,8 +599,7 @@ class QbeTest extends PmaTestCase 'table1.deleted', ]; $this->assertEquals( - 'FROM `table1` -', + 'FROM `table1`' . "\n", $this->_callProtectedFunction( '_getSQLQuery', [['`table1`.`id`']] From 47d00d85ef3511f1e41407e5ea8557a9558a6188 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 15 Feb 2020 01:32:26 +0100 Subject: [PATCH 3/6] Fix Uncaught TypeError for strtoupper caught on Windows unit test suite Signed-off-by: William Desportes --- libraries/classes/DatabaseInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 669cec6b7f..4d87eb65ee 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -794,7 +794,7 @@ class DatabaseInterface $each_tables[$table_name]['TABLE_COMMENT'] =& $each_tables[$table_name]['Comment']; - if (strtoupper($each_tables[$table_name]['Comment']) === 'VIEW' + if (strtoupper($each_tables[$table_name]['Comment'] ?? '') === 'VIEW' && $each_tables[$table_name]['Engine'] == null ) { $each_tables[$table_name]['TABLE_TYPE'] = 'VIEW'; From 74f7e7b0f030fc96d486587a787d59b86e1c94a5 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 15 Feb 2020 01:39:26 +0100 Subject: [PATCH 4/6] Fix CR vs CRLF issue for testSendHeaderLocationIisLongUri on Windows Signed-off-by: William Desportes --- test/classes/CoreTest.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/classes/CoreTest.php b/test/classes/CoreTest.php index 16dac440a2..a92f09769f 100644 --- a/test/classes/CoreTest.php +++ b/test/classes/CoreTest.php @@ -703,18 +703,17 @@ class CoreTest extends PmaTestCase $testUri_html = htmlspecialchars($testUri); $testUri_js = Sanitize::escapeJsString($testUri); - $header = "\n\n - - - - " + $header = "\n\n - - -" + . "\n " . "\n " . "\n " . "\n " - . "\n \n -\n\n\n -"; + . "\n \n" + . "\n\n\n\n\n"; $this->expectOutputString($header); From 39284cc8774192ae49b9bbff4f1d695cc88fd251 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 15 Feb 2020 01:42:31 +0100 Subject: [PATCH 5/6] Use isset for errno Signed-off-by: William Desportes --- libraries/classes/DatabaseInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 4d87eb65ee..debb7bce4a 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -957,7 +957,7 @@ class DatabaseInterface $databases = $this->fetchResult($sql, 'SCHEMA_NAME', null, $link); $mysql_error = $this->getError($link); - if (! count($databases) && $GLOBALS['errno']) { + if (! count($databases) && isset($GLOBALS['errno'])) { Util::mysqlDie($mysql_error, $sql); } From 1e384979add6737d6bb6c8f60d92e09b54a13aa0 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 15 Feb 2020 11:06:15 +0100 Subject: [PATCH 6/6] Fix ja translation detection for data depending on translations Signed-off-by: William Desportes --- test/classes/UtilTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 570f32d1d0..889efaa4a9 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -2090,6 +2090,7 @@ class UtilTest extends PmaTestCase */ public function providerLocalisedDate() { + $hasJaTranslations = file_exists(LOCALE_PATH . '/cs/LC_MESSAGES/phpmyadmin.mo'); return [ [ 1227455558, @@ -2136,21 +2137,21 @@ class UtilTest extends PmaTestCase [ 1227455558, '%Y-%m-%d %H:%M:%S %a', - '2008-11-24 00:52:38 月', + $hasJaTranslations ? '2008-11-24 00:52:38 月' : '2008-11-24 00:52:38 Mon', 'Asia/Tokyo', 'ja', ], [ 1227455558, '%a %A %b %B', - '月 月 11 月 11 月', + $hasJaTranslations ? '月 月 11 月 11 月' : 'Mon Mon Nov Nov', 'Asia/Tokyo', 'ja', ], [ 1227455558, '%a %A %b %B %P', - '月 月 11 月 11 月 午前', + $hasJaTranslations ? '月 月 11 月 11 月 午前' : 'Mon Mon Nov Nov AM', 'Asia/Tokyo', 'ja', ],