Category: RandomQueryGenerator

RandomQueryGeneratorGrammarMaskingAndRedefinition

[edit] Grammar Masking

The Random Query Generator's main scripts (runall.pl and gentest.pl) support a --mask parameter that can be used to specify that only certain portions of the grammar should be exercised. It takes the sub-elements of the top-level query element and --mask-level levels (default 1) down in the rule hierarchy and filters them out.

--mask is a seed to an infinite random bit-mask.

The intended use of this option is to do numerous test runs with variousvalues for --mask in order to achieve various workloads using the same SQL grammar.

For example, the following grammar:

 query:
   select | insert | update | delete ;
 ...

, when executed with --mask=someseed and the random value (first 16 bits) happen to be 5, will only run select and update queries (in a 50/50 proportion) because 5 decimal is 0101 binary.

In case of mask-level = 0 or mask = 0 no masking gets applied.

[edit] Known issue with grammar masking

In case of masking gets applied grammar constructs like

dml_list:
   safety_check dml |
   safety_check dml ; dml_list ;

could degenerate to something like

dml_list:
   safety_check dml ; dml_list ;

and cause that RQG aborts with errors like

   Rule safety_check occured more than 500 times. Possible endless loop in grammar. Aborting.
   ...
   Test completed with failure status 34.

Workaround:

   mask-level < hierarchy level where the grammar element occurs
 

[edit] Grammar Redefinition

To execute variants of a grammar, one may use --redefine to specify another grammar file that redefines and/or adds rules to the grammar. Consider the following files.

a.yy:

query:
  select | insert | update | delete ;
select:
  ... ;
insert:
  ....;
delete:
  ....;

and b.yy:

query:
  select | update | show ;
show:
  .... ;

when gentest.pl or runall.pl is executed withe the options --grammar=a.yy --redefine=b.yy you will get a run where query has been redefined and show has been added.

Retrieved from "http://forge.mysql.com/wiki/RandomQueryGeneratorGrammarMaskingAndRedefinition"

This page has been accessed 373 times. This page was last modified 11:31, 11 April 2011.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...