Commit graph

88940 commits

Author SHA1 Message Date
Monty
cc8aed3eb7 MDEV 4427: query timeouts
Added MAX_STATEMENT_TIME user variable to automaticly kill queries after a given time limit has expired.

- Added timer functions based on pthread_cond_timedwait
- Added kill_handlerton() to signal storage engines about kill/timeout
- Added support for GRANT ... MAX_STATEMENT_TIME=#
- Copy max_statement_time to current user, if stored in mysql.user
- Added status variable max_statement_time_exceeded
- Added KILL_TIMEOUT
- Removed digest hash from performance schema tests as they change all the time.
- Updated test results that changed because of the new user variables or new fields in mysql.user

This functionallity is inspired by work done by Davi Arnaut at twitter.
Test case is copied from Davi's work.

Documentation can be found at
https://kb.askmonty.org/en/how-to-limittimeout-queries/

mysql-test/r/mysqld--help.result:
  Updated for new help message
mysql-test/suite/perfschema/r/all_instances.result:
  Added new mutex
mysql-test/suite/sys_vars/r/max_statement_time_basic.result:
  Added testing of max_statement_time
mysql-test/suite/sys_vars/t/max_statement_time_basic.test:
  Added testing of max_statement_time
mysql-test/t/max_statement_time.test:
  Added testing of max_statement_time
mysys/CMakeLists.txt:
  Added thr_timer
mysys/my_init.c:
mysys/mysys_priv.h:
  Added new mutex and condition variables
  Added new mutex and condition variables
mysys/thr_timer.c:
  Added timer functions based on pthread_cond_timedwait()
  This can be compiled with HAVE_TIMER_CREATE to benchmark agains timer_create()/timer_settime()
sql/lex.h:
  Added MAX_STATEMENT_TIME
sql/log_event.cc:
  Safety fix (timeout should be threated as an interrupted query)
sql/mysqld.cc:
  Added support for timers
  Added status variable max_statement_time_exceeded
sql/share/errmsg-utf8.txt:
  Added ER_QUERY_TIMEOUT
sql/signal_handler.cc:
  Added support for KILL_TIMEOUT
sql/sql_acl.cc:
  Added support for GRANT ... MAX_STATEMENT_TIME=#
  Copy max_statement_time to current user
sql/sql_class.cc:
  Added timer functionality to THD.
  Added thd_kill_timeout()
sql/sql_class.h:
  Added timer functionality to THD.
  Added KILL_TIMEOUT
  Added max_statement_time variable in similar manner as long_query_time was done.
sql/sql_connect.cc:
  Added handling of max_statement_time_exceeded
sql/sql_parse.cc:
  Added starting and stopping timers for queries.
sql/sql_show.cc:
  Added max_statement_time_exceeded for user/connects status in MariaDB 10.0
sql/sql_yacc.yy:
  Added support for GRANT ... MAX_STATEMENT_TIME=# syntax, to be enabled in 10.0
sql/structs.h:
  Added max_statement_time user resource
sql/sys_vars.cc:
  Added max_statement_time variables
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
  Removed test as we require all fields in mysql.user table.
scripts/mysql_system_tables.sql
scripts/mysql_system_tables_data.sql
scripts/mysql_system_tables_fix.sql
  Updated mysql.user with new max_statement_time field
2014-10-07 11:37:36 +03:00
Sergei Petrunia
1a7d17311c Merge ../10.1-orderby-fixes into 10.1 2014-10-06 12:21:53 +04:00
Nirbhay Choubey
61d8b4a29b MDEV-6833: SIGSEGV on shutdown with non-default wsrep_slave_threads
thd->variables' table_plugin & tmp_table_plugin should be set to
NULL for wsrep system threads.
Also made a minor change to skip checking of wsrep options if
wsrep_on is not set.
2014-10-04 13:59:07 -04:00
Nirbhay Choubey
c768af75b7 Minor modifications
- Simplified test cases in wsrep.variables
- Fixed a condition in wsrep_check_opts.cc
- Fixed an "unbound variable" in wsrep_sst_rsync
2014-10-04 13:53:33 -04:00
Jan Lindström
7474e7baa0 MDEV-6807: InnoDB: Assertion failure in file lock0lock.cc
(lock != ctx->wait_lock)

