Skip to content

Commit

Permalink
Merge pull request #6 from epenet/20240305-1209
Browse files Browse the repository at this point in the history
Fix DELIMITER handling
  • Loading branch information
droyad authored Oct 23, 2024
2 parents 6521d77 + 6b31d1c commit 8cb2925
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/dbup-oracle/OracleCommandReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public class OracleCommandReader : SqlCommandReader
/// Hook to support custom statements
/// </summary>
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());

/// <summary>
/// Read a custom statement
Expand Down
5 changes: 3 additions & 2 deletions src/dbup-oracle/OracleCustomDelimiterCommandReader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Text;
using DbUp.Support;

Expand All @@ -20,7 +20,8 @@ public OracleCustomDelimiterCommandReader(string sqlText, char delimiter) : base
/// </summary>
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());

/// <summary>
/// Read a custom statement
Expand Down

0 comments on commit 8cb2925

Please sign in to comment.