From 5afcef00e6ccba90a78ecf5944f0295d7e9e2f95 Mon Sep 17 00:00:00 2001 From: Azhari Harahap Date: Sun, 10 Apr 2011 07:02:06 +0700 Subject: [PATCH] (Drizzle) Listing/change table structure small fix --- tbl_alter.php | 4 +++- tbl_structure.php | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tbl_alter.php b/tbl_alter.php index fa82d7cca..1c2d7fbd8 100644 --- a/tbl_alter.php +++ b/tbl_alter.php @@ -170,7 +170,9 @@ if ($abort == false) { */ for ($i = 0; $i < $selected_cnt; $i++) { $_REQUEST['field'] = PMA_sqlAddslashes($selected[$i], true); - $result = PMA_DBI_query('SHOW FULL COLUMNS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ' LIKE \'' . $_REQUEST['field'] . '\';'); + $result = PMA_DRIZZLE + ? PMA_DBI_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ' WHERE Field = \'' . $_REQUEST['field'] . '\';') + : PMA_DBI_query('SHOW FULL COLUMNS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ' LIKE \'' . $_REQUEST['field'] . '\';'); $fields_meta[] = PMA_DBI_fetch_assoc($result); PMA_DBI_free_result($result); } diff --git a/tbl_structure.php b/tbl_structure.php index 73a45fcef..73374d7a5 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -121,10 +121,11 @@ foreach (PMA_Index::getFromTable($table, $db) as $index) { unset($index, $columns, $column_name, $dummy); // 3. Get fields -$fields_rs = PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE); +$fields_rs = PMA_DRIZZLE + ? PMA_DBI_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE) + : PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE); $fields_cnt = PMA_DBI_num_rows($fields_rs); - // Get more complete field information // For now, this is done just for MySQL 4.1.2+ new TIMESTAMP options // but later, if the analyser returns more information, it