Merge pull request #18138 from kamil-tekiela/Fix-issue-with-numerical-table-name

Fix more issues with numerical table names
This commit is contained in:
Maurício Meneghini Fauth 2023-02-24 19:27:44 -03:00 committed by GitHub
commit 39855af4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 23 deletions

View File

@ -620,11 +620,12 @@ class DatabaseInterface implements DbalInterface
*/
public function getVirtualTables(string $db): array
{
$tables_full = array_keys($this->getTablesFull($db));
/** @var string[] $tables_full */
$tables_full = array_column($this->getTablesFull($db), 'TABLE_NAME');
$views = [];
foreach ($tables_full as $table) {
$table = $this->getTable($db, (string) $table);
$table = $this->getTable($db, $table);
if (! $table->isView()) {
continue;
}

View File

@ -325,7 +325,9 @@ class Util
$tableGroups = [];
foreach ($tables as $tableName => $table) {
foreach ($tables as $table) {
/** @var string $tableName */
$tableName = $table['TABLE_NAME'];
$table['Rows'] = self::checkRowCount($db, $table);
// in $group we save the reference to the place in $table_groups
@ -2288,18 +2290,15 @@ class Util
}
}
$tables = array_merge(
$groupTable,
$dbi->getTablesFull(
$db,
$groupWithSeparator !== false ? $groupWithSeparator : '',
$groupWithSeparator !== false,
$limitOffset,
$limitCount,
$sort,
$sortOrder,
$tableType
)
$tables = $groupTable + $dbi->getTablesFull(
$db,
$groupWithSeparator !== false ? $groupWithSeparator : '',
$groupWithSeparator !== false,
$limitOffset,
$limitCount,
$sort,
$sortOrder,
$tableType
);
}
@ -2402,10 +2401,7 @@ class Util
}
if (count($names) > 0) {
$tables = array_merge(
$tables,
$dbi->getTablesFull($db, $names)
);
$tables += $dbi->getTablesFull($db, $names);
}
if ($GLOBALS['cfg']['NaturalOrder']) {

View File

@ -14441,14 +14441,12 @@
<code>$table['Name']</code>
<code>$user</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="5">
<MixedArgumentTypeCoercion occurrences="3">
<code>$columnNames</code>
<code>$tableName</code>
<code>$tableName</code>
<code>uksort($tables, 'strnatcasecmp')</code>
<code>uksort($tables, 'strnatcasecmp')</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess occurrences="21">
<MixedArrayAccess occurrences="22">
<code>$_SESSION['tmpval']['table_limit_offset']</code>
<code>$row['Cardinality']</code>
<code>$row['Column_name']</code>
@ -14470,6 +14468,7 @@
<code>$row['Seq_in_index']</code>
<code>$row['Seq_in_index']</code>
<code>$row['Sub_part']</code>
<code>$table['TABLE_NAME']</code>
</MixedArrayAccess>
<MixedArrayAssignment occurrences="3">
<code>$_SESSION['tmpval']['table_limit_offset']</code>