Use new parser for table's structure.

Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
This commit is contained in:
Dan Ungureanu 2015-06-22 22:36:13 +03:00
parent 6c3ccb2d56
commit 11adecc1d8
2 changed files with 5 additions and 4 deletions

View File

@ -115,9 +115,9 @@ foreach ($fields as $row) {
$attribute = $extracted_columnspec['attribute'];
// prepare a common variable to reuse below; however,
// in case of a VIEW, $analyzed_sql[0]['create_table_fields'] is empty
if (isset($analyzed_sql[0]['create_table_fields'][$row['Field']])) {
$tempField = $analyzed_sql[0]['create_table_fields'][$row['Field']];
// in case of a VIEW, $create_table_fields is empty
if (isset($create_table_fields[$row['Field']])) {
$tempField = $create_table_fields[$row['Field']];
} else {
$tempField = array();
}

View File

@ -199,7 +199,8 @@ $show_create_table = $GLOBALS['dbi']->fetchValue(
. PMA_Util::backquote($table),
0, 1
);
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table));
$parser = new SqlParser\Parser($show_create_table);
$create_table_fields = SqlParser\Utils\Table::getFields($parser->statements[0]);
/**
* prepare table infos