From fa051ff3e862c03d14918c43f4c865bc549904f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 14 Feb 2017 13:54:13 +0100 Subject: [PATCH] Add basic support for TokuDB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This applies most of https://github.com/phpmyadmin/phpmyadmin/pull/12693 on top of current code base. - offer correct operations on operations tab - properly handle counting same as with InnoDB Fixes #12693 Signed-off-by: Michal Čihař --- ChangeLog | 1 + .../controllers/database/DatabaseStructureController.php | 8 ++++---- libraries/operations.lib.php | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe8082cadf..991f4b4e07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -75,6 +75,7 @@ phpMyAdmin - ChangeLog - issue #12980 Better defaults when creating multi field foreign key - issue #12976 Improved foreign key editor behavior - issue #12958 Always show error reporting dialog on top +- issue #12693 Improved support for TokuDB 4.6.6 (2017-01-23) - issue #12759 Fix Notice regarding 'Undefined index: old_usergroup' diff --git a/libraries/controllers/database/DatabaseStructureController.php b/libraries/controllers/database/DatabaseStructureController.php index e8efd15e33..86bc8e72be 100644 --- a/libraries/controllers/database/DatabaseStructureController.php +++ b/libraries/controllers/database/DatabaseStructureController.php @@ -754,9 +754,9 @@ class DatabaseStructureController extends DatabaseController if (isset($current_table['TABLE_ROWS']) && ($current_table['ENGINE'] != null || $table_is_view) ) { - // InnoDB table: we did not get an accurate row count + // InnoDB/TokuDB table: we did not get an accurate row count $approx_rows = !$table_is_view - && $current_table['ENGINE'] == 'InnoDB' + && in_array($current_table['ENGINE'], array('InnoDB', 'TokuDB')) && !$current_table['COUNTED']; if ($table_is_view @@ -943,7 +943,6 @@ class DatabaseStructureController extends DatabaseController case 'ARCHIVE' : case 'Aria' : case 'Maria' : - case 'TokuDB' : list($current_table, $formatted_size, $unit, $formatted_overhead, $overhead_unit, $overhead_size, $sum_size) = $this->getValuesForAriaTable( @@ -953,6 +952,7 @@ class DatabaseStructureController extends DatabaseController break; case 'InnoDB' : case 'PBMS' : + case 'TokuDB' : // InnoDB table: Row count is not accurate but data and index sizes are. // PBMS table in Drizzle: TABLE_ROWS is taken from table cache, // so it may be unavailable @@ -1062,7 +1062,7 @@ class DatabaseStructureController extends DatabaseController ) { $formatted_size = $unit = ''; - if (($current_table['ENGINE'] == 'InnoDB' + if (in_array($current_table['ENGINE'], array('InnoDB', 'TokuDB')) && $current_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) || !isset($current_table['TABLE_ROWS']) ) { diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 3c5a1b3f99..40139bc275 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -1358,7 +1358,7 @@ function PMA_getListofMaintainActionLink($pma_table, $url_params) $html_output = ''; // analyze table - if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB'))) { + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB', 'TOKUDB'))) { $params = array( 'sql_query' => 'ANALYZE TABLE ' . Util::backquote($GLOBALS['table']), @@ -1373,7 +1373,7 @@ function PMA_getListofMaintainActionLink($pma_table, $url_params) } // check table - if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB'))) { + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'TOKUDB'))) { $params = array( 'sql_query' => 'CHECK TABLE ' . Util::backquote($GLOBALS['table']), @@ -1433,7 +1433,7 @@ function PMA_getListofMaintainActionLink($pma_table, $url_params) ); // optimize table - if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB'))) { + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB', 'TOKUDB'))) { $params = array( 'sql_query' => 'OPTIMIZE TABLE ' . Util::backquote($GLOBALS['table']),