From 98372481bb511dff7dfd674c4511dce9f34496ae Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Tue, 8 Sep 2015 20:29:55 +1000 Subject: [PATCH] Remove Drizzle from database level functions Signed-off-by: Madhura Jayaratne --- db_create.php | 6 +- db_operations.php | 4 +- libraries/DbSearch.class.php | 7 +- libraries/rte/rte_routines.lib.php | 74 +++++++++---------- .../database/structure/check_all_tables.phtml | 8 +- 5 files changed, 43 insertions(+), 56 deletions(-) diff --git a/db_create.php b/db_create.php index 86cdf4bafd..c8b7c7b5fe 100644 --- a/db_create.php +++ b/db_create.php @@ -12,9 +12,9 @@ require_once 'libraries/common.inc.php'; require_once 'libraries/mysql_charsets.inc.php'; -if (! PMA_DRIZZLE) { - include_once 'libraries/replication.inc.php'; -} + +require_once 'libraries/replication.inc.php'; + require 'libraries/build_html_for_db.lib.php'; /** diff --git a/db_operations.php b/db_operations.php index 7f0e2b9df5..bc50d1732d 100644 --- a/db_operations.php +++ b/db_operations.php @@ -105,7 +105,7 @@ if (/*overload*/mb_strlen($GLOBALS['db']) } unset($sqlConstratints); - if (! PMA_DRIZZLE && PMA_MYSQL_INT_VERSION >= 50100) { + if (PMA_MYSQL_INT_VERSION >= 50100) { // here DELIMITER is not used because it's not part of the // language; each statement is sent one by one @@ -261,7 +261,7 @@ if (!$is_information_schema) { // Don't allow to easily drop mysql database, RFE #1327514. if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_system_schema - && (PMA_DRIZZLE || $GLOBALS['db'] != 'mysql') + && $GLOBALS['db'] != 'mysql' ) { $response->addHTML(PMA_getHtmlForDropDatabaseLink($GLOBALS['db'])); } diff --git a/libraries/DbSearch.class.php b/libraries/DbSearch.class.php index bce102f90d..c8c7cb49cf 100644 --- a/libraries/DbSearch.class.php +++ b/libraries/DbSearch.class.php @@ -226,11 +226,8 @@ class PMA_DbSearch || /*overload*/mb_strlen($this->_criteriaColumnName) == 0 || $column['Field'] == $this->_criteriaColumnName ) { - // Drizzle has no CONVERT and all text columns are UTF-8 - $column = ((PMA_DRIZZLE) - ? PMA_Util::backquote($column['Field']) - : 'CONVERT(' . PMA_Util::backquote($column['Field']) - . ' USING utf8)'); + $column = 'CONVERT(' . PMA_Util::backquote($column['Field']) + . ' USING utf8)'; $likeClausesPerColumn[] = $column . ' ' . $like_or_regex . ' ' . "'" . $automatic_wildcard . $search_word . $automatic_wildcard diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index 9fca018734..668c4d90b9 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -312,10 +312,6 @@ function PMA_RTN_handleRequestCreateOrEdit($errors, $db) */ function PMA_RTN_backupPrivileges() { - if (defined('PMA_DRIZZLE') && PMA_DRIZZLE) { - return array(); - } - if (!(isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv'] && isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv']) @@ -390,28 +386,26 @@ function PMA_RTN_createRoutine( // Default value $resultAdjust = false; - if (!defined('PMA_DRIZZLE') || !PMA_DRIZZLE) { - if (isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv'] - && isset($GLOBALS['flush_priv']) - && $GLOBALS['flush_priv'] - ) { - // Insert all the previous privileges - // but with the new name and the new type - foreach ($privilegesBackup as $priv) { - $adjustProcPrivilege = 'INSERT INTO ' - . PMA_Util::backquote('mysql') . '.' - . PMA_Util::backquote('procs_priv') - . ' VALUES("' . $priv[0] . '", "' - . $priv[1] . '", "' . $priv[2] . '", "' - . $_REQUEST['item_name'] . '", "' - . $_REQUEST['item_type'] . '", "' - . $priv[5] . '", "' - . $priv[6] . '", "' - . $priv[7] . '");'; - $resultAdjust = $GLOBALS['dbi']->query( - $adjustProcPrivilege - ); - } + if (isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv'] + && isset($GLOBALS['flush_priv']) + && $GLOBALS['flush_priv'] + ) { + // Insert all the previous privileges + // but with the new name and the new type + foreach ($privilegesBackup as $priv) { + $adjustProcPrivilege = 'INSERT INTO ' + . PMA_Util::backquote('mysql') . '.' + . PMA_Util::backquote('procs_priv') + . ' VALUES("' . $priv[0] . '", "' + . $priv[1] . '", "' . $priv[2] . '", "' + . $_REQUEST['item_name'] . '", "' + . $_REQUEST['item_type'] . '", "' + . $priv[5] . '", "' + . $priv[6] . '", "' + . $priv[7] . '");'; + $resultAdjust = $GLOBALS['dbi']->query( + $adjustProcPrivilege + ); } } @@ -998,21 +992,19 @@ function PMA_RTN_getEditorForm($mode, $operation, $routine) $retval .= " " . __('Adjust privileges'); $retval .= PMA_Util::showDocu('faq', 'faq6-39'); $retval .= ""; - if (! defined('PMA_DRIZZLE') || ! PMA_DRIZZLE) { - if (isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv'] - && isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv'] - ) { - $retval .= " "; - } else { - $retval .= " "; - } + if (isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv'] + && isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv'] + ) { + $retval .= " "; + } else { + $retval .= " "; } $retval .= ""; } diff --git a/templates/database/structure/check_all_tables.phtml b/templates/database/structure/check_all_tables.phtml index a6866118a0..56b5213fa3 100644 --- a/templates/database/structure/check_all_tables.phtml +++ b/templates/database/structure/check_all_tables.phtml @@ -18,11 +18,9 @@ - - - - - + + +