Merge pull request #18848 from kamil-tekiela/$GLOBALS-'find_real_end']

Remove dead code and globals
This commit is contained in:
Maurício Meneghini Fauth 2023-12-17 14:11:56 -03:00 committed by GitHub
commit 20d50d398c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 135 additions and 314 deletions

View File

@ -3516,7 +3516,7 @@ parameters:
path: src/Controllers/Import/ImportController.php
-
message: "#^Parameter \\#12 \\$sqlQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndGetQueryResponse\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#11 \\$sqlQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndGetQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Import/ImportController.php
@ -3606,7 +3606,7 @@ parameters:
path: src/Controllers/Import/ImportController.php
-
message: "#^Parameter \\#9 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndGetQueryResponse\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#8 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndGetQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Import/ImportController.php
@ -5212,7 +5212,7 @@ parameters:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 5
count: 4
path: src/Controllers/Sql/SqlController.php
-
@ -5220,11 +5220,6 @@ parameters:
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#1 \\$db of method PhpMyAdmin\\\\Sql\\:\\:findRealEndOfRows\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#1 \\$db of method PhpMyAdmin\\\\Sql\\:\\:getDefaultSqlQueryForBrowse\\(\\) expects string, mixed given\\.$#"
count: 1
@ -5266,22 +5261,17 @@ parameters:
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#10 \\$dispQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
message: "#^Parameter \\#10 \\$dispMessage of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects PhpMyAdmin\\\\Message\\|string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#11 \\$dispMessage of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects PhpMyAdmin\\\\Message\\|string\\|null, mixed given\\.$#"
message: "#^Parameter \\#11 \\$sqlQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#12 \\$sqlQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#13 \\$completeQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
message: "#^Parameter \\#12 \\$completeQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
@ -5290,21 +5280,11 @@ parameters:
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#2 \\$isGotoFile of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#2 \\$signature of static method PhpMyAdmin\\\\Core\\:\\:checkSqlQuerySignature\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Sql\\:\\:findRealEndOfRows\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Sql\\:\\:getDefaultSqlQueryForBrowse\\(\\) expects string, mixed given\\.$#"
count: 1
@ -5326,22 +5306,22 @@ parameters:
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#5 \\$findRealEnd of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects bool\\|null, mixed given\\.$#"
message: "#^Parameter \\#5 \\$sqlQueryForBookmark of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#6 \\$sqlQueryForBookmark of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
message: "#^Parameter \\#6 \\$messageToShow of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#7 \\$messageToShow of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
message: "#^Parameter \\#8 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
-
message: "#^Parameter \\#9 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#9 \\$dispQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Sql/SqlController.php
@ -5821,17 +5801,12 @@ parameters:
path: src/Controllers/Table/DeleteRowsController.php
-
message: "#^Parameter \\#10 \\$dispQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
message: "#^Parameter \\#10 \\$dispMessage of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects PhpMyAdmin\\\\Message\\|string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Table/DeleteRowsController.php
-
message: "#^Parameter \\#11 \\$dispMessage of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects PhpMyAdmin\\\\Message\\|string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Table/DeleteRowsController.php
-
message: "#^Parameter \\#12 \\$sqlQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#11 \\$sqlQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Table/DeleteRowsController.php
@ -5861,7 +5836,12 @@ parameters:
path: src/Controllers/Table/DeleteRowsController.php
-
message: "#^Parameter \\#9 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#8 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Table/DeleteRowsController.php
-
message: "#^Parameter \\#9 \\$dispQuery of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Controllers/Table/DeleteRowsController.php
@ -6871,7 +6851,7 @@ parameters:
path: src/Controllers/Table/SearchController.php
-
message: "#^Parameter \\#9 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#8 \\$goto of method PhpMyAdmin\\\\Sql\\:\\:executeQueryAndSendQueryResponse\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Table/SearchController.php
@ -7455,6 +7435,11 @@ parameters:
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
@ -7540,6 +7525,11 @@ parameters:
count: 1
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 \\$table of static method PhpMyAdmin\\\\Index\\:\\:findDuplicates\\(\\) expects string, mixed given\\.$#"
count: 1
@ -17152,7 +17142,7 @@ parameters:
-
message: "#^Cannot access offset 'pos' on mixed\\.$#"
count: 4
count: 3
path: src/Sql.php
-
@ -17285,11 +17275,6 @@ parameters:
count: 1
path: src/Sql.php
-
message: "#^Parameter \\#13 \\$showTable of method PhpMyAdmin\\\\Display\\\\Results\\:\\:setProperties\\(\\) expects array\\<string, mixed\\>\\|null, array\\|null given\\.$#"
count: 2
path: src/Sql.php
-
message: "#^Parameter \\#2 \\$db of class PhpMyAdmin\\\\Display\\\\Results constructor expects string, mixed given\\.$#"
count: 1
@ -17350,11 +17335,6 @@ parameters:
count: 1
path: src/Sql.php
-
message: "#^Parameter \\#6 \\$showTable of method PhpMyAdmin\\\\Sql\\:\\:getHtmlForSqlQueryResultsTable\\(\\) expects array\\|null, mixed given\\.$#"
count: 1
path: src/Sql.php
-
message: "#^Parameter \\#6 \\$sqlQuery of class PhpMyAdmin\\\\Display\\\\Results constructor expects string, mixed given\\.$#"
count: 1
@ -17765,11 +17745,6 @@ parameters:
count: 3
path: src/Table/Table.php
-
message: "#^Cannot access offset 'Name' on mixed\\.$#"
count: 1
path: src/Table/Table.php
-
message: "#^Cannot access offset 'Type' on mixed\\.$#"
count: 2
@ -18040,11 +18015,6 @@ parameters:
count: 1
path: src/Table/Table.php
-
message: "#^Parameter \\#2 \\$tableName of method PhpMyAdmin\\\\DatabaseInterface\\:\\:getTable\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Table/Table.php
-
message: "#^Parameter \\#3 \\$foreignDb of method PhpMyAdmin\\\\Table\\\\Table\\:\\:getSQLToCreateForeignKey\\(\\) expects string, mixed given\\.$#"
count: 2

