-
Notifications
You must be signed in to change notification settings - Fork 20
RandomQueryGeneratorQueryProperties
It is difficult to do purely functional testing on a random query workload, and validate the result set of every individual query, especially when the queries are executed concurrently.
Nevertheless, there are cases where the queries being generated have some generic properties that should be validated after each query is run.
In order to make use of this facility, put the desired propery inside /* */ comments and place it in the grammar file. This way, it will get added to each query that is generated from the particular rule. The property will also be visible in the server query log. For example:
select_item: _field | COUNT ( _field ) /* RESULTSET_HAS_ZERO_OR_ONE_ROWS */;
In this example, if the generated queries happens to have COUNT, it is also going to be tagged with /* RESULTSET_HAS_ZERO_OR_ONE_ROWS */. If the RQG detects that you have tagged queries in your grammar, it will enable the QueryProperties Validator in order to validate them.
In this particular case, COUNT() should cause query to never return more than one row, which will be checked because the query is tagged accordingly.
- RESULTSET_HAS_SAME_DATA_IN_EVERY_ROW
- RESULTSET_IS_SINGLE_INTEGER_ONE
- RESULTSET_HAS_ZERO_OR_ONE_ROWS, RESULTSET_HAS_ONE_ROW
- ERROR_NNN
- QUERY_IS_REPLICATION_SAFE