|
14 | 14 | use PhpMyAdmin\Html\Generator; |
15 | 15 | use PhpMyAdmin\Html\MySQLDocumentation; |
16 | 16 | use PhpMyAdmin\Identifiers\DatabaseName; |
17 | | -use PhpMyAdmin\Query\Generator as QueryGenerator; |
18 | 17 | use PhpMyAdmin\Query\Utilities; |
19 | 18 | use PhpMyAdmin\SqlParser\Components\Expression; |
20 | 19 | use PhpMyAdmin\SqlParser\Statements\AlterStatement; |
@@ -313,23 +312,21 @@ public function getFullValuesForSetColumn( |
313 | 312 | /** |
314 | 313 | * Get all the values for a enum column or set column in a table |
315 | 314 | * |
316 | | - * @param string $db current database |
317 | | - * @param string $table current table |
318 | | - * @param string $column current column |
| 315 | + * @param string $db current database |
| 316 | + * @param string $table current table |
| 317 | + * @param string $columnName current column |
319 | 318 | * |
320 | 319 | * @return mixed[]|null array containing the value list for the column, null on failure |
321 | 320 | */ |
322 | | - public function getValuesForColumn(string $db, string $table, string $column): array|null |
| 321 | + public function getValuesForColumn(string $db, string $table, string $columnName): array|null |
323 | 322 | { |
324 | | - $fieldInfoQuery = QueryGenerator::getColumnsSql($db, $table, $this->dbi->escapeString($column)); |
| 323 | + $column = $this->dbi->getColumn($db, $table, $columnName); |
325 | 324 |
|
326 | | - $fieldInfoResult = $this->dbi->fetchResult($fieldInfoQuery); |
327 | | - |
328 | | - if (! isset($fieldInfoResult[0])) { |
| 325 | + if ($column === null) { |
329 | 326 | return null; |
330 | 327 | } |
331 | 328 |
|
332 | | - return Util::parseEnumSetValues($fieldInfoResult[0]['Type']); |
| 329 | + return Util::parseEnumSetValues($column->type); |
333 | 330 | } |
334 | 331 |
|
335 | 332 | /** |
|
0 commit comments