Skip to content

Commit 7cde53e

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2 parents 6d24181 + 4b5c494 commit 7cde53e

7 files changed

Lines changed: 182 additions & 20 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ phpMyAdmin - ChangeLog
7878
- issue #17944 Fix unable to create a view from tree view button
7979
- issue #17927 Fix key navigation between select inputs (drop an old Firefox workaround)
8080
- issue #17967 Fix missing icon for collapse all button
81+
- issue #18006 Fixed UUID columns can't be moved
8182

8283
5.2.0 (2022-05-10)
8384
- issue #16521 Upgrade Bootstrap to version 5

libraries/classes/Controllers/Import/ImportController.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,10 @@ public function __invoke(ServerRequest $request): void
304304
}
305305

306306
$GLOBALS['timestamp'] = time();
307-
if ($request->hasBodyParam('allow_interrupt')) {
308-
$GLOBALS['maximum_time'] = ini_get('max_execution_time');
309-
$GLOBALS['maximum_time'] -= 1; // Give 1 second for phpMyAdmin to exit nicely
310-
} else {
311-
$GLOBALS['maximum_time'] = 0;
307+
$GLOBALS['maximum_time'] = 0;
308+
$maxExecutionTime = (int) ini_get('max_execution_time');
309+
if ($request->hasBodyParam('allow_interrupt') && $maxExecutionTime >= 1) {
310+
$GLOBALS['maximum_time'] = $maxExecutionTime - 1; // Give 1 second for phpMyAdmin to exit nicely
312311
}
313312

314313
// set default values

libraries/classes/Controllers/Table/Structure/MoveColumnsController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,17 @@ public function __invoke(ServerRequest $request): void
8181
$timeDefault = $data['Default'] === 'CURRENT_TIMESTAMP' || $data['Default'] === 'current_timestamp()';
8282
$current_timestamp = $timeType && $timeDefault;
8383

84+
$uuidType = $data['Type'] === 'uuid';
85+
$uuidDefault = $data['Default'] === 'UUID' || $data['Default'] === 'uuid()';
86+
$uuid = $uuidType && $uuidDefault;
87+
8488
// @see https://mariadb.com/kb/en/library/information-schema-columns-table/#examples
8589
if ($data['Null'] === 'YES' && in_array($data['Default'], [$defaultNullValue, null])) {
8690
$default_type = 'NULL';
8791
} elseif ($current_timestamp) {
8892
$default_type = 'CURRENT_TIMESTAMP';
93+
} elseif ($uuid) {
94+
$default_type = 'UUID';
8995
} elseif ($data['Default'] === null) {
9096
$default_type = 'NONE';
9197
} else {

libraries/classes/Header.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ public function getDisplay(): string
360360

361361
$console = $this->console->getDisplay();
362362
$messages = $this->getMessage();
363+
$isLoggedIn = isset($GLOBALS['dbi']) && $GLOBALS['dbi']->isConnected();
363364

364365
$this->scripts->addFile('datetimepicker.js');
365366
$this->scripts->addFile('validator-messages.js');
@@ -381,7 +382,7 @@ public function getDisplay(): string
381382
'show_hint' => $GLOBALS['cfg']['ShowHint'],
382383
'is_warnings_enabled' => $this->warningsEnabled,
383384
'is_menu_enabled' => $this->menuEnabled,
384-
'is_logged_in' => isset($GLOBALS['dbi']) ? $GLOBALS['dbi']->isConnected() : false,
385+
'is_logged_in' => $isLoggedIn,
385386
'menu' => $menu ?? '',
386387
'console' => $console,
387388
'messages' => $messages,

phpstan-baseline.neon

Lines changed: 165 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ parameters:
9595
count: 1
9696
path: libraries/classes/Charsets.php
9797

98+
-
99+
message: "#^Cannot access an offset on array\\<string\\>\\|true\\.$#"
100+
count: 1
101+
path: libraries/classes/CheckUserPrivileges.php
102+
98103
-
99104
message: "#^Only numeric types are allowed in \\+, int\\<0, max\\>\\|false given on the left side\\.$#"
100105
count: 2
@@ -1405,11 +1410,6 @@ parameters:
14051410
count: 1
14061411
path: libraries/classes/Controllers/HomeController.php
14071412

1408-
-
1409-
message: "#^Binary operation \"\\-\\=\" between string\\|false and 1 results in an error\\.$#"
1410-
count: 1
1411-
path: libraries/classes/Controllers/Import/ImportController.php
1412-
14131413
-
14141414
message: "#^Cannot cast mixed to int\\.$#"
14151415
count: 2
@@ -1560,6 +1560,11 @@ parameters:
15601560
count: 1
15611561
path: libraries/classes/Controllers/Preferences/ManageController.php
15621562

1563+
-
1564+
message: "#^Parameter \\#1 \\$file_name of method PhpMyAdmin\\\\UserPreferences\\:\\:redirect\\(\\) expects string, string\\|false given\\.$#"
1565+
count: 1
1566+
path: libraries/classes/Controllers/Preferences/ManageController.php
1567+
15631568
-
15641569
message: "#^Cannot cast mixed to int\\.$#"
15651570
count: 1
@@ -1865,6 +1870,11 @@ parameters:
18651870
count: 1
18661871
path: libraries/classes/Controllers/Table/ReplaceController.php
18671872

1873+
-
1874+
message: "#^Parameter \\#1 \\$messages of method PhpMyAdmin\\\\Message\\:\\:addMessagesString\\(\\) expects array\\<string\\>, array\\<int, PhpMyAdmin\\\\Message\\|string\\|null\\> given\\.$#"
1875+
count: 1
1876+
path: libraries/classes/Controllers/Table/ReplaceController.php
1877+
18681878
-
18691879
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Table\\\\SearchController\\:\\:getColumnMinMax\\(\\) return type has no value type specified in iterable type array\\.$#"
18701880
count: 1
@@ -2075,6 +2085,11 @@ parameters:
20752085
count: 1
20762086
path: libraries/classes/Controllers/TableController.php
20772087

2088+
-
2089+
message: "#^Parameter \\#1 \\$password of method PhpMyAdmin\\\\UserPassword\\:\\:changePassword\\(\\) expects string, mixed given\\.$#"
2090+
count: 1
2091+
path: libraries/classes/Controllers/UserPasswordController.php
2092+
20782093
-
20792094
message: "#^Parameter \\#1 \\$pmaPw of method PhpMyAdmin\\\\UserPassword\\:\\:setChangePasswordMsg\\(\\) expects string, mixed given\\.$#"
20802095
count: 1
@@ -2170,6 +2185,11 @@ parameters:
21702185
count: 1
21712186
path: libraries/classes/CreateAddField.php
21722187

2188+
-
2189+
message: "#^Offset 'tbl_collation' on array\\<string, mixed\\> on left side of \\?\\? always exists and is not nullable\\.$#"
2190+
count: 1
2191+
path: libraries/classes/CreateAddField.php
2192+
21732193
-
21742194
message: "#^Foreach overwrites \\$table with its value variable\\.$#"
21752195
count: 2
@@ -5255,6 +5275,11 @@ parameters:
52555275
count: 1
52565276
path: libraries/classes/Navigation/NavigationTree.php
52575277

5278+
-
5279+
message: "#^Offset 'pos3_name' on array\\<string, mixed\\> on left side of \\?\\? always exists and is not nullable\\.$#"
5280+
count: 1
5281+
path: libraries/classes/Navigation/NavigationTree.php
5282+
52585283
-
52595284
message: "#^Offset 'text' on array\\{text\\: array\\{route\\: string, params\\: array\\<string, mixed\\>\\}, icon\\: array\\{route\\: string, params\\: array\\<string, mixed\\>\\}, second_icon\\?\\: array\\{route\\: string, params\\: array\\<string, mixed\\>\\}, title\\?\\: string\\} in isset\\(\\) always exists and is not nullable\\.$#"
52605285
count: 1
@@ -5555,6 +5580,16 @@ parameters:
55555580
count: 1
55565581
path: libraries/classes/Operations.php
55575582

5583+
-
5584+
message: "#^Offset 'db_collation' on array\\<string, mixed\\> on left side of \\?\\? always exists and is not nullable\\.$#"
5585+
count: 1
5586+
path: libraries/classes/Operations.php
5587+
5588+
-
5589+
message: "#^Offset 'tbl_collation' on array\\<string, mixed\\> on left side of \\?\\? always exists and is not nullable\\.$#"
5590+
count: 1
5591+
path: libraries/classes/Operations.php
5592+
55585593
-
55595594
message: "#^Parameter \\#1 \\$query of method PhpMyAdmin\\\\DatabaseInterface\\:\\:query\\(\\) expects string, string\\|null given\\.$#"
55605595
count: 1
@@ -5680,6 +5715,11 @@ parameters:
56805715
count: 1
56815716
path: libraries/classes/Plugins.php
56825717

5718+
-
5719+
message: "#^Offset 'errno' on array\\<string, mixed\\> in isset\\(\\) always exists and is not nullable\\.$#"
5720+
count: 1
5721+
path: libraries/classes/Plugins/Auth/AuthenticationConfig.php
5722+
56835723
-
56845724
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
56855725
count: 1
@@ -8225,6 +8265,11 @@ parameters:
82258265
count: 1
82268266
path: libraries/classes/Table.php
82278267

8268+
-
8269+
message: "#^Offset 'sql_constraints…' on non\\-empty\\-array\\<string, mixed\\> in empty\\(\\) always exists and is always falsy\\.$#"
8270+
count: 1
8271+
path: libraries/classes/Table.php
8272+
82288273
-
82298274
message: "#^Parameter \\#1 \\$list of class PhpMyAdmin\\\\SqlParser\\\\Parser constructor expects PhpMyAdmin\\\\SqlParser\\\\TokensList\\|PhpMyAdmin\\\\SqlParser\\\\UtfString\\|string\\|null, mixed given\\.$#"
82308275
count: 1
@@ -8265,6 +8310,11 @@ parameters:
82658310
count: 1
82668311
path: libraries/classes/Table.php
82678312

8313+
-
8314+
message: "#^Result of && is always false\\.$#"
8315+
count: 1
8316+
path: libraries/classes/Table.php
8317+
82688318
-
82698319
message: "#^Right side of \\|\\| is always false\\.$#"
82708320
count: 1
@@ -9130,6 +9180,11 @@ parameters:
91309180
count: 2
91319181
path: test/classes/Command/TwigLintCommandTest.php
91329182

9183+
-
9184+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'test' and non\\-empty\\-array\\<string, mixed\\> will always evaluate to true\\.$#"
9185+
count: 1
9186+
path: test/classes/CommonTest.php
9187+
91339188
-
91349189
message: "#^Method PhpMyAdmin\\\\Tests\\\\CommonTest\\:\\:providerForTestCleanupPathInfo\\(\\) return type has no value type specified in iterable type array\\.$#"
91359190
count: 1
@@ -9260,6 +9315,31 @@ parameters:
92609315
count: 1
92619316
path: test/classes/Config/SettingsTest.php
92629317

9318+
-
9319+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with arguments 'relation', non\\-empty\\-array\\<string, mixed\\> and 'The cache is…' will always evaluate to true\\.$#"
9320+
count: 1
9321+
path: test/classes/ConfigStorage/RelationTest.php
9322+
9323+
-
9324+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with arguments 0, array\\{\\} and 'The cache is…' will always evaluate to false\\.$#"
9325+
count: 1
9326+
path: test/classes/ConfigStorage/RelationTest.php
9327+
9328+
-
9329+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with arguments 1, array\\{\\} and 'The cache is…' will always evaluate to false\\.$#"
9330+
count: 5
9331+
path: test/classes/ConfigStorage/RelationTest.php
9332+
9333+
-
9334+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{\\} and array\\{\\} will always evaluate to true\\.$#"
9335+
count: 1
9336+
path: test/classes/ConfigStorage/RelationTest.php
9337+
9338+
-
9339+
message: "#^Cannot unset offset 1 on array\\{\\}\\.$#"
9340+
count: 1
9341+
path: test/classes/ConfigStorage/RelationTest.php
9342+
92639343
-
92649344
message: "#^Method PhpMyAdmin\\\\Tests\\\\ConfigTest\\:\\:configPaths\\(\\) return type has no value type specified in iterable type array\\.$#"
92659345
count: 1
@@ -9395,6 +9475,41 @@ parameters:
93959475
count: 7
93969476
path: test/classes/Controllers/Server/VariablesControllerTest.php
93979477

9478+
-
9479+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'flashMessages' and array\\{ PMA_token \\: 'token'\\} will always evaluate to false\\.$#"
9480+
count: 1
9481+
path: test/classes/Controllers/Table/DropColumnControllerTest.php
9482+
9483+
-
9484+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNull\\(\\) with null will always evaluate to true\\.$#"
9485+
count: 2
9486+
path: test/classes/Controllers/Table/Structure/SpatialControllerTest.php
9487+
9488+
-
9489+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 'ALTER TABLE `test…' and null will always evaluate to false\\.$#"
9490+
count: 3
9491+
path: test/classes/Controllers/Table/Structure/SpatialControllerTest.php
9492+
9493+
-
9494+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNull\\(\\) with null will always evaluate to true\\.$#"
9495+
count: 2
9496+
path: test/classes/Controllers/Table/Structure/UniqueControllerTest.php
9497+
9498+
-
9499+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 'ALTER TABLE `test…' and null will always evaluate to false\\.$#"
9500+
count: 3
9501+
path: test/classes/Controllers/Table/Structure/UniqueControllerTest.php
9502+
9503+
-
9504+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with false will always evaluate to false\\.$#"
9505+
count: 3
9506+
path: test/classes/Controllers/VersionCheckControllerTest.php
9507+
9508+
-
9509+
message: "#^Offset 'ajax_request' on array\\{\\} in isset\\(\\) does not exist\\.$#"
9510+
count: 3
9511+
path: test/classes/Controllers/VersionCheckControllerTest.php
9512+
93989513
-
93999514
message: "#^Method PhpMyAdmin\\\\Tests\\\\CoreTest\\:\\:provideTestSafeUnserialize\\(\\) return type has no value type specified in iterable type array\\.$#"
94009515
count: 1
@@ -9465,6 +9580,16 @@ parameters:
94659580
count: 1
94669581
path: test/classes/CreateAddFieldTest.php
94679582

9583+
-
9584+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'URLQueryEncryptionS…' and array\\{URLQueryEncryptionSecretKey\\: 'aaaaaaaaaaaaaaaaaaa…'\\} will always evaluate to true\\.$#"
9585+
count: 1
9586+
path: test/classes/Crypto/CryptoTest.php
9587+
9588+
-
9589+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'URLQueryEncryptionS…' and array\\{\\} will always evaluate to false\\.$#"
9590+
count: 1
9591+
path: test/classes/Crypto/CryptoTest.php
9592+
94689593
-
94699594
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with array\\<string\\> will always evaluate to true\\.$#"
94709595
count: 1
@@ -10945,6 +11070,16 @@ parameters:
1094511070
count: 2
1094611071
path: test/classes/ParseAnalyzeTest.php
1094711072

11073+
-
11074+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 'SELECT \\* FROM …' and '' will always evaluate to false\\.$#"
11075+
count: 1
11076+
path: test/classes/ParseAnalyzeTest.php
11077+
11078+
-
11079+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 'SELECT `first_name`…' and '' will always evaluate to false\\.$#"
11080+
count: 1
11081+
path: test/classes/ParseAnalyzeTest.php
11082+
1094811083
-
1094911084
message: "#^Method PhpMyAdmin\\\\Tests\\\\Partitioning\\\\TablePartitionDefinitionTest\\:\\:testGetDetails\\(\\) has parameter \\$partitions with no value type specified in iterable type array\\.$#"
1095011085
count: 1
@@ -11020,6 +11155,11 @@ parameters:
1102011155
count: 1
1102111156
path: test/classes/Plugins/Import/ImportOdsTest.php
1102211157

11158+
-
11159+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFalse\\(\\) with false will always evaluate to true\\.$#"
11160+
count: 1
11161+
path: test/classes/Plugins/Import/ImportShpTest.php
11162+
1102311163
-
1102411164
message: "#^Method PhpMyAdmin\\\\Tests\\\\Plugins\\\\Transformations\\\\TransformationPluginsTest\\:\\:multiDataProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
1102511165
count: 1
@@ -11090,6 +11230,11 @@ parameters:
1109011230
count: 4
1109111231
path: test/classes/RoutingTest.php
1109211232

11233+
-
11234+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'allow' and non\\-empty\\-array\\<string, mixed\\> will always evaluate to true\\.$#"
11235+
count: 1
11236+
path: test/classes/SanitizeTest.php
11237+
1109311238
-
1109411239
message: "#^Method PhpMyAdmin\\\\Tests\\\\SanitizeTest\\:\\:dataProviderCheckLinks\\(\\) return type has no value type specified in iterable type array\\.$#"
1109511240
count: 1
@@ -11385,6 +11530,11 @@ parameters:
1138511530
count: 1
1138611531
path: test/classes/UserPasswordTest.php
1138711532

11533+
-
11534+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with false will always evaluate to false\\.$#"
11535+
count: 1
11536+
path: test/classes/UserPreferencesTest.php
11537+
1138811538
-
1138911539
message: "#^Casting to string something that's already string\\.$#"
1139011540
count: 1
@@ -11555,6 +11705,16 @@ parameters:
1155511705
count: 1
1155611706
path: test/classes/Utils/HttpRequestTest.php
1155711707

11708+
-
11709+
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'cache' and array\\{\\} will always evaluate to false\\.$#"
11710+
count: 2
11711+
path: test/classes/Utils/SessionCacheTest.php
11712+
11713+
-
11714+
message: "#^Offset 'cache' does not exist on array\\{\\}\\.$#"
11715+
count: 4
11716+
path: test/classes/Utils/SessionCacheTest.php
11717+
1155811718
-
1155911719
message: "#^Method PhpMyAdmin\\\\Tests\\\\VersionInformationTest\\:\\:dataProviderVersionConditions\\(\\) return type has no value type specified in iterable type array\\.$#"
1156011720
count: 1

0 commit comments

Comments
 (0)