Merge branch 'rte'
This commit is contained in:
commit
9ca378d794
@ -9,6 +9,40 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets required globals
|
||||
*/
|
||||
function PMA_EVN_setGlobals()
|
||||
{
|
||||
global $event_status, $event_type, $event_interval;
|
||||
|
||||
$event_status = array(
|
||||
'query' => array('ENABLE',
|
||||
'DISABLE',
|
||||
'DISABLE ON SLAVE'),
|
||||
'display' => array('ENABLED',
|
||||
'DISABLED',
|
||||
'SLAVESIDE_DISABLED')
|
||||
);
|
||||
$event_type = array('RECURRING',
|
||||
'ONE TIME');
|
||||
$event_interval = array('YEAR',
|
||||
'QUARTER',
|
||||
'MONTH',
|
||||
'DAY',
|
||||
'HOUR',
|
||||
'MINUTE',
|
||||
'WEEK',
|
||||
'SECOND',
|
||||
'YEAR_MONTH',
|
||||
'DAY_HOUR',
|
||||
'DAY_MINUTE',
|
||||
'DAY_SECOND',
|
||||
'HOUR_MINUTE',
|
||||
'HOUR_SECOND',
|
||||
'MINUTE_SECOND');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
|
||||
* rte_events.lib.php. It is used to retreive some language strings that are
|
||||
@ -40,6 +74,7 @@ function PMA_RTE_main()
|
||||
{
|
||||
global $db;
|
||||
|
||||
PMA_EVN_setGlobals();
|
||||
/**
|
||||
* Process all requests
|
||||
*/
|
||||
|
||||
@ -71,51 +71,6 @@ $titles = PMA_buildActionTitles();
|
||||
*/
|
||||
$errors = array();
|
||||
|
||||
// Some definitions for triggers
|
||||
$action_timings = array('BEFORE',
|
||||
'AFTER');
|
||||
$event_manipulations = array('INSERT',
|
||||
'UPDATE',
|
||||
'DELETE');
|
||||
|
||||
// Some definitions for routines
|
||||
$param_directions = array('IN',
|
||||
'OUT',
|
||||
'INOUT');
|
||||
$param_opts_num = array('UNSIGNED',
|
||||
'ZEROFILL',
|
||||
'UNSIGNED ZEROFILL');
|
||||
$param_sqldataaccess = array('NO SQL',
|
||||
'CONTAINS SQL',
|
||||
'READS SQL DATA',
|
||||
'MODIFIES SQL DATA');
|
||||
|
||||
// Some definitions for events
|
||||
$event_status = array(
|
||||
'query' => array('ENABLE',
|
||||
'DISABLE',
|
||||
'DISABLE ON SLAVE'),
|
||||
'display' => array('ENABLED',
|
||||
'DISABLED',
|
||||
'SLAVESIDE_DISABLED')
|
||||
);
|
||||
$event_type = array('RECURRING',
|
||||
'ONE TIME');
|
||||
$event_interval = array('YEAR',
|
||||
'QUARTER',
|
||||
'MONTH',
|
||||
'DAY',
|
||||
'HOUR',
|
||||
'MINUTE',
|
||||
'WEEK',
|
||||
'SECOND',
|
||||
'YEAR_MONTH',
|
||||
'DAY_HOUR',
|
||||
'DAY_MINUTE',
|
||||
'DAY_SECOND',
|
||||
'HOUR_MINUTE',
|
||||
'HOUR_SECOND',
|
||||
'MINUTE_SECOND');
|
||||
/**
|
||||
* The below function is defined in rte_routines.lib.php,
|
||||
* rte_triggers.lib.php and rte_events.lib.php
|
||||
|
||||
@ -9,6 +9,25 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets required globals
|
||||
*/
|
||||
function PMA_RTN_setGlobals()
|
||||
{
|
||||
global $param_directions, $param_opts_num, $param_sqldataaccess;
|
||||
|
||||
$param_directions = array('IN',
|
||||
'OUT',
|
||||
'INOUT');
|
||||
$param_opts_num = array('UNSIGNED',
|
||||
'ZEROFILL',
|
||||
'UNSIGNED ZEROFILL');
|
||||
$param_sqldataaccess = array('NO SQL',
|
||||
'CONTAINS SQL',
|
||||
'READS SQL DATA',
|
||||
'MODIFIES SQL DATA');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
|
||||
* rte_events.lib.php. It is used to retreive some language strings that are
|
||||
@ -40,6 +59,7 @@ function PMA_RTE_main()
|
||||
{
|
||||
global $db;
|
||||
|
||||
PMA_RTN_setGlobals();
|
||||
/**
|
||||
* Process all requests
|
||||
*/
|
||||
@ -1100,22 +1120,7 @@ function PMA_RTN_getQueryFromRequest()
|
||||
}
|
||||
$query .= " (" . $params . ") ";
|
||||
if ($_REQUEST['item_type'] == 'FUNCTION') {
|
||||
// Make a flat array with column types
|
||||
$columnTypes = array();
|
||||
foreach ($cfg['ColumnTypes'] as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$columnTypes = array_merge($value, $columnTypes);
|
||||
} else {
|
||||
$columnTypes[] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($columnTypes as $key => $type) {
|
||||
if ($type == '-') {
|
||||
unset($columnTypes[$key]);
|
||||
}
|
||||
}
|
||||
// Search the flat array for the supplied return type
|
||||
if (! empty($_REQUEST['item_returntype']) && in_array($_REQUEST['item_returntype'], $columnTypes)) {
|
||||
if (! empty($_REQUEST['item_returntype']) && in_array($_REQUEST['item_returntype'], PMA_getSupportedDatatypes())) {
|
||||
$query .= "RETURNS {$_REQUEST['item_returntype']}";
|
||||
} else {
|
||||
$errors[] = __('You must provide a valid return type for the routine.');
|
||||
|
||||
@ -9,6 +9,21 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets required globals
|
||||
*/
|
||||
function PMA_TRI_setGlobals()
|
||||
{
|
||||
global $action_timings, $event_manipulations;
|
||||
|
||||
// Some definitions for triggers
|
||||
$action_timings = array('BEFORE',
|
||||
'AFTER');
|
||||
$event_manipulations = array('INSERT',
|
||||
'UPDATE',
|
||||
'DELETE');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
|
||||
* rte_events.lib.php. It is used to retreive some language strings that are
|
||||
@ -40,6 +55,7 @@ function PMA_RTE_main()
|
||||
{
|
||||
global $db, $table;
|
||||
|
||||
PMA_TRI_setGlobals();
|
||||
/**
|
||||
* Process all requests
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user