As some of you may know, part of Drizzle’s testing process involves the use of the random query generator (aka randgen aka RQG). Any patches that want to make it into trunk must survive several randgen tests, among other things.
One of the first things I did upon joining the Drizzle team at Rackspace was to take a look at the RQG tests running in Hudson. My evaluation included tuning up the existing tests and modifying some MySQL test grammars for use with Drizzle. It should be noted that randomness is a double-edged sword – it is extremely powerful for finding bugs, but it also requires a certain amount of diligence to produce useful, valid queries. Once my initial work was complete, we unleashed the new RQG tests and found the following bugs:
- Adding STRAIGHT_JOIN to certain queries results in loss of returned rows
- Adding STRAIGHT_JOIN to certain queries results in a large number of duplicate rows
- Segfault – operator= (join=0x1fd0fd8, tables=<value optimized out>, conds=<value optimized out>, keyuse_array=<value optimized out>) at ./drizzled/join_table.h:73
- Crash/segfault in drizzled::subselect_single_select_engine::exec (this=0x19a7008) at drizzled/item/subselect.cc:2204
- Server allowing JOIN on NULL values in certain cases if query includes ORDER BY clause
- crash / assertion in add_found_match_trig_cond
- Assertion failed – exec_method != MATERIALIZATION || (exec_method == MATERIALIZATION && engine->engine_type() == subselect_engine::HASH_SJ_ENGINE)”, file=<value optimized out>, line=318, function=0x84fae0 “virtual bool drizzled::Item_in_subselect::exec()
- Using ‘ALTER TABLE <> ENABLE KEYS’ on a BlitzDB table locks up the server
- Crash / segfault in drizzled::optimizer::add_key_part (keyuse_array=<value optimized out>, key_field=0x2d0dc28) at drizzled/optimizer/key_field.cc:63
- Crash / Segfault in BlitzDB – in BlitzTree::write (this=<value optimized out>, key=0x3c72 <Address 0x3c72 out of bounds>, klen=6) at plugin/blitzdb/blitzindex.cc:116
- Crash / assertion failed – “void drizzled::Select_Lex::print(drizzled::Session*, drizzled::String*, drizzled::enum_query_type)”) at assert.c:81 #3 0x00000000006282fb in drizzled::Select_Lex::print (this=0x3911418, session=0x0, str=0x7f26b77fd7c0, query_type=drizzled::QT_ORDINARY) at drizzled/sql_select.cc:6592
At the time of this writing, 6 of these are in ‘Fix Released’ status and 3 more are in work. I’d like to extend a personal “Thank you” to Prafulla Tekawade for his great work – he has supplied the patches for 5 out of the 6 fixed bugs (!). Additionally, thanks for Toru Maesaka for his continued work on BlitzDB (which is part of our regular randgen testing).
If anyone is interested in learning more about using the random query generator, I encourage you to check out launchpad. General information can also be found here and here