From 358b1e935905893fa5dc5367ab0b041a2536aa22 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sat, 27 Jan 2007 23:37:22 +0000 Subject: [PATCH] Oracle PL/SQL blocks can end by ";". Prevent that to be trimmed. --- lib/dmllib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index 5c3dabb3a9..53c2e2e1f6 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -72,8 +72,13 @@ function execute_sql($command, $feedback=true) { $command = trim($command); /// If the trailing ; is there, fix and warn! if (substr($command, strlen($command)-1, 1) == ';') { - $command = trim($command, ';'); - debugging('Warning. Avoid to end your SQL commands with a trailing ";".', DEBUG_DEVELOPER); + /// 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); + } } } -- 2.39.5