Commit graph

6963 commits

Author SHA1 Message Date
Jan Lindström
8249dcaaeb MDEV-6858: enforce_storage_engine option
Merge from Percona Server enforced use of a specific storage engine
authored by Stewart Smith.

Modified to be session variable and modifiable only by SUPER. Use
similar implementation as default_storage_engine.
2015-03-12 12:17:14 +02:00
Daniel Black
fa5809ce10 Add Master_gtid_wait_{count,time,timeouts} status
MASTER_GTID_WAIT function needs some status to evaluate its use.

master_gtid_wait_count indicates how many times the function is called.
master_gtid_wait_time indicates how much time in microseconds occurred
waiting (or timing out)
master_gtid_timeouts indicates how many time times this function timed
out rather than all successful gtids events being available.
2015-03-12 06:43:38 +11:00
Daniel Black
eac71ced18 Add Slave_skipped_errors to global status
This counts the number of times a replication event is ignored
due to slave_skip_errors.
2015-03-12 05:23:05 +11:00
Sergei Petrunia
1626e0d3d4 MDEV-7648: Extra data in ANALYZE FORMAT=JSON $stmt
Show total execution time (r_total_time_ms) for various parts of the
query:
1. time spent in SELECTs
2. time spent reading rows from storage engines

#2 currently gets the data from P_S.
2015-03-07 22:47:28 +03:00
Sergei Golubchik
18feb62fee MDEV-6819 st_mysql_show_var::value should be void* not char* 2015-03-07 13:27:56 +01:00
Sergey Vojtovich
6f9e33ecb0 MDEV-7273 - 10.1 fails to start up during tc_log initializations on PPC64
log-tc-size is 24K by default. Page size is 64K on PPC64. But log-tc-
size
must be at least 3 x page size. This is enforced by TC_LOG_MMAP::open()
with a comment: to guarantee non-empty pool.

This all makes server not startable in default configuration on PPC64.

Autosize log-tc-size, so that it's min value= page size * 3, default
value= page size * 6, block size= page size.

Conflicts:
	mysql-test/suite/sys_vars/inc/sysvars_server.inc
	mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
	mysql-test/t/mysqld--help.test
	sql/mysqld.cc
	sql/sys_vars.cc
2015-03-05 16:59:06 -05:00
Sergei Golubchik
7951bb1656 cleanup: remove unused variables 2015-02-28 19:48:22 +01:00
Nirbhay Choubey
a174aaed75 cleanup: remove unused THD::COND_wsrep_thd
Conflicts:
	mysql-test/suite/perfschema/r/all_instances.result
	sql/mysqld.h
2015-02-19 17:45:21 -05:00
Nirbhay Choubey
1e6f46d78f cleanup: remove unused THD::COND_wsrep_thd 2015-02-19 17:28:18 -05:00
Monty
d7d589dc01 Push for testing of encryption 2015-02-10 10:21:17 +01:00
Sergei Golubchik
4280b25ed8 --getopt-prefix-matching command-line option 2015-02-10 10:21:15 +01:00
Sergei Golubchik
f13939061d Merge branch 'bb-10.1-merge' into 10.1 2015-02-07 16:14:21 +01:00
Kristian Nielsen
8672339328 MDEV-6676: Optimistic parallel replication
Adjust the configuration options, as discussed on the
maria-developers@ mailing list.

The option to hint a transaction to not be replicated in parallel is
now called @@skip_parallel_replication, consistent with
@@skip_replication.

And the --slave-parallel-mode is now simplified to have just one of
the following values:

  none
  minimal
  conservative
  optimistic
  aggressive

This reflects successively harder efforts to find opportunities to run
things in parallel on the slave. It allows to extend the server with
more automatic heuristics in the future without having to introduce a
new configuration option for each and every one.
2015-02-07 09:42:58 +01:00
Sergei Golubchik
2a1470a0ed wsrep: check options as early as possible
to be able disable wsrep before any further code that uses it
(e.g. initialized binlog when wsrep is enabled)
2015-02-06 16:16:38 +01:00
Sergei Golubchik
8e7649867f Merge 10.0-galera into 10.1 2015-02-06 16:14:23 +01:00
Praveenkumar.Hulakund
ddd275bde7 Bug#20052694 - FAILED RESTARTS CONTAIN NO VERSION DETAILS.
In versions 5.5 and 5.6 the MySQL version is not logged until
server is started and ready to accept connections. Exiting
server before this point will not have server version information
in the log. But in 5.7 code, we log a server version information
just after we prepare server_version string and logging is initialized.

For 5.5 and 5.6 code also adding this code to print server version
information.

Test results:
================

5.5
-----
Server version will be logged as below on server startup:
141218  8:45:48 [Note] /home/praveen/WorkDir/mysql_local/bug20052694/mysql/sql/mysqld (mysqld 5.5.42-debug-log) starting as process 19697 ...

5.6
----
Server version will be logged as below on server startup:
2014-12-18 09:08:43 0 [Note] /home/praveen/WorkDir/mysql_local/bug20052694/mysql-5.6/sql/mysqld (mysqld 5.6.23-debug-log) starting as process 18474 ...
2015-02-06 11:09:08 +05:30
Sergei Golubchik
bfe703a458 don't let current_thd to point to a destroyed THD
* reset current_thd in THD::~THD, otherwise my_malloc_size_cb_func()
  might access THD after it was destroyed.
* remove now redundant set_current_thd(0) calls that follow delete thd.
2015-02-03 18:19:56 +01:00
Monty
cd9e69ec70 Cleaned up code for setting slave_parallel_mode
Now this works the same way as all other multi source variables.
2015-02-01 22:39:59 +02:00
Monty
0ee879ff8a Improve performance for calculating memory allocation
Extend interface for 'show variables' with current scope
2015-02-01 15:24:22 +02:00
Sergei Golubchik
4b21cd21fe Merge branch '10.0' into merge-wip 2015-01-31 21:48:47 +01:00
Nirbhay Choubey
7cda4bee0e maria-10.0.16 merge
bzr merge -r4588 maria/10.0
2015-01-26 22:54:27 -05:00
Sergei Golubchik
919443f7a5 MDEV-5679 MariaDB holds stdin open after startup as mysqld 2015-01-19 16:11:48 +01:00
Michael Widenius
32be7dffbe Return to original stage after mysql_lock_tables
Stage "Filling schema table" is now properly shown in 'show processlist'


mysys/mf_keycache.c:
  Simple cleanup with more comments
sql/lock.cc:
  Return to original stage after mysql_lock_tables
  Made 'Table lock' as a true stage
sql/sql_show.cc:
  Restore original stage after get_schema_tables_result
2015-01-18 13:39:59 +02:00
Sergei Golubchik
e695db0f2d MDEV-7437 remove suport for "atomics" with rwlocks 2015-01-13 10:15:21 +01:00
Sergei Golubchik
2501a0ea59 MDEV-7364 - mysqld --help --verbose prints random values for "debug"
better fix that doesn't make debug-dbug variable to disappear
from mysqld --help output (this fact is used by have_debug.inc)
and shows correctly what dbug value was set on the command line.
2015-01-11 16:37:25 +01:00
Sergey Vojtovich
dc92032fa3 Fixed sysvars_server_embedded test result to reflect new values for
query_prealloc_size, query_alloc_block_size and log_tc_size.

Fixed incorrect registration of LOCK_binlog_end_pos in PFS.
2014-12-29 15:41:08 +04:00
Sergey Vojtovich
6dbc48ca79 MDEV-7324 - Lock-free hash for table definition cache 2014-12-28 19:46:18 +04:00
Sergey Vojtovich
f65901eef2 MDEV-7273 - 10.1 fails to start up during tc_log initializations on PPC64
log-tc-size is 24K by default. Page size is 64K on PPC64. But log-tc-size
must be at least 3 x page size. This is enforced by TC_LOG_MMAP::open()
with a comment: to guarantee non-empty pool.

This all makes server not startable in default configuration on PPC64.

Autosize log-tc-size, so that it's min value= page size * 3, default
value= page size * 6, block size= page size.
2014-12-26 23:38:45 +04:00
Jonas Oreland
0b87de124d MDEV-162 Enhanced semisync replication
Implement --semi-sync-master-wait-point=AFTER_SYNC|AFTER_COMMIT.

When AFTER_SYNC, the semi-sync wait will be done earlier, before the storage
engine commit rather than after. This means that a transaction will not be
visible on the master until at least one slave has received it.
2014-12-23 14:16:32 +01:00
Jonas Oreland
4d8b346e07 MDEV-7257: Dump Thread Enhancements
Make the binlog dump threads not need to take LOCK_log while sending
binlog events to slave. Instead, a new LOCK_binlog_end_pos is used
just to coordinate tracking the current end-of-log.

This is a pre-requisite for MDEV-162, "Enhanced semisync
replication". It should also help reduce the contention on LOCK_log on
a busy master.

Also does some much-needed refactoring/cleanup of the related code in
the binlog dump thread.
2014-12-23 14:16:13 +01:00
Kristian Nielsen
db21fddc37 MDEV-6676: Optimistic parallel replication
Implement a new mode for parallel replication. In this mode, all transactions
are optimistically attempted applied in parallel. In case of conflicts, the
offending transaction is rolled back and retried later non-parallel.

This is an early-release patch to facilitate testing, more changes to user
interface / options will be expected. The new mode is not enabled by default.
2014-12-06 08:49:50 +01:00
Nirbhay Choubey
3bb02f3e6d bzr merge -rtag:mariadb-10.0.15 maria/10.0 2014-12-05 12:33:02 -05:00
Sergey Vojtovich
faf169d245 MDEV-6906 - Relaxed memory order for counters
Let some atomic counters use relaxed memory order.
2014-12-05 11:01:49 +04:00
Sergei Golubchik
7516a3c7f4 strict_password_validation 2014-12-04 10:41:55 +01:00
Sergei Golubchik
853077ad7e Merge branch '10.0' into bb-10.1-merge
Conflicts:
	.bzrignore
	VERSION
	cmake/plugin.cmake
	debian/dist/Debian/control
	debian/dist/Ubuntu/control
	mysql-test/r/join_outer.result
	mysql-test/r/join_outer_jcl6.result
	mysql-test/r/null.result
	mysql-test/r/old-mode.result
	mysql-test/r/union.result
	mysql-test/t/join_outer.test
	mysql-test/t/null.test
	mysql-test/t/old-mode.test
	mysql-test/t/union.test
	packaging/rpm-oel/mysql.spec.in
	scripts/mysql_config.sh
	sql/ha_ndbcluster.cc
	sql/ha_ndbcluster_binlog.cc
	sql/ha_ndbcluster_cond.cc
	sql/item_cmpfunc.h
	sql/lock.cc
	sql/sql_select.cc
	sql/sql_show.cc
	sql/sql_update.cc
	sql/sql_yacc.yy
	storage/innobase/buf/buf0flu.cc
	storage/innobase/fil/fil0fil.cc
	storage/innobase/include/srv0srv.h
	storage/innobase/lock/lock0lock.cc
	storage/tokudb/CMakeLists.txt
	storage/xtradb/buf/buf0flu.cc
	storage/xtradb/fil/fil0fil.cc
	storage/xtradb/include/srv0srv.h
	storage/xtradb/lock/lock0lock.cc
	support-files/mysql.spec.sh
2014-12-02 22:25:16 +01:00
Sergei Golubchik
dbbe831096 don't skip wsrep position recovery silently
control scripts (mysqld_safe for example) want to know
whether a recovery was successful or not.
total silence is too suspicious to be trusted.
2014-12-01 15:25:07 +01:00
Nirbhay Choubey
5298e21c32 MDEV-6961: mysqld should terminate when started with --wsrep-recover
Fixed the condition to make sure mysqld process terminates when
started with wsrep-recover.
2014-11-30 00:12:45 -05:00
Sergei Golubchik
ea04a8cfda MDEV-6805 one can set character_set_client to utf32
use the same restriction for character_set_client on the command line
and from SQL.

Also: remove strange hack from thd_init_client_charset() that contradicted
the manual (collation_connection and character_set_result were not always set)
2014-11-18 22:25:47 +01:00
Nirbhay Choubey
6f65d2d114 MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
Do not allow server to start if binlog_format is set
to a format other than ROW. Also restrict the change
of GLOBAL/SESSION binlog_format value at runtime.
2014-11-17 11:56:03 -05:00
Nirbhay Choubey
c68e73b53f MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
Do not allow server to start if binlog_format is set
to a format other than ROW. Also restrict the change
of GLOBAL/SESSION binlog_format value at runtime.
2014-11-17 09:55:53 -05:00
Kristian Nielsen
a98a034c5e MDEV-7102: Incorrect PSI_stage_info message in SHOW PROCESSLIST during parallel replication
In parallel replication, threads can do two different waits for a prior
transaction. One is for the prior transaction to start commit, the other is
for it to complete commit.

It turns out that the same PSI_stage_info message was errorneously used in
both cases (probably a merge error), causing SHOW PROCESSLIST to be
misleading.

