mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Oracle PL/SQL blocks can end by ";". Prevent that to be trimmed.
This commit is contained in:
parent
1e94fe068c
commit
358b1e9359
1 changed files with 7 additions and 2 deletions
|
@ -72,10 +72,15 @@ function execute_sql($command, $feedback=true) {
|
|||
$command = trim($command);
|
||||
/// If the trailing ; is there, fix and warn!
|
||||
if (substr($command, strlen($command)-1, 1) == ';') {
|
||||
/// One noticeable exception, Oracle PL/SQL blocks require ending in ";"
|
||||
if ($db->family == 'oracle' && substr($command, -4) == 'END;') {
|
||||
/// Nothing to fix/warn. The command is one PL/SQL block, so it's ok.
|
||||
} else {
|
||||
$command = trim($command, ';');
|
||||
debugging('Warning. Avoid to end your SQL commands with a trailing ";".', DEBUG_DEVELOPER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$empty_rs_cache = array(); // Clear out the cache, just in case changes were made to table structures
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue