Roundhouse Hangs on Regex

26 views
Skip to first unread message

MichaelK

unread,
Mar 26, 2012, 12:47:09 PM3/26/12
to chucknorris
Hi All,

I was trying to get Roundhouse working with our existing database. I
used a nice tool called Claymore (https://github.com/jaredmcguire/
Claymore) to dump out all of my sql objects to files so I can then
incorporate those into a new RH project.

Everything seems to run fine but on one of the Functions RH just
hangs. I stepped through the RH code and it has to do with the Regex
work in the StatementSplitter class. My regex skills a best are rusty,
but looking at the complexity of the regex expression it looks like RH
is doing much more than just splitting on GO statements.

The Regex hangs on this line
string sql_statement_scrubbed = regex_replace.Replace(sql_to_run,
match => evaluate_and_replace_batch_split_items(match,
regex_replace));

My plan is to dig a bit deeper into our FN to see if I can find the
line that causes it to hang. My question, if anyone has some insight
as to what exactly the Regex is doing that might help me out a bit.

Rob Reynolds

unread,
Mar 26, 2012, 2:43:58 PM3/26/12
to chucknorri...@googlegroups.com
There was a bug found in there that the latest version fixes. It has to do with "--" inside of a line somewhere but not at the beginning of the line.

It splits on the word GO, but it doesn't split the go when the GO is in a comment or inside of text.  It's  a crazy regex, but it is heavily tested and works well.

If you want, you can email your function directly to me and I can point out where the issue is or determine if there is a bug.

One thing to consider, GO should never be the first words in the script.
____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder



--
You received this message because you are subscribed to the Google Groups "chucknorris" group.
To post to this group, send email to chucknorri...@googlegroups.com.
To unsubscribe from this group, send email to chucknorrisframe...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chucknorrisframework?hl=en.


MichaelK

unread,
Mar 27, 2012, 9:38:16 AM3/27/12
to chucknorris
I found out what the problem is. If you have comments with ' then it
seems to blow up. For example -- Don't foget to check for...

Rob I will email you directly an example of one failing. I removed
the details of the FN, but you should be able to use it to reproduce
the bug.

On Mar 26, 2:43 pm, Rob Reynolds <ferventco...@gmail.com> wrote:
> There was a bug found in there that the latest version fixes. It has to do
> with "--" inside of a line somewhere but not at the beginning of the line.
>
> It splits on the word GO, but it doesn't split the go when the GO is in a
> comment or inside of text.  It's  a crazy regex, but it is heavily tested
> and works well.
>
> If you want, you can email your function directly to me and I can point out
> where the issue is or determine if there is a bug.
>
> One thing to consider, GO should never be the first words in the script.
> ____
> Rob
> "Be passionate in all you do"
>
> http://devlicio.us/blogs/rob_reynoldshttp://ferventcoder.comhttp://twitter.com/ferventcoder

Rob Reynolds

unread,
Mar 23, 2013, 2:18:24 AM3/23/13
to chucknorri...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages