226 Commits

Author SHA1 Message Date
609f7c4db3 Pass SQL state to Lua in case of errors.
Since PostgreSQL doesn't have SQL error codes, get SQL state in case of
an error for both MySQL and PostgrSQL, and make it available to Lua.
2017-01-20 10:54:01 +03:00
dbb7bbfcd1 Implement error propagation.
SQL query errors can now be propagated to Lua scripts. This is a
prerequisite for custom error hooks.
2017-01-20 02:43:08 +03:00
d767dba581 Move the unused --myisam-max-rows option from drv_mysql.c to legacy API. 2017-01-18 21:52:32 +03:00
2f865a0053 Use pgsql_common.sh in PostgreSQL-specific regression tests. 2017-01-18 12:13:49 +03:00
9dc835aa48 Disable api_sql_pgsql.t for now. Prepared statements need more work for PostgreSQL. 2017-01-18 00:55:07 +03:00
5e7d79b49f Fixes #13: Export db_fetch_row
Add support for result set retrieving for MySQL and PostgreSQL drivers
and export it to the new Lua SQL API.
2017-01-17 22:58:18 +03:00
50f2c49c93 Improve script_bulk_insert_*.t tests stability. 2017-01-17 12:49:31 +03:00
5cab979e7d Test multiple connections per thread.
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.
2017-01-17 01:12:31 +03:00
950d848fcd Fix oltp_insert.lua, add a regression test. 2017-01-17 00:39:44 +03:00
a6cebd3a57 Rewrite OLTP benchmarks with the new SQL API + cleanups. 2017-01-17 00:17:17 +03:00
ee22b36298 Rewrite bulk_insert.lua to the new SQL API + regression tests. 2017-01-16 17:54:07 +03:00
8925dfdc79 Re-write select_random*.lua benchmarks to the new SQL API. 2017-01-16 16:01:35 +03:00
378c49b275 Fix legacy OLTP regression tests. 2017-01-15 16:53:00 +03:00
84fed669cc Move oltp_point_select.lua from sysbench/tests/db/ to sysbench/lua/.
Move oltp_point_select.lua to the sysbench/lua/ directory. Add basic
regression tests.
2017-01-15 16:45:38 +03:00
ebc2cb5420 Export prepared statements API to Lua.
Fix function name in an error message.

Fix prepared statements for string parameters.
2017-01-15 14:46:23 +03:00
1d434809ec SQL API refactoring, cut #1. 2017-01-14 01:29:57 +03:00
de3003c2c5 Fixes #96: sb_rand_uniq(1, oltp_table_size) generate duplicate value
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.
2017-01-06 19:28:48 +03:00
58e4e6e65c Fix legacy API tests. 2017-01-06 15:10:29 +03:00
9e5507db1c Merge branch '1.0' 2017-01-06 09:42:00 +03:00
99b0f4e260 Merge branch '0.5' into 1.0 2017-01-06 09:40:52 +03:00
ffc2782153 Fix portability by masking table options in api_sql.t. 2017-01-05 23:16:53 +03:00
2a523826dc Use MySQL connection arguments in API tests. 2017-01-05 23:10:34 +03:00
5e94314e69 Specify DB driver explicitly in API tests. 2017-01-05 23:03:49 +03:00
e25e4d4864 Lua API regression tests. 2017-01-05 23:00:13 +03:00
3c89312c6d Fix cmd_help.t. 2017-01-04 18:31:26 +03:00
1b91649457 Move all pseudo-random numbers related code to sb_rand.c 2017-01-02 22:25:23 +03:00
3a96db7a58 Fix timestamps in interval reports. 2017-01-02 16:00:52 +03:00
821be2a7c4 Timers overhaul. 2017-01-02 14:57:55 +03:00
c3fd06203b Better formatting for help/usage text. 2016-12-30 21:23:29 +03:00
d5b661a019 Implement --histogram option.
When --histogram is used, print latency histogram as a part of the
benchmark report. For now, the histogram is actually a text
representation of an internal data structure used by sysbench to
calculate latency percentile.
2016-12-30 20:42:35 +03:00
837b2b6a3e Adjust test_fileio.t to pass on slow machines. 2016-12-23 18:22:34 +08:00
ec2274bf2f Merge branch 'luajit' into concurrency_kit 2016-12-23 17:18:20 +08:00
7bc9a0622f Fix tests, remove thread_id arg from Lua API functions. 2016-12-18 22:18:58 +08:00
e398721314 Merge branch '1.0' into luajit 2016-12-18 21:20:32 +08:00
482136beb5 Lua implementation of the main event loop.
For Lua scripts the main event loop is now implemented in Lua
itself. This is a prerequisite for leveraging LuaJIT optimizations.
2016-12-12 22:48:11 +03:00
c36861f5ad Add PostgreSQL tests for select_random_*.lua 2016-12-08 22:31:30 +03:00
bee2ed3c00 Rafactor select_random_* benchmarks,
Refactor select_random_*.lua to reuse code from common.lua. Add basic
regression tests.
2016-12-08 22:04:55 +03:00
aead4b99bd Minor change to ensure all existing tests pass after previous commit 2016-12-05 12:23:46 +00:00
025d2b319c Split cmd_version.t into cmd_version.t and opt_version.t. 2016-12-05 13:28:22 +03:00
18b7e914a6 Various test-related fixes.
1. Fix drivers.t so it passes when no DB drivers are available.
2. Make it possible for the test suite to detect if certain DB drivers
are available, so individual tests that require them can be skipped.
2016-12-05 13:25:39 +03:00
70a1c04592 Addendum to commit b450bf0. 2016-12-05 12:45:58 +03:00
b450bf0fd6 Fix script_oltp_* tests to take new version format into account. 2016-12-05 12:31:26 +03:00
aade88ed5e Merge branch '1.0' into concurrency_kit 2016-12-05 12:22:21 +03:00
f9764f1445 Fixes #54: Reduce overhead from percentile stats
Rewrite percentile calculation to scale on modern hardware. Rename the
underlying data structure from sb_percentile to sb_histogram.
2016-12-05 11:18:40 +03:00
4b0a44c678 Fix obscure error with intermediate reports in tests that don't support them.
If a test did not support intermediate reports (i.e. --report-interval
or --report-checkpoints), there was a confusing (but benign) error at
the end of the test: "Terminating the reporting thread failed".
2016-12-02 22:06:47 +03:00
8ff0cc14e4 Fix help_drv_mysql.t after adding --mysql-ssl-cipher. 2016-11-29 22:04:11 +03:00
e43059d69d Use glob patterns to hide version-specific COLLATE clauses in script_oltp_mysql.t. 2016-10-23 11:53:48 +03:00
c3aa671364 Fix tests to pass on Travis CI with different MySQL and PostgreSQL server version. 2016-10-23 11:26:01 +03:00
0a6bc8a9ed Add tests for --oltp-create-secondary. 2016-10-22 21:30:24 +03:00
be5ce00ad7 Don't default to the first available driver when an invalid name was specified. 2016-10-22 21:12:07 +03:00