Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… - RoundhousE has trouble parsing scripts when -- is in text in a statement and there are more statements prior to GO
  • Loading branch information
ferventcoder committed Jan 27, 2012
1 parent cc518af commit a297dd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SqlServerDatabase : AdoNetDatabase

public override string sql_statement_separator_regex_pattern
{
get { return @"(?<KEEP1>^(?:.)*(?:-{2}).*$)|(?<KEEP1>/{1}\*{1}[\S\s]*?\*{1}/{1})|(?<KEEP1>'{1}(?:[^']|\n[^'])*?'{1})|(?<KEEP1>\s)(?<BATCHSPLITTER>GO)(?<KEEP2>\s)|(?<KEEP1>\s)(?<BATCHSPLITTER>GO)(?<KEEP2>$)"; }
get { return @"(?<KEEP1>^(?:[\s\t])*(?:-{2}).*$)|(?<KEEP1>/{1}\*{1}[\S\s]*?\*{1}/{1})|(?<KEEP1>'{1}(?:[^']|\n[^'])*?'{1})|(?<KEEP1>\s)(?<BATCHSPLITTER>GO)(?<KEEP2>\s)|(?<KEEP1>\s)(?<BATCHSPLITTER>GO)(?<KEEP2>$)"; }

This comment has been minimized.

Copy link
@ferventcoder

ferventcoder Jun 26, 2012

Author Member

This is the one you want to roll back for sql server.

}

public override void initialize_connections(ConfigurationPropertyHolder configuration_property_holder)
Expand Down
14 changes: 13 additions & 1 deletion product/roundhouse.tests/sqlsplitters/SplitterContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ dml statements
GO
dml statements '
GO
INSERT [dbo].[Foo] ([Bar]) VALUES (N'hello--world.
Thanks!')
INSERT [dbo].[Foo] ([Bar]) VALUES (N'Go speed racer, go speed racer, go speed racer go!!!!! ')
GO";

public static string tsql_statement_scrubbed = @"
Expand Down Expand Up @@ -175,7 +181,13 @@ dml statements
GO
dml statements '
" + StatementSplitter.batch_terminator_replacement_string + @"";
" + StatementSplitter.batch_terminator_replacement_string + @"
INSERT [dbo].[Foo] ([Bar]) VALUES (N'hello--world.
Thanks!')
INSERT [dbo].[Foo] ([Bar]) VALUES (N'Go speed racer, go speed racer, go speed racer go!!!!! ')
"+ StatementSplitter.batch_terminator_replacement_string + @"";

public static string plsql_statement =
@"
Expand Down
2 changes: 1 addition & 1 deletion product/roundhouse/databases/DefaultDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class DefaultDatabase<DBCONNECTION> : Database

public virtual string sql_statement_separator_regex_pattern
{
get { return @"(?<KEEP1>^(?:.)*(?:-{2}).*$)|(?<KEEP1>/{1}\*{1}[\S\s]*?\*{1}/{1})|(?<KEEP1>'{1}(?:[^']|\n[^'])*?'{1})|(?<KEEP1>\s)(?<BATCHSPLITTER>\;)(?<KEEP2>\s)|(?<KEEP1>\s)(?<BATCHSPLITTER>\;)(?<KEEP2>$)"; }
get { return @"(?<KEEP1>^(?:[\s\t])*(?:-{2}).*$)|(?<KEEP1>/{1}\*{1}[\S\s]*?\*{1}/{1})|(?<KEEP1>'{1}(?:[^']|\n[^'])*?'{1})|(?<KEEP1>\s)(?<BATCHSPLITTER>\;)(?<KEEP2>\s)|(?<KEEP1>\s)(?<BATCHSPLITTER>\;)(?<KEEP2>$)"; }
}

public int command_timeout { get; set; }
Expand Down

0 comments on commit a297dd4

Please sign in to comment.