Fix by using correct, distinct message in each case.
2014-11-13 09:56:28 +01:00
Alexander Barkov
43f185e171 MDEV-5528 Command line variable to choose MariaDB-5.3 vs MySQL-5.6 temporal data formats 2014-11-03 21:45:06 +04:00
Sergei Golubchik
f62c12b405 Merge 10.0.14 into 10.1 2014-10-15 12:59:13 +02:00
Sergei Golubchik
7f5e51b940 MDEV-34 delete storage/ndb and sql/*ndb* (and collateral changes)
remove:
* NDB from everywhere
* IM from mtr-v1
* packaging/rpm-oel and packaging/rpm-uln
* few unused spec files
* plug.in file
* .bzrignore
2014-10-11 18:53:06 +02:00
Sergei Golubchik
db8af31831 SHOW and FLUSH for I_S tables.
Extend existing plugins to support
* SHOW QUERY_RESPONSE_TIME
* FLUSH QUERY_RESPONSE_TIME
* SHOW LOCALE

move userstat tables to use the new API instead of
hand-coded syntax
2014-10-11 18:53:04 +02:00
Sergei Golubchik
2a4e8813f6 GLOBAL_VALUE_ORIGIN=AUTO 2014-10-11 10:23:21 +02:00
Sergei Golubchik
3fa8c279d5 INFORMATION_SCHEMA.SYSTEM_VARIABLES.GLOBAL_VALUE_ORIGIN 2014-10-11 10:23:20 +02:00
Sergei Golubchik
051c132635 cleanup: sysvar, SHOW_VALUE_IN_HELP->GETOPT_ONLY_HELP
replace flag SHOW_VALUE_IN_HELP (that's not really an
independendent flag, as it should only be used for
NO_CMD_LINE sysvars) with a special getopt.id type.
2014-10-10 22:27:40 +02:00
Sergei Golubchik
ab34aecff3 MDEV-6513 deprecate engine_condition_pushdown value of the @@optimizer_switch
* ignore the OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN bit
* issue a deprecation warning on 'engine_condition_pushdown=on'
* remove unused remains of the old pre-5.5 engine_condition_pushdown variable
2014-10-10 22:27:40 +02:00
Sergei Golubchik
d7c1e0ebbd MDEV-5317 Compound statement / anonymous blocks
originally based on the patch by Antony T Curtis
2014-10-10 22:27:39 +02:00
Sergei Golubchik
d103e359f8 followup changes to timeout commit
* fix debian patch
* update the copyright
* rename include guards to follow conventions
* restore incorectly deleted test file, add clarification in a comment
* capitalize the first letter of the status variable
2014-10-10 22:27:36 +02:00
Nirbhay Choubey
542968cf0a bzr merge -r4015..4026 codership/5.5 2014-10-09 18:28:14 -04:00
Nirbhay Choubey
068fb8569f bzr merge -rtag:mariadb-5.5.40 maria/5.5 2014-10-09 17:25:08 -04:00
Sergei Golubchik
1b75bed00f 5.5.40+ merge 2014-10-09 10:30:11 +02:00
Sergei Golubchik
d3677c872f jemalloc compatibility 2014-10-08 00:45:41 +02:00
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 Golubchik
1ddfce4840 mysql-5.5.40 2014-10-06 19:53:55 +02: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
Sergei Golubchik
11242006ad MDEV-6461 mysqld should not trap SIGTSTP if running with --gdb/--debug-gdb 2014-10-02 13:52:51 +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
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
Nirbhay Choubey
9a57de86be bzr merge -r4123..4144 codership/5.6 2014-09-30 18:06:15 -04:00
Michael Widenius
70823e1d91 MDEV-5120 Test suite test maria-no-logging fails
The reason for the failure was a bug in an include file on debian that causes 'struct stat'
to have different sized depending on the environment.

This patch fixes so that we always include my_global.h or my_config.h before we include any other files.

Other things:
- Removed #include <my_global.h> in some include files; Better to always do this at the top level to have as few
  "always-include-this-file-first' files as possible.
- Removed usage of some include files that where already included by my_global.h or by other files.


client/mysql_plugin.c:
  Use my_global.h first
client/mysqlslap.c:
  Remove duplicated include files
extra/comp_err.c:
  Remove duplicated include files
include/m_string.h:
  Remove duplicated include files
include/maria.h:
  Remove duplicated include files
libmysqld/emb_qcache.cc:
  Use my_global.h first
plugin/semisync/semisync.h:
  Use my_pthread.h first
sql/datadict.cc:
  Use my_global.h first
sql/debug_sync.cc:
  Use my_global.h first
sql/derror.cc:
  Use my_global.h first
sql/des_key_file.cc:
  Use my_global.h first
sql/discover.cc:
  Use my_global.h first
sql/event_data_objects.cc:
  Use my_global.h first
sql/event_db_repository.cc:
  Use my_global.h first
sql/event_parse_data.cc:
  Use my_global.h first
sql/event_queue.cc:
  Use my_global.h first
sql/event_scheduler.cc:
  Use my_global.h first
sql/events.cc:
  Use my_global.h first
sql/field.cc:
  Use my_global.h first
  Remove duplicated include files
sql/field_conv.cc:
  Use my_global.h first
sql/filesort.cc:
  Use my_global.h first
  Remove duplicated include files
sql/gstream.cc:
  Use my_global.h first
sql/ha_ndbcluster.cc:
  Use my_global.h first
sql/ha_ndbcluster_binlog.cc:
  Use my_global.h first
sql/ha_ndbcluster_cond.cc:
  Use my_global.h first
sql/ha_partition.cc:
  Use my_global.h first
sql/handler.cc:
  Use my_global.h first
sql/hash_filo.cc:
  Use my_global.h first
sql/hostname.cc:
  Use my_global.h first
sql/init.cc:
  Use my_global.h first
sql/item.cc:
  Use my_global.h first
sql/item_buff.cc:
  Use my_global.h first
sql/item_cmpfunc.cc:
  Use my_global.h first
sql/item_create.cc:
  Use my_global.h first
sql/item_geofunc.cc:
  Use my_global.h first
sql/item_inetfunc.cc:
  Use my_global.h first
sql/item_row.cc:
  Use my_global.h first
sql/item_strfunc.cc:
  Use my_global.h first
sql/item_subselect.cc:
  Use my_global.h first
sql/item_sum.cc:
  Use my_global.h first
sql/item_timefunc.cc:
  Use my_global.h first
sql/item_xmlfunc.cc:
  Use my_global.h first
sql/key.cc:
  Use my_global.h first
sql/lock.cc:
  Use my_global.h first
sql/log.cc:
  Use my_global.h first
sql/log_event.cc:
  Use my_global.h first
sql/log_event_old.cc:
  Use my_global.h first
sql/mf_iocache.cc:
  Use my_global.h first
sql/mysql_install_db.cc:
  Remove duplicated include files
sql/mysqld.cc:
  Remove duplicated include files
sql/net_serv.cc:
  Remove duplicated include files
sql/opt_range.cc:
  Use my_global.h first
sql/opt_subselect.cc:
  Use my_global.h first
sql/opt_sum.cc:
  Use my_global.h first
sql/parse_file.cc:
  Use my_global.h first
sql/partition_info.cc:
  Use my_global.h first
sql/procedure.cc:
  Use my_global.h first
sql/protocol.cc:
  Use my_global.h first
sql/records.cc:
  Use my_global.h first
sql/records.h:
  Don't include my_global.h
  Better to do this at the upper level
sql/repl_failsafe.cc:
  Use my_global.h first
sql/rpl_filter.cc:
  Use my_global.h first
sql/rpl_gtid.cc:
  Use my_global.h first
sql/rpl_handler.cc:
  Use my_global.h first
sql/rpl_injector.cc:
  Use my_global.h first
sql/rpl_record.cc:
  Use my_global.h first
sql/rpl_record_old.cc:
  Use my_global.h first
sql/rpl_reporting.cc:
  Use my_global.h first
sql/rpl_rli.cc:
  Use my_global.h first
sql/rpl_tblmap.cc:
  Use my_global.h first
sql/rpl_utility.cc:
  Use my_global.h first
sql/set_var.cc:
  Added comment
sql/slave.cc:
  Use my_global.h first
sql/sp.cc:
  Use my_global.h first
sql/sp_cache.cc:
  Use my_global.h first
sql/sp_head.cc:
  Use my_global.h first
sql/sp_pcontext.cc:
  Use my_global.h first
sql/sp_rcontext.cc:
  Use my_global.h first
sql/spatial.cc:
  Use my_global.h first
sql/sql_acl.cc:
  Use my_global.h first
sql/sql_admin.cc:
  Use my_global.h first
sql/sql_analyse.cc:
  Use my_global.h first
sql/sql_audit.cc:
  Use my_global.h first
sql/sql_base.cc:
  Use my_global.h first
sql/sql_binlog.cc:
  Use my_global.h first
sql/sql_bootstrap.cc:
  Use my_global.h first
  Use my_global.h first
sql/sql_cache.cc:
  Use my_global.h first
sql/sql_class.cc:
  Use my_global.h first
sql/sql_client.cc:
  Use my_global.h first
sql/sql_connect.cc:
  Use my_global.h first
sql/sql_crypt.cc:
  Use my_global.h first
sql/sql_cursor.cc:
  Use my_global.h first
sql/sql_db.cc:
  Use my_global.h first
sql/sql_delete.cc:
  Use my_global.h first
sql/sql_derived.cc:
  Use my_global.h first
sql/sql_do.cc:
  Use my_global.h first
sql/sql_error.cc:
  Use my_global.h first
sql/sql_explain.cc:
  Use my_global.h first
sql/sql_expression_cache.cc:
  Use my_global.h first
sql/sql_handler.cc:
  Use my_global.h first
sql/sql_help.cc:
  Use my_global.h first
sql/sql_insert.cc:
  Use my_global.h first
sql/sql_lex.cc:
  Use my_global.h first
sql/sql_load.cc:
  Use my_global.h first
sql/sql_locale.cc:
  Use my_global.h first
sql/sql_manager.cc:
  Use my_global.h first
sql/sql_parse.cc:
  Use my_global.h first
sql/sql_partition.cc:
  Use my_global.h first
sql/sql_plugin.cc:
  Added comment
sql/sql_prepare.cc:
  Use my_global.h first
sql/sql_priv.h:
  Added error if we use this before including my_global.h
  This check is here becasue so many files includes sql_priv.h first.
sql/sql_profile.cc:
  Use my_global.h first
sql/sql_reload.cc:
  Use my_global.h first
sql/sql_rename.cc:
  Use my_global.h first
sql/sql_repl.cc:
  Use my_global.h first
sql/sql_select.cc:
  Use my_global.h first
sql/sql_servers.cc:
  Use my_global.h first
sql/sql_show.cc:
  Added comment
sql/sql_signal.cc:
  Use my_global.h first
sql/sql_statistics.cc:
  Use my_global.h first
sql/sql_table.cc:
  Use my_global.h first
sql/sql_tablespace.cc:
  Use my_global.h first
sql/sql_test.cc:
  Use my_global.h first
sql/sql_time.cc:
  Use my_global.h first
sql/sql_trigger.cc:
  Use my_global.h first
sql/sql_udf.cc:
  Use my_global.h first
sql/sql_union.cc:
  Use my_global.h first
sql/sql_update.cc:
  Use my_global.h first
sql/sql_view.cc:
  Use my_global.h first
sql/sys_vars.cc:
  Added comment
sql/table.cc:
  Use my_global.h first
sql/thr_malloc.cc:
  Use my_global.h first
sql/transaction.cc:
  Use my_global.h first
sql/uniques.cc:
  Use my_global.h first
sql/unireg.cc:
  Use my_global.h first
sql/unireg.h:
  Removed inclusion of my_global.h
storage/archive/ha_archive.cc:
  Added comment
storage/blackhole/ha_blackhole.cc:
  Use my_global.h first
storage/csv/ha_tina.cc:
  Use my_global.h first
storage/csv/transparent_file.cc:
  Use my_global.h first
storage/federated/ha_federated.cc:
  Use my_global.h first
storage/federatedx/federatedx_io.cc:
  Use my_global.h first
storage/federatedx/federatedx_io_mysql.cc:
  Use my_global.h first
storage/federatedx/federatedx_io_null.cc:
  Use my_global.h first
storage/federatedx/federatedx_txn.cc:
  Use my_global.h first
storage/heap/ha_heap.cc:
  Use my_global.h first
storage/innobase/handler/handler0alter.cc:
  Use my_global.h first
storage/maria/ha_maria.cc:
  Use my_global.h first
storage/maria/unittest/ma_maria_log_cleanup.c:
  Remove duplicated include files
storage/maria/unittest/test_file.c:
  Added comment
storage/myisam/ha_myisam.cc:
  Move sql_plugin.h first as this includes my_global.h
storage/myisammrg/ha_myisammrg.cc:
  Use my_global.h first
storage/oqgraph/oqgraph_thunk.cc:
  Use my_config.h and my_global.h first
  One could not include my_global.h before oqgraph_thunk.h (don't know why)
storage/spider/ha_spider.cc:
  Use my_global.h first
storage/spider/hs_client/config.cpp:
  Use my_global.h first
storage/spider/hs_client/escape.cpp:
  Use my_global.h first
storage/spider/hs_client/fatal.cpp:
  Use my_global.h first
storage/spider/hs_client/hstcpcli.cpp:
  Use my_global.h first
storage/spider/hs_client/socket.cpp:
  Use my_global.h first
storage/spider/hs_client/string_util.cpp:
  Use my_global.h first
storage/spider/spd_conn.cc:
  Use my_global.h first
storage/spider/spd_copy_tables.cc:
  Use my_global.h first
storage/spider/spd_db_conn.cc:
  Use my_global.h first
storage/spider/spd_db_handlersocket.cc:
  Use my_global.h first
storage/spider/spd_db_mysql.cc:
  Use my_global.h first
storage/spider/spd_db_oracle.cc:
  Use my_global.h first
storage/spider/spd_direct_sql.cc:
  Use my_global.h first
storage/spider/spd_i_s.cc:
  Use my_global.h first
storage/spider/spd_malloc.cc:
  Use my_global.h first
storage/spider/spd_param.cc:
  Use my_global.h first
storage/spider/spd_ping_table.cc:
  Use my_global.h first
storage/spider/spd_sys_table.cc:
  Use my_global.h first
storage/spider/spd_table.cc:
  Use my_global.h first
storage/spider/spd_trx.cc:
  Use my_global.h first
storage/xtradb/handler/handler0alter.cc:
  Use my_global.h first
storage/xtradb/handler/i_s.cc:
  Use my_global.h first
2014-09-30 20:31:14 +03:00
Nirbhay Choubey
c916085e27 bzr merge -rtag:mariadb-10.0.14 maria/10.0/ 2014-09-28 20:43:56 -04:00
Nirbhay Choubey
4538665a63 MDEV-6740 : Galera crash in rpl_sql_thread_info/cached_charset_compare
Properly initialized rpl_sql_thread_info for bf threads.
Also removed some dead code.
2014-09-22 12:15:44 -04:00
Nirbhay Choubey
ac2a2f3453 MDEV-6659: mysqld --help --verbose initializes wsrep
Do not initialize/load wsrep subsystem if server is
started in help mode.
2014-09-16 12:42:17 -04:00
Michael Widenius
e36d6f03a4 Don't use LOCK_status for the duration of SHOW STATUS because of possible lookups.
Instead we use LOCK_status only to protect summary of thread statistics and use a new mutex, LOCK_show_status
to protect concurrent SHOW STATUS.

sql/mysqld.cc:
  Add LOCK_show_status
  Don't free LOCK_status while calculating status variables.
sql/mysqld.h:
  Add LOCK_show_status
sql/sql_show.cc:
  Use LOCK_show_status to protect SHOW STATUS instead of LOCK_status.
2014-09-12 14:49:13 +03:00
Jan Lindström
595bcb7947 Fix merge error on binlog_remove_pending_rows causing failure
on binlog_innodb_row test.
2014-09-10 18:48:26 +03:00
Nirbhay Choubey
f3e95caacd MDEV-6699 : wsrep_node_name not automatically set to hostname
Fixed by using hostname (glob_hostname) as default value for
wsrep_node_name system variable.
Added a test case.
2014-09-09 09:25:47 -04:00
Nirbhay Choubey
140fd7adbd MDEV-6699 : wsrep_node_name not automatically set to hostname
Fixed by using hostname (glob_hostname) as default value for
wsrep_node_name system variable.
Added a test case.
2014-09-09 09:18:35 -04:00
Nirbhay Choubey
47fcca0ffc MDEV-6667 : Improved handling of wsrep-new-cluster option
Code refactoring. Using mysql option handling system to
handle 'wsrep-new-cluster' option.
2014-09-08 21:21:37 -04:00
Jan Lindström
f99f573dc7 MDEV-6656: Test wsrep.variables hangs
Analysis: wsrep_applier_thread shutdown signaling does not always work
correctly causing a timing problem where main thread is waiting in a
condition variable a signal that all worker threads to end.
2014-08-29 09:42:13 +03:00
Nirbhay Choubey
4cccd57849 MDEV-6659: mysqld --help --verbose initializes wsrep
Do not initialize/load wsrep subsystem if server is
started in help mode.
2014-08-28 23:42:45 -04:00
Jan Lindström
ab150128ce MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3880.

    Added a new functions to handler API to forcefully abort_transaction,
    producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
    were added for future possiblity to add more storage engines that
    could use galera replication.
2014-08-27 13:15:37 +03:00
Jan Lindström
df4dd593f2 MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
2014-08-26 15:43:46 +03:00
Sergey Vojtovich
f1c1c04a34 MDEV-4262 - P_S discovery
Discover P_S tables automatically.

Most of this patch is code clean-up:
- removed tests and code responsible for P_S tables correctness verification
- always return error from ha_perfschema::create()
- install/upgrade scripts won't create P_S tables anymore
2014-08-19 15:18:18 +04:00
Nirbhay Choubey
857abf1481 bzr merge -r4104..4120 codership/5.6/ 2014-08-12 14:05:44 -04:00
Nirbhay Choubey
8358dd53b7 bzr merge -r4346 maria/10.0 (maria-10.0.13) 2014-08-11 23:55:41 -04:00
Monty
e2b2bde358 Made sql_log_slow a session variable
mysqldump:
- Added --log-queries to allow one to disable logging for the dump

sql/log_event.cc:
- Removed setting of enable_slow_log as it's not required anymore.

sql/sql_parse.cc:
- Set enable_slow_log to value of thd->variables.sql_log_slow as this will speed up tests if slow log is disabled.
- opt_log_slow_admin_statements can now only disable slow log, not enable it.

sql/sql_explain.cc:
- Minor cleanup

Other things:
- Added sql_log_slow to system variables.
- Changed opt_slow_log to global_system_variables.sql_log_slow in all files
- Updated tests to reflect changes
2014-08-09 13:22:01 +03:00
Sergei Golubchik
6fb17a0601 5.5.39 merge 2014-08-07 18:06:56 +02:00
Nirbhay Choubey
ec91eea8db Local merge of mariadb-5.5.39
bzr merge -r4264 maria/5.5

Text conflict in sql/mysqld.cc
Text conflict in storage/xtradb/btr/btr0cur.c
Text conflict in storage/xtradb/buf/buf0buf.c
Text conflict in storage/xtradb/buf/buf0lru.c
Text conflict in storage/xtradb/handler/ha_innodb.cc
5 conflicts encountered.
2014-08-06 14:06:11 -04:00
Sergei Golubchik
627caa30b6 fix the error message when getaddrinfo() fails. on windows "*" doesn't mean "any address" 2014-08-06 15:53:31 +02:00
Sergei Golubchik
ef2bf18706 MDEV-4379 expand MariaDB dual-stack support
when binding to wildcard addresses (no --bind is specified or --bind=*),
bind to both ipv6 and ipv4 as mysql-5.6 is doing.
2014-08-03 21:43:59 +02:00
Sergei Golubchik
6145e167f3 remove unused OPT_xxx values from mysqld.cc and the related dead code 2014-08-03 18:58:53 +02:00
Sergei Golubchik
a40be4cc6e fix failures in embedded tests 2014-07-31 18:14:37 +02:00
Sergei Golubchik
a6071cc596 MDEV-6082 Assertion `0' fails in TC_LOG_DUMMY::log_and_order on DML after installing TokuDB at runtime on server with disabled InnoDB
We don't support changing tc_log implementation at run time.
If the first XA-capable engine is loaded with INSTALL PLUGIN - disable its
XA capabilities with a warning
2014-07-27 21:02:00 +02:00
Michael Widenius
f0f2072d1f Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write
Reason for the problem was that the hash of changed files in the key cache was too small (was 128). Fixed by making the hash size larger and changeable.

- Introduced key-cache-file-hash-size (default 512) for MyISAM and aria_pagecache_file_hash_size (default 512) for Aria.
- Added new status variable "Feature_delay_key_write" which counts number of tables opened that are using delay_key_write


mysql-test/r/features.result:
  Added test of Feature_delay_key_write
mysql-test/r/key_cache.result:
  Updated tests as the number of blocks has changed
mysql-test/r/mysqld--help.result:
  Updated result
mysql-test/suite/maria/maria3.result:
  Updated result
mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result:
  Test new variable
mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test:
  Test new variable
mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test:
  Test new variable
mysql-test/t/features.test:
  Added test of Feature_delay_key_write
mysql-test/t/key_cache.test:
  Updated tests as the number of blocks has changed
mysys/mf_keycache.c:
  Made CHANGED_BLOCKS_HASH dynamic
sql/handler.cc:
  Updated call to init_key_cache()
sql/mysqld.cc:
  Added "Feature_delay_key_write"
  Added support for key-cache-file-hash-size
sql/mysqld.h:
  Added support for key-cache-file-hash-size
sql/sql_class.h:
  Added feature_files_opened_with_delayed_keys
sql/sys_vars.cc:
  Added key_cache_file_hash_size
storage/maria/ha_maria.cc:
  Added pagecache_file_hash_size
  Added counting of files with delay_key_write
storage/maria/ma_checkpoint.c:
  Fixed compiler warning
storage/maria/ma_pagecache.c:
  Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable
storage/maria/ma_pagecache.h:
  Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable
storage/maria/ma_rt_test.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test1.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test2.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test3.c:
  Updated parameters for init_pagecache()
storage/maria/maria_chk.c:
  Updated parameters for init_pagecache()
storage/maria/maria_ftdump.c:
  Updated parameters for init_pagecache()
storage/maria/maria_pack.c:
  Updated parameters for init_pagecache()
storage/maria/maria_read_log.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_consist.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_rwconsist.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_rwconsist2.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_single.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  Updated parameters for init_pagecache()
storage/myisam/ha_myisam.cc:
  Added counting of files with delay_key_write
storage/myisam/mi_check.c:
  Updated call to init_key_cache()
storage/myisam/mi_test1.c:
  Updated call to init_key_cache()
storage/myisam/mi_test2.c:
  Updated call to init_key_cache()
storage/myisam/mi_test3.c:
  Updated call to init_key_cache()
storage/myisam/mi_test_all.sh:
  Fixed broken test
storage/myisam/myisam_ftdump.c:
  Updated call to init_key_cache()
storage/myisam/myisamchk.c:
  Updated call to init_key_cache()
storage/myisam/myisamlog.c:
  Updated call to init_key_cache()
2014-07-19 17:46:08 +03:00
Michael Widenius
ff205b25d5 Fixed assert in perfschema/pfs.cc::start_idle_wait_v1 when using performance schema and big packets in debug version.
The bug was that my_real_read() called net_before_header_psi() multiple times for long packets.
Fixed by adding a flag when we are reading a header.
Did also some cleanups to interface of my_net_read() to avoid unnecessary calls if performance schema is not used.

- Added my_net_read_packet() as a replacement for my_net_read(). my_net_read() is still in the client library for old clients.
- Removed THD->m_server_idle (not needed anymore as this is now given as argument to my_net_read_packet()
- Added my_net_read_packet(), which is a new version of my_net_read() with a new parameter if we are doing a read for a new command from the server.
- Added tests for compressed protocol and big packets





include/mysql.h.pp:
  Added my_net_read_packet() as a replacement for my_net_read()
include/mysql_com.h:
  Added my_net_read_packet() as a replacement for my_net_read()
mysql-test/r/mysql_client_test_comp.result:
  New test
mysql-test/t/mysql_client_test-master.opt:
  Added max_allowed_packet to be able to test big packets and packet size overflows.
mysql-test/t/mysql_client_test_comp-master.opt:
  New test
mysql-test/t/mysql_client_test_nonblock-master.opt:
  Added max_allowed_packet to be able to test big packets and packet size overflows.
sql-common/client.c:
  Use my_net_read_packet()
sql/mf_iocache.cc:
  Use my_net_read_packet()
sql/mysqld.cc:
  Removed THD->m_server_idle (not needed anymore as this is now given as argument to my_net_read_packet()
sql/net_serv.cc:
  Added argument to my_real_read() to indicte if we are reading the first block of the next statement and should call performance schema.
  Added 'compatibilty function' my_net_read().
  Added my_net_read_packet(), which is a new version of my_net_read() with a new parameter if we are doing a read for a new command from the server.
sql/sql_class.cc:
  Removed m_server_idle (not needed anymore)
sql/sql_class.h:
  Removed m_server_idle (not needed anymore)
sql/sql_parse.cc:
  Removed m_server_idle (not needed anymore)
tests/mysql_client_test.c:
  Added tests for compressed protocol and big packets
2014-07-19 13:38:40 +03:00
Kristian Nielsen
501c56ef1e MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel replication causing replication to fail.
Merge the patches into MariaDB 10.0 main.

With this patch, parallel replication will now automatically retry a
transaction that fails due to deadlock or other temporary error, same as
single-threaded replication.

We catch deadlocks with InnoDB transactions due to enforced commit order. If
T1 must commit before T2 in parallel replication and T1 ends up waiting for T2
inside InnoDB, we kill T2 and retry it later to resolve the deadlock
automatically.
2014-07-11 12:06:47 +02:00
Nirbhay Choubey
dc377fcbc0 Merge of patch for MDEV-6411 from maria-5.5-galera. 2014-07-09 11:07:23 -04:00
Nirbhay Choubey
40bfd20180 MDEV#6411 - Setting set @@global_wsrep_sst_auth=NULL
causes crash

Fixed by properly handling the NULL values.
2014-07-09 11:04:28 -04:00
Kristian Nielsen
98fc5b3af8 MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel replication causing replication to fail.
After-review changes.

For this patch in 10.0, we do not introduce a new public storage engine API,
we just fix the InnoDB/XtraDB issues. In 10.1, we will make a better public
API that can be used for all storage engines (MDEV-6429).

Eliminate the background thread that did deadlock kills asynchroneously.
Instead, we ensure that the InnoDB/XtraDB code can handle doing the kill from
inside the deadlock detection code (when thd_report_wait_for() needs to kill a
later thread to resolve a deadlock).

(We preserve the part of the original patch that introduces dedicated mutex
and condition for the slave init thread, to remove the abuse of
LOCK_thread_count for start/stop synchronisation of the slave init thread).
2014-07-08 12:54:47 +02:00
Oleksandr Byelkin
01046e7f92 RBR triggers enabling in 10.1 2014-07-02 16:18:28 +03:00
Arun Kuruvila
8a4ec676ed Bug#17873011 NO DEPRECATION WARNING FOR THREAD_CONCURRENCY
Description:
THREAD_CONCURRENCY is deprecated and there is no 
deprecation warning message while setting this variable
while starting the server.

Analysis:
This variable is specific to Solaris 8 and earlier systems
and is ignored on all other platforms. But since many 
customers, who uses other than Solaris, still has this 
variable in their configuration file, it is important to
have a deprecation warning.

Fix:
THREAD_CONCURRENCY deprecation warning message is added.
2014-07-02 14:52:52 +05:30
Arun Kuruvila
cf50d1e6d6 Bug#17873011 NO DEPRECATION WARNING FOR THREAD_CONCURRENCY
Description:
THREAD_CONCURRENCY is deprecated and there is no 
deprecation warning message while setting this variable
while starting the server.

Analysis:
This variable is specific to Solaris 8 and earlier systems
and is ignored on all other platforms. But since many 
customers, who uses other than Solaris, still has this 
variable in their configuration file, it is important to
have a deprecation warning.

Fix:
THREAD_CONCURRENCY deprecation warning message is added.
2014-07-02 14:52:52 +05:30
Sergey Petrunya
c16c3b9e47 MDEV-6430: It is impossible to see if "filesort with small limit" optimization was used
- Add a Sort_priority_queue_sorts status variable.
2014-07-09 13:09:41 +04:00
Nirbhay Choubey
a76a6601ec bzr merge -rtag:mariadb-10.0.12 maria/10.0 2014-06-19 13:12:38 -04:00
Sergei Golubchik
dc64ba2187 MDEV-6137 better help for SET/ENUM sysvars
Auto-generate the allowed list of values for enum/set/flagset options
in --help output. But don't do that when the help text already has them.

Also, remove lists of values from help strings of various options, where
they were simply listed without any additional information.
2014-06-19 12:02:23 +02:00
Sergei Golubchik
cf1a09e42f MDEV-6107 merge default_tmp_storage_engine
Adapt default_tmp_storage_engine implementation from mysql-5.6
New feature (as compared to 5.6), default_tmp_storage_engine=NULL
means that temporary tables will use default_storage_engine value.
This makes the behavior backward compatible.
2014-06-15 18:42:31 +02:00
Nirbhay Choubey
85032e36c6 Modified patch for lp:1310875. 2014-06-11 17:13:03 -04:00
Alexey Botchkov
bcb85f0e02 MDEV-5995 MySQL Bug#12750920: EMBEDDED SERVER START/STOP.
Some variables weren't cleared properly so consequitive embedded server start/stop failed.
  Cleanups added. Also mysql_client_test.c extended to test that (taken from Mattias Johnson's patch)
2014-06-11 16:03:10 +05:00
Nirbhay Choubey
c29cbac2eb bzr merge -r3985..3997 codership/5.5 2014-06-10 17:00:32 -04:00
unknown
629b822913 MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel
replication causing replication to fail.

In parallel replication, we run transactions from the master in parallel, but
force them to commit in the same order they did on the master. If we force T1
to commit before T2, but T2 holds eg. a row lock that is needed by T1, we get
a deadlock when T2 waits until T1 has committed.

Usually, we do not run T1 and T2 in parallel if there is a chance that they
can have conflicting locks like this, but there are certain edge cases where
it can occasionally happen (eg. MDEV-5914, MDEV-5941, MDEV-6020). The bug was
that this would cause replication to hang, eventually getting a lock timeout
and causing the slave to stop with error.

With this patch, InnoDB will report back to the upper layer whenever a
transactions T1 is about to do a lock wait on T2. If T1 and T2 are parallel
replication transactions, and T2 needs to commit later than T1, we can thus
detect the deadlock; we then kill T2, setting a flag that causes it to catch
the kill and convert it to a deadlock error; this error will then cause T2 to
roll back and release its locks (so that T1 can commit), and later T2 will be
re-tried and eventually also committed.

The kill happens asynchroneously in a slave background thread; this is
necessary, as the reporting from InnoDB about lock waits happen deep inside
the locking code, at a point where it is not possible to directly call
THD::awake() due to mutexes held.

Deadlock is assumed to be (very) rarely occuring, so this patch tries to
minimise the performance impact on the normal case where no deadlocks occur,
rather than optimise the handling of the occasional deadlock.

Also fix transaction retry due to deadlock when it happens after a transaction
already signalled to later transactions that it started to commit. In this
case we need to undo this signalling (and later redo it when we commit again
during retry), so following transactions will not start too early.

Also add a missing thd->send_kill_message() that got triggered during testing
(this corrects an incorrect fix for MySQL Bug#58933).
2014-06-03 10:31:11 +02:00
Nirbhay Choubey
8d37bd48c7 Fixing a typo s/connection_tcpwrap_errors/connection_errors_tcpwrap,
causing build to fail when HAVE_LIBWRAP is enabled.
2014-05-27 10:11:42 -04:00
Sergei Golubchik
63a0e5640d typo fixed (compilation failure with libwrap) 2014-05-26 13:31:11 +02:00
Nirbhay Choubey
ab4947463e Merging changes from maria-5.5-galera and
some test fixes.

bzr merge -r3479..3493 maria-5.5-galera
2014-05-22 18:31:04 -04:00
Nirbhay Choubey
81a85ad8d7 bzr merge -r3985..3991 codership/5.5 2014-05-21 15:04:13 -04:00
Nirbhay Choubey
2f90221ad4 Fixed a segfault issue by initializing thd's
system_thread_info in wsrep applier threads,
introduced by MDEV#6156.
2014-05-21 11:23:59 -04:00
Nirbhay Choubey
086af8367e bzr merge -r4209 maria/10.0. 2014-05-21 11:09:55 -04:00
Sergei Golubchik
edf1fbd25b MDEV-6153 Trivial Lintian errors in MariaDB sources: spelling errors and wrong executable bits 2014-05-13 11:53:30 +02:00
Sergei Golubchik
d3e2e1243b 5.5 merge 2014-05-09 12:35:11 +02:00
Nirbhay Choubey
00b6fff2e7 MDEV#6206: wsrep_slave_threads subtracts from max_connections
Decoupled wsrep thread count from connection count. By doing so,
the number of wsrep threads (applier/rollbacker) would no longer
affect the threads_connected status variable and thus maximum
allowable user connections limit would be @@max_connections.

Also introduced a new status variable 'wsrep_thread_count' to hold
the number of wsrep applier/rollbacker threads.

Added a test case.
2014-05-08 14:45:00 -04:00
Venkatesh Duggirala
2870bd7423 Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS,
SHOW PROCESSLIST, SHOW BINLOGS

Problem:  A deadlock was occurring when 4 threads were
involved in acquiring locks in the following way
Thread 1: Dump thread ( Slave is reconnecting, so on
              Master, a new dump thread is trying kill
              zombie dump threads. It acquired thread's
              LOCK_thd_data and it is about to acquire
              mysys_var->current_mutex ( which LOCK_log)
Thread 2: Application thread is executing show binlogs and
               acquired LOCK_log and it is about to acquire
               LOCK_index.
Thread 3: Application thread is executing Purge binary logs
               and acquired LOCK_index and it is about to
               acquire LOCK_thread_count.
Thread 4: Application thread is executing show processlist
               and acquired LOCK_thread_count and it is
               about to acquire zombie dump thread's
               LOCK_thd_data.
Deadlock Cycle:
     Thread 1 -> Thread 2 -> Thread 3-> Thread 4 ->Thread 1

The same above deadlock was observed even when thread 4 is
executing 'SELECT * FROM information_schema.processlist' command and
acquired LOCK_thread_count and it is about to acquire zombie
dump thread's LOCK_thd_data.

Analysis:
There are four locks involved in the deadlock.  LOCK_log,
LOCK_thread_count, LOCK_index and LOCK_thd_data.
LOCK_log, LOCK_thread_count, LOCK_index are global mutexes
where as LOCK_thd_data is local to a thread.
We can divide these four locks in two groups.
Group 1 consists of LOCK_log and LOCK_index and the order
should be LOCK_log followed by LOCK_index.
Group 2 consists of other two mutexes
LOCK_thread_count, LOCK_thd_data and the order should
be LOCK_thread_count followed by LOCK_thd_data.
Unfortunately, there is no specific predefined lock order defined
to follow in the MySQL system when it comes to locks across these
two groups. In the above problematic example,
there is no problem in the way we are acquiring the locks
if you see each thread individually.
But If you combine all 4 threads, they end up in a deadlock.

Fix: 
Since everything seems to be fine in the way threads are taking locks,
In this patch We are changing the duration of the locks in Thread 4
to break the deadlock. i.e., before the patch, Thread 4
('show processlist' command) mysqld_list_processes()
function acquires LOCK_thread_count for the complete duration
of the function and it also acquires/releases
each thread's LOCK_thd_data.

LOCK_thread_count is used to protect addition and
deletion of threads in global threads list. While show
process list is looping through all the existing threads,
it will be a problem if a thread is exited but there is no problem
if a new thread is added to the system. Hence a new mutex is
introduced "LOCK_thd_remove" which will protect deletion
of a thread from global threads list. All threads which are
getting exited should acquire LOCK_thd_remove
followed by LOCK_thread_count. (It should take LOCK_thread_count
also because other places of the code still thinks that exit thread
is protected with LOCK_thread_count. In this fix, we are changing
only 'show process list' query logic )
(Eg: unlink_thd logic will be protected with
LOCK_thd_remove).

Logic of mysqld_list_processes(or file_schema_processlist)
will now be protected with 'LOCK_thd_remove' instead of
'LOCK_thread_count'.

Now the new locking order after this patch is:
LOCK_thd_remove -> LOCK_thd_data -> LOCK_log ->
LOCK_index -> LOCK_thread_count
2014-05-08 18:13:01 +05:30
Venkatesh Duggirala
33f15dc7ac Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS,
SHOW PROCESSLIST, SHOW BINLOGS

Problem:  A deadlock was occurring when 4 threads were
involved in acquiring locks in the following way
Thread 1: Dump thread ( Slave is reconnecting, so on
              Master, a new dump thread is trying kill
              zombie dump threads. It acquired thread's
              LOCK_thd_data and it is about to acquire
              mysys_var->current_mutex ( which LOCK_log)
Thread 2: Application thread is executing show binlogs and
               acquired LOCK_log and it is about to acquire
               LOCK_index.
Thread 3: Application thread is executing Purge binary logs
               and acquired LOCK_index and it is about to
               acquire LOCK_thread_count.
Thread 4: Application thread is executing show processlist
               and acquired LOCK_thread_count and it is
               about to acquire zombie dump thread's
               LOCK_thd_data.
Deadlock Cycle:
     Thread 1 -> Thread 2 -> Thread 3-> Thread 4 ->Thread 1

The same above deadlock was observed even when thread 4 is
executing 'SELECT * FROM information_schema.processlist' command and
acquired LOCK_thread_count and it is about to acquire zombie
dump thread's LOCK_thd_data.

Analysis:
There are four locks involved in the deadlock.  LOCK_log,
LOCK_thread_count, LOCK_index and LOCK_thd_data.
LOCK_log, LOCK_thread_count, LOCK_index are global mutexes
where as LOCK_thd_data is local to a thread.
We can divide these four locks in two groups.
Group 1 consists of LOCK_log and LOCK_index and the order
should be LOCK_log followed by LOCK_index.
Group 2 consists of other two mutexes
LOCK_thread_count, LOCK_thd_data and the order should
be LOCK_thread_count followed by LOCK_thd_data.
Unfortunately, there is no specific predefined lock order defined
to follow in the MySQL system when it comes to locks across these
two groups. In the above problematic example,
there is no problem in the way we are acquiring the locks
if you see each thread individually.
But If you combine all 4 threads, they end up in a deadlock.

Fix: 
Since everything seems to be fine in the way threads are taking locks,
In this patch We are changing the duration of the locks in Thread 4
to break the deadlock. i.e., before the patch, Thread 4
('show processlist' command) mysqld_list_processes()
function acquires LOCK_thread_count for the complete duration
of the function and it also acquires/releases
each thread's LOCK_thd_data.

LOCK_thread_count is used to protect addition and
deletion of threads in global threads list. While show
process list is looping through all the existing threads,
it will be a problem if a thread is exited but there is no problem
if a new thread is added to the system. Hence a new mutex is
introduced "LOCK_thd_remove" which will protect deletion
of a thread from global threads list. All threads which are
getting exited should acquire LOCK_thd_remove
followed by LOCK_thread_count. (It should take LOCK_thread_count
also because other places of the code still thinks that exit thread
is protected with LOCK_thread_count. In this fix, we are changing
only 'show process list' query logic )
(Eg: unlink_thd logic will be protected with
LOCK_thd_remove).

Logic of mysqld_list_processes(or file_schema_processlist)
will now be protected with 'LOCK_thd_remove' instead of
'LOCK_thread_count'.

Now the new locking order after this patch is:
LOCK_thd_remove -> LOCK_thd_data -> LOCK_log ->
LOCK_index -> LOCK_thread_count
2014-05-08 18:13:01 +05:30
Sergei Golubchik
a83a4136ff revno: 5265
committer: Christopher Powers <chris.powers@oracle.com>
branch nick: mysql-5.6-bug16750433
timestamp: Fri 2013-06-28 07:48:12 -0500
message:
  Bug#16750433 - THE STATEMENT DIGEST DOES NOT SHOW THE SLAVE SQL
                 THREAD STATEMENTS

revno: 5414.1.1
committer: Marc Alff <marc.alff@oracle.com>
branch nick: mysql-5.6-bug17271055
timestamp: Thu 2013-08-29 12:29:25 +0200
message:
  Bug#17271055 "STATEMENT/COM" EVENT MEANING IS UNCLEAR

(test case was merged with perfschema 5.6.17)
2014-05-07 16:12:39 +02:00
Jan Lindström
150e88e8c9 Merge from lp:maria/5.5 to maria-5.5.37 release revision 4154. 2014-04-16 12:13:43 +03:00
Nirbhay Choubey
9d911608f1 Fixes for some test failures. 2014-04-09 12:25:47 -04:00
Nirbhay Choubey
4213263101 Merging mariadb-10.0.10.
* bzr merge -rtag:mariadb-10.0.10 maria/10.0.
2014-04-08 10:36:34 -04:00
Nirbhay Choubey
9d2e90f379 Merged revision 3471, 3472 & 3473 from maria-5.5-galera. 2014-03-28 08:26:08 -04:00
Sergei Golubchik
cb67dcb618 mysql-5.5.37 selective merge 2014-03-27 22:26:58 +01:00
Nirbhay Choubey
02ba2bfdb4 Merging revision from codership-mysql/5.5 (r3928..3968) and
codership-mysql/5.6 (r4021..4065).
- Also contains fixes for some build failures.
2014-03-27 16:26:00 -04:00
Nirbhay Choubey
a500865c13 Merged revision 3471, 3472 & 3473 from maria-5.5-galera. 2014-03-27 16:22:57 -04:00
Nirbhay Choubey
90e4f7f9d3 * bzr merge -rtag:mariadb-10.0.9 maria/10.0
* Fix for post-merge build failures.
2014-03-26 14:27:24 -04:00
Nirbhay Choubey
b5871a51e9 * bzr merge -r4027..4061 codership/5.6
* Merged Innodb changes to xtradb
2014-03-26 11:12:38 -04:00
Nirbhay Choubey
899f9801d4 bzr merge -r3946..3968 codership/5.5 2014-03-25 17:01:05 -04:00
Nirbhay Choubey
3088d52c20 bzr merge -r3933..3945 codership/5.5 (Non-InnoDB changes only). 2014-03-25 14:42:15 -04:00
Sergei Golubchik
10740939eb 5.5 merge 2014-03-26 22:25:38 +01:00
unknown
e7704bfdd6 RBR triggers compiled-out with ifdefs in 10.0 2014-03-19 11:35:32 +02:00
unknown
af3180ab6f MDEV-9095: Executing triggers on slave in row-based replication 2014-03-19 11:00:56 +02:00
Michael Widenius
dd13db6f4a MDEV-5829: STOP SLAVE resets global status variables
Reason for the bug was an optimization for higher connect speed where we moved when global status was updated,
but forgot to update states when slave thread dies.
Fixed by adding thd->add_status_to_global() before deleting slave thread's thd.


mysys/my_delete.c:
  Added missing newline
sql/mysqld.cc:
  Use add_status_to_global()
sql/slave.cc:
  Added missing add_status_to_global()
sql/sql_class.cc:
  Use add_status_to_global()
sql/sql_class.h:
  Simplify adding local status to global by adding add_status_to_global()
2014-03-14 16:29:23 +02:00
Nirbhay Choubey
57ba177daf MDEV#5812 Memory leaks while running mysqld in
bootstrap mode

Added calls to deinit functions at appropriate
places.
2014-03-11 23:12:18 -04:00
unknown
8b9b7ec395 MDEV-5804: If same GTID is received on multiple master connections in multi-source replication, the event is double-executed causing corruption or replication failure
Some fixes, mainly to make it work in non-parallel replication mode also
(--slave-parallel-threads=0).

Patch should be fairly complete now.
2014-03-12 00:14:49 +01:00
unknown
2c2478b822 MDEV-5804: If same GTID is received on multiple master connections in multi-source replication, the event is double-executed causing corruption or replication failure
Before, the arrival of same GTID twice in multi-source replication
would cause double-apply or in gtid strict mode an error.

Keep the behaviour, but add an option --gtid-ignore-duplicates which
allows to correctly handle duplicates, ignoring all but the first.
This relies on the user ensuring correct configuration so that
sequence numbers are strictly increasing within each replication
domain; then duplicates can be detected simply by comparing the
sequence numbers against what is already applied.

Only one master connection (but possibly multiple parallel worker
threads within that connection) is allowed to apply events within
one replication domain at a time; any other connection that
receives a GTID in the same domain either discards it (if it is
already applied) or waits for the other connection to not have
any events to apply.

Intermediate patch, as proof-of-concept for testing. The main limitation
is that currently it is only implemented for parallel replication,
@@slave_parallel_threads > 0.
2014-03-09 10:27:38 +01:00
Nirbhay Choubey
653ef22336 MDEV#5687: Maria doesn't shutdown following upgrade
to 5.5.35-galera

Restored patch for MDEV#4136 and added a test.
2014-03-06 18:44:16 -05:00
Nirbhay Choubey
27c09524eb MDEV#5790 : SHOW GLOBAL STATUS LIKE does not show
the correct list of variables when using "_"

Fixed the type for offending "wsrep", wrongly
set to SHOW_SIMPLE_FUNC.

Added a test case.
2014-03-04 22:10:28 -05:00
Nirbhay Choubey
c3a2394641 * Merged revisions 3945, 3946..3950, 3951..3961
from codership-mysql/5.5.
* Merged changes in innobase to xtradb.
* Updated WSREP_PATCH_REVNO.
2014-02-28 13:56:08 -05:00
Sergei Golubchik
41c760b121 merge 2014-02-28 10:00:31 +01:00
Alexander Barkov
57cdc561fc Fixing AIX compilation failires 2014-02-27 19:44:00 +04:00
unknown
20959fa09c Merge MDEV-5657 (parallel replication) to 10.0 2014-02-26 16:38:42 +01:00
Sergei Golubchik
0dc23679c8 10.0-base merge 2014-02-26 15:28:07 +01:00
unknown
e90f68c0ba MDEV-5657: Parallel replication.
Clean up and improve the parallel implementation code, mainly related to
scheduling of work to threads and handling of stop and errors.

Fix a lot of bugs in various corner cases that could lead to crashes or
corruption.

Fix that a single replication domain could easily grab all worker threads and
stall all other domains; now a configuration variable
--slave-domain-parallel-threads allows to limit the number of
workers.

Allow next event group to start as soon as previous group begins the commit
phase (as opposed to when it ends it); this allows multiple event groups on
the slave to participate in group commit, even when no other opportunities for
parallelism are available.

Various fixes:

 - Fix some races in the rpl.rpl_parallel test case.

 - Fix an old incorrect assertion in Log_event iocache read.

 - Fix repeated malloc/free of wait_for_commit and rpl_group_info objects.

 - Simplify wait_for_commit wakeup logic.

 - Fix one case in queue_for_group_commit() where killing one thread would
   fail to correctly signal the error to the next, causing loss of the
   transaction after slave restart.

 - Fix leaking of pthreads (and their allocated stack) due to missing
   PTHREAD_CREATE_DETACHED attribute.

 - Fix how one batch of group-committed transactions wait for the previous
   batch before starting to execute themselves. The old code had a very
   complex scheduling where the first transaction was handled differently,
   with subtle bugs in corner cases. Now each event group is always scheduled
   for a new worker (in a round-robin fashion amongst available workers).
   Keep a count of how many transactions have started to commit, and wait for
   that counter to reach the appropriate value.

 - Fix slave stop to wait for all workers to actually complete processing;
   before, the wait was for update of last_committed_sub_id, which happens a
   bit earlier, and could leave worker threads potentially accessing bits of
   the replication state that is no longer valid after slave stop.

 - Fix a couple of places where the test suite would kill a thread waiting
   inside enter_cond() in connection with debug_sync; debug_sync + kill can
   crash in rare cases due to a race with mysys_var_current_mutex in this
   case.

 - Fix some corner cases where we had enter_cond() but no exit_cond().

 - Fix that we could get failure in wait_for_prior_commit() but forget to flag
   the error with my_error().

 - Fix slave stop (both for normal stop and stop due to error). Now, at stop
   we pick a specific safe point (in terms of event groups executed) and make
   sure that all event groups before that point are executed to completion,
   and that no event group after start executing; this ensures a safe place to
   restart replication, even for non-transactional stuff/DDL. In error stop,
   make sure that all prior event groups are allowed to execute to completion,
   and that any later event groups that have started are rolled back, if
   possible. The old code could leave eg. T1 and T3 committed but T2 not, or
   it could even leave half a transaction not rolled back in some random
   worker, which would cause big problems when that worker was later reused
   after slave restart.

 - Fix the accounting of amount of events queued for one worker. Before, the
   amount was reduced immediately as soon as the events were dequeued (which
   happens all at once); this allowed twice the amount of events to be queued
   in memory for each single worker, which is not what users would expect.

 - Fix that an error set during execution of one event was sometimes not
   cleared before executing the next, causing problems with the error
   reporting.

 - Fix incorrect handling of thd->killed in worker threads.
2014-02-26 15:02:09 +01:00
Nirbhay Choubey
ae6e1548cb Merge from maria/5.5 (-rtag:mariadb-5.5.36). 2014-02-25 17:49:41 -05:00
Sergei Golubchik
0b9a0a3517 5.5 merge 2014-02-25 16:04:35 +01:00
Sergey Vojtovich
d12c7adf71 MDEV-5314 - Compiling fails on OSX using clang
This is port of fix for MySQL BUG#17647863.

revno: 5572
revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj
committer: Jon Olav Hauglid <jon.hauglid@oracle.com>
timestamp: Thu 2013-10-31 00:22:43 +0100
message:
  Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM

  Rename test() macro to MY_TEST() to avoid conflict with libc++.
2014-02-19 14:05:15 +04:00
Sergei Golubchik
84651126c0 MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
2014-02-17 11:00:51 +01:00
Sergey Vojtovich
bde11c1ab5 MDEV-5089 - possible deadlocks between rwlocks and mutexes
Pre-MDL versions had direct relationship between LOCK_open and
LOCK_global_system_variables, e.g.:
  intern_sys_var_ptr // locks LOCK_global_system_variable
  mysql_sys_var_char
  create_options_are_valid
  ha_innobase::create
  handler::ha_create
  ha_create_table
  rea_create_table
  mysql_create_table_no_lock // locks LOCK_open
  mysql_create_table

With MDL this relationship was removed, but mutex order was still
recorded. In fact there is indirect relationship between LOCK_open
and LOCK_global_system_variables via rwlocks in reverse order.

Removed LOCK_open and LOCK_global_system_variables order recording,
instead assert that LOCK_open is never held in intern_sys_var_ptr().

This solves only one of many problems detected with MDEV-5089.
2014-02-13 11:40:49 +04:00
unknown
dd93ec5633 Merge MariaDB 10.0-base to 10.0. 2014-02-10 15:12:17 +01:00
unknown
fefdb576bb Merge of MDEV-4984, MDEV-4726, and MDEV-5636 into 10.0-base.
MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.
    MDEV-4726: Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
    MDEV-5636: Deadlock in RESET MASTER
2014-02-10 12:39:26 +01:00
unknown
4e6606acad MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.
MASTER_GTID_WAIT() is similar to MASTER_POS_WAIT(), but works with a
GTID position rather than an old-style filename/offset.

@@LAST_GTID gives the GTID assigned to the last transaction written
into the binlog.

Together, the two can be used by applications to obtain the GTID of
an update on the master, and then do a MASTER_GTID_WAIT() for that
position on any read slave where it is important to get results that
are caught up with the master at least to the point of the update.

The implementation of MASTER_GTID_WAIT() is implemented in a way
that tries to minimise the performance impact on the SQL threads,
even in the presense of many waiters on single GTID positions (as
from @@LAST_GTID).
2014-02-07 19:15:28 +01:00
Michael Widenius
10001c8e4f Automatic merge 2014-02-05 19:23:11 +02:00
Michael Widenius
5426facdcb Replication changes for CREATE OR REPLACE TABLE
- CREATE TABLE is by default executed on the slave as CREATE OR REPLACE
- DROP TABLE is by default executed on the slave as DROP TABLE IF NOT EXISTS

This means that a slave will by default continue even if we try to create
a table that existed on the slave (the table will be deleted and re-created) or
if we try to drop a table that didn't exist on the slave.
This should be safe as instead of having the slave stop because of an inconsistency between
master and slave, it will fix the inconsistency.
Those that would prefer to get a stopped slave instead for the above cases can set slave_ddl_exec_mode to STRICT. 

- Ensure that a CREATE OR REPLACE TABLE which dropped a table is replicated
- DROP TABLE that generated an error on master is handled as an identical DROP TABLE on the slave (IF NOT EXISTS is not added in this case)
- Added slave_ddl_exec_mode variable to decide how DDL's are replicated

New logic for handling BEGIN GTID ... COMMIT from the binary log:

- When we find a BEGIN GTID, we start a transaction and set OPTION_GTID_BEGIN
- When we find COMMIT, we reset OPTION_GTID_BEGIN and execute the normal COMMIT code.
- While OPTION_GTID_BEGIN is set:
  - We don't generate implict commits before or after statements
  - All tables are regarded as transactional tables in the binary log (to ensure things are executed exactly as on the master)
- We reset OPTION_GTID_BEGIN also on rollback

This will help ensuring that we don't get any sporadic commits (and thus new GTID's) on the slave and will help keep the GTID's between master and slave in sync.


mysql-test/extra/rpl_tests/rpl_log.test:
  Added testing of mode slave_ddl_exec_mode=STRICT
mysql-test/r/mysqld--help.result:
  New help messages
mysql-test/suite/rpl/r/create_or_replace_mix.result:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/r/create_or_replace_row.result:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/r/create_or_replace_statement.result:
  Testing replication of create or replace
mysql-test/suite/rpl/r/rpl_gtid_startpos.result:
  Test must be run in slave_ddl_exec_mode=STRICT as part of the test depends on that DROP TABLE should fail on slave.
mysql-test/suite/rpl/r/rpl_row_log.result:
  Updated result
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
  Updated result
mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result:
  Updated result
mysql-test/suite/rpl/r/rpl_stm_log.result:
  Updated result
mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result:
  Updated result
mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result:
  Updated result
mysql-test/suite/rpl/t/create_or_replace.inc:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/create_or_replace_mix.cnf:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/create_or_replace_mix.test:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/create_or_replace_row.cnf:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/create_or_replace_row.test:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/create_or_replace_statement.cnf:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/create_or_replace_statement.test:
  Testing of CREATE OR REPLACE TABLE with replication
mysql-test/suite/rpl/t/rpl_gtid_startpos.test:
  Test must be run in slave_ddl_exec_mode=STRICT as part of the test depends on that DROP TABLE should fail on slave.
mysql-test/suite/rpl/t/rpl_stm_log.test:
  Removed some lines
mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result:
  Testing of slave_ddl_exec_mode
mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test:
  Testing of slave_ddl_exec_mode
sql/handler.cc:
  Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set.
  This is to ensure that statments are not commited too early if non transactional tables are used.
sql/log.cc:
  Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set.
  Also treat 'direct' log events as transactional (to get them logged as they where on the master)
sql/log_event.cc:
  Ensure that the new error from DROP TABLE when trying to drop a view is treated same as the old one.
  Store error code that slave expects in THD.
  Set OPTION_GTID_BEGIN if we find a BEGIN.
  Reset OPTION_GTID_BEGIN if we find a COMMIT.
sql/mysqld.cc:
  Added slave_ddl_exec_mode_options
sql/mysqld.h:
  Added slave_ddl_exec_mode_options
sql/rpl_gtid.cc:
  Reset OPTION_GTID_BEGIN if we record a gtid (safety)
sql/sql_class.cc:
  Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set.
sql/sql_class.h:
  Added to THD: log_current_statement and slave_expected_error
sql/sql_insert.cc:
  Ensure that CREATE OR REPLACE is logged if table was deleted.
  Don't do implicit commit for CREATE if we are under OPTION_GTID_BEGIN
sql/sql_parse.cc:
  Change CREATE TABLE -> CREATE OR REPLACE TABLE for slaves
  Change DROP TABLE -> DROP TABLE IF EXISTS for slaves
  CREATE TABLE doesn't force implicit commit in case of OPTION_GTID_BEGIN
  Don't do commits before or after any statement if OPTION_GTID_BEGIN was set.
sql/sql_priv.h:
  Added OPTION_GTID_BEGIN
sql/sql_show.cc:
  Enhanced store_create_info() to also be able to handle CREATE OR REPLACE
sql/sql_show.h:
  Updated prototype
sql/sql_table.cc:
  Ensure that CREATE OR REPLACE is logged if table was deleted.
sql/sys_vars.cc:
  Added slave_ddl_exec_mode
sql/transaction.cc:
  Added warning if we got a GTID under OPTION_GTID_BEGIN
2014-02-05 19:01:59 +02:00
Nirbhay Choubey
7ca53d9479 Merging revisions 3934..3944 from codership-mysql/5.5. 2014-02-03 22:55:46 -05:00
Sergei Golubchik
72c20282db 10.0-base merge 2014-02-03 15:22:39 +01:00
Sergei Golubchik
59d9d08e2b 5.5 merge 2014-02-01 00:54:03 +01:00
Nirbhay Choubey
4a6be51f78 * Merged revisions: 3431, 3435..3457, 3459, 3460 from maria-5.5-galera.
* Fixed Debian/Ubuntu dist files.
* Fixed some compiler warnings.
2014-01-30 12:45:38 -05:00
Nirbhay Choubey
ecc2c96c9d Merge of maria/5.5 into maria-5.5-galera.
bzr merge -r tag:mariadb-5.5.35 maria/5.5
2014-01-29 19:00:43 -05:00
Jan Lindström
86d470386b Fixed issue with extra status lines Wsrep_local_bf_aborts at SHOW GLOBAL STATUS
LIKE 'x'; where x != wsrep_local_bf_aborts by changing it as SHOW_SIMPLE_FUNC
from SHOW_FUNC.
2014-01-28 09:48:51 +02:00
Jan Lindström
d43afb8828 Merge MariaDB-10.0.7 revision 3961. 2014-01-25 11:02:49 +02:00
Alexey Botchkov
8f3e1bfc92 MDEV-5419 no audit events for warnings converted to errors in the strict mode.
Plugins get error notifications only when my_message_sql() is called.
        But errors are launched with THD::raise_condition() calls in other
        places. These are push_warning(), implementations of SIGNAL and
        RESIGNAL commands.
        So it makes sence to notify plugins there in THD::raise_condition().
2014-01-23 22:21:02 +04:00
Nirbhay Choubey
31eaa90a6e Merging revision 3839..3932 from codership-mysql/5.5. 2014-01-09 14:54:57 -05:00
Nisha Gopalakrishnan
df1df7eaae BUG#17324415:GETTING MYSQLD --HELP AS ROOT EXITS WITH 1
Analysis
--------

Running 'MYSQLD --help --verbose' as ROOT user without
using '--user' option displays the help contents but
aborts at the end with an exit code '1'.

While starting the server, a validation is performed to
ensure when the server is started as root user, it should
be done using '--user' option. Else we abort. In case
of help, we dump the help contents and abort.

Fix:
---
During the validation, we skip aborting the server incase
we are using the help option under the condition mentioned
above.

NOTE: Test case has not been added since it requires using 
      'root' user.
2014-01-08 10:04:05 +05:30
Nisha Gopalakrishnan
1ef8ed17f1 BUG#17324415:GETTING MYSQLD --HELP AS ROOT EXITS WITH 1
Analysis
--------

Running 'MYSQLD --help --verbose' as ROOT user without
using '--user' option displays the help contents but
aborts at the end with an exit code '1'.

While starting the server, a validation is performed to
ensure when the server is started as root user, it should
be done using '--user' option. Else we abort. In case
of help, we dump the help contents and abort.

Fix:
---
During the validation, we skip aborting the server incase
we are using the help option under the condition mentioned
above.

NOTE: Test case has not been added since it requires using 
      'root' user.
2014-01-08 10:04:05 +05:30
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Murthy Narkedimilli
496abd0814 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Michael Widenius
273078c5fa Fixes to get valgrind to work with jemalloc
- Added MALLOC_LIBRARY variable to hold name of malloc library
- Back ported valgrind related fixes from jemalloc 3.4.1 to the included jemalloc 3.3.1
- Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() to avoid clash with jemalloc 3.4.1
- Use option --soname-synonyms=somalloc=NON to valgrind when using jemalloc
- Show version related variables in mysqld --help
  -- Added SHOW_VALUE_IN_HELP marker

Increased back_log to 150 as the original value was a bit too small


CMakeLists.txt:
  Added MALLOC_LIBRARY variable to hold name of malloc library
cmake/jemalloc.cmake:
  Added MALLOC_LIBRARY variable to hold name of malloc library
config.h.cmake:
  Added MALLOC_LIBRARY variable to hold name of malloc library
extra/jemalloc/ChangeLog:
  Updates changelog
extra/jemalloc/include/jemalloc/internal/arena.h:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/include/jemalloc/internal/private_namespace.h:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/include/jemalloc/internal/tcache.h:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/src/arena.c:
  Backported valgrind fixes from jemalloc 3.4.1
include/my_bitmap.h:
  Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() to avoid clash with jemalloc 3.4.1
mysql-test/mysql-test-run.pl:
  Use option --soname-synonyms=somalloc=NON to valgrind when using jemalloc
mysql-test/valgrind.supp:
  Supression of memory leak in OpenSuse 12.3
mysys/my_bitmap.c:
  Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free()
sql/ha_ndbcluster_binlog.cc:
  Renames
sql/ha_ndbcluster_cond.h:
  Renames
sql/ha_partition.cc:
  Renames
sql/handler.cc:
  Renames
sql/item_subselect.cc:
  Renames
sql/log_event.cc:
  Renames
sql/log_event_old.cc:
  Renames
sql/mysqld.cc:
  Renames
  Show version related variables in mysqld --help
sql/opt_range.cc:
  Renames
sql/opt_table_elimination.cc:
  Renames
sql/partition_info.cc:
  Renames
sql/rpl_injector.h:
  Renames
sql/set_var.h:
  Renames
sql/slave.cc:
  Renames
sql/sql_bitmap.h:
  Renames
sql/sql_insert.cc:
  Renames
sql/sql_lex.h:
  Renames
sql/sql_parse.cc:
  Renames
sql/sql_partition.cc:
  Renames
sql/sql_select.cc:
  Renames
sql/sql_show.cc:
  Renames
sql/sql_update.cc:
  Renames
sql/sys_vars.cc:
  Show version related variables in mysqld --help
sql/sys_vars.h:
  Added SHOW_VALUE_IN_HELP marker for variables that should be shown in --help
sql/table.cc:
  Renames
sql/table.h:
  Removed not used bitmap_init_value
storage/connect/ha_connect.cc:
  Removed compiler warning
storage/maria/ma_open.c:
  Renames
unittest/mysys/bitmap-t.c:
  Renames
2014-01-02 11:19:19 +02:00
Michael Widenius
e41788d2b2 Increased back_log to 150, but not more than max_connections.
- This was done to get better performance when doing a lot of connections.
Ensure that thread_cache_size is not larger than max_connections (trivial optimizations).
Fixed that the --host_cache_size=# startup option works

mysql-test/r/variables.result:
  Increase back_log to 150
sql/hostname.cc:
  Fixed that the --host_cache_size=# startup option works
sql/mysqld.cc:
  Ensure that back_log and thread_cache_size is not set higher than max_connections (as this would not make any sense).
sql/sys_vars.cc:
  Increased back_log to 150
2013-12-27 13:00:14 +02:00
Sergei Golubchik
d28d3ba40d 10.0-base merge 2013-12-16 13:02:21 +01:00
Sergei Golubchik
6bf10fac44 5.5 merge 2013-12-15 15:57:26 +01:00
Nirbhay Choubey
48e83ba6f7 * Updated auto_increment_xxx_func.result to reflect the changes
made by https://bugs.launchpad.net/codership-mysql/+bug/587170

* Fix for some compiler errors/warnings.
2013-12-10 22:11:42 -05:00
Sergei Golubchik
182ffc0cc8 remove #ifdef ENABLE_BEFORE_END_OF_MERGE_QQ 2013-12-09 12:38:37 +01:00
Sergei Golubchik
6ae5f0efea MDEV-5115 RBR from MySQL 5.6 to MariaDB 10.0 does not work
Patially merge WL#5917, to understand v2 row events
2013-12-09 12:37:45 +01:00
Seppo Jaakola
496e22cf3b merge with MariaDB 5.6 bzr merge lp:maria --rtag:mariadb-10.0.6
and a number of fixes to make this buildable. 
Run also few short multi-master high conflict rate tests, with no issues
2013-12-04 10:32:43 +02:00
Nirbhay Choubey
e4f5e49cd6 MDEV#4109: Galera: Valgrind warnings "blocks are still
reachable" in wsrep_init_startup on MTR tests

The initialization & de-initialization of wsrep plugin is solely
controlled by wsrep_on system variable. Now, as wsrep_on is ON by
default, the plugin gets initialized during server start. However,
there would be a leakage in case wsrep_on is turned off before plugin's
deinitialization (while server is shutting down) takes place, in which
case the deinit routine will not be invoked.

In this particular case, wsrep_on is turned off as no wsrep provider
has been specified & thus the valgrind warnings.

Fixed by introducing a flag which tracks and now controls the
(de|)initialization of the wsrep plugin instead on wsrep_on.
Added necessary asserts.

main.connect                             [ pass ]  16534
valgrind_report                          [ pass ]
2013-11-29 13:03:00 -05:00
Nirbhay Choubey
6271c06a73 MDEV-4222: Assertion `( ((global_system_variables.wsrep_on) &&
(thd && thd->variables.wsrep_on)) && wsrep_emulate_bin_log) ||
  mysql_bin_log .is_open()' fails on SAVEPOINT with disabled
  wsrep_provider

As wsrep_on system variable is ON by default the binlog handlerton
is implicitly enabled during the server initialization phase. Later,
while wsrep plugin is getting initialized, wsrep_on in corrected &
turned OFF in case wsrep provider is not specified (leaving binlog
in ON state!). This leads to the reported assertion.

Fixed by adding another check for wsrep provider before binlog
is enabled.

Added a test case.
2013-11-29 12:50:31 -05:00
Seppo Jaakola
b098b7a84c bzr merge -r3904..3928 lp:codership-mysql/5.5
This is now otherwise on level wsrep-25.9, but storage/innobase has not been fully merged
wsrep-5.5 is not good source for that, so we probably have to cherry pick innodb changes from wsrep-5.6
2013-11-27 00:18:44 +02:00
Seppo Jaakola
6422d276fa bzr merge -r3895..3903 lp:codership-mysql/5.5
This is just before 5.5.34 merge in wsrep-5.5 branch
2013-11-26 22:09:14 +02:00
Seppo Jaakola
a2594e96f7 Merges from lp:codership-mysql/5.5 up to rev #3893, this changes to wsrep API #24 2013-11-26 16:48:30 +02:00
Jan Lindström
071edcfea0 Merge with MariaDB 5.5.34. 2013-11-25 17:14:08 +02:00
Jan Lindström
4f85baab95 Merged revisions 3931--3942 from from lp:~codership/codership-mysql/5.5-23.
------------------------------------------------------------
revno: 3942
committer: Seppo Jaakola <seppo.jaakola@codership.com>
branch nick: wsrep-5.5-23
timestamp: Thu 2013-11-07 17:37:10 +0200
message:
  References: lp:1248921 - checking if index is foreign earlier to adhere to lat
ch order protocol
------------------------------------------------------------
revno: 3941
fixes bug: https://launchpad.net/bugs/1248908
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Thu 2013-11-07 14:31:04 +0200
message:
  References lp:1248908 - Fixed access to trx sys header
    
  Pass trx sys header as argument for trx_sys_update_wsrep_checkpoint()
  and trx_sys_update_mysql_binlog_offset() to avoid successive calls
  to trx_sysf_get().
------------------------------------------------------------
revno: 3940
fixes bug: https://launchpad.net/bugs/1244100
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Tue 2013-11-05 15:31:12 +0200
message:
  References lp:1244100 - assign value for check_purge before return
------------------------------------------------------------
revno: 3939
fixes bug: https://launchpad.net/bugs/1247978
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Tue 2013-11-05 01:01:36 +0200
message:
  References lp:1247978 - force release transactional MDL locks if wsrep is on a
nd no active transaction at the end of mysql_execute_command()
------------------------------------------------------------
revno: 3938
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-11-03 20:48:06 +0400
message:
  References lp:1232789 - fix FLUSH STATUS zeroes up wsrep_cluster_size and wsre
p_local_index
------------------------------------------------------------
revno: 3937  5kB/s - 
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-11-03 17:06:31 +0400
message:
  References lp:587170 - reset auto_increment_* vars to defaults for TOI operati
ons
------------------------------------------------------------
revno: 3936
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-11-03 00:10:45 +0400
message:
  References lp:1072839 - fix for memory leaks with wsrep variables
------------------------------------------------------------
revno: 3935
committer: Seppo Jaakola <seppo.jaakola@codership.com>
branch nick: wsrep-5.5-23
timestamp: Wed 2013-10-30 14:34:32 +0200
message:
  References: lp:1246257 - skipping replication for CREATE TEMPORARY TABLE LIKE.
..  constructs
------------------------------------------------------------
revno: 3934  6kB/s \ 
fixes bug: https://launchpad.net/bugs/1241760
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Mon 2013-10-28 11:01:53 +0200
message:
  References lp:1241760 - save thd->db to wsrep_thd_shadow before replay
------------------------------------------------------------
revno: 3933
fixes bug: https://launchpad.net/bugs/1206129
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-10-27 18:15:12 +0200
message:
  References lp:1206129 - check binlog_hton->commit() return value, call wsrep_p
ost_commit() instead of wsrep_cleanup_transaction()
------------------------------------------------------------
revno: 3932
fixes bug: https://launchpad.net/bugs/1244661
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-10-27 13:14:02 +0200
message:
  References lp:1244661 - added wsrep_register_hton() to trans_rollback_implicit
()
------------------------------------------------------------
revno: 3931
fixes bug: https://launchpad.net/bugs/1244667
committer: Teemu Ollakka <teemu.ollakka@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-10-27 11:08:49 +0200
message:
  References lp:1244667 - restore thd->server_status after replay
2013-11-25 14:04:49 +02:00
Sergei Golubchik
c6d30805db 5.5 merge 2013-11-23 00:50:54 +01:00
Nirbhay Choubey
eb29ce250a MDEV-3895 Version naming for MariaDB-Galera builds
This patch fixes both the reported issues :
(1) Included '-wsrep' to the server version information.

> select @@version;
+-----------------------------+
| @@version                   |
+-----------------------------+
| 5.5.33a-MariaDB-wsrep-debug |
+-----------------------------+

(2) The @@version_comment would no longer have XXXX
in the wsrep version information in case cmake couldn't
determine the current bzr revision.
2013-11-22 14:30:00 -05:00
Sergey Vojtovich
e5a80a307c MDEV-5277 - Ensure that all MySQL 5.6 options are supported by the
MariaDB 10.0 server
2013-11-25 18:49:40 +04:00
Alexey Botchkov
fb2de58294 MDEV-5321 Calling mysql_library_end accesses freed memory; dumps memory to display.
Don't call the vio_end() in the clean_up() in EMBEDDED mode.
        Call vio_end() before the end_embedded_server().
2013-11-25 21:38:01 +04:00
unknown
170e9e593d MDEV-5306: Missing locking around rpl_global_gtid_binlog_state
There were some places where insufficient locking between
parallel threads could cause invalid memory accesses and
possibly other grief.

This patch adds the missing locking, and moves the locking
into the struct rpl_binlog_state methods to make it easier
to see that proper locking is in place everywhere.
2013-11-18 15:22:50 +01:00
Sergei Golubchik
fa3f8a18b2 mysql-5.5.34 merge
(some patches reverted, test case added)
2013-11-19 13:16:25 +01:00
Sergey Vojtovich
1da6d6880b MDEV-5220 - [PATCH] MariaDB 10.0.4 doesn't compile without perfschema
Fixed the following compilation errors and test failures:
- maria SE: "stage_waiting_for_a_resource" wasn't declared w/o PFS
- sql_repl.h: PSI_mutex_key is not available in non-PFS builds
- mysqld.cc: pfs_param is not available in non-PFS builds
- mysqld.cc: init_show_explain_psi_keys() is not available in non-PFS builds
- mysqld.cc: call net_before_header_psi, net_after_header_psi even if PFS
  is not available so that thread enters stage_init at proper time. Fixes
  sp-threads and a few tests in funcs_1.
- myisam_file_io.opt: added missing loose prefix
2013-11-14 18:00:00 +04:00
Atanu Ghosh
e9854f5826 Bug #17049656 : MYSQLD --LOCAL-SERVICE PARAMETER DOES NOT WORK
Problem: The "--local-install" service does not perform as expected for, at least,
         Windows.

Fix: A NULL pointer was dereferenced due to which there was crash.A check was introduced
     for NULL string before dereferencing it.No test cases written as it is a bug during 
     installation.
2013-11-14 14:27:31 +05:30
Atanu Ghosh
0c2030e250 Bug #17049656 : MYSQLD --LOCAL-SERVICE PARAMETER DOES NOT WORK
Problem: The "--local-install" service does not perform as expected for, at least,
         Windows.

Fix: A NULL pointer was dereferenced due to which there was crash.A check was introduced
     for NULL string before dereferencing it.No test cases written as it is a bug during 
     installation.
2013-11-14 14:27:31 +05:30
Sergei Golubchik
4157185f24 10.0-base merge 2013-11-13 23:03:48 +01:00
Sergei Golubchik
bdd883ed9a 5.5. merge 2013-11-13 14:07:58 +01:00
Sergei Golubchik
1585652862 MDEV-5236 Status variables are not all listed alphabetically
sort Com_ counters. No simple fix for Binlog_ variables.
2013-11-11 17:20:18 +01:00
Seppo Jaakola
2b4183f10b bzr merge -r3890..3891 lp:codership-mysql/5.5 2013-11-06 00:29:37 +02:00
unknown
57a267a8c0 Merge from 10.0-base to 10.0 the feature MDEV-4506: Parallel replication.
The merge is still missing a few hunks related to temporary tables and
InnoDB log file size. The associated code did not seem to exist in
10.0, so the merge of that needs more work. Until this is fixed, there
are a number of test failures as a result.
2013-11-01 12:00:11 +01:00
unknown
cb86ce60b9 Merge MDEV-4506: Parallel replication into 10.0-base. 2013-11-01 09:17:06 +01:00
Sergei Golubchik
0fdb3bcfdb 10.0-base merge (roles) 2013-10-29 15:08:44 +01:00
unknown
ee8a816208 MDEV-4506: Parallel replication.
Implement --slave-parallel-max-queue to limit memory usage
of SQL thread read-ahead in the relay log.
2013-10-24 12:44:21 +02:00
Alexander Barkov
a06cd2cbe5 Merge 5.3 -> 5.5 2013-10-21 13:37:17 +04:00
Alexander Barkov
046fe91161 Merge 5.2 -> 5.3 2013-10-21 13:36:29 +04:00
Alexander Barkov
c63b72c968 Merge 5.1 -> 5.2 2013-10-21 13:35:43 +04:00
Alexander Barkov
11d141004a A clean-up for DEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-21 13:34:18 +04:00
Sergei Golubchik
d2c683527f recursive privilege propagation for roles.
functions for traversing the role graph in either direction.
merging of global, database, table, column, routine privileges.
debug status variables for counting number of privilege merges.
tests.
2013-10-18 13:06:41 -07:00
Vicențiu Ciorbaru
4a58599930 Implemented SHOW GRANTS functionality 2013-10-18 06:40:25 -07:00
Vicențiu Ciorbaru
f2ab661999 Added SHOW GRANTS recursive role print.
The output is not completely correct due to recursive role grants not
being completly implemented. However, this will help with testing the
implementation of set role with recursive grants.
2013-10-18 06:34:07 -07:00
Vicențiu Ciorbaru
dcc9fd4c8e Implemented syntax recognition for REVOKE ROLE 2013-10-18 04:41:06 -07:00
Vicențiu Ciorbaru
ec92a4e0ff Implemented syntax recognition for DROP ROLE 2013-10-18 04:36:25 -07:00
Vicențiu Ciorbaru
51c631c2ae Implemented syntax recognition for CREATE ROLE 2013-10-18 04:35:18 -07:00
Vicențiu Ciorbaru
a57cdcd69a Changed GRANT ROLE to use SQLCOM_GRANT_ROLE 2013-10-18 04:29:40 -07:00
Vicențiu Ciorbaru
d40d356606 Added syntax detection for the GRANT role TO {user | role } command.
Also added syntax for GRANT privilege TO { role } command
2013-10-18 04:29:01 -07:00
Alexander Barkov
adbb439358 Merge 5.5 -> 10.0-base 2013-10-21 13:43:45 +04:00
Alexander Barkov
b88bf50ec1 Merge 5.5 -> 10.0-base 2013-10-16 20:41:50 +04:00
Alexander Barkov
11005f3413 Merge 5.3->5.5 2013-10-16 18:17:51 +04:00
Alexander Barkov
2b60ad3637 Merge 5.1->5.2 2013-10-16 17:58:15 +04:00
Alexander Barkov
049000101a Merge 5.1 -> 5.3 2013-10-16 17:48:31 +04:00
Alexander Barkov
de4ca539b8 MDEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-16 17:37:11 +04:00
Jan Lindström
eec8297107 Fixed performance schema instrumentation on galera and added correct mutexing when cancelling waiting trx on InnoDB 2013-10-15 12:03:57 +03:00
Michael Widenius
5748eb3ec6 Moved the remaining variables, that depends on sql execution, from Relay_log_info to rpl_group_info:
-row_stmt_start_timestamp
-last_event_start_time
-long_find_row_note
-trans_retries

Added slave_executed_entries_lock to protect rli->executed_entries
Added primitives for thread safe 64 bit increment
Update rli->executed_entries when event has executed, not when event has been sent to sql execution thread


sql/log_event.cc:
  row_stmt_start and long_find_row_note is now in rpl_group_info
sql/mysqld.cc:
  Added slave_executed_entries_lock to protect rli->executed_entries
sql/mysqld.h:
  Added slave_executed_entries_lock to protect rli->executed_entries
  Added primitives for thread safe 64 bit increment
sql/rpl_parallel.cc:
  Update rli->executed_entries when event has executed, not when event has been sent to sql execution thread
sql/rpl_rli.cc:
  Moved row_stmt_start_timestamp, last_event_start_time and long_find_row_note from Relay_log_info to rpl_group_info
sql/rpl_rli.h:
  Moved trans_retries, row_stmt_start_timestamp, last_event_start_time and long_find_row_note from Relay_log_info to rpl_group_info
sql/slave.cc:
  Use rgi for trans_retries and last_event_start_time
  Update rli->executed_entries when event has executed, not when event has been sent to sql execution thread
  Reset trans_retries when object is created
2013-10-15 00:17:16 +03:00
Jan Lindström
1a34a56a9f Fix incorrect merge 2013-10-14 11:54:27 +03:00
Michael Widenius
2e100cc5a4 Fixes for parallel slave:
- Made slaves temporary table multi-thread slave safe by adding mutex around save_temporary_table usage.
  - rli->save_temporary_tables is the active list of all used temporary tables
  - This is copied to THD->temporary_tables when temporary tables are opened and updated when temporary tables are closed
  - Added THD->lock_temporary_tables() and THD->unlock_temporary_tables() to simplify this.
- Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code.
- Added is_part_of_group() to mark functions that are part of the next function. This replaces setting IN_STMT when events are executed.
- Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code.
- If slave_skip_counter is set run things in single threaded mode. This simplifies code for skipping events.
- Updating state of relay log (IN_STMT and IN_TRANSACTION) is moved to one single function: update_state_of_relay_log()
  We can't use OPTION_BEGIN to check for the state anymore as the sql_driver and sql execution threads may be different.
  Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts
  is_in_group() is now independent of state of executed transaction.
- Reset thd->transaction.all.modified_non_trans_table() if we did set it for single table row events.
  This was mainly for keeping the flag as documented.
- Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it.
- Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
- Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
- Changed some functions to take rpl_group_info instead of Relay_log_info to make them multi-slave safe and to simplify usage
  - do_shall_skip()
  - continue_group()
  - sql_slave_killed()
  - next_event()
- Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure.
- set_thd_in_use_temporary_tables() removed as in_use is set on usage
- Added information to thd_proc_info() which thread is waiting for slave mutex to exit.
- In open_table() reuse code from find_temporary_table()

Other things:
- More DBUG statements
- Fixed the rpl_incident.test can be run with --debug
- More comments
- Disabled not used function rpl_connect_master()

mysql-test/suite/perfschema/r/all_instances.result:
  Moved sleep_lock and sleep_cond to rpl_group_info
mysql-test/suite/rpl/r/rpl_incident.result:
  Updated result
mysql-test/suite/rpl/t/rpl_incident-master.opt:
  Not needed anymore
mysql-test/suite/rpl/t/rpl_incident.test:
  Fixed that test can be run with --debug
sql/handler.cc:
  More DBUG_PRINT
sql/log.cc:
  More comments
sql/log_event.cc:
  Added DBUG statements
  do_shall_skip(), continue_group() now takes rpl_group_info param
  Use is_begin(), is_commit() and is_rollback() functions instead of inspecting query string
  We don't have set slaves temporary tables 'in_use' as this is now done when tables are opened.
  Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
  Use IN_TRANSACTION flag to test state of relay log.
  In rows_event_stmt_cleanup() reset thd->transaction.all.modified_non_trans_table if we had set this before.
sql/log_event.h:
  do_shall_skip(), continue_group() now takes rpl_group_info param
  Added is_part_of_group() to mark events that are part of the next event. This replaces setting IN_STMT when events are executed.
  Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code.
sql/log_event_old.cc:
  Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
  do_shall_skip(), continue_group() now takes rpl_group_info param
sql/log_event_old.h:
  Added is_part_of_group() to mark events that are part of the next event.
  do_shall_skip(), continue_group() now takes rpl_group_info param
sql/mysqld.cc:
  Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it.
  Relay_log_info::sleep_lock -> Rpl_group_info::sleep_lock
  Relay_log_info::sleep_cond -> Rpl_group_info::sleep_cond
sql/mysqld.h:
  Updated types and names
sql/rpl_gtid.cc:
  More DBUG
sql/rpl_parallel.cc:
  Updated TODO section
  Set thd for event that is execution
  Use new  is_begin(), is_commit() and is_rollback() functions.
  More comments
sql/rpl_rli.cc:
  sql_thd -> sql_driver_thd
  Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
  Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
  Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts.
  Reset table->in_use for temporary tables as the table may have been used by another THD.
  Use IN_TRANSACTION instead of OPTION_BEGIN to check state of relay log.
  Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
sql/rpl_rli.h:
  Changed relay log state flags to bit masks instead of bit positions (most other code we have uses bit masks)
  Added IN_TRANSACTION to mark if we are in a BEGIN ... COMMIT section.
  save_temporary_tables is now thread safe
  Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
  Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
  Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code
  is_in_group() is now independent of state of executed transaction.
sql/slave.cc:
  Simplifed arguments to io_salve_killed(), sql_slave_killed() and check_io_slave_killed(); No reason to supply THD as this is part of the given structure.
  set_thd_in_use_temporary_tables() removed as in_use is set on usage in sql_base.cc
  sql_thd -> sql_driver_thd
  More DBUG
  Added update_state_of_relay_log() which will calculate the IN_STMT and IN_TRANSACTION state of the relay log after the current element is executed.
  If slave_skip_counter is set run things in single threaded mode.
  Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure.
  Added information to thd_proc_info() which thread is waiting for slave mutex to exit.
  Disabled not used function rpl_connect_master()
  Updated argument to next_event()
sql/sql_base.cc:
  Added mutex around usage of slave's temporary tables. The active list is always kept up to date in sql->rgi_slave->save_temporary_tables.
  Clear thd->temporary_tables after query (safety)
  More DBUG
  When using temporary table, set table->in_use to current thd as the THD may be different for slave threads.
  Some code is ifdef:ed with REMOVE_AFTER_MERGE_WITH_10 as the given code in 10.0 is not yet in this tree.
  In open_table() reuse code from find_temporary_table()
sql/sql_binlog.cc:
  rli->sql_thd -> rli->sql_driver_thd
  Remove duplicate setting of rgi->rli
sql/sql_class.cc:
  Added helper functions rgi_lock_temporary_tables() and rgi_unlock_temporary_tables()
  Would have been nicer to have these inline, but there was no easy way to do that
sql/sql_class.h:
  Added functions to protect slaves temporary tables
sql/sql_parse.cc:
  Added DBUG_PRINT
sql/transaction.cc:
  Added comment
2013-10-14 00:24:05 +03:00
unknown
8f4eb208d2 merge 10.0-base -> 10.0 2013-10-17 19:01:57 +03:00
Alexander Barkov
a9240dce9e Merge 10.0-base -> 10.0 2013-10-15 10:26:08 +04:00
Seppo Jaakola
255e20a175 Merged revisions 3418..3424 from mariadb-galera-5.5 2013-10-07 08:57:23 +03:00
Alexander Barkov
c8e6cb9643 MDEV-4425 Regexp enhancements
Clean-up: moving initialization of my_string_stack_guard
and pcre_stack_guard into init_libstrings() and init_pcre().
2013-10-03 16:42:20 +04:00
Alexander Barkov
0b6c4bb34f MDEV-4928 Merge collation customization improvements
Merging the following MySQL-5.6 changes:
- WL#5624: Collation customization improvements
  http://dev.mysql.com/worklog/task/?id=5624

- WL#4013: Unicode german2 collation
  http://dev.mysql.com/worklog/task/?id=4013

- Bug#62429 XML: ExtractValue, UpdateXML max arg length 127 chars
  http://bugs.mysql.com/bug.php?id=62429
  (required by WL#5624)
2013-10-02 15:04:07 +04:00
Alexander Barkov
fcf992ba4c MDEV-4425 REGEXP enhancements
Adding pcre_stack_guard to avoid crashes in pcre_compile()
on a long recursive patterns with parenthesizes:

SELECT a RLIKE '((((...((((x)))...))))';
2013-10-02 11:58:29 +04:00
Alexander Barkov
59311f3ead Make PCRE use my_malloc() and my_free().
This patch also makes libstrings use my_malloc() and my_free()
in embedded server. Previously, embeddes server used malloc()
and free() in libstrings.
2013-10-01 16:39:29 +04:00
Alexander Barkov
4e433d73af MDEV-4425: Removing the remainders from the old regex library. 2013-09-30 18:48:24 +04:00
Alexander Barkov
285e7aa179 MDEV-4425 REGEXP enhancements 2013-09-26 18:02:17 +04:00
Jan Lindström
c72126e043 Merge revisions 3907--3914 from lp:~codership/codership-mysql/5.5-23
------------------------------------------------------------
revno: 3914  3kB/s | 
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Thu 2013-09-12 15:00:46 +0400
message:
  References lp:1217653 - fix index-id evaluation of FOREIGN KEY, when referenced table without PRIMARY KEY
------------------------------------------------------------
revno: 3913
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Wed 2013-09-11 13:58:02 +0400
message:
  References lp:1217653 - fix index-id evaluation of FOREIGN KEY, when referenced table without PRIMARY KEY
------------------------------------------------------------
revno: 3912
committer: Seppo Jaakola <seppo.jaakola@codership.com>
branch nick: wsrep-5.5-23
timestamp: Fri 2013-09-06 13:13:48 +0300
message:
  References: lp:1212955 - releasing MDL after failed BEGIN and "SET AUTOCOMMIT"
------------------------------------------------------------
revno: 3911
committer: Seppo Jaakola <seppo.jaakola@codership.com>
branch nick: wsrep-5.5-23
timestamp: Wed 2013-09-04 10:52:31 +0300
message:
  References: lp:1123233 - avoiding to set wsrep_seqno_changed for replaying transactions
    Note, also missing transactions don't declare seqno_changed anymore. Earlier they would have caused crash at wsrep_cleanup_transaction phase.
------------------------------------------------------------
revno: 3910 [merge]
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Tue 2013-09-03 15:27:02 +0400
message:
  References lp:1049599 - expose desync functionality to the client
------------------------------------------------------------
revno: 3909
committer: Seppo Jaakola <seppo.jaakola@codership.com>
branch nick: wsrep-5.5-23
timestamp: Tue 2013-09-03 09:41:08 +0300
message:
   References: lp:1123233 - rollback for transaction which has not appended key information
------------------------------------------------------------
revno: 3908
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-09-01 13:29:12 +0400
message:
  lp:1201893 - fix command for default IP address
------------------------------------------------------------
revno: 3907
committer: Seppo Jaakola <seppo.jaakola@codership.com>
branch nick: wsrep-5.5-23
timestamp: Thu 2013-08-29 12:16:42 +0300
message:
  References: lp:1212955 - releasing transactional MDL locks after commit failures (e.g. certification failure).
2013-09-26 16:43:49 +03:00
Sergei Golubchik
9af177042e 10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6)
TokuDB does not compile (not updated to 10.0 SE API)
2013-09-21 10:14:42 +02:00
Sergei Golubchik
4ec2e9d7ed 5.5 merge and fixes for compiler/test errors 2013-09-18 13:07:31 +02:00
Sergei Golubchik
909775a762 mariadb-5.5.33 merge 2013-09-18 12:00:23 +02:00
Alexey Botchkov
92265da9d7 MDEV-4472 Audit-plugin. Server-related part of the task.
file_logger became the service.
     Data like query_id now are sent to the audit plugin.
     Fix for MDEV-4770 ported from 10.0.
     Fix added for the read_maria_plugin_info().
     Log rotation can be disabled with 'set rotations=0'.
2013-09-09 16:56:35 +05:00
Jan Lindström
9c85ced30d Merge fix. 2013-09-09 10:38:58 +03:00
Jan Lindström
ba3ff50ab2 Merge 10.0 to galera-10.0 2013-09-03 17:50:36 +03:00
Ashish Agarwal
292aa926c1 WL#7076: Backporting wl6715 to support both formats
in 5.5, 5.6, 5.7.
2013-08-23 09:07:09 +05:30
Ashish Agarwal
d75c58e11f WL#7076: Backporting wl6715 to support both formats
in 5.5, 5.6, 5.7.
2013-08-23 09:07:09 +05:30
Seppo Jaakola
4222b2520b Merge with mariadb 5.5: bzr merge lp:maria/5.5 --rtag:mariadb-5.5.32 2013-08-21 16:34:31 +03:00
Sergey Vojtovich
b7f9c89423 MDEV-4702 - Reduce usage of LOCK_open
Following variables do not require LOCK_open protection anymore:
- table_def_cache (renamed to tdc_hash) is protected by rw-lock
  LOCK_tdc_hash;
- table_def_shutdown_in_progress doesn't need LOCK_open protection;
- last_table_id use atomics;
- TABLE_SHARE::ref_count (renamed to TABLE_SHARE::tdc.ref_count)
  is protected by TABLE_SHARE::tdc.LOCK_table_share;
- TABLE_SHARE::next, ::prev (renamed to tdc.next and tdc.prev),
  oldest_unused_share, end_of_unused_share are protected by
  LOCK_unused_shares;
- TABLE_SHARE::m_flush_tickets (renamed to tdc.m_flush_tickets)
  is protected by TABLE_SHARE::tdc.LOCK_table_share;
- refresh_version (renamed to tdc_version) use atomics.
2013-08-14 12:48:50 +04:00
Sergei Golubchik
fcf87600a2 MDEV-4865 Change related to --log option/variable was merged partially
Complete the merge of magne.mahre@oracle.com-20101102115354-vxcaxminmzglzalk
(WL#5185 Remove deprecated 5.1 features)
2013-08-13 13:35:36 +02:00
Sergei Golubchik
9747fbb411 MDEV-4786 merge 10.0-monty -> 10.0
remove TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE
2013-08-12 15:46:35 +02:00
Sergey Vojtovich
be995467f0 MDEV-4786 - merge 10.0-monty - 10.0
Fixed main.partition_open_files_limit, innodb.innodb_bug12400341 failures.

These testcases use --max-connections=N command line option, which
was declared PARSE_EARLY during the merge. Embedded didn't handle
early options and failed to start due to unknown command line
option.

libmysqld/lib_sql.cc:
  Let embedded handle early options.
sql/mysqld.cc:
  Moved handling of early options to a separate function.
sql/mysqld.h:
  Moved handling of early options to a separate function.
2013-08-01 16:09:26 +04:00
Vladislav Vaintroub
a06a844d9a MDEV-4712 : Fix "shutdown" test.
There is a race condition during shutdown, that happens when "show status" runs during shutdown. 
Functions show_slave_running(), show_slave_received_heartbeats(), show_heartbeat_period() would dereference NULL pointer master_info_index, after this variable is  set to NULL in slave_end() during shutdown.
Fix introduces check for master_info_index == NULL in the affected functions.
2013-07-31 15:04:14 +02:00
Praveenkumar Hulakund
03940a7bd8 Bug#16865959 - PLEASE BACKPORT BUG 14749800.
Since log_throttle is not available in 5.5. Logging of
error message for failure of thread to create new connection
in "create_thread_to_handle_connection" is not backported.

Since, function "my_plugin_log_message" is not available in 
5.5 version and since there is incompatibility between
sql_print_XXX function compiled with g++ and alog files with
gcc to use sql_print_error, changes related to audit log
plugin is not backported.
2013-07-24 15:44:41 +05:30
Praveenkumar Hulakund
0ae219cd75 Bug#16865959 - PLEASE BACKPORT BUG 14749800.
Since log_throttle is not available in 5.5. Logging of
error message for failure of thread to create new connection
in "create_thread_to_handle_connection" is not backported.

Since, function "my_plugin_log_message" is not available in 
5.5 version and since there is incompatibility between
sql_print_XXX function compiled with g++ and alog files with
gcc to use sql_print_error, changes related to audit log
plugin is not backported.
2013-07-24 15:44:41 +05:30
Sergei Golubchik
b7b5f6f1ab 10.0-monty merge
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
2013-07-21 16:39:19 +02:00