diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5c48ea5d62..90752741d6 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1585,11 +1585,6 @@ parameters: count: 1 path: src/Controllers/Database/DataDictionaryController.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/Controllers/Database/DataDictionaryController.php - - message: "#^Cannot access offset 'dbName' on mixed\\.$#" count: 2 @@ -3360,11 +3355,6 @@ parameters: count: 2 path: src/Controllers/Operations/DatabaseController.php - - - message: "#^Cannot access offset 'Row_format' on mixed\\.$#" - count: 1 - path: src/Controllers/Operations/TableController.php - - message: "#^Cannot access offset 'back' on mixed\\.$#" count: 2 @@ -5880,59 +5870,29 @@ parameters: count: 2 path: src/Controllers/Table/Structure/SaveController.php + - + message: "#^Binary operation \"\\+\" between int\\|non\\-falsy\\-string and int\\|non\\-falsy\\-string results in an error\\.$#" + count: 4 + path: src/Controllers/Table/StructureController.php + + - + message: "#^Binary operation \"\\-\" between mixed and int\\|string results in an error\\.$#" + count: 1 + path: src/Controllers/Table/StructureController.php + + - + message: "#^Binary operation \"/\" between mixed and int\\|string\\|null results in an error\\.$#" + count: 1 + path: src/Controllers/Table/StructureController.php + - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" count: 1 path: src/Controllers/Table/StructureController.php - - - message: "#^Cannot access offset 'Check_time' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Create_time' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Data_free' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Data_length' on mixed\\.$#" - count: 7 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Index_length' on mixed\\.$#" - count: 2 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Name' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Rows' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Type' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Cannot access offset 'Update_time' on mixed\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - message: "#^Cannot use array destructuring on array\\\\|null\\.$#" - count: 1 + count: 4 path: src/Controllers/Table/StructureController.php - @@ -5946,28 +5906,18 @@ parameters: path: src/Controllers/Table/StructureController.php - - message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, int\\|string given\\.$#" count: 3 path: src/Controllers/Table/StructureController.php - - message: "#^Parameter \\#1 \\$showTableName of method PhpMyAdmin\\\\Table\\\\Table\\:\\:getNumRows\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Controllers/Table/StructureController.php - - - - message: "#^Parameter \\#1 \\$timestamp of static method PhpMyAdmin\\\\Util\\:\\:localisedDate\\(\\) expects int, \\(int\\|false\\) given\\.$#" + message: "#^Parameter \\#1 \\$timestamp of static method PhpMyAdmin\\\\Util\\:\\:localisedDate\\(\\) expects int, int\\|false given\\.$#" count: 3 path: src/Controllers/Table/StructureController.php - - - message: "#^Parameter \\#1 \\$value of static method PhpMyAdmin\\\\Util\\:\\:formatByteDown\\(\\) expects float\\|int\\|string\\|null, \\(array\\|float\\|int\\) given\\.$#" - count: 2 - path: src/Controllers/Table/StructureController.php - - message: "#^Parameter \\#1 \\$value of static method PhpMyAdmin\\\\Util\\:\\:formatByteDown\\(\\) expects float\\|int\\|string\\|null, mixed given\\.$#" - count: 3 + count: 4 path: src/Controllers/Table/StructureController.php - @@ -12995,26 +12945,6 @@ parameters: count: 10 path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - - message: "#^Cannot access offset 'Check_time' on mixed\\.$#" - count: 1 - path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - - - message: "#^Cannot access offset 'Comment' on mixed\\.$#" - count: 1 - path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - - - message: "#^Cannot access offset 'Create_time' on mixed\\.$#" - count: 1 - path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - - - message: "#^Cannot access offset 'Update_time' on mixed\\.$#" - count: 1 - path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - message: "#^Cannot access offset 'foreign_field' on mixed\\.$#" count: 1 @@ -13071,7 +13001,7 @@ parameters: path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, int\\|string given\\.$#" count: 3 path: src/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -13081,7 +13011,7 @@ parameters: path: src/Plugins/Schema/Pdf/PdfRelationSchema.php - - message: "#^Parameter \\#1 \\$timestamp of static method PhpMyAdmin\\\\Util\\:\\:localisedDate\\(\\) expects int, \\(int\\|false\\) given\\.$#" + message: "#^Parameter \\#1 \\$timestamp of static method PhpMyAdmin\\\\Util\\:\\:localisedDate\\(\\) expects int, int\\|false given\\.$#" count: 3 path: src/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -15427,31 +15357,31 @@ parameters: - message: "#^Cannot cast mixed to int\\.$#" - count: 4 + count: 1 path: src/Table/Table.php - message: "#^Cannot cast mixed to string\\.$#" - count: 3 + count: 2 path: src/Table/Table.php - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 20 + count: 18 path: src/Table/Table.php - - message: "#^Method PhpMyAdmin\\\\Table\\\\Table\\:\\:getAutoIncrement\\(\\) should return string but returns mixed\\.$#" + message: "#^Method PhpMyAdmin\\\\Table\\\\Table\\:\\:getAutoIncrement\\(\\) should return string but returns int\\|string\\.$#" count: 1 path: src/Table/Table.php - - message: "#^Method PhpMyAdmin\\\\Table\\\\Table\\:\\:getCollation\\(\\) should return string but returns mixed\\.$#" + message: "#^Method PhpMyAdmin\\\\Table\\\\Table\\:\\:getCollation\\(\\) should return string but returns int\\|string\\.$#" count: 1 path: src/Table/Table.php - - message: "#^Method PhpMyAdmin\\\\Table\\\\Table\\:\\:getComment\\(\\) should return string but returns mixed\\.$#" + message: "#^Method PhpMyAdmin\\\\Table\\\\Table\\:\\:getComment\\(\\) should return string but returns int\\|string\\.$#" count: 1 path: src/Table/Table.php @@ -15577,11 +15507,6 @@ parameters: - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: src/Table/Table.php - - - - message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#" count: 1 path: src/Table/Table.php @@ -15607,7 +15532,7 @@ parameters: - message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#" - count: 3 + count: 2 path: src/Table/Table.php - diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 441d62b1a5..c63e23a1e9 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -2394,15 +2394,10 @@ $tableAlters is_array($partitionNames) ? $partitionNames : [] - - - - $showTable - $showTable @@ -4088,47 +4083,34 @@ - - - - - - - - - - - - - - - - - - - - - $attributes[$rownum] - $showTable icon]]> icon]]> - - - - - + + + + + + + + + + + + + + + + + + + + @@ -5521,7 +5503,6 @@ $query $rel $relationalDisplay - $tableCreateTime $value @@ -9798,9 +9779,6 @@ - - - $table $table $table @@ -9823,10 +9801,6 @@ - - - - pdf->customLinks['RT']['-']]]> pdf->customLinks['doc'][$foreigner['foreign_table']]]]> pdf->customLinks['doc'][$table]]]> @@ -9864,8 +9838,6 @@ $oneField $oneKey $rel - $showComment - $showTable $table $table $type @@ -9876,12 +9848,14 @@ - $showComment $table $table + + + @@ -11580,12 +11554,20 @@ + + + getStatusInfo('TABLE_COLLATION') ?? '']]> + getStatusInfo('TABLE_COMMENT') ?? '']]> + + + string + string + string + - $cachedResult - $cachedResult $column $column @@ -11621,7 +11603,6 @@ - $tableOptions uiprefs[$property]]]> uiprefs[$property]]]> $value @@ -11692,14 +11673,11 @@ $altered $altered - $cachedResult - $cachedResult $column $column $column $constraintName - $currCreateTime $eachCol $foreignDb $foreignDb @@ -11719,15 +11697,6 @@ $refDbName $ret[] $row - $rowCount - $tableAutoIncrement - $tableCollation - $tableComment - $tableNumRowInfo - $tableOptions - $tableRowFormat - $tableStorageEngine - $type $value $value $value @@ -11736,9 +11705,6 @@ mixed[] string string - string - string - string has @@ -11757,11 +11723,6 @@ options]]> - - - - - $tableComment errors)]]> messages)]]> json_decode($value, true) diff --git a/src/Controllers/Import/ImportController.php b/src/Controllers/Import/ImportController.php index a32010ef4b..a981ccbed5 100644 --- a/src/Controllers/Import/ImportController.php +++ b/src/Controllers/Import/ImportController.php @@ -112,12 +112,6 @@ final class ImportController extends AbstractController // default values $GLOBALS['reload'] = false; - // Use to identify current cycle is executing - // a multiquery statement or stored routine - if (! isset($_SESSION['is_multi_query'])) { - $_SESSION['is_multi_query'] = false; - } - $GLOBALS['ajax_reload'] = []; $GLOBALS['import_text'] = ''; // Are we just executing plain query or sql file? @@ -678,9 +672,7 @@ final class ImportController extends AbstractController } if ($GLOBALS['go_sql']) { - if ($queriesToBeExecuted !== []) { - $_SESSION['is_multi_query'] = true; - } else { + if ($queriesToBeExecuted === []) { $queriesToBeExecuted = [$GLOBALS['sql_query']]; } diff --git a/src/Controllers/Operations/TableController.php b/src/Controllers/Operations/TableController.php index 08b6464265..7ae9aef9dc 100644 --- a/src/Controllers/Operations/TableController.php +++ b/src/Controllers/Operations/TableController.php @@ -118,7 +118,7 @@ class TableController extends AbstractController */ $this->dbi->selectDb(Current::$database); - $showTable = $pmaTable->getStatusInfo(); + $rowFormat = $pmaTable->getStatusInfo('Row_format'); if ($pmaTable->isView()) { $tableIsAView = true; $tableStorageEngine = __('View'); @@ -327,7 +327,7 @@ class TableController extends AbstractController // a change, clear the cache $this->dbi->getCache()->clearTableCache(); $this->dbi->selectDb(Current::$database); - $showTable = $pmaTable->getStatusInfo(forceRead: true); + $rowFormat = $pmaTable->getStatusInfo('Row_format'); if ($pmaTable->isView()) { $tableIsAView = true; $tableStorageEngine = __('View'); @@ -501,7 +501,7 @@ class TableController extends AbstractController 'collations' => $collations, 'tbl_collation' => $tableCollation, 'row_formats' => $possibleRowFormats[$tableStorageEngine] ?? [], - 'row_format_current' => $showTable['Row_format'], + 'row_format_current' => $rowFormat, 'has_auto_increment' => $hasAutoIncrement, 'auto_increment' => $GLOBALS['auto_increment'], 'has_pack_keys' => $hasPackKeys, diff --git a/src/Controllers/Table/StructureController.php b/src/Controllers/Table/StructureController.php index 1c1ffe875a..cc76cc42a3 100644 --- a/src/Controllers/Table/StructureController.php +++ b/src/Controllers/Table/StructureController.php @@ -39,7 +39,6 @@ use stdClass; use function __; use function in_array; -use function is_string; use function str_contains; use function strtotime; @@ -49,7 +48,7 @@ use function strtotime; */ class StructureController extends AbstractController { - protected readonly Table $tableObj; + private readonly Table $tableObj; public function __construct( ResponseRenderer $response, @@ -151,7 +150,7 @@ class StructureController extends AbstractController * @param (string|int)[] $columnsWithIndex Columns with index * @psalm-param non-empty-string $route */ - protected function displayStructure( + private function displayStructure( RelationParameters $relationParameters, array $columnsWithUniqueIndex, Index|null $primaryIndex, @@ -293,17 +292,14 @@ class StructureController extends AbstractController /** * Get HTML snippet for display table statistics */ - protected function getTableStats( + private function getTableStats( bool $isSystemSchema, bool $tableIsAView, string $tableStorageEngine, ): string { - $showTable = $this->dbi->getTable(Current::$database, Current::$table)->getStatusInfo(forceRead: true); - $tableInfoNunRows = $this->tableObj->getNumRows($showTable['Name']); - - if (is_string($showTable)) { - $showTable = []; - } + // Clear the cache as some table information might have gotten changed due to the user action. + $this->dbi->getCache()->clearTableCache(); + $showTable = $this->tableObj->getStatusInfo(); if (empty($showTable['Data_length'])) { $showTable['Data_length'] = 0; @@ -352,7 +348,7 @@ class StructureController extends AbstractController $avgSize = ''; $avgUnit = ''; - if ($tableInfoNunRows > 0) { + if ($this->tableObj->getNumRows() > 0) { [$avgSize, $avgUnit] = Util::formatByteDown( ($showTable['Data_length'] + $showTable['Index_length']) @@ -392,7 +388,6 @@ class StructureController extends AbstractController 'db' => Current::$database, 'table' => Current::$table, 'showtable' => $showTable, - 'table_info_num_rows' => $tableInfoNunRows, 'tbl_is_view' => $tableIsAView, 'db_is_system_schema' => $isSystemSchema, 'tbl_storage_engine' => $tableStorageEngine, diff --git a/src/Plugins/Schema/Pdf/PdfRelationSchema.php b/src/Plugins/Schema/Pdf/PdfRelationSchema.php index 094fb74ebd..505143955c 100644 --- a/src/Plugins/Schema/Pdf/PdfRelationSchema.php +++ b/src/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -537,11 +537,7 @@ class PdfRelationSchema extends ExportRelationSchema $mimeMap = $this->transformations->getMime($this->db->getName(), $table, true); } - /** - * Gets table information - */ - $showTable = $dbi->getTable($this->db->getName(), $table) - ->getStatusInfo(); + $showTable = $dbi->getTable($this->db->getName(), $table)->getStatusInfo(); $showComment = $showTable['Comment'] ?? ''; $createTime = isset($showTable['Create_time']) ? Util::localisedDate( diff --git a/src/Query/Cache.php b/src/Query/Cache.php index 6d6373cfb4..2aaa81d1e7 100644 --- a/src/Query/Cache.php +++ b/src/Query/Cache.php @@ -4,8 +4,6 @@ declare(strict_types=1); namespace PhpMyAdmin\Query; -use PhpMyAdmin\Util; - /** * Handles caching results */ @@ -46,14 +44,19 @@ class Cache /** * Get a cached value from table cache. * - * @param (int|string)[] $contentPath Array of the name of the target value - * @param mixed $default Return value on cache miss + * @param T $key * - * @return mixed cached value or default + * @return (T is null ? (string|int|null)[] : (string|int|null))|null + * + * @template T of string|null */ - public function getCachedTableContent(array $contentPath, mixed $default = null): mixed + public function getCachedTableContent(string $db, string $table, string|null $key = null): array|string|int|null { - return Util::getValueByKey($this->tableCache, $contentPath, $default); + if ($key === null) { + return $this->tableCache[$db][$table] ?? null; + } + + return $this->tableCache[$db][$table][$key] ?? null; } public function clearTableCache(): void diff --git a/src/Sql.php b/src/Sql.php index da79eaaa15..5062df5511 100644 --- a/src/Sql.php +++ b/src/Sql.php @@ -1088,7 +1088,6 @@ class Sql ); } - $_SESSION['is_multi_query'] = false; $displayResultsObject->setProperties( $unlimNumRows, $this->dbi->getFieldsMeta($result), diff --git a/src/Table/Table.php b/src/Table/Table.php index 71800e54b5..b4acea2b30 100644 --- a/src/Table/Table.php +++ b/src/Table/Table.php @@ -34,7 +34,6 @@ use PhpMyAdmin\Util; use Stringable; use function __; -use function array_key_exists; use function array_keys; use function array_map; use function array_merge; @@ -64,11 +63,8 @@ use function strtolower; use function strtoupper; use function substr; use function substr_compare; -use function trigger_error; use function trim; -use const E_USER_WARNING; - /** * Handles everything related to tables * @@ -222,7 +218,7 @@ class Table implements Stringable // use cached data or load information with SHOW command if ( - $this->dbi->getCache()->getCachedTableContent([$this->dbName, $this->name]) != null + $this->dbi->getCache()->getCachedTableContent($this->dbName, $this->name) !== null || Config::getInstance()->selectedServer['DisableIS'] ) { $type = $this->getStatusInfo('TABLE_TYPE'); @@ -277,54 +273,34 @@ class Table implements Stringable * Returns full table status info, or specific if $info provided * this info is collected from information_schema * - * @param string|null $info specific information to be fetched - * @param bool $forceRead read new rather than serving from cache - * @param bool $disableError if true, disables error message + * @param T $info specific information to be fetched * - * @todo DatabaseInterface::getTablesFull needs to be merged - * somehow into this class or at least better documented + * @return (T is null ? (string|int|null)[]|null : (string|int|null)) + * + * @template T of string|null */ - public function getStatusInfo( - string|null $info = null, - bool $forceRead = false, - bool $disableError = false, - ): mixed { - if (! empty($_SESSION['is_multi_query'])) { - $disableError = true; - } - - $cachedResult = $this->dbi->getCache()->getCachedTableContent([$this->dbName, $this->name]); + public function getStatusInfo(string|null $info = null): array|string|int|null + { + $cachedResult = $this->dbi->getCache()->getCachedTableContent($this->dbName, $this->name); // sometimes there is only one entry (ExactRows) so // we have to get the table's details - if ($cachedResult === null || $forceRead || count($cachedResult) === 1) { + if ($cachedResult === null || count($cachedResult) === 1) { $this->dbi->getTablesFull($this->dbName, $this->name); - $cachedResult = $this->dbi->getCache()->getCachedTableContent([$this->dbName, $this->name]); + $cachedResult = $this->dbi->getCache()->getCachedTableContent($this->dbName, $this->name); } if ($cachedResult === null) { // happens when we enter the table creation dialog // or when we really did not get any status info, for example // when $table === 'TABLE_NAMES' after the user tried SHOW TABLES - return ''; + return null; } if ($info === null) { return $cachedResult; } - // array_key_exists allows for null values - if (! array_key_exists($info, $cachedResult)) { - if (! $disableError) { - trigger_error( - __('Unknown table status:') . ' ' . $info, - E_USER_WARNING, - ); - } - - return false; - } - return $cachedResult[$info]; } @@ -336,7 +312,7 @@ class Table implements Stringable */ public function getStorageEngine(): string { - $tableStorageEngine = $this->getStatusInfo('ENGINE', false, true); + $tableStorageEngine = $this->getStatusInfo('ENGINE'); return strtoupper((string) $tableStorageEngine); } @@ -348,12 +324,7 @@ class Table implements Stringable */ public function getComment(): string { - $tableComment = $this->getStatusInfo('TABLE_COMMENT', false, true); - if ($tableComment === false) { - return ''; - } - - return $tableComment; + return $this->getStatusInfo('TABLE_COMMENT') ?? ''; } /** @@ -363,12 +334,7 @@ class Table implements Stringable */ public function getCollation(): string { - $tableCollation = $this->getStatusInfo('TABLE_COLLATION', false, true); - if ($tableCollation === false) { - return ''; - } - - return $tableCollation ?? ''; + return $this->getStatusInfo('TABLE_COLLATION') ?? ''; } /** @@ -376,15 +342,9 @@ class Table implements Stringable * * @return int Return no of rows info if it is not null for the selected table or return 0. */ - public function getNumRows(string $showTableName): int + public function getNumRows(): int { - $tableNumRowInfo = $this->getStatusInfo('TABLE_ROWS', false, true); - if ($tableNumRowInfo === false) { - $tableNumRowInfo = $this->dbi->getTable($this->dbName, $showTableName) - ->countRecords(true); - } - - return (int) $tableNumRowInfo; + return (int) $this->getStatusInfo('TABLE_ROWS'); } /** @@ -394,7 +354,7 @@ class Table implements Stringable */ public function getRowFormat(): string { - $tableRowFormat = $this->getStatusInfo('ROW_FORMAT', false, true); + $tableRowFormat = $this->getStatusInfo('ROW_FORMAT'); return is_string($tableRowFormat) ? $tableRowFormat : ''; } @@ -406,7 +366,7 @@ class Table implements Stringable */ public function getAutoIncrement(): string { - $tableAutoIncrement = $this->getStatusInfo('AUTO_INCREMENT', false, true); + $tableAutoIncrement = $this->getStatusInfo('AUTO_INCREMENT'); return $tableAutoIncrement ?? ''; } @@ -418,8 +378,8 @@ class Table implements Stringable */ public function getCreateOptions(): array { - $tableOptions = $this->getStatusInfo('CREATE_OPTIONS', false, true); - $createOptionsTmp = empty($tableOptions) ? [] : explode(' ', $tableOptions); + $tableOptions = $this->getStatusInfo('CREATE_OPTIONS'); + $createOptionsTmp = is_string($tableOptions) && $tableOptions !== '' ? explode(' ', $tableOptions) : []; $createOptions = []; // export create options by its name as variables into global namespace // f.e. pack_keys=1 becomes available as $pack_keys with value of '1' @@ -689,7 +649,7 @@ class Table implements Stringable $isView = $this->isView(); $cache = $this->dbi->getCache(); - $exactRowsCached = $cache->getCachedTableContent([$this->dbName, $this->name, 'ExactRows']); + $exactRowsCached = $cache->getCachedTableContent($this->dbName, $this->name, 'ExactRows'); if ($exactRowsCached !== null) { return (int) $exactRowsCached; } @@ -697,11 +657,11 @@ class Table implements Stringable $rowCount = null; if (! $forceExact) { - if (($cache->getCachedTableContent([$this->dbName, $this->name, 'Rows']) === null) && ! $isView) { + if (($cache->getCachedTableContent($this->dbName, $this->name, 'Rows') === null) && ! $isView) { $this->dbi->getTablesFull($this->dbName, $this->name); } - $rowCount = $cache->getCachedTableContent([$this->dbName, $this->name, 'Rows']); + $rowCount = $cache->getCachedTableContent($this->dbName, $this->name, 'Rows'); } // for a VIEW, $row_count is always false at this point @@ -1800,7 +1760,7 @@ class Table implements Stringable // we want to save the create time if the property is PROP_COLUMN_ORDER if (! $this->isView() && ($property == self::PROP_COLUMN_ORDER || $property == self::PROP_COLUMN_VISIB)) { $currCreateTime = $this->getStatusInfo('CREATE_TIME'); - if (! isset($tableCreateTime) || $tableCreateTime != $currCreateTime) { + if ($tableCreateTime === null || $tableCreateTime != $currCreateTime) { // there is no $table_create_time, or // supplied $table_create_time is older than current create time, // so don't save diff --git a/tests/classes/Table/TableTest.php b/tests/classes/Table/TableTest.php index d7915f63fe..3d4b81969a 100644 --- a/tests/classes/Table/TableTest.php +++ b/tests/classes/Table/TableTest.php @@ -1446,7 +1446,7 @@ class TableTest extends AbstractTestCase $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension); $tblObject = new Table($targetTable, $targetDb, $dbi); - $tblObject->getStatusInfo(null, true); + $tblObject->getStatusInfo(null); $expect = 'DBIDUMMY'; $tblStorageEngine = $dbi->getTable($targetDb, $targetTable)->getStorageEngine(); $this->assertEquals($expect, $tblStorageEngine); @@ -1462,7 +1462,7 @@ class TableTest extends AbstractTestCase $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension); $tblObject = new Table($targetTable, $targetDb, $dbi); - $tblObject->getStatusInfo(null, true); + $tblObject->getStatusInfo(null); $expect = 'Test comment for "table1" in \'pma_test\''; $showComment = $dbi->getTable($targetDb, $targetTable)->getComment(); $this->assertEquals($expect, $showComment); @@ -1478,7 +1478,7 @@ class TableTest extends AbstractTestCase $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension); $tblObject = new Table($targetTable, $targetDb, $dbi); - $tblObject->getStatusInfo(null, true); + $tblObject->getStatusInfo(null); $expect = 'utf8mb4_general_ci'; $tblCollation = $dbi->getTable($targetDb, $targetTable)->getCollation(); $this->assertEquals($expect, $tblCollation); @@ -1494,7 +1494,7 @@ class TableTest extends AbstractTestCase $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension); $tblObject = new Table($targetTable, $targetDb, $dbi); - $tblObject->getStatusInfo(null, true); + $tblObject->getStatusInfo(null); $expect = 'Redundant'; $rowFormat = $dbi->getTable($targetDb, $targetTable)->getRowFormat(); $this->assertEquals($expect, $rowFormat); @@ -1510,7 +1510,7 @@ class TableTest extends AbstractTestCase $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension); $tblObject = new Table($targetTable, $targetDb, $dbi); - $tblObject->getStatusInfo(null, true); + $tblObject->getStatusInfo(null); $expect = '5'; $autoIncrement = $dbi->getTable($targetDb, $targetTable)->getAutoIncrement(); $this->assertEquals($expect, $autoIncrement); @@ -1526,7 +1526,7 @@ class TableTest extends AbstractTestCase $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension); $tblObject = new Table($targetTable, $targetDb, $dbi); - $tblObject->getStatusInfo(null, true); + $tblObject->getStatusInfo(null); $expect = ['pack_keys' => 'DEFAULT', 'row_format' => 'REDUNDANT']; $createOptions = $dbi->getTable($targetDb, $targetTable)->getCreateOptions(); $this->assertEquals($expect, $createOptions);