Merge branch 'QA_4_7'

This commit is contained in:
Michal Čihař 2017-03-01 15:57:24 +01:00
commit 2c55ecc450
3 changed files with 12 additions and 3 deletions

View File

@ -866,6 +866,10 @@ $GLOBALS['dummy_queries'] = array(
'query' => 'SELECT @@ndb_version_string',
'result' => array(array('ndb-7.4.10')),
),
array(
'query' => "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` WHERE `TABLE_SCHEMA` = 'information_schema' AND `TABLE_NAME` = 'PMA'",
'result' => array(),
),
);
/**
* Current database.

View File

@ -862,9 +862,13 @@ function PMA_getDisplayField($db, $table)
/**
* Pick first char field
*/
foreach ($GLOBALS['dbi']->getColumnsFull($db, $table) as $column) {
if ($GLOBALS['PMA_Types']->getTypeClass($column['DATA_TYPE']) == 'CHAR') {
return $column['COLUMN_NAME'];
$columns = $GLOBALS['dbi']->getColumnsFull($db, $table);
if ($columns) {
foreach ($columns as $column) {
var_dump($column);
if ($GLOBALS['PMA_Types']->getTypeClass($column['DATA_TYPE']) == 'CHAR') {
return $column['COLUMN_NAME'];
}
}
}

View File

@ -38,6 +38,7 @@ class PMA_Relation_Test extends PHPUnit_Framework_TestCase
$GLOBALS['db'] = 'db';
$GLOBALS['cfg']['Server']['user'] = 'root';
$GLOBALS['cfg']['Server']['pmadb'] = 'phpmyadmin';
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$GLOBALS['cfg']['ZeroConf'] = true;
$_SESSION['relation'][$GLOBALS['server']] = "PMA_relation";
$_SESSION['relation'] = array();