Conversation
+ If a trailing comment contains a single quote and the following SQL batch contains a single quote, roundhouse was not recognizing them as separate batches. + Split the regex up to make it easier for the next person looking at it to understand.
|
Looks good. I just pulled that code in to simplify the original regex, which was failing on some code I had. Thought it was good (leaning on tests, but guess I didn't have enough). Thanks for finding this. Wonder how it works when you have -- inside of the single quote marks. Someone had this... |
|
I believe his issue has been around since a297dd4. I ran into it a while back but we were running a custom build of Roundhouse and I hadn't had time to look at it, so we hadn't updated due to it. It's been on my conscience for a while, so it was definitely something high on my to-do list! I expected it should handle that fine, but better safe than sorry, so I ran it against the original issue in https://code.google.com/p/roundhouse/issues/detail?id=71 and it came out as expected: |
|
That commit definitely caused an issue. But I did take in a pull request around a month ago that may have brought new items. I was hoping it fixed some of the other issues but hadn't had a chance yet to look around. https://groups.google.com/forum/?hl=en&fromgroups=#!searchin/chucknorrisframework/hangs$20regex/chucknorrisframework/wOdQOMXxmNM/HtsXYiJ_EjYJ It appears I may have have it backwards. The --comments then the ' mark. |
|
The stuff in 71 was definitely fixed then, but it cropped up this issue: |
|
And you've now fixed that. :) |
There was a nasty bug in the SQL Server batch splitting regex which caused batches to be split incorrectly. Consider the following contrived example SQL:
The statement splitter would not detect the GO statement because it incorrectly considered the single quote in the trailing comment as a string.
I tightened up the regex and made it a bit more legible for future readers.