Quantcast
Channel: MSFTASProdSamples Work Item Rss Feed
Viewing all articles
Browse latest Browse all 20

Commented Issue: Ascmd.exe XMLA batch delimiter regex bug [14608]

$
0
0
I was running into issues trying to run an OLAP DB scripted out XMLA create (from management studio). The XMLA was valid and could be run fine in management studio, and AScmd would run simpler XMLA just fine.

It appears to be the "BatchRegex" pattern defined on line 316 in Ascmd.cs. It looks for "GO" statements within the xmla, however the pattern looked for any "go" text followed by a space. We had a dimension attribute of "Year Ago Today", and the ascmd would try to split the xmla into batches, and truncate the large CREATE statement at "Year Ago".

I've changed the regex to include and end string token and this seems to fix the problem, however I don't understand the batching properly to know if this is an adequate fix:
My Chagne: const string BatchRegex = @"^[\w\W]*?[\r\n]*go\s$";

Reproduction steps:
Create an olapdb/cube with a measure or dimension having "go" in the name, anything like "go time" or "year ago today" should work.
Script entire olap database as "CREATE" from Management studio
Try to run this create script to create the olapdb on a new server using Ascmd.exe.
Comments: ** Comment from web user: kosteckir **

We have faced the same issue and following some code debugging came up with the following bug fix: const string BatchRegex = @"^[\w\W]*?[\r\n]+go\s";

The second star before ‘go’ needs to be replaced with ‘+’

Justification:
“+” means 1 or more occurrences. This means that that ‘go’ must be preceded by at least one new line “\r\n” to form a new batch.

“*” means 0 or more occurrences therefore every string ending with “go”+ white space (such as “ringo “, “bingo “, “dingo “ etc.) created a new batch with a broken XML structure regardless whether it was preceded by [\r\n] or not.


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>