Commit Graph

247 Commits

Author SHA1 Message Date
cfe594bd42 SQL API: fix prepared statements with FLOAT/DOUBLE type arguments
SQL API failed to prepare correctly SQL statements containing floating
point arguments.
2021-03-25 21:20:15 +03:00
805825fa81 --rand-type: remove 'special' from available distributions
Remove the legacy 'special' distribution, because it was unscientific
and hard to explain.

Pareto and Zipfian distributions provide more clearly defined
alternatives.
2020-05-05 11:33:09 +03:00
0bd7771533 --rand-type: use 'uniform' by default
By a popular request, change the default --rand-type value from
'special' to 'uniform'.

Fixes GH-329.
2020-05-05 11:32:42 +03:00
e4e6d67325 Code cleanup: remove redundant local declarations. 2019-08-24 19:10:33 +03:00
9df34ccd1a lua return value of sb_rand_varstr 2019-07-04 16:19:09 +10:00
672be3e61a Addendum to the fix for #287: fix MySQL 5.6 builds again. 2019-01-16 18:38:27 +03:00
f98859a649 Addendum to the fix for #287: fix MySQL 5.6 builds. 2019-01-16 18:25:29 +03:00
0fcd22cc44 Merge branch 'gh-287' 2019-01-16 16:33:04 +03:00
f30a30c875 Fix #287: Issue of MYSQL_OPT_SSL_MODE
In drv_mysql.c do not assume MYSQL_OPT_SSL_MODE to be a preprocessor
define. It is an mysql_option enum value with all MySQL
versions. Instead, do a configure-time check if that value is defined in
mysql.h.
2019-01-16 14:57:37 +03:00
7df3892975 Merge branch '1.0' 2018-12-24 08:41:17 +03:00
54da9152c8 --rate mode: remove the now unnecessary queue_is_full global variable. 2018-12-24 08:40:23 +03:00
f88d27028e Merge branch '1.0' 2018-12-23 11:12:53 +03:00
a4b8aeb31a regression tests: remove unnecessary error leading to opt_rate.t instability. 2018-12-23 11:12:00 +03:00
9bb1f99169 Merge branch '1.0' 2018-12-22 20:13:15 +03:00
8744b88cad Return a non-zero exit code on event queue overflow in the --rate mode. 2018-12-22 20:11:34 +03:00
cd73213935 Merge branch '1.0' 2018-12-18 19:17:52 +03:00
3b7aacb567 --rate mode: fix a bogus error about eventgen thread termination
When the --rate option was used together with the --time option, a bogus
"Terminating the event generator thread failed" error was thrown at the
end of the test.
2018-12-17 21:59:09 +03:00
ad2b1bf1e7 Merge branch '1.0' 2018-12-16 17:27:36 +03:00
b017a998ef Fix GH-282: Mysql's fetch_row() is broken
Fix both MySQL and PostgreSQL drivers to return an error when
fetch_row() is called after retrieving all rows in the result set.
2018-12-16 17:21:39 +03:00
44db9bae33 Fix a merge error. 2018-12-11 23:32:42 +03:00
a245b2f531 OLTP scripts: add --reconnect option.
oltp_*.lua scripts now support the --reconnect=N option. When specified,
sysbench will reconnect after every N events.

Fixes GH-90.
2018-12-11 23:22:56 +03:00
8c8122080c Merge branch '1.0' 2018-12-11 23:22:32 +03:00
bb8c3b04c5 --rate mode: fix latency stats skew on low rates
Worker threads used sleep() in the bounded rate mode to avoid CPU
hogging when polling on the event queue. The problem was that sleep()
calls increased time spent by events in the queue, which is counted
towards event latency to avoid the coordinated omission problem. The
lower the rate, the bigger impact on latency was observed.

The fix is replacing sleep()s with a condition variable which is now
used to put worker into an idle wait when the queue is empty. The event
generation thread now uses pthread_cond_signal() after each generated
event to wake up an idle worker thread. Which somewhat increases
sysbench CPU consumption, especially for high rates.
2018-12-10 21:05:38 +03:00
5cd1244ecc Merge branch '1.0' 2018-10-23 14:57:36 +03:00
49f17576f2 Add /usr/share/lua/5.1 to LUA_PATH and /usr/lib/lua/5.1 to LUA_CPATH.
Those are the paths used by Luarocks on CentOS by default.
2018-10-23 14:56:40 +03:00
b04e5fd8c5 memory benchmark: code cleanups and optimizations.
Get rid of TLS variables in sb_memory.c, because their implementation
varies across platforms and their usage is an overkill for this
benchmark. Instead just use preallocated arrays with per-thread buffers/counters.
2018-10-05 19:12:07 +03:00
c63dbedae0 sb_memory.c: use configurable random function
The --rand-type described in man pages don't really work for
sysbench memory tests. So enable this powerful feature.

