Merge pull request #19470 from kamil-tekiela/getColumnsFull
Remove DatabaseInterface::getColumnsFull()
This commit is contained in:
commit
38f42dab62
@ -1614,18 +1614,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLUMN_NAME'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''DATA_TYPE'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: '#^Cannot cast mixed to string\.$#'
|
||||
identifier: cast.string
|
||||
@ -1662,12 +1650,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\ConfigStorage\\Relation\:\:getDisplayField\(\) should return string but returns mixed\.$#'
|
||||
identifier: return.type
|
||||
count: 1
|
||||
path: src/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\ConfigStorage\\Relation\:\:getTableReplacementNames\(\) should return array\<string, string\> but returns array\<string, array\<array\<string\>\|bool\|int\|string\>\|int\<1, max\>\|string\|true\>\.$#'
|
||||
identifier: return.type
|
||||
@ -1873,7 +1855,7 @@ parameters:
|
||||
path: src/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$type of method PhpMyAdmin\\Types\:\:getTypeClass\(\) expects string, mixed given\.$#'
|
||||
message: '#^Parameter \#1 \$type of method PhpMyAdmin\\Types\:\:getTypeClass\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/ConfigStorage/Relation.php
|
||||
@ -6681,18 +6663,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Dbal/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: '#^Foreach overwrites \$database with its value variable\.$#'
|
||||
identifier: foreach.valueOverwrite
|
||||
count: 1
|
||||
path: src/Dbal/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: '#^Foreach overwrites \$table with its value variable\.$#'
|
||||
identifier: foreach.valueOverwrite
|
||||
count: 1
|
||||
path: src/Dbal/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
|
||||
identifier: equal.notAllowed
|
||||
@ -6705,12 +6675,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Dbal/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Dbal\\DatabaseInterface\:\:getColumnsFull\(\) should return array\<mixed\> but returns mixed\.$#'
|
||||
identifier: return.type
|
||||
count: 1
|
||||
path: src/Dbal/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Dbal\\DatabaseInterface\:\:getCurrentRoles\(\) should return list\<string\> but returns mixed\.$#'
|
||||
identifier: return.type
|
||||
@ -12093,12 +12057,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#'
|
||||
identifier: binaryOp.invalid
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '''
|
||||
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:
|
||||
@ -12123,12 +12081,6 @@ parameters:
|
||||
count: 2
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''alias'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
@ -12150,7 +12102,7 @@ parameters:
|
||||
-
|
||||
message: '#^Cannot access offset \(int\|string\) on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
@ -12162,7 +12114,7 @@ parameters:
|
||||
-
|
||||
message: '#^Cannot access offset string on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 10
|
||||
count: 11
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
@ -14568,174 +14520,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Properties/Options/OptionsPropertyGroup.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''CHARACTER_MAXIMUM_LENGTH'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''CHARACTER_OCTET_LENGTH'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''CHARACTER_SET_NAME'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLLATION_NAME'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLUMN_COMMENT'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLUMN_DEFAULT'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLUMN_KEY'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLUMN_NAME'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''COLUMN_TYPE'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Collation'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Comment'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''DATA_TYPE'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Default'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''EXTRA'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Extra'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Field'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''IS_NULLABLE'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Key'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''NUMERIC_PRECISION'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''NUMERIC_SCALE'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Null'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''ORDINAL_POSITION'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''PRIVILEGES'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Privileges'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''TABLE_CATALOG'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''TABLE_NAME'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''TABLE_SCHEMA'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Query/Compatibility.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
|
||||
identifier: equal.notAllowed
|
||||
@ -16701,18 +16485,6 @@ parameters:
|
||||
count: 2
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Field'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''Type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''foreign_db'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
@ -16797,12 +16569,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Table\\Table\:\:getNameAndTypeOfTheColumns\(\) should return array\<string, string\> but returns array\.$#'
|
||||
identifier: return.type
|
||||
count: 1
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Table\\Table\:\:getUiPrefsFromDb\(\) should return array\<mixed\> but returns mixed\.$#'
|
||||
identifier: return.type
|
||||
@ -16875,12 +16641,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Table/Table.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#3 \$foreignDb of method PhpMyAdmin\\Table\\Table\:\:getSQLToCreateForeignKey\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
|
||||
@ -677,7 +677,6 @@
|
||||
<code><![CDATA[$_SESSION['sql_history']]]></code>
|
||||
<code><![CDATA[$_SESSION['sql_history']]]></code>
|
||||
<code><![CDATA[$_SESSION['sql_history']]]></code>
|
||||
<code><![CDATA[$column['DATA_TYPE']]]></code>
|
||||
<code><![CDATA[$columns['table_name']]]></code>
|
||||
<code><![CDATA[$columns['table_schema']]]></code>
|
||||
<code><![CDATA[$foreignDb]]></code>
|
||||
@ -689,10 +688,6 @@
|
||||
<MixedArgumentTypeCoercion>
|
||||
<code><![CDATA[uksort($foreign, strnatcasecmp(...))]]></code>
|
||||
</MixedArgumentTypeCoercion>
|
||||
<MixedArrayAccess>
|
||||
<code><![CDATA[$column['COLUMN_NAME']]]></code>
|
||||
<code><![CDATA[$column['DATA_TYPE']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedArrayAssignment>
|
||||
<code><![CDATA[$_SESSION['sql_history'][]]]></code>
|
||||
</MixedArrayAssignment>
|
||||
@ -700,7 +695,6 @@
|
||||
<code><![CDATA[$foreign[$key]]]></code>
|
||||
</MixedArrayOffset>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$column]]></code>
|
||||
<code><![CDATA[$foreignDb]]></code>
|
||||
<code><![CDATA[$foreignField]]></code>
|
||||
<code><![CDATA[$foreignTable]]></code>
|
||||
@ -711,10 +705,8 @@
|
||||
</MixedAssignment>
|
||||
<MixedInferredReturnType>
|
||||
<code><![CDATA[array|false]]></code>
|
||||
<code><![CDATA[string]]></code>
|
||||
</MixedInferredReturnType>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[$column['COLUMN_NAME']]]></code>
|
||||
<code><![CDATA[$foreigners[$column]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<MixedReturnTypeCoercion>
|
||||
@ -4204,7 +4196,6 @@
|
||||
<MixedInferredReturnType>
|
||||
<code><![CDATA[list<string>]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[string]]></code>
|
||||
</MixedInferredReturnType>
|
||||
<MixedOperand>
|
||||
@ -4215,8 +4206,6 @@
|
||||
<code><![CDATA[$resultRows]]></code>
|
||||
<code><![CDATA[SessionCache::get('mysql_cur_role')]]></code>
|
||||
<code><![CDATA[SessionCache::get('mysql_cur_user')]]></code>
|
||||
<code><![CDATA[reset($columns)]]></code>
|
||||
<code><![CDATA[reset($columns)]]></code>
|
||||
</MixedReturnStatement>
|
||||
<MixedReturnTypeCoercion>
|
||||
<code><![CDATA[$this->fetchResultSimple($sql, $connectionType)]]></code>
|
||||
@ -7084,7 +7073,6 @@
|
||||
<code><![CDATA[$aliases[$oldDatabase]['tables'][$oldTable]]]></code>
|
||||
<code><![CDATA[$aliases[$oldDatabase]['tables'][$oldTable]['columns']]]></code>
|
||||
<code><![CDATA[$columnAliases[$column['name']]]]></code>
|
||||
<code><![CDATA[$definition['Type']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedArrayTypeCoercion>
|
||||
<code><![CDATA[$row[$j]]]></code>
|
||||
@ -7094,7 +7082,6 @@
|
||||
<code><![CDATA[$colAlias]]></code>
|
||||
<code><![CDATA[$colAs]]></code>
|
||||
<code><![CDATA[$columnAliases]]></code>
|
||||
<code><![CDATA[$definition]]></code>
|
||||
<code><![CDATA[$field->name]]></code>
|
||||
<code><![CDATA[$field->references->table->table]]></code>
|
||||
<code><![CDATA[$newDatabase]]></code>
|
||||
@ -7105,9 +7092,6 @@
|
||||
<code><![CDATA[$statement->name->table]]></code>
|
||||
<code><![CDATA[$statement->table->table]]></code>
|
||||
</MixedAssignment>
|
||||
<MixedOperand>
|
||||
<code><![CDATA[$definition['Type']]]></code>
|
||||
</MixedOperand>
|
||||
<MixedPropertyTypeCoercion>
|
||||
<code><![CDATA[$field->key->columns]]></code>
|
||||
<code><![CDATA[$field->references->columns]]></code>
|
||||
@ -8696,33 +8680,6 @@
|
||||
</RiskyTruthyFalsyComparison>
|
||||
</file>
|
||||
<file src="src/Query/Compatibility.php">
|
||||
<MixedArrayAccess>
|
||||
<code><![CDATA[$columns[$columnName]['Collation']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Comment']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Default']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Extra']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Field']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Key']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Null']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Privileges']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['Type']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedArrayAssignment>
|
||||
<code><![CDATA[$columns[$columnName]['CHARACTER_MAXIMUM_LENGTH']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['CHARACTER_OCTET_LENGTH']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['CHARACTER_SET_NAME']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['DATA_TYPE']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['NUMERIC_PRECISION']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['NUMERIC_SCALE']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['ORDINAL_POSITION']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['TABLE_CATALOG']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['TABLE_NAME']]]></code>
|
||||
<code><![CDATA[$columns[$columnName]['TABLE_SCHEMA']]]></code>
|
||||
</MixedArrayAssignment>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$colCollation]]></code>
|
||||
<code><![CDATA[$colType]]></code>
|
||||
</MixedAssignment>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$eachTables[$tableName]['Comment'] ?? '']]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
@ -9720,7 +9677,6 @@
|
||||
<code><![CDATA[$index]]></code>
|
||||
<code><![CDATA[$index[0]]]></code>
|
||||
<code><![CDATA[$options['expr']]]></code>
|
||||
<code><![CDATA[$row['Type']]]></code>
|
||||
<code><![CDATA[$this->uiprefs[$property->value]]]></code>
|
||||
<code><![CDATA[$this->uiprefs[$property->value]]]></code>
|
||||
</MixedArgument>
|
||||
@ -9735,10 +9691,6 @@
|
||||
<code><![CDATA[$existrel[$masterField]['foreign_table']]]></code>
|
||||
<code><![CDATA[$index[0]]]></code>
|
||||
<code><![CDATA[$index[0]]]></code>
|
||||
<code><![CDATA[$row['Field']]]></code>
|
||||
<code><![CDATA[$row['Field']]]></code>
|
||||
<code><![CDATA[$row['Type']]]></code>
|
||||
<code><![CDATA[$row['Type']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedArrayAssignment>
|
||||
<code><![CDATA[$_SESSION['tmpval']['table_uiprefs']]]></code>
|
||||
@ -9747,15 +9699,11 @@
|
||||
<code><![CDATA[$_SESSION['tmpval']['table_uiprefs'][$serverId][$this->dbName][$this->name]]]></code>
|
||||
</MixedArrayAssignment>
|
||||
<MixedArrayOffset>
|
||||
<code><![CDATA[$columns[$row['Field']]]]></code>
|
||||
<code><![CDATA[$columns[$row['Field']]]]></code>
|
||||
<code><![CDATA[$optionsArray[$_POST['on_delete'][$masterFieldMd5]]]]></code>
|
||||
<code><![CDATA[$optionsArray[$_POST['on_update'][$masterFieldMd5]]]]></code>
|
||||
</MixedArrayOffset>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$columns[$row['Field']]]]></code>
|
||||
<code><![CDATA[$index]]></code>
|
||||
<code><![CDATA[$row]]></code>
|
||||
</MixedAssignment>
|
||||
<MixedInferredReturnType>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
@ -9766,10 +9714,6 @@
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[json_decode($value, true)]]></code>
|
||||
</MixedReturnStatement>
|
||||
<MixedReturnTypeCoercion>
|
||||
<code><![CDATA[$columns]]></code>
|
||||
<code><![CDATA[array<string, string>]]></code>
|
||||
</MixedReturnTypeCoercion>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$_POST['constraint_name'][$masterFieldMd5]]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
|
||||
@ -43,6 +43,7 @@ use function mb_strtoupper;
|
||||
use function mb_substr;
|
||||
use function natcasesort;
|
||||
use function preg_match;
|
||||
use function preg_replace;
|
||||
use function sprintf;
|
||||
use function str_contains;
|
||||
use function str_replace;
|
||||
@ -500,10 +501,11 @@ class Relation
|
||||
/**
|
||||
* Pick first char field
|
||||
*/
|
||||
$columns = $this->dbi->getColumnsFull($db, $table);
|
||||
$columns = $this->dbi->getColumns($db, $table);
|
||||
foreach ($columns as $column) {
|
||||
if ($this->dbi->types->getTypeClass($column['DATA_TYPE']) === TypeClass::Char) {
|
||||
return $column['COLUMN_NAME'];
|
||||
$columnType = preg_replace('@(\(.*)|(\s/.*)@s', '', $column->type);
|
||||
if ($this->dbi->types->getTypeClass($columnType) === TypeClass::Char) {
|
||||
return $column->field;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ use function is_int;
|
||||
use function mb_strtolower;
|
||||
use function microtime;
|
||||
use function openlog;
|
||||
use function reset;
|
||||
use function sprintf;
|
||||
use function str_contains;
|
||||
use function str_replace;
|
||||
@ -745,68 +744,6 @@ class DatabaseInterface
|
||||
return $databases;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns detailed array with all columns for given table in database,
|
||||
* or all tables/databases
|
||||
*
|
||||
* @param string|null $database name of database
|
||||
* @param string|null $table name of table to retrieve columns from
|
||||
* @param string|null $column name of specific column
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function getColumnsFull(
|
||||
string|null $database = null,
|
||||
string|null $table = null,
|
||||
string|null $column = null,
|
||||
ConnectionType $connectionType = ConnectionType::User,
|
||||
): array {
|
||||
if (! $this->config->selectedServer['DisableIS']) {
|
||||
$sql = QueryGenerator::getInformationSchemaColumnsFullRequest(
|
||||
$database !== null ? $this->quoteString($database, $connectionType) : null,
|
||||
$table !== null ? $this->quoteString($table, $connectionType) : null,
|
||||
$column !== null ? $this->quoteString($column, $connectionType) : null,
|
||||
);
|
||||
$arrayKeys = QueryGenerator::getInformationSchemaColumns($database, $table, $column);
|
||||
|
||||
return $this->fetchResult($sql, $arrayKeys, null, $connectionType);
|
||||
}
|
||||
|
||||
$columns = [];
|
||||
if ($database === null) {
|
||||
foreach ($this->getDatabaseList() as $database) {
|
||||
$columns[$database] = $this->getColumnsFull($database, null, null, $connectionType);
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
if ($table === null) {
|
||||
$tables = $this->getTables($database);
|
||||
foreach ($tables as $table) {
|
||||
$columns[$table] = $this->getColumnsFull($database, $table, null, $connectionType);
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
$sql = 'SHOW FULL COLUMNS FROM '
|
||||
. Util::backquote($database) . '.' . Util::backquote($table);
|
||||
if ($column !== null) {
|
||||
$sql .= ' LIKE ' . $this->quoteString($column, $connectionType);
|
||||
}
|
||||
|
||||
$columns = $this->fetchResult($sql, 'Field', null, $connectionType);
|
||||
|
||||
$columns = Compatibility::getISCompatForGetColumnsFull($columns, $database, $table);
|
||||
|
||||
if ($column !== null) {
|
||||
return reset($columns);
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns description of a $column in given table
|
||||
*
|
||||
|
||||
@ -1260,14 +1260,14 @@ class ExportSql extends ExportPlugin
|
||||
|
||||
$createQuery .= Util::backquote($viewAlias) . ' (' . "\n";
|
||||
$tmp = [];
|
||||
$columns = DatabaseInterface::getInstance()->getColumnsFull($db, $view);
|
||||
foreach ($columns as $columnName => $definition) {
|
||||
$colAlias = $columnName;
|
||||
$columns = DatabaseInterface::getInstance()->getColumns($db, $view);
|
||||
foreach ($columns as $column) {
|
||||
$colAlias = $column->field;
|
||||
if (! empty($aliases[$db]['tables'][$view]['columns'][$colAlias])) {
|
||||
$colAlias = $aliases[$db]['tables'][$view]['columns'][$colAlias];
|
||||
}
|
||||
|
||||
$tmp[] = Util::backquote($colAlias) . ' ' . $definition['Type'] . "\n";
|
||||
$tmp[] = Util::backquote($colAlias) . ' ' . $column->type . "\n";
|
||||
}
|
||||
|
||||
return $createQuery . implode(',', $tmp) . ');' . "\n";
|
||||
|
||||
@ -9,11 +9,7 @@ use PhpMyAdmin\Util;
|
||||
|
||||
use function array_keys;
|
||||
use function in_array;
|
||||
use function is_string;
|
||||
use function strlen;
|
||||
use function strpos;
|
||||
use function strtoupper;
|
||||
use function substr;
|
||||
|
||||
/**
|
||||
* Handles data compatibility from SQL query results
|
||||
@ -76,55 +72,6 @@ class Compatibility
|
||||
return $eachTables;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $columns
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public static function getISCompatForGetColumnsFull(array $columns, string $database, string $table): array
|
||||
{
|
||||
$ordinalPosition = 1;
|
||||
foreach (array_keys($columns) as $columnName) {
|
||||
// Compatibility with INFORMATION_SCHEMA output
|
||||
$columns[$columnName]['COLUMN_NAME'] =& $columns[$columnName]['Field'];
|
||||
$columns[$columnName]['COLUMN_TYPE'] =& $columns[$columnName]['Type'];
|
||||
$columns[$columnName]['COLLATION_NAME'] =& $columns[$columnName]['Collation'];
|
||||
$columns[$columnName]['IS_NULLABLE'] =& $columns[$columnName]['Null'];
|
||||
$columns[$columnName]['COLUMN_KEY'] =& $columns[$columnName]['Key'];
|
||||
$columns[$columnName]['COLUMN_DEFAULT'] =& $columns[$columnName]['Default'];
|
||||
$columns[$columnName]['EXTRA'] =& $columns[$columnName]['Extra'];
|
||||
$columns[$columnName]['PRIVILEGES'] =& $columns[$columnName]['Privileges'];
|
||||
$columns[$columnName]['COLUMN_COMMENT'] =& $columns[$columnName]['Comment'];
|
||||
|
||||
$columns[$columnName]['TABLE_CATALOG'] = null;
|
||||
$columns[$columnName]['TABLE_SCHEMA'] = $database;
|
||||
$columns[$columnName]['TABLE_NAME'] = $table;
|
||||
$columns[$columnName]['ORDINAL_POSITION'] = $ordinalPosition;
|
||||
$colType = $columns[$columnName]['COLUMN_TYPE'];
|
||||
$colType = is_string($colType) ? $colType : '';
|
||||
$colTypePosComa = strpos($colType, '(');
|
||||
$colTypePosComa = $colTypePosComa !== false ? $colTypePosComa : strlen($colType);
|
||||
$columns[$columnName]['DATA_TYPE'] = substr($colType, 0, $colTypePosComa);
|
||||
/** @todo guess CHARACTER_MAXIMUM_LENGTH from COLUMN_TYPE */
|
||||
$columns[$columnName]['CHARACTER_MAXIMUM_LENGTH'] = null;
|
||||
/** @todo guess CHARACTER_OCTET_LENGTH from CHARACTER_MAXIMUM_LENGTH */
|
||||
$columns[$columnName]['CHARACTER_OCTET_LENGTH'] = null;
|
||||
$columns[$columnName]['NUMERIC_PRECISION'] = null;
|
||||
$columns[$columnName]['NUMERIC_SCALE'] = null;
|
||||
$colCollation = $columns[$columnName]['COLLATION_NAME'];
|
||||
$colCollation = is_string($colCollation) ? $colCollation : '';
|
||||
$colCollationPosUnderscore = strpos($colCollation, '_');
|
||||
$colCollationPosUnderscore = $colCollationPosUnderscore !== false
|
||||
? $colCollationPosUnderscore
|
||||
: strlen($colCollation);
|
||||
$columns[$columnName]['CHARACTER_SET_NAME'] = substr($colCollation, 0, $colCollationPosUnderscore);
|
||||
|
||||
$ordinalPosition++;
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
public static function isMySqlOrPerconaDb(): bool
|
||||
{
|
||||
$serverType = Util::getServerType();
|
||||
|
||||
@ -328,70 +328,6 @@ class Generator
|
||||
return $sql;
|
||||
}
|
||||
|
||||
public static function getInformationSchemaColumnsFullRequest(
|
||||
string|null $escapedDatabase,
|
||||
string|null $escapedTable,
|
||||
string|null $escapedColumn,
|
||||
): string {
|
||||
$sqlWheres = [];
|
||||
|
||||
// get columns information from information_schema
|
||||
if ($escapedDatabase !== null) {
|
||||
$sqlWheres[] = '`TABLE_SCHEMA` = ' . $escapedDatabase . ' ';
|
||||
}
|
||||
|
||||
if ($escapedTable !== null) {
|
||||
$sqlWheres[] = '`TABLE_NAME` = ' . $escapedTable . ' ';
|
||||
}
|
||||
|
||||
if ($escapedColumn !== null) {
|
||||
$sqlWheres[] = '`COLUMN_NAME` = ' . $escapedColumn . ' ';
|
||||
}
|
||||
|
||||
// for PMA bc:
|
||||
// `[SCHEMA_FIELD_NAME]` AS `[SHOW_FULL_COLUMNS_FIELD_NAME]`
|
||||
$sql = 'SELECT *,'
|
||||
. ' `COLUMN_NAME` AS `Field`,'
|
||||
. ' `COLUMN_TYPE` AS `Type`,'
|
||||
. ' `COLLATION_NAME` AS `Collation`,'
|
||||
. ' `IS_NULLABLE` AS `Null`,'
|
||||
. ' `COLUMN_KEY` AS `Key`,'
|
||||
. ' `COLUMN_DEFAULT` AS `Default`,'
|
||||
. ' `EXTRA` AS `Extra`,'
|
||||
. ' `PRIVILEGES` AS `Privileges`,'
|
||||
. ' `COLUMN_COMMENT` AS `Comment`'
|
||||
. ' FROM `information_schema`.`COLUMNS`';
|
||||
|
||||
if ($sqlWheres !== []) {
|
||||
$sql .= "\n" . ' WHERE ' . implode(' AND ', $sqlWheres);
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public static function getInformationSchemaColumns(
|
||||
string|null $database,
|
||||
string|null $table,
|
||||
string|null $column,
|
||||
): array {
|
||||
$arrayKeys = [];
|
||||
|
||||
if ($database === null) {
|
||||
$arrayKeys[] = 'TABLE_SCHEMA';
|
||||
}
|
||||
|
||||
if ($table === null) {
|
||||
$arrayKeys[] = 'TABLE_NAME';
|
||||
}
|
||||
|
||||
if ($column === null) {
|
||||
$arrayKeys[] = 'COLUMN_NAME';
|
||||
}
|
||||
|
||||
return $arrayKeys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get sql query for renaming the index using SQL RENAME INDEX Syntax
|
||||
*/
|
||||
|
||||
@ -1299,18 +1299,15 @@ class Table implements Stringable
|
||||
public function getNameAndTypeOfTheColumns(): array
|
||||
{
|
||||
$columns = [];
|
||||
foreach (
|
||||
$this->dbi->getColumnsFull($this->dbName, $this->name) as $row
|
||||
) {
|
||||
if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp) === 1) {
|
||||
foreach ($this->dbi->getColumns($this->dbName, $this->name) as $row) {
|
||||
if (preg_match('@^(set|enum)\((.+)\)$@i', $row->type, $tmp) === 1) {
|
||||
$tmp[2] = mb_substr(
|
||||
(string) preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]),
|
||||
1,
|
||||
);
|
||||
$columns[$row['Field']] = $tmp[1] . '('
|
||||
. str_replace(',', ', ', $tmp[2]) . ')';
|
||||
$columns[$row->field] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||
} else {
|
||||
$columns[$row['Field']] = $row['Type'];
|
||||
$columns[$row->field] = $row->type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -57,6 +57,8 @@ class RelationTest extends AbstractTestCase
|
||||
$relation->getDisplayField($db, $table),
|
||||
);
|
||||
|
||||
$dummyDbi->addResult('SHOW COLUMNS FROM `information_schema`.`PMA`', []);
|
||||
|
||||
$db = 'information_schema';
|
||||
$table = 'PMA';
|
||||
self::assertSame(
|
||||
|
||||
@ -66,15 +66,16 @@ final class BrowseForeignersControllerTest extends AbstractTestCase
|
||||
);
|
||||
$dbiDummy->addResult('SELECT `actor_id` FROM .`actor` LIMIT 100', [['71'], ['173'], ['125']], ['actor_id']);
|
||||
$dbiDummy->addResult(
|
||||
'SHOW FULL COLUMNS FROM .`actor`',
|
||||
'SHOW COLUMNS FROM .`actor`',
|
||||
[
|
||||
['actor_id', 'smallint(5) unsigned', null, 'NO', 'PRI', null, 'auto_increment', 'select,insert,update,references', ''],
|
||||
['first_name', 'varchar(45)', 'utf8mb4_general_ci', 'NO', '', null, '', 'select,insert,update,references', ''],
|
||||
['last_name', 'varchar(45)', 'utf8mb4_general_ci', 'NO', 'MUL', null, '', 'select,insert,update,references', ''],
|
||||
['last_update', 'timestamp', null, 'NO', '', 'current_timestamp()', 'on update current_timestamp()', 'select,insert,update,references', ''],
|
||||
['actor_id', 'smallint(5) unsigned', 'NO', 'PRI', null, 'auto_increment' ],
|
||||
['first_name', 'varchar(45)', 'NO', '', null, '' ],
|
||||
['last_name', 'varchar(45)', 'NO', 'MUL', null, '' ],
|
||||
['last_update', 'timestamp', 'NO', '', 'current_timestamp()', 'on update current_timestamp()'],
|
||||
],
|
||||
['Field', 'Type', 'Collation', 'Null', 'Key', 'Default', 'Extra', 'Privileges', 'Comment'],
|
||||
['Field', 'Type', 'Null', 'Key', 'Default', 'Extra'],
|
||||
);
|
||||
$dbiDummy->addResult('SHOW INDEXES FROM .`actor`', []);
|
||||
// phpcs:enable
|
||||
$dbiDummy->addResult(
|
||||
'SELECT `actor_id`, `first_name` FROM .`actor` ORDER BY `actor`.`first_name`LIMIT 0, 25',
|
||||
|
||||
@ -63,16 +63,10 @@ class OptionsTest extends AbstractTestCase
|
||||
$numTablesStr = '10';
|
||||
$unlimNumRowsStr = 'unlim_num_rows_str';
|
||||
|
||||
$columnsInfo = [
|
||||
'test_column1' => ['COLUMN_NAME' => 'test_column1'],
|
||||
'test_column2' => ['COLUMN_NAME' => 'test_column2'],
|
||||
];
|
||||
$dbi = $this->getMockBuilder(DatabaseInterface::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$dbi->expects(self::any())->method('getColumnsFull')
|
||||
->willReturn($columnsInfo);
|
||||
$dbi->expects(self::any())->method('getCompatibilities')
|
||||
->willReturn([]);
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests\Plugins\Export;
|
||||
|
||||
use PhpMyAdmin\Column;
|
||||
use PhpMyAdmin\ColumnFull;
|
||||
use PhpMyAdmin\Config;
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
@ -650,9 +651,9 @@ class ExportSqlTest extends AbstractTestCase
|
||||
->getMock();
|
||||
|
||||
$dbi->expects(self::once())
|
||||
->method('getColumnsFull')
|
||||
->method('getColumns')
|
||||
->with('db', 'view')
|
||||
->willReturn(['cname' => ['Type' => 'int']]);
|
||||
->willReturn([new Column('cname', 'int', false, '', null, '')]);
|
||||
|
||||
DatabaseInterface::$instance = $dbi;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user