From 6b43b01f7201397504255e9e976dfe37992f46b8 Mon Sep 17 00:00:00 2001
From: epenet <6771947+epenet@users.noreply.github.com>
Date: Tue, 5 Mar 2024 12:09:38 +0100
Subject: [PATCH 1/2] Fix DELIMITER handling
---
src/dbup-oracle/OracleCommandReader.cs | 3 ++-
src/dbup-oracle/OracleCustomDelimiterCommandReader.cs | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/dbup-oracle/OracleCommandReader.cs b/src/dbup-oracle/OracleCommandReader.cs
index ffa686c..41e2750 100644
--- a/src/dbup-oracle/OracleCommandReader.cs
+++ b/src/dbup-oracle/OracleCommandReader.cs
@@ -20,7 +20,8 @@ public class OracleCommandReader : SqlCommandReader
/// Hook to support custom statements
///
protected override bool IsCustomStatement => TryPeek(DelimiterKeyword.Length, out var statement) &&
- string.Equals(DelimiterKeyword, statement, StringComparison.OrdinalIgnoreCase);
+ string.Equals(DelimiterKeyword, statement, StringComparison.OrdinalIgnoreCase) &&
+ string.IsNullOrEmpty(GetCurrentCommandTextFromBuffer());
///
/// Read a custom statement
diff --git a/src/dbup-oracle/OracleCustomDelimiterCommandReader.cs b/src/dbup-oracle/OracleCustomDelimiterCommandReader.cs
index d2278a1..cfc1d33 100644
--- a/src/dbup-oracle/OracleCustomDelimiterCommandReader.cs
+++ b/src/dbup-oracle/OracleCustomDelimiterCommandReader.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Text;
using DbUp.Support;
@@ -20,7 +20,8 @@ public OracleCustomDelimiterCommandReader(string sqlText, char delimiter) : base
///
protected override bool IsCustomStatement
=> TryPeek(DelimiterKeyword.Length - 1, out var statement) &&
- string.Equals(DelimiterKeyword, CurrentChar + statement, StringComparison.OrdinalIgnoreCase);
+ string.Equals(DelimiterKeyword, CurrentChar + statement, StringComparison.OrdinalIgnoreCase) &&
+ string.IsNullOrEmpty(GetCurrentCommandTextFromBuffer());
///
/// Read a custom statement
From 51af5290ab8ba94ed3b9db4cd481d0c6878c81f6 Mon Sep 17 00:00:00 2001
From: epenet <6771947+epenet@users.noreply.github.com>
Date: Fri, 15 Mar 2024 08:39:10 +0100
Subject: [PATCH 2/2] Update core package
---
src/dbup-oracle/dbup-oracle.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dbup-oracle/dbup-oracle.csproj b/src/dbup-oracle/dbup-oracle.csproj
index bbaeceb..4d95e3a 100644
--- a/src/dbup-oracle/dbup-oracle.csproj
+++ b/src/dbup-oracle/dbup-oracle.csproj
@@ -17,7 +17,7 @@
-
+