Warn the user if the definition of a stored function does not contain a return statement.
This commit is contained in:
parent
48681dfd81
commit
279ef37298
@ -80,6 +80,13 @@ function validateRoutineEditor(syntaxHiglighter) {
|
||||
isError = true;
|
||||
}
|
||||
}
|
||||
if (! isError && $('select[name=routine_type]').find(':selected').val() == 'FUNCTION') {
|
||||
if ($('.rte_table').find('textarea[name=routine_definition]').val().toLowerCase().indexOf('return') < 0) {
|
||||
syntaxHiglighter.focus();
|
||||
alert(PMA_messages['MissingReturn']);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (! isError) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@ -86,6 +86,9 @@ $js_messages['strShowSearchResults'] = __('Show search results');
|
||||
$js_messages['strBrowsing'] = __('Browsing');
|
||||
$js_messages['strDeleting'] = __('Deleting');
|
||||
|
||||
/* For db_routines.js */
|
||||
$js_messages['MissingReturn'] = __('The definition of a stored function must contain a RETURN statement!');
|
||||
|
||||
/* For import.js */
|
||||
$js_messages['strImportCSV'] = __('Note: If the file contains multiple tables, they will be combined into one');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user