From 7b0d46818c195e6c135fa5c8a4489448fd7c86eb Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Tue, 22 Jan 2013 10:37:37 +0100 Subject: [PATCH 1/2] fix wrong/unused variable name --- libraries/rte/rte_routines.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index b0b6358242..22c25c27d9 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -1368,7 +1368,7 @@ function PMA_RTN_handleExecute() $message = PMA_message::error( sprintf( __('The following query has failed: "%s"'), - htmlspecialchars($query) + htmlspecialchars($multiple_query) ) . '

' . __('MySQL said: ') . PMA_DBI_getError(null) From ecf055cad30b4029c03f2edd49337909db346728 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Tue, 22 Jan 2013 11:19:17 +0100 Subject: [PATCH 2/2] wrap long lines --- libraries/rte/rte_routines.lib.php | 219 ++++++++++++++++++++--------- 1 file changed, 154 insertions(+), 65 deletions(-) diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index 22c25c27d9..b69c4bb4c3 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -114,7 +114,7 @@ function PMA_RTN_parseOneParameter($value) $param_opts = array(); for ($i=$pos; $i<$parsed_param['len']; $i++) { if (($parsed_param[$i]['type'] == 'alpha_columnType' - || $parsed_param[$i]['type'] == 'alpha_functionName') && $depth == 0 // "CHAR" seems to be mistaken for a function by the parser + || $parsed_param[$i]['type'] == 'alpha_functionName') && $depth == 0 ) { $retval[2] = strtoupper($parsed_param[$i]['data']); } else if ($parsed_param[$i]['type'] == 'punct_bracket_open_round' @@ -277,11 +277,19 @@ function PMA_RTN_handleEditor() // Execute the created query if (! empty($_REQUEST['editor_process_edit'])) { if (! in_array($_REQUEST['item_original_type'], array('PROCEDURE', 'FUNCTION'))) { - $errors[] = sprintf(__('Invalid routine type: "%s"'), htmlspecialchars($_REQUEST['item_original_type'])); + $errors[] = sprintf( + __('Invalid routine type: "%s"'), + htmlspecialchars($_REQUEST['item_original_type']) + ); } else { // Backup the old routine, in case something goes wrong - $create_routine = PMA_DBI_get_definition($db, $_REQUEST['item_original_type'], $_REQUEST['item_original_name']); - $drop_routine = "DROP {$_REQUEST['item_original_type']} " . PMA_Util::backquote($_REQUEST['item_original_name']) . ";\n"; + $create_routine = PMA_DBI_get_definition( + $db, $_REQUEST['item_original_type'], + $_REQUEST['item_original_name'] + ); + $drop_routine = "DROP {$_REQUEST['item_original_type']} " + . PMA_Util::backquote($_REQUEST['item_original_name']) + . ";\n"; $result = PMA_DBI_try_query($drop_routine); if (! $result) { $errors[] = sprintf( @@ -299,7 +307,8 @@ function PMA_RTN_handleEditor() ) . '
' . __('MySQL said: ') . PMA_DBI_getError(null); - // We dropped the old routine, but were unable to create the new one + // We dropped the old routine, + // but were unable to create the new one // Try to restore the backup query $result = PMA_DBI_try_query($create_routine); if (! $result) { @@ -309,7 +318,8 @@ function PMA_RTN_handleEditor() // This should not happen, but we better handle // this just in case. $errors[] = __( - 'Sorry, we failed to restore the dropped routine.' + 'Sorry, we failed to restore' + . ' the dropped routine.' ) . '
' . __('The backed up query was:') @@ -352,7 +362,10 @@ function PMA_RTN_handleEditor() if (count($errors)) { $message = PMA_Message::error( - __('One or more errors have occured while processing your request:') + __( + 'One or more errors have occured while' + . ' processing your request:' + ) ); $message->addString('