References: lp:1364840 lp:1280896 - reverted a part of fix for
lp:1280896 (updating a unique key can cause parallel applying to hang )
in revision #4105. This "BF (brute force) lock skipping" caused
regression which surfaced in randgen test for bug lp:1364840
2014-10-02 21:17:57 +03:00
Sergei Golubchik
ebe4fadcd5 when running mtr tests don't let galera-started rsyncd to log to syslog 2014-10-02 18:54:01 +02:00
Jan Lindström
251239af67 Fix Windows compiler error 'log2f': identifier not found 2014-10-02 15:09:17 +03:00
Sergei Golubchik
f13cf62147 don't enable SECURITY_HARDENED on old gcc
on CentOS 5 x86 (at least) this results in a binary
that cannot load plugins. Draw the line, quite
arbitrarily, at gcc 4.6.
2014-10-01 23:48:36 +02:00
Sergei Golubchik
2156f62d2e portability: use getifaddrs()
instead of exec'ing /usr/sbin/ifconfig|grep|sed|awk
2014-10-01 23:48:36 +02:00
Sergei Golubchik
edd1de3d1c cleanup: introduce CF_SKIP_WSREP_CHECK
remove if() over many COM_xxx values
2014-10-01 23:48:36 +02:00
Sergei Golubchik
b3469520a1 cleanup: remove OPT_WSREP_START_POSITION and OPT_WSREP_SST_AUTH
there is no reason to initialize wsrep start position
and auth from inside the get_one_option() callback
2014-10-01 23:48:35 +02:00
Sergei Golubchik
eaec266eb1 restore and fix wsrep status variables 2014-10-01 23:48:35 +02:00
Sergei Golubchik
13af416a82 cleanup: wsrep_check_opts 2014-10-01 23:48:35 +02:00
Sergei Golubchik
425dc6d2fd small cleanup 2014-10-01 23:48:35 +02:00
Sergei Golubchik
7aabc2ded2 fixing embedded: WaaS. Wsrep as a Service. 2014-10-01 23:48:34 +02:00
Sergei Golubchik
8877adb773 fixing embedded: first set of changes (storage engines don't work yet) 2014-10-01 23:38:28 +02:00
Sergei Golubchik
c6b95222c3 use MD5 service in innodb/xtradb 2014-10-01 23:38:28 +02:00
Sergei Golubchik
d6141a553c MD5 service 2014-10-01 23:38:28 +02:00
Sergei Golubchik
11b6452a0f extend SHA1 service. cleanup of sha1 wrappers 2014-10-01 23:38:28 +02:00
Sergei Golubchik
93b50e64a0 cleanup: remove galera/wsrep magic from mtr 2014-10-01 23:38:27 +02:00
Sergei Golubchik
4bb49d84a9 correct handling on defaults[-extra]-file is SST scripts
pass --defaults-file and --defaults-extra-file
(whatever was specified, or none)
from mysqld down to SST scripts.

parse these options in SST scripts and pass them down
to mysqldump, my_print_defaults, and xtrabackup
2014-10-01 23:38:27 +02:00
Sergei Golubchik
dc113e2765 fix cmake detection of bfd.h 2014-10-01 23:38:27 +02:00
Sergei Golubchik
d06b5b6a2d disable wsrep by default.
fix wsrep not to crash when started disabled
2014-10-01 23:38:27 +02:00
Sergei Golubchik
4b9bf9d3b8 bugfix: remove the code that broke XA recovery 2014-10-01 23:38:27 +02:00
Sergei Golubchik
3620910eea cleanup: galera merge, simple changes 2014-10-01 23:38:27 +02:00
Sergei Golubchik
b04f848176 cleanup: use is_supported_parser_charset 2014-10-01 23:38:26 +02:00
Sergei Golubchik
1a731af194 cleanup: remove redundant clauses from sys_vars.cc 2014-10-01 23:38:26 +02:00
Sergei Golubchik
b054e4bdb1 bugfix: disabling partitioning in already built tree
that didn't quite work, WITH_PARTITION_STORAGE_ENGINE
was not undefined
2014-10-01 23:38:26 +02:00
Sergei Golubchik
88cebbdf6d cleanup: remove libedit, move readline to extra/ 2014-10-01 23:38:26 +02:00
Sergei Golubchik
74a552d5dc cleanup: remove table->status from some engines
from engines that we don't need to merge from
a third-party repository on a regular basis
2014-10-01 23:38:26 +02:00
Sergei Golubchik
fe0ff58000 compiler warnings 2014-10-01 23:38:26 +02:00
Sergei Petrunia
605b48d3e3 MDEV-6814: Server crashes in calculate_key_len on query with ORDER BY
- if test_if_skip_sort_order() decides to switch to using an index, or
  switch from using ref to using quick select, it should set all
  members accordingly.
2014-09-30 19:22:27 +04:00
Jan Lindström
fc2df3c637 MDEV-6812: Merge Kakao: Add global status variables which tell
you the progress of inplace alter table and row log buffer usage

-    (x 100%, it's 4-digit. 10000 means 100.00%)
-    Innodb_onlineddl_rowlog_rows
       Shows how many rows are stored in row log buffer.
-    Innodb_onlineddl_rowlog_pct_used
       Shows row log buffer usage in percent ( *100%, it's 4-digit. 10000 means 100.00% ).
-    Innodb_onlineddl_pct_progress
       Shows the progress of inplace alter table. It might
       be not so accurate because inplace alter is highly
       depend on disk and buffer pool status.
       But still it is useful and better than nothing.

-    Add some log for inplace alter table
       XtraDB/InnoDB will print some message before and
       after doing some task.
2014-09-30 14:50:34 +03:00
Sergei Petrunia
0b15557c8f MDEV-6796: Unable to skip filesort when using implicit extended key
Re-work test_if_order_by_key() to work correctly for extended indexes.
2014-09-26 15:54:35 +04:00
Jan Lindström
bef30f2e30 Fix test failures seen on
-- innodb-wl5522-debug-zip (path differences win/unix)
-- innodb_defragment_fill_factor (stabilise)
-- innodb_force_pk (case difference win/unix)
2014-09-26 12:16:05 +03:00
Nirbhay Choubey
236cc6cd49 wsrep-related changes: removed some unnecessary files & minor modifications. 2014-09-25 20:59:15 -04:00
Sergei Petrunia
a756ac6190 Merge branch '10.1' of github.com:MariaDB/server into 10.1 2014-09-25 22:12:52 +04:00
Sergei Petrunia
98c95ff1e2 Better comments about KEY::ext_key_part_map 2014-09-25 22:12:18 +04:00
Nirbhay Choubey
d6a67ce080 Fix for syntax error in debian control file. 2014-09-25 13:32:55 -04:00
Nirbhay Choubey
a28c9a5857 MDEV-6790: 10.1: debian build failure
Updated 33_scripts__mysql_create_system_tables__no_test.dpatch
to reflect user.default_role.
2014-09-25 11:46:52 -04:00
Sergei Petrunia
30fab5fb51 MDEV-6788: The variable 'role' is being used without being initialized at sql_acl.cc:8840
[re-commit in git]
Second variant of the fix: reduce the scope of 'role' variable
2014-09-25 19:14:16 +04:00
Sergei Petrunia
532334cb11 MDEV-6788: The variable 'role' is being used without being initialized at sql_acl.cc:8840
[Re-commit in git]
Don't check the value of 'role' variable in the cases where we don't need
it. (it may be marked as uninitialized and we get a runtime error).
2014-09-25 18:27:20 +04:00
Sergei Petrunia
9ce830d641 Merge branch '10.1' of github.com:MariaDB/server into 10.1 2014-09-25 14:30:59 +04:00
Sergei Petrunia
e74bf07982 Better comments 2014-09-25 14:29:14 +04:00
Monty
3f2d9a902e Fixed failing test temp_table_frm
The problem was that the internal temporary table created
for information_schema overflow to MyISAM because it has
a row width of > 3000 characters, which filled the in memory
temporary tables.
Fix was to increase size for the heap table.
2014-09-24 23:52:17 +03:00
Sergei Petrunia
15ad0d0bb7 Merge ../10.1-mdev6657 into bb-10.1-orderby-fixes 2014-09-24 12:17:15 +04:00
Sergei Petrunia
c7d45c220f Merge ../10.1-mdev6402 into bb-10.1-orderby-fixes 2014-09-24 12:04:16 +04:00
Sergei Petrunia
f5d845426e Better comments 2014-09-24 11:56:22 +04:00
Sergei Petrunia
8aa88db3c2 MDEV-6402: Optimizer doesn't choose best execution plan when composite...
Fix test_if_skip_sort_order() logic:
WHEN
we use index X, which doesn't produce needed ordering, but there is
an index Y which does and has the same prefix as used prefix of X
THEN
don't just switch to using ref access on Y. If range(Y) would use more
key parts, use range(Y).
2014-09-12 02:19:49 +04:00
Jan Lindström
d0a5f33ccd Remove incorrect test file. 2014-09-11 07:10:37 +03:00