From 10de07bb1d6e9b9016ca64f6a4b1fe52a951a12f Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 29 Oct 2015 21:48:14 +1100 Subject: [PATCH] Fix #11617 Getting real row count is not allowed for views Signed-off-by: Madhura Jayaratne --- .../DatabaseStructureController.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libraries/controllers/DatabaseStructureController.php b/libraries/controllers/DatabaseStructureController.php index 34657100dd..3fa8d3cd68 100644 --- a/libraries/controllers/DatabaseStructureController.php +++ b/libraries/controllers/DatabaseStructureController.php @@ -546,6 +546,23 @@ class DatabaseStructureController extends DatabaseController $approx_rows = !$table_is_view && $current_table['ENGINE'] == 'InnoDB' && !$current_table['COUNTED']; + + if ($table_is_view + && $current_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] + ) { + $approx_rows = true; + $show_superscript = Util::showHint( + PMA_sanitize( + sprintf( + __( + 'This view has at least this number of ' + . 'rows. Please refer to %sdocumentation%s.' + ), + '[doc@cfg_MaxExactCountViews]', '[/doc]' + ) + ) + ); + } } $this->response->addHTML( @@ -917,6 +934,8 @@ class DatabaseStructureController extends DatabaseController // or on some servers it's reported as "SYSTEM VIEW" case null : case 'SYSTEM VIEW' : + // possibly a view, do nothing + break; default : // Unknown table type. if ($this->_is_show_stats) {