Tested with

  sysbench memory --memory-access-mode=rnd --rand-type=pareto run

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
2018-10-05 15:39:32 +03:00
0aba8f60da Fix GH-250: mysql_table_options is not supported in oltp tests
OLTP scripts now support --create-table-options, which can be used to
pass extra SQL to CREATE TABLE statements executed on 'prepare'.

Ref. GH-252.
2018-07-17 00:05:48 +03:00
50966c85ce Merge branch '1.0' 2018-06-26 21:35:39 +03:00
aa52c53001 Update copyright year in sysbench.cmdline.lua. 2018-05-11 22:24:41 +03:00
d805300846 Fix GH-223: test failure on ppc64
Make sysbench.cmdline.print_test_options() output deterministic by
sorting option names when parsing.
2018-05-11 22:22:33 +03:00
449b70a5b6 Merge branch '1.0' 2018-05-03 19:14:50 +03:00
e633f9c744 Fix GH-229: "--file-fsync-freq=0" seems to prevent fsync() at end of test
Ensure fsync() is called at the end of a fileio benchmark regardless of
--events, --time and --file-fsync-freq values.
2018-05-03 18:41:24 +03:00
3a5475b53e Remove Windows support which was broken in 1.0. 2018-04-21 15:19:36 +03:00
565e93cf37 Update copyright years. 2018-04-21 08:14:20 +03:00
8ded1d9f10 Remove unsupported Oracle, Drizzle and AttachSQL drivers from the source tree. 2018-04-21 08:08:48 +03:00
9ef42e269f Remove deprecated options.
--tx-rate, --max-requests, --max-time and --num-threads are no longer
supported. --rate, --events, --time and --threads should be used
instead.
2018-04-20 18:20:29 +03:00
ecf119106b Merge branch '1.0' 2018-04-16 13:23:27 +03:00
061ba339fc Update copyright year in sb_options.c. 2018-04-16 13:22:46 +03:00
3a06fdc87b Merge branch '1.0' 2018-04-12 22:14:44 +03:00
af11fa7bd4 Improve parsing of boolean command line options.
Accept true/1 as synonyms for 'on', and 'false'/0 as synonyms for
'off'. Also reject other values instead of silently converting them to
'off'.
2018-04-12 22:11:16 +03:00
8445775235 Merge branch '1.0' 2018-04-02 13:09:40 +03:00
92b1426276 Use --db-driver=mysql by default, if the MySQL driver is available.
If the MySQL driver is available and --db-driver option was explicitly
specified, assume MySQL and don't compain about multiple DB drivers
being available.

That was a popular request and is likely what most sysbench users want.
2018-04-02 11:20:55 +03:00
133aa442e1 Merge branch '1.0' 2018-04-01 14:39:10 +03:00
56b473faf6 Fix GH-195: Fix JSON reporter to produce valid JSON
sysbench.report_json() now generates well-formed JSON without comma
after the last array element and with proper opening/closing brackets.
2018-04-01 13:59:00 +03:00
b3169380ad Fix Lua state usage after closing it in sb_lua_close_state(). 2018-04-01 08:29:11 +03:00
e5c8052027 Make --mysql-ssl behave like --ssl-mode in MySQL client utilities.
The problem with MySQL 5.7+ client libraries was that there was no way
to disable SSL usage from the sysbench command line, because the client
library defaults to MYSQL_OPT_SSL_MODE = SSL_MODE_REQUIRED, even if
--mysql-ssl is not used. So the only way to disable it was disabling SSL
on the server.

Now --mysql-ssl behaves like the --ssl-mode option in MySQL client
utilities. It accepts the following values (with "disabled" being the
default):

disabled, preferred, required, verify_ca, verify_identity.

When sysbench is built With pre-5.6 MySQL client libraries or MariaDB
client libraries, where support for SSL modes is not available,
--mysql-ssl behavior is not affected by this change, i.e. it remains a
boolean variable accepting the on/off values, with "off" being the
default.
2018-03-31 20:32:09 +03:00
9ebe81693f Update copyright year in drv_mysql.c 2018-03-31 16:03:25 +03:00
b1a0694cc0 Added --mysql-ssl-key, --mysql-ca and --mysql-ssl-cert.
Replace hard-coded values for client SSL path names with driver options,
at the same time making it possible to skip those options even when
--mysql-ssl is used.
2018-03-31 15:28:29 +03:00
81ae246691 Do not error if SSL files are missing 2018-03-29 12:52:08 +02:00