From 9aa55d5a50bd4c219f409dcd1c42c373c7dcfdb8 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 27 Oct 2014 07:09:47 -0400
Subject: [PATCH] Fix so DDL script for Oracle can be executed in SQLPlus

---
 program/lib/Roundcube/rcube_db_oracle.php |    2 +-
 SQL/oracle.initial.sql                    |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/SQL/oracle.initial.sql b/SQL/oracle.initial.sql
index 84f7a1f..d32cc92 100644
--- a/SQL/oracle.initial.sql
+++ b/SQL/oracle.initial.sql
@@ -20,7 +20,7 @@
 BEGIN
     :NEW."user_id" := "users_seq".nextval;
 END;
-
+/
 
 CREATE TABLE "session" (
     "sess_id" varchar(128) NOT NULL PRIMARY KEY,
@@ -60,7 +60,7 @@
 BEGIN
     :NEW."identity_id" := "identities_seq".nextval;
 END;
-
+/
 
 CREATE TABLE "contacts" (
     "contact_id" integer PRIMARY KEY,
@@ -86,7 +86,7 @@
 BEGIN
     :NEW."contact_id" := "contacts_seq".nextval;
 END;
-
+/
 
 CREATE TABLE "contactgroups" (
     "contactgroup_id" integer PRIMARY KEY,
@@ -107,7 +107,7 @@
 BEGIN
     :NEW."contactgroup_id" := "contactgroups_seq".nextval;
 END;
-
+/
 
 CREATE TABLE "contactgroupmembers" (
     "contactgroup_id" integer NOT NULL
@@ -211,7 +211,7 @@
 BEGIN
     :NEW."search_id" := "searches_seq".nextval;
 END;
-
+/
 
 CREATE TABLE "system" (
     "name" varchar(64) NOT NULL PRIMARY KEY,
diff --git a/program/lib/Roundcube/rcube_db_oracle.php b/program/lib/Roundcube/rcube_db_oracle.php
index 338eb2e..362beb0 100644
--- a/program/lib/Roundcube/rcube_db_oracle.php
+++ b/program/lib/Roundcube/rcube_db_oracle.php
@@ -500,7 +500,7 @@
 
         foreach (explode("\n", $sql) as $line) {
             $tok = strtolower(trim($line));
-            if (preg_match('/^--/', $line) || $tok == '') {
+            if (preg_match('/^--/', $line) || $tok == '' || $tok == '/') {
                 continue;
             }
 

--
Gitblit v1.9.1