View File

@ -2402,15 +2402,15 @@
<code>is_array($partitionNames) ? $partitionNames : []</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess>
<code><![CDATA[$GLOBALS['showtable']['Row_format']]]></code>
<code><![CDATA[$showTable['Row_format']]]></code>
</MixedArrayAccess>
<MixedAssignment>
<code><![CDATA[$GLOBALS['auto_increment']]]></code>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['message_to_show']]]></code>
<code><![CDATA[$GLOBALS['showtable']]]></code>
<code><![CDATA[$GLOBALS['showtable']]]></code>
<code>$rereadInfo</code>
<code>$showTable</code>
<code>$showTable</code>
</MixedAssignment>
<PossiblyUnusedMethod>
<code>__construct</code>
@ -3207,17 +3207,13 @@
<code><![CDATA[$GLOBALS['disp_message']]]></code>
<code><![CDATA[$GLOBALS['disp_query']]]></code>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['find_real_end']]]></code>
<code><![CDATA[$GLOBALS['is_gotofile']]]></code>
<code><![CDATA[$GLOBALS['message_to_show']]]></code>
<code><![CDATA[$GLOBALS['table_from_sql']]]></code>
<code><![CDATA[$GLOBALS['unlim_num_rows']]]></code>
</InvalidArrayOffset>
<MixedArgument>
<code><![CDATA[$GLOBALS['disp_message'] ?? null]]></code>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['find_real_end'] ?? null]]></code>
<code><![CDATA[$GLOBALS['message_to_show'] ?? null]]></code>
<code><![CDATA[$GLOBALS['sql_query']]]></code>
<code><![CDATA[$GLOBALS['sql_query']]]></code>
@ -3234,11 +3230,8 @@
<code><![CDATA[$GLOBALS['disp_query']]]></code>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['find_real_end']]]></code>
<code><![CDATA[$GLOBALS['is_gotofile']]]></code>
<code><![CDATA[$GLOBALS['message_to_show']]]></code>
<code><![CDATA[$GLOBALS['sql_query']]]></code>
<code><![CDATA[$GLOBALS['table_from_sql']]]></code>
<code><![CDATA[$GLOBALS['unlim_num_rows']]]></code>
<code>$bkmAllUsers</code>
<code>$sqlQuery</code>
@ -4105,55 +4098,48 @@
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
</InvalidArrayOffset>
<MixedArgument>
<code><![CDATA[$GLOBALS['showtable']['Check_time']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Create_time']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_free']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length']
- $GLOBALS['showtable']['Data_free']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_length'] + $GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Update_time']]]></code>
<code><![CDATA[($GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length'])
/ $GLOBALS['showtable']['Rows']]]></code>
<code><![CDATA[$showTable['Check_time']]]></code>
<code><![CDATA[$showTable['Create_time']]]></code>
<code><![CDATA[$showTable['Data_free']]]></code>
<code><![CDATA[$showTable['Data_length']]]></code>
<code><![CDATA[$showTable['Data_length']
+ $showTable['Index_length']]]></code>
<code><![CDATA[$showTable['Data_length']
+ $showTable['Index_length']
- $showTable['Data_free']]]></code>
<code><![CDATA[$showTable['Data_length'] + $showTable['Index_length']]]></code>
<code><![CDATA[$showTable['Index_length']]]></code>
<code><![CDATA[$showTable['Name']]]></code>
<code><![CDATA[$showTable['Update_time']]]></code>
<code><![CDATA[($showTable['Data_length']
+ $showTable['Index_length'])
/ $showTable['Rows']]]></code>
</MixedArgument>
<MixedArrayAccess>
<code><![CDATA[$GLOBALS['showtable']['Data_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Rows']]]></code>
<code><![CDATA[$showTable['Name']]]></code>
<code><![CDATA[$showTable['Rows']]]></code>
</MixedArrayAccess>
<MixedArrayAssignment>
<code><![CDATA[$GLOBALS['showtable']['Data_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$showTable['Data_length']]]></code>
<code><![CDATA[$showTable['Index_length']]]></code>
</MixedArrayAssignment>
<MixedAssignment>
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
<code><![CDATA[$GLOBALS['showtable']]]></code>
<code><![CDATA[$GLOBALS['showtable']]]></code>
<code>$attributes[$rownum]</code>
<code>$rereadInfo</code>
<code>$showTable</code>
<code>$showTable</code>
</MixedAssignment>
<MixedOperand>
<code><![CDATA[$GLOBALS['showtable']['Data_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$displayedFields[$rownum]->icon]]></code>
<code><![CDATA[$displayedFields[$rownum]->icon]]></code>
<code><![CDATA[$showTable['Data_length']]]></code>
<code><![CDATA[$showTable['Data_length']
+ $showTable['Index_length']]]></code>
<code><![CDATA[$showTable['Index_length']]]></code>
<code><![CDATA[$showTable['Index_length']]]></code>
<code><![CDATA[$showTable['Index_length']]]></code>
</MixedOperand>
<PossiblyNullOperand>
<code><![CDATA[$GLOBALS['showtable']['Data_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Data_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Index_length']]]></code>
<code><![CDATA[$GLOBALS['showtable']['Rows']]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Controllers/Table/TrackingController.php">
<DeprecatedMethod>
@ -11326,10 +11312,6 @@
<code>$sortCol</code>
<code><![CDATA[$statement->expr]]></code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code>$showTable</code>
<code>$showTable</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess>
<code><![CDATA[$_SESSION['tmpval']['max_rows']]]></code>
<code><![CDATA[$_SESSION['tmpval']['max_rows']]]></code>
@ -11341,7 +11323,6 @@
<code><![CDATA[$statementInfo->statement->where[0]]]></code>
</MixedArrayAccess>
<MixedArrayAssignment>
<code><![CDATA[$_SESSION['tmpval']['pos']]]></code>
<code><![CDATA[$_SESSION['tmpval']['possible_as_geometry']]]></code>
<code><![CDATA[$statement->expr[0]]]></code>
</MixedArrayAssignment>
@ -11876,7 +11857,6 @@
<code><![CDATA[$_POST['on_update'][$masterFieldMd5]]]></code>
</PossiblyInvalidArrayOffset>
<PossiblyNullArgument>
<code><![CDATA[$GLOBALS['showtable']['Name']]]></code>
<code><![CDATA[$commentsCopyRow['column_name']]]></code>
<code><![CDATA[$commentsCopyRow['comment']]]></code>
<code><![CDATA[$commentsCopyRow['mimetype']]]></code>

View File

@ -31,7 +31,6 @@ import { escapeHtml } from '../modules/functions/escape.ts';
AJAX.registerTeardown('database/structure.js', function () {
$(document).off('click', 'a.truncate_table_anchor.ajax');
$(document).off('click', 'a.drop_table_anchor.ajax');
$(document).off('click', '#real_end_input');
$(document).off('click', 'a.favorite_table_anchor.ajax');
$('a.real_row_count').off('click');
$('a.row_count_sum').off('click');
@ -419,26 +418,6 @@ AJAX.registerOnload('database/structure.js', function () {
}, Functions.loadForeignKeyCheckbox);
}); // end of Drop Table Ajax action
// Calculate Real End for InnoDB
/**
* Ajax Event handler for calculating the real end for a InnoDB table
*
*/
$(document).on('click', '#real_end_input', function (event) {
event.preventDefault();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = window.Messages.strOperationTakesLongTime;
$(this).confirm(question, '', function () {
return true;
});
return false;
}); // end Calculate Real End for InnoDB
// Add tooltip to favorite icons.
$('.favorite_table_anchor').each(function () {
tooltip($(this), 'a', $(this).attr('title'));

View File

@ -68,9 +68,6 @@
<input type="hidden" name="pos" value="{{ navigation.pos_last }}">
<input type="hidden" name="is_browse_distinct" value="{{ is_browse_distinct }}">
<input type="hidden" name="goto" value="{{ goto }}">
{% if navigation.has_real_end_input %}
<input id="real_end_input" type="hidden" name="find_real_end" value="1">
{% endif %}
{% set end_text %}
{%- if show_text('TableNavigationLinksMode') -%}
{% trans %}End{% context %}Last page{% endtrans %}&nbsp;

View File

@ -723,7 +723,6 @@ final class ImportController extends AbstractController
false, // is_gotofile
$GLOBALS['db'], // db
$GLOBALS['table'], // table
null, // find_real_end
null, // sql_query_for_bookmark - see below
null, // message_to_show
null, // sql_data

View File

@ -65,7 +65,6 @@ final class JavaScriptMessagesController
'strDeletingTrackingData' => __('Deleting tracking data'),
'strDroppingPrimaryKeyIndex' => __('Dropping Primary Key/Index'),
'strDroppingForeignKey' => __('Dropping Foreign key.'),
'strOperationTakesLongTime' => __('This operation could take a long time. Proceed anyway?'),
'strDropUserGroupWarning' => __('Do you really want to delete user group "%s"?'),
'strConfirmNavigation' => __('You have unsaved changes; are you sure you want to leave this page?'),
'strConfirmRowChange' => __(

View File

@ -118,7 +118,7 @@ class TableController extends AbstractController
$this->dbi->selectDb($GLOBALS['db']);
$rereadInfo = $pmaTable->getStatusInfo();
$GLOBALS['showtable'] = $pmaTable->getStatusInfo(null, ! empty($rereadInfo));
$showTable = $pmaTable->getStatusInfo(null, ! empty($rereadInfo));
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($GLOBALS['db']);
$GLOBALS['showtable'] = $pmaTable->getStatusInfo(null, true);
$showTable = $pmaTable->getStatusInfo(null, true);
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' => $GLOBALS['showtable']['Row_format'],
'row_format_current' => $showTable['Row_format'],
'has_auto_increment' => $hasAutoIncrement,
'auto_increment' => $GLOBALS['auto_increment'],
'has_pack_keys' => $hasPackKeys,

View File

@ -47,16 +47,13 @@ class SqlController extends AbstractController
$GLOBALS['ajax_reload'] ??= null;
$GLOBALS['goto'] ??= null;
$GLOBALS['errorUrl'] ??= null;
$GLOBALS['find_real_end'] ??= null;
$GLOBALS['unlim_num_rows'] ??= null;
$GLOBALS['import_text'] ??= null;
$GLOBALS['disp_query'] ??= null;
$GLOBALS['message_to_show'] ??= null;
$GLOBALS['disp_message'] ??= null;
$GLOBALS['complete_query'] ??= null;
$GLOBALS['is_gotofile'] ??= null;
$GLOBALS['back'] ??= null;
$GLOBALS['table_from_sql'] ??= null;
$this->checkUserPrivileges->getPrivileges();
@ -81,7 +78,7 @@ class SqlController extends AbstractController
/**
* Defines the url to return to in case of error in a sql statement
*/
$GLOBALS['is_gotofile'] = true;
$isGotofile = true;
$config = Config::getInstance();
if (empty($GLOBALS['goto'])) {
if (empty($GLOBALS['table'])) {
@ -141,13 +138,10 @@ class SqlController extends AbstractController
/**
* Parse and analyze the query
*/
[$statementInfo, $GLOBALS['db'], $GLOBALS['table_from_sql']] = ParseAnalyze::sqlQuery(
$GLOBALS['sql_query'],
$GLOBALS['db'],
);
[$statementInfo, $GLOBALS['db'], $tableFromSql] = ParseAnalyze::sqlQuery($GLOBALS['sql_query'], $GLOBALS['db']);
if ($GLOBALS['table'] != $GLOBALS['table_from_sql'] && ! empty($GLOBALS['table_from_sql'])) {
$GLOBALS['table'] = $GLOBALS['table_from_sql'];
if ($GLOBALS['table'] != $tableFromSql && $tableFromSql !== '') {
$GLOBALS['table'] = $tableFromSql;
}
/**
@ -172,13 +166,6 @@ class SqlController extends AbstractController
);
}
/**
* Need to find the real end of rows?
*/
if (isset($GLOBALS['find_real_end']) && $GLOBALS['find_real_end']) {
$GLOBALS['unlim_num_rows'] = $this->sql->findRealEndOfRows($GLOBALS['db'], $GLOBALS['table']);
}
/**
* Bookmark add
*/
@ -194,7 +181,7 @@ class SqlController extends AbstractController
* Sets or modifies the $goto variable if required
*/
if ($GLOBALS['goto'] === Url::getFromRoute('/sql')) {
$GLOBALS['is_gotofile'] = false;
$isGotofile = false;
$GLOBALS['goto'] = Url::getFromRoute('/sql', [
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table'],
@ -204,10 +191,9 @@ class SqlController extends AbstractController
$this->response->addHTML($this->sql->executeQueryAndSendQueryResponse(
$statementInfo,
$GLOBALS['is_gotofile'],
$isGotofile,
$GLOBALS['db'],
$GLOBALS['table'],
$GLOBALS['find_real_end'] ?? null,
$GLOBALS['import_text'] ?? null,
$GLOBALS['message_to_show'] ?? null,
null,

View File

@ -92,7 +92,6 @@ final class DeleteRowsController extends AbstractController
null,
null,
null,
null,
$GLOBALS['goto'] ?? '',
$GLOBALS['disp_query'] ?? null,
$GLOBALS['disp_message'] ?? null,

View File

@ -282,7 +282,6 @@ class SearchController extends AbstractController
false, // is_gotofile
$GLOBALS['db'], // db
$GLOBALS['table'], // table
null, // find_real_end
null, // sql_query_for_bookmark
null, // message_to_show
null, // sql_data

View File

@ -65,7 +65,6 @@ final class BrowseController extends AbstractController
false, // is_gotofile
$GLOBALS['db'], // db
$GLOBALS['table'], // table
null, // find_real_end
null, // sql_query_for_bookmark
null, // message_to_show
null, // sql_data

View File

@ -65,12 +65,11 @@ class StructureController extends AbstractController
public function __invoke(ServerRequest $request): void
{
$GLOBALS['showtable'] ??= null;
$GLOBALS['errorUrl'] ??= null;
$this->dbi->selectDb($GLOBALS['db']);
$rereadInfo = $this->tableObj->getStatusInfo(null, true);
$GLOBALS['showtable'] = $this->tableObj->getStatusInfo(null, ! empty($rereadInfo));
$showTable = $this->tableObj->getStatusInfo(null, ! empty($rereadInfo));
$this->pageSettings->init('TableStructure');
$this->response->addHTML($this->pageSettings->getErrorHTML());
@ -141,6 +140,7 @@ class StructureController extends AbstractController
$columnsWithIndex,
$isSystemSchema,
$request->getRoute(),
$showTable,
));
}
@ -160,6 +160,7 @@ class StructureController extends AbstractController
array $columnsWithIndex,
bool $isSystemSchema,
string $route,
mixed $showTable,
): string {
if ($this->tableObj->isView()) {
$tableIsAView = true;
@ -191,7 +192,7 @@ class StructureController extends AbstractController
// Get valid statistics whatever is the table type
if ($config->settings['ShowStats']) {
//get table stats in HTML format
$tablestats = $this->getTableStats($isSystemSchema, $tableIsAView, $tableStorageEngine);
$tablestats = $this->getTableStats($isSystemSchema, $tableIsAView, $tableStorageEngine, $showTable);
//returning the response in JSON format to be used by Ajax
$this->response->addJSON('tableStat', $tablestats);
}
@ -294,63 +295,63 @@ class StructureController extends AbstractController
/**
* Get HTML snippet for display table statistics
*/
protected function getTableStats(bool $isSystemSchema, bool $tableIsAView, string $tableStorageEngine): string
{
$tableInfoNunRows = $this->tableObj->getNumRows();
protected function getTableStats(
bool $isSystemSchema,
bool $tableIsAView,
string $tableStorageEngine,
mixed $showTable,
): string {
$tableInfoNunRows = $this->tableObj->getNumRows($showTable['Name']);
if (empty($GLOBALS['showtable'])) {
$GLOBALS['showtable'] = $this->dbi->getTable($GLOBALS['db'], $GLOBALS['table'])->getStatusInfo(null, true);
if (empty($showTable)) {
$showTable = $this->dbi->getTable($GLOBALS['db'], $GLOBALS['table'])->getStatusInfo(null, true);
}
if (is_string($GLOBALS['showtable'])) {
$GLOBALS['showtable'] = [];
if (is_string($showTable)) {
$showTable = [];
}
if (empty($GLOBALS['showtable']['Data_length'])) {
$GLOBALS['showtable']['Data_length'] = 0;
if (empty($showTable['Data_length'])) {
$showTable['Data_length'] = 0;
}
if (empty($GLOBALS['showtable']['Index_length'])) {
$GLOBALS['showtable']['Index_length'] = 0;
if (empty($showTable['Index_length'])) {
$showTable['Index_length'] = 0;
}
$isInnoDB = (isset($GLOBALS['showtable']['Type'])
&& $GLOBALS['showtable']['Type'] === 'InnoDB');
$isInnoDB = (isset($showTable['Type'])
&& $showTable['Type'] === 'InnoDB');
$mergetable = $this->tableObj->isMerge();
// this is to display for example 261.2 MiB instead of 268k KiB
$maxDigits = 3;
$decimals = 1;
[$dataSize, $dataUnit] = Util::formatByteDown($GLOBALS['showtable']['Data_length'], $maxDigits, $decimals);
[$dataSize, $dataUnit] = Util::formatByteDown($showTable['Data_length'], $maxDigits, $decimals);
if ($mergetable === false) {
[$indexSize, $indexUnit] = Util::formatByteDown(
$GLOBALS['showtable']['Index_length'],
$maxDigits,
$decimals,
);
[$indexSize, $indexUnit] = Util::formatByteDown($showTable['Index_length'], $maxDigits, $decimals);
}
if (isset($GLOBALS['showtable']['Data_free'])) {
[$freeSize, $freeUnit] = Util::formatByteDown($GLOBALS['showtable']['Data_free'], $maxDigits, $decimals);
if (isset($showTable['Data_free'])) {
[$freeSize, $freeUnit] = Util::formatByteDown($showTable['Data_free'], $maxDigits, $decimals);
[$effectSize, $effectUnit] = Util::formatByteDown(
$GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length']
- $GLOBALS['showtable']['Data_free'],
$showTable['Data_length']
+ $showTable['Index_length']
- $showTable['Data_free'],
$maxDigits,
$decimals,
);
} else {
[$effectSize, $effectUnit] = Util::formatByteDown(
$GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length'],
$showTable['Data_length']
+ $showTable['Index_length'],
$maxDigits,
$decimals,
);
}
[$totSize, $totUnit] = Util::formatByteDown(
$GLOBALS['showtable']['Data_length'] + $GLOBALS['showtable']['Index_length'],
$showTable['Data_length'] + $showTable['Index_length'],
$maxDigits,
$decimals,
);
@ -359,9 +360,9 @@ class StructureController extends AbstractController
$avgUnit = '';
if ($tableInfoNunRows > 0) {
[$avgSize, $avgUnit] = Util::formatByteDown(
($GLOBALS['showtable']['Data_length']
+ $GLOBALS['showtable']['Index_length'])
/ $GLOBALS['showtable']['Rows'],
($showTable['Data_length']
+ $showTable['Index_length'])
/ $showTable['Rows'],
6,
1,
);
@ -381,22 +382,22 @@ class StructureController extends AbstractController
$tableCollation = ['name' => $collation->getName(), 'description' => $collation->getDescription()];
}
if (isset($GLOBALS['showtable']['Create_time'])) {
$GLOBALS['showtable']['Create_time'] = Util::localisedDate(strtotime($GLOBALS['showtable']['Create_time']));
if (isset($showTable['Create_time'])) {
$showTable['Create_time'] = Util::localisedDate(strtotime($showTable['Create_time']));
}
if (isset($GLOBALS['showtable']['Update_time'])) {
$GLOBALS['showtable']['Update_time'] = Util::localisedDate(strtotime($GLOBALS['showtable']['Update_time']));
if (isset($showTable['Update_time'])) {
$showTable['Update_time'] = Util::localisedDate(strtotime($showTable['Update_time']));
}
if (isset($GLOBALS['showtable']['Check_time'])) {
$GLOBALS['showtable']['Check_time'] = Util::localisedDate(strtotime($GLOBALS['showtable']['Check_time']));
if (isset($showTable['Check_time'])) {
$showTable['Check_time'] = Util::localisedDate(strtotime($showTable['Check_time']));
}
return $this->template->render('table/structure/display_table_stats', [
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table'],
'showtable' => $GLOBALS['showtable'],
'showtable' => $showTable,
'table_info_num_rows' => $tableInfoNunRows,
'tbl_is_view' => $tableIsAView,
'db_is_system_schema' => $isSystemSchema,

View File

@ -91,7 +91,6 @@ class MultiTableQuery
false, // is_gotofile
$db, // db
null, // table
null, // find_real_end
null, // sql_query_for_bookmark - see below
null, // message_to_show
null, // sql_data

View File

@ -20,7 +20,6 @@ use PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Sql;
use PhpMyAdmin\Plugins\Transformations\Text_Plain_Link;
use PhpMyAdmin\Plugins\TransformationsPlugin;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Sanitize;
use PhpMyAdmin\Sql;
use PhpMyAdmin\SqlParser\Parser;
use PhpMyAdmin\SqlParser\Statements\SelectStatement;
@ -139,13 +138,6 @@ class Results
*/
private string|int $numRows = 0;
/**
* table definitions
*
* @var array<string, mixed>|null
*/
private array|null $showTable = null;
/** @var bool[] */
private array $highlightColumns = [];
@ -340,23 +332,22 @@ class Results
/**
* Set properties which were not initialized at the constructor
*
* @param int|string $unlimNumRows the total number of rows returned by the SQL query without
* any appended "LIMIT" clause programmatically
* @param FieldMetadata[] $fieldsMeta meta information about fields
* @param bool $isCount statement is SELECT COUNT
* @param bool $isExport statement contains INTO OUTFILE
* @param bool $isFunction statement contains a function like SUM()
* @param bool $isAnalyse statement contains PROCEDURE ANALYSE
* @param int|string $numRows total no. of rows returned by SQL query
* @param float $queryTime time taken for execute the SQL query
* @param string $textDirection text direction
* @param bool $isMaintenance statement contains a maintenance command
* @param bool $isExplain statement contains EXPLAIN
* @param bool $isShow statement contains SHOW
* @param array<string, mixed>|null $showTable table definitions
* @param bool $printView print view was requested
* @param bool $editable whether the results set is editable
* @param bool $isBrowseDistinct whether browsing distinct values
* @param int|string $unlimNumRows the total number of rows returned by the SQL query without
* any appended "LIMIT" clause programmatically
* @param FieldMetadata[] $fieldsMeta meta information about fields
* @param bool $isCount statement is SELECT COUNT
* @param bool $isExport statement contains INTO OUTFILE
* @param bool $isFunction statement contains a function like SUM()
* @param bool $isAnalyse statement contains PROCEDURE ANALYSE
* @param int|string $numRows total no. of rows returned by SQL query
* @param float $queryTime time taken for execute the SQL query
* @param string $textDirection text direction
* @param bool $isMaintenance statement contains a maintenance command
* @param bool $isExplain statement contains EXPLAIN
* @param bool $isShow statement contains SHOW
* @param bool $printView print view was requested
* @param bool $editable whether the results set is editable
* @param bool $isBrowseDistinct whether browsing distinct values
* @psalm-param int|numeric-string $unlimNumRows
* @psalm-param int|numeric-string $numRows
*/
@ -373,7 +364,6 @@ class Results
bool $isMaintenance,
bool $isExplain,
bool $isShow,
array|null $showTable,
bool $printView,
bool $editable,
bool $isBrowseDistinct,
@ -390,7 +380,6 @@ class Results
$this->isMaintenance = $isMaintenance;
$this->isExplain = $isExplain;
$this->isShow = $isShow;
$this->showTable = $showTable;
$this->printView = $printView;
$this->editable = $editable;
$this->isBrowseDistinct = $isBrowseDistinct;
@ -631,7 +620,6 @@ class Results
*
* @param int $posNext the offset for the "next" page
* @param int $posPrevious the offset for the "previous" page
* @param bool $isInnodb whether its InnoDB or not
* @param mixed[] $sortByKeyData the sort by key dialog
*
* @return mixed[]
@ -639,7 +627,6 @@ class Results
private function getTableNavigation(
int $posNext,
int $posPrevious,
bool $isInnodb,
array $sortByKeyData,
): array {
$isShowingAll = $_SESSION['tmpval']['max_rows'] === self::ALL_ROWS;
@ -665,7 +652,6 @@ class Results
: 'false') . ';"';
$config = Config::getInstance();
$hasRealEndInput = $isInnodb && $this->unlimNumRows > $config->settings['MaxExactCount'];
$posLast = 0;
if (is_numeric($_SESSION['tmpval']['max_rows'])) {
$posLast = @((int) ceil(
@ -697,7 +683,6 @@ class Results
'pos_last' => $posLast,
'is_last_page' => $isLastPage,
'is_last_page_known' => $this->unlimNumRows !== false,
'has_real_end_input' => $hasRealEndInput,
'onsubmit' => $onsubmit,
];
}
@ -3174,24 +3159,8 @@ class Results
$statement = null;
}
/**
* @todo move this to a central place
* @todo for other future table types
*/
$isInnodb = (isset($this->showTable['Type'])
&& $this->showTable['Type'] === self::TABLE_TYPE_INNO_DB);
if ($isInnodb && Sql::isJustBrowsing($statementInfo, true)) {
$preCount = '~';
$afterCount = Generator::showHint(
Sanitize::convertBBCode(
__('May be approximate. See [doc@faq3-11]FAQ 3.11[/doc].'),
),
);
} else {
$preCount = '';
$afterCount = '';
}
$preCount = '';
$afterCount = '';
// 1. ----- Prepares the work -----
@ -3286,7 +3255,7 @@ class Results
$navigation = [];
if ($displayParts->hasNavigationBar && $statement !== null && empty($statement->limit)) {
$navigation = $this->getTableNavigation($posNext, $posPrev, $isInnodb, $sortByKeyData);
$navigation = $this->getTableNavigation($posNext, $posPrev, $sortByKeyData);
}
// 2b ----- Get field references from Database -----

View File

@ -36,7 +36,6 @@ use function count;
use function defined;
use function htmlspecialchars;
use function in_array;
use function is_array;
use function session_start;
use function session_write_close;
use function sprintf;
@ -369,10 +368,8 @@ class Sql
/**
* Function to check whether this query is for just browsing
*
* @param bool|null $findRealEnd whether the real end should be found
*/
public static function isJustBrowsing(StatementInfo $statementInfo, bool|null $findRealEnd): bool
public static function isJustBrowsing(StatementInfo $statementInfo, bool $findRealEnd = false): bool
{
return ! $statementInfo->isGroup
&& ! $statementInfo->isFunction
@ -384,7 +381,7 @@ class Sql
|| (count($statementInfo->statement->where) === 1
&& $statementInfo->statement->where[0]->expr === '1'))
&& ! $statementInfo->group
&& ! isset($findRealEnd)
&& ! $findRealEnd
&& ! $statementInfo->isSubquery
&& ! $statementInfo->join
&& ! $statementInfo->having;
@ -412,22 +409,6 @@ class Sql
return ! $allowUserDropDatabase && $statementInfo->dropDatabase && ! $isSuperUser;
}
/**
* Function to find the real end of rows
*
* @param string $db the current database
* @param string $table the current table
*
* @return int the number of rows
*/
public function findRealEndOfRows(string $db, string $table): int
{
$unlimNumRows = $this->dbi->getTable($db, $table)->countRecords(true);
$_SESSION['tmpval']['pos'] = $this->getStartPosToDisplayRow($unlimNumRows);
return $unlimNumRows;
}
/**
* Function to get the default sql query for browsing page
*
@ -661,9 +642,6 @@ class Sql
// and no WHERE clause (or just 'WHERE 1 '),
// we do a quick count (which uses MaxExactCount) because
// SQL_CALC_FOUND_ROWS is not quick on large InnoDB tables
// However, do not count again if we did it previously
// due to $find_real_end == true
if ($justBrowsing) {
// Get row count (is approximate for InnoDB)
$unlimNumRows = $this->dbi->getTable($db, $table)->countRecords();
@ -717,7 +695,6 @@ class Sql
* @param bool $isGotoFile whether to go to a file
* @param string $db current database
* @param string|null $table current table
* @param bool|null $findRealEnd whether to find the real end
* @param string|null $sqlQueryForBookmark sql query to be stored as bookmark
*
* @psalm-return array{
@ -734,7 +711,6 @@ class Sql
bool $isGotoFile,
string $db,
string|null $table,
bool|null $findRealEnd,
string|null $sqlQueryForBookmark,
): array {
$response = ResponseRenderer::getInstance();
@ -787,7 +763,7 @@ class Sql
$profilingResults = Profiling::getInformation($this->dbi);
$justBrowsing = self::isJustBrowsing($statementInfo, $findRealEnd ?? null);
$justBrowsing = self::isJustBrowsing($statementInfo);
$unlimNumRows = $this->countQueryResults($numRows, $justBrowsing, $db, $table ?? '', $statementInfo);
@ -999,7 +975,6 @@ class Sql
false,
0,
$numRows,
null,
$result,
$statementInfo,
true,
@ -1083,7 +1058,6 @@ class Sql
* @param bool $editable whether the result table is editable or not
* @param int|string $unlimNumRows unlimited number of rows
* @param int|string $numRows number of rows
* @param mixed[]|null $showTable table definitions
* @param ResultInterface $result result of the executed query
* @param bool $isLimitedDisplay Show only limited operations or not
* @psalm-param int|numeric-string $unlimNumRows
@ -1095,7 +1069,6 @@ class Sql
bool $editable,
int|string $unlimNumRows,
int|string $numRows,
array|null $showTable,
ResultInterface $result,
StatementInfo $statementInfo,
bool $isLimitedDisplay = false,
@ -1108,7 +1081,6 @@ class Sql
$result,
$displayResultsObject,
$statementInfo,
$showTable,
$printView,
$editable,
$isBrowseDistinct,
@ -1130,7 +1102,6 @@ class Sql
$statementInfo->isMaint,
$statementInfo->isExplain,
$statementInfo->isShow,
$showTable,
$printView,
$editable,
$isBrowseDistinct,
@ -1139,12 +1110,10 @@ class Sql
return $displayResultsObject->getTable($result, $displayParts, $statementInfo, $isLimitedDisplay);
}
/** @param mixed[]|null $showTable table definitions */
private function getHtmlForStoredProcedureResults(
ResultInterface $result,
DisplayResults $displayResultsObject,
StatementInfo $statementInfo,
array|null $showTable,
bool $printView,
bool $editable,
bool $isBrowseDistinct,
@ -1169,7 +1138,6 @@ class Sql
$statementInfo->isMaint,
$statementInfo->isExplain,
$statementInfo->isShow,
$showTable,
$printView,
$editable,
$isBrowseDistinct,
@ -1307,8 +1275,6 @@ class Sql
string $sqlQuery,
string|null $completeQuery,
): string {
$GLOBALS['showtable'] ??= null;
// If we are retrieving the full value of a truncated field or the original
// value of a transformed field, show it here
if (isset($_POST['grid_edit']) && $_POST['grid_edit'] == true) {
@ -1319,11 +1285,6 @@ class Sql
// Gets the list of fields properties
$fieldsMeta = $this->dbi->getFieldsMeta($result);
// Should be initialized these parameters before parsing
if (! is_array($GLOBALS['showtable'])) {
$GLOBALS['showtable'] = null;
}
$response = ResponseRenderer::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
@ -1427,7 +1388,6 @@ class Sql
$editable,
$unlimNumRows,
$numRows,
$GLOBALS['showtable'],
$result,
$statementInfo,
);
@ -1469,7 +1429,6 @@ class Sql
* @param bool $isGotoFile whether goto file or not
* @param string $db current database
* @param string|null $table current table
* @param bool|null $findRealEnd whether to find real end or not
* @param string|null $sqlQueryForBookmark the sql query to be stored as bookmark
* @param string|null $messageToShow message to show
* @param mixed[]|null $sqlData sql data
@ -1484,7 +1443,6 @@ class Sql
bool $isGotoFile,
string $db,
string|null $table,
bool|null $findRealEnd,
string|null $sqlQueryForBookmark,
string|null $messageToShow,
array|null $sqlData,
@ -1506,7 +1464,6 @@ class Sql
$isGotoFile, // is_gotofile
$db, // db
$table, // table
$findRealEnd, // find_real_end
$sqlQueryForBookmark, // sql_query_for_bookmark
$messageToShow, // message_to_show
$sqlData, // sql_data
@ -1524,7 +1481,6 @@ class Sql
* @param bool $isGotoFile whether goto file or not
* @param string $db current database
* @param string|null $table current table
* @param bool|null $findRealEnd whether to find real end or not
* @param string|null $sqlQueryForBookmark the sql query to be stored as bookmark
* @param string|null $messageToShow message to show
* @param mixed[]|null $sqlData sql data
@ -1541,7 +1497,6 @@ class Sql
bool $isGotoFile,
string $db,
string|null $table,
bool|null $findRealEnd,
string|null $sqlQueryForBookmark,
string|null $messageToShow,
array|null $sqlData,
@ -1611,7 +1566,6 @@ class Sql
$isGotoFile,
$db,
$table,
$findRealEnd,
$sqlQueryForBookmark,
);

View File

@ -375,11 +375,11 @@ 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(): int
public function getNumRows(string $showTableName): int
{
$tableNumRowInfo = $this->getStatusInfo('TABLE_ROWS', false, true);
if ($tableNumRowInfo === false) {
$tableNumRowInfo = $this->dbi->getTable($this->dbName, $GLOBALS['showtable']['Name'])
$tableNumRowInfo = $this->dbi->getTable($this->dbName, $showTableName)
->countRecords(true);
}

View File

@ -19,7 +19,6 @@ class DeleteRowsControllerTest extends AbstractTestCase
public function testDeleteRowsController(): void
{
$GLOBALS['goto'] = null;
$GLOBALS['showtable'] = null;
$GLOBALS['db'] = 'test_db';
$GLOBALS['table'] = 'test_table';
$GLOBALS['urlParams'] = [];

View File

@ -45,7 +45,6 @@ class ReplaceControllerTest extends AbstractTestCase
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
DatabaseInterface::$instance = $this->dbi;
$GLOBALS['server'] = 1;
$GLOBALS['showtable'] = null;
$GLOBALS['db'] = 'my_db';
$GLOBALS['table'] = 'test_tbl';

View File

@ -1170,7 +1170,6 @@ class ResultsTest extends AbstractTestCase
$statementInfo->isMaint,
$statementInfo->isExplain,
$statementInfo->isShow,
null,
false,
true,
false,
@ -1463,7 +1462,6 @@ class ResultsTest extends AbstractTestCase
$statementInfo->isMaint,
$statementInfo->isExplain,
$statementInfo->isShow,
null,
false,
true,
true,

View File

@ -61,7 +61,6 @@ class SqlTest extends AbstractTestCase
$config->settings['Confirm'] = true;
$config->settings['LoginCookieValidity'] = 1440;
$config->settings['enable_drag_drop_import'] = true;
$GLOBALS['showtable'] = null;
$relation = new Relation($this->dbi);
$this->sql = new Sql(
@ -159,17 +158,14 @@ class SqlTest extends AbstractTestCase
$this->assertTrue(Sql::isJustBrowsing(
ParseAnalyze::sqlQuery('SELECT * FROM db.tbl', $GLOBALS['db'])[0],
null,
));
$this->assertTrue(Sql::isJustBrowsing(
ParseAnalyze::sqlQuery('SELECT * FROM tbl WHERE 1', $GLOBALS['db'])[0],
null,
));
$this->assertFalse(Sql::isJustBrowsing(
ParseAnalyze::sqlQuery('SELECT * from tbl1, tbl2 LIMIT 0, 10', $GLOBALS['db'])[0],
null,
));
}
@ -607,7 +603,6 @@ class SqlTest extends AbstractTestCase
null,
null,
null,
null,
'index.php?route=/sql',
null,
null,