Skip to content

Commit

Permalink
Remove Drizzle from database level functions
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <[email protected]>
  • Loading branch information
madhuracj committed Sep 9, 2015
1 parent f3ff840 commit 9837248
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 56 deletions.
6 changes: 3 additions & 3 deletions db_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down
4 changes: 2 additions & 2 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
}
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

Expand Down Expand Up @@ -261,7 +261,7 @@
// 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']));
}
Expand Down
7 changes: 2 additions & 5 deletions libraries/DbSearch.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,8 @@ private function _getWhereClause($table)
|| /*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
Expand Down
74 changes: 33 additions & 41 deletions libraries/rte/rte_routines.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down Expand Up @@ -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
);
}
}

Expand Down Expand Up @@ -998,21 +992,19 @@ function PMA_RTN_getEditorForm($mode, $operation, $routine)
$retval .= " <td>" . __('Adjust privileges');
$retval .= PMA_Util::showDocu('faq', 'faq6-39');
$retval .= "</td>";
if (! defined('PMA_DRIZZLE') || ! PMA_DRIZZLE) {
if (isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv']
&& isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv']
) {
$retval .= " <td><input type='checkbox' "
. "name='item_adjust_privileges' value='1' checked /></td>";
} else {
$retval .= " <td><input type='checkbox' "
. "name='item_adjust_privileges' value='1' title='" . __(
"You do not have sufficient privileges to perform this "
. "operation; Please refer to the documentation for more "
. "details"
)
. "' disabled/></td>";
}
if (isset($GLOBALS['proc_priv']) && $GLOBALS['proc_priv']
&& isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv']
) {
$retval .= " <td><input type='checkbox' "
. "name='item_adjust_privileges' value='1' checked /></td>";
} else {
$retval .= " <td><input type='checkbox' "
. "name='item_adjust_privileges' value='1' title='" . __(
"You do not have sufficient privileges to perform this "
. "operation; Please refer to the documentation for more "
. "details"
)
. "' disabled/></td>";
}
$retval .= "</tr>";
}
Expand Down
8 changes: 3 additions & 5 deletions templates/database/structure/check_all_tables.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
<optgroup label="<?php echo __('Table maintenance'); ?>">
<option value="analyze_tbl" ><?php echo __('Analyze table'); ?></option>
<option value="check_tbl" ><?php echo __('Check table'); ?></option>
<?php if (!PMA_DRIZZLE): ?>
<option value="checksum_tbl" ><?php echo __('Checksum table'); ?></option>
<option value="optimize_tbl" ><?php echo __('Optimize table'); ?></option>
<option value="repair_tbl" ><?php echo __('Repair table'); ?></option>
<?php endif; ?>
<option value="checksum_tbl" ><?php echo __('Checksum table'); ?></option>
<option value="optimize_tbl" ><?php echo __('Optimize table'); ?></option>
<option value="repair_tbl" ><?php echo __('Repair table'); ?></option>
</optgroup>
<optgroup label="<?php echo __('Prefix'); ?>">
<option value="add_prefix_tbl" ><?php echo __('Add prefix to table'); ?></option>
Expand Down

0 comments on commit 9837248

Please sign in to comment.