Now if the help command is specified for a script, sysbench first check
if the script impelements a custom help command, and calls it. If no
custom command is defined, it checks whether the script declares any
command line options, in which case it prints their description. If
neither the help() function nor an option declaration is available,
sysbench prints an error message.
All bundled OLTP tests now declare their supported options. Which means:
- unknown options are not be silently accepted, but throw an
error (fixes#15)
- 'sysbench /any OLTP script/ help' now prints a list of supported
options, their descriptions, types and default values just as built-in
tests do (fixes#79)
Lua scripts can now declare their supported options, in which case
sysbench validates command line arguments and display usage
information.
This is a prerequisite for fixing #15 and #79.
- add support for 'validator' functions
- add support to define command line options after test
initialization. It is a prerequisite for option definitions in Lua
scripts
- various code cleanups
If a Lua script defines the sysbench.hooks.sql_error_ignorable function,
sysbench calls it whenever an SQL error occurs and passes information
about connection, failed query, SQL error number, state and message as
arguments. If the function returns true, the error is ignored and the
entire event is restarted. Otherwise sysbench aborts scripts execution.
Multiple connections per thread were made possible as a part of the SQL
API refactoring. The feature is a pre-requisite for fixing issue #73.
This commit just adds a regression test.
Use ideas and code from https://github.com/preshing/RandomSequence to
generate a sequence of unique 32-bit numbers. Make the code thread-safe
as the corresponding Lua function in sysbench might be used in a
concurrent context.