Commit graph

87524 commits

Author SHA1 Message Date
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
Sergey Vojtovich
fd1437dfe5 MDEV-5597 - Reduce usage of LOCK_open: LOCK_flush
Replaced LOCK_flush with per-share conditional variable.
2014-02-13 11:13:55 +04:00
Sergey Vojtovich
048e9c40a6 MDEV-5492 - Reduce usage of LOCK_open: TABLE::in_use
Move TABLE::in_use out of LOCK_open.

This is done with assumtion that foreign threads accessing TABLE::in_use
will only need consistent value _after_ marking table for flush and purging
unused table instances. In this case TABLE::in_use will always point to a
valid thread object.

Previously FLUSH TABLES thread may wait for tables flushed subsequently by
concurrent threads which breaks the above assumption, e.g.:
open tables: t1 (version= 1)
thr1 (FLUSH TABLES): refresh_version++
thr1 (FLUSH TABLES): purge table cache
open tables: none
thr2 (SELECT * FROM t1): open tables: t1
open tables: t1 (version= 2)
thr2 (FLUSH TABLES): refresh_version++
thr2 (FLUSH TABLES): purge table cache
thr1 (FLUSH TABLES): wait for old tables (including t1 with version 2)

It is fixed so that FLUSH TABLES waits only for tables that were open
heretofore.
2014-02-13 10:44:10 +04:00
Sergey Vojtovich
a25d87e50f MDEV-5403 - Reduce usage of LOCK_open: tc_count
Lock-free tc_count.
2014-02-13 10:19:37 +04:00
Michael Widenius
103643d87a Changed " to ' around connection name (safer) 2014-02-12 00:06:44 +02:00
Michael Widenius
3474bb04ec Fixed that --apply-slave-statements also uses multi-source
mysql-test/r/rpl_mysqldump_slave.result:
  Updated test result
2014-02-11 23:41:56 +02:00
Michael Widenius
3f4337103a Automatic merge 2014-02-11 19:45:38 +02:00
Michael Widenius
add6eb69a8 Fixed MDEV-4551: mysqldump --dump-slave fails with multi-source replication
When running with multi-source enabled master (MariaDB 10.0) all master will be recorded

mysql-test/r/rpl_mysqldump_slave.result:
  Updated results to new syntax
2014-02-11 19:42:18 +02:00
Michael Widenius
94d23e2413 Fixed MDEV-3815: Aria engine return "The table is full" (ERROR 1114) inserting record, while MyISAM and InnoDB doesn't
Increase default pointer length for Aria tables to be able to handle big files without having to specify MAX_ROWS


mysql-test/suite/maria/icp.result:
  Updated result
mysql-test/suite/maria/maria-preload.result:
  More pages are needed with longer pointer length
mysql-test/suite/maria/maria.result:
  Added more tests
mysql-test/suite/maria/maria.test:
  Added more tests
storage/maria/ma_create.c:
  Increase default pointer length for Aria tables to be able to handle big files without having to specify MAX_ROWS
storage/maria/ma_range.c:
  Optimize records_in_range() to be more exact
storage/maria/ma_static.c:
  Increase default pointer size
storage/maria/ma_test2.c:
  Allow a bit larger errors in records_in_range
2014-02-11 19:40:33 +02:00
Michael Widenius
50323f1263 Fixed test case as gtid events are not counted anymore 2014-02-11 18:45:49 +02:00
Michael Widenius
e068197ca3 Fixed wrong result file 2014-02-11 18:08:02 +02:00
unknown
34bd0d02ba Merge 10.0-base -> 10.0 2014-02-11 14:21:48 +01:00
unknown
cc7925765e MDEV-4937: sql_slave_skip_counter does not work with GTID
As a side-effect of purge_relay_logs(), sql_slave_skip_counter
was silently ignored in GTID mode.

But sql_slave_skip_counter in fact is not a good match with GTID.
And it is not really needed either, as users can explicitly set
@@gtid_slave_pos to skip specific GTIDs, in a way that matches
well how GTID replication works.

So with this patch, we give an error on attempts to set
sql_slave_skip_counter when using GTID, with a suggestion to use
gtid_slave_pos instead, if needed.
2014-02-11 14:06:03 +01:00
Elena Stepanova
2e42130ba0 Increase version number 2014-02-11 01:51:48 +04:00
unknown
dd93ec5633 Merge MariaDB 10.0-base to 10.0. 2014-02-10 15:12:17 +01:00
unknown
f3a6f86ec3 Fix check_testcase complaints due to missing SET debug_sync=RESET in a few tests. 2014-02-10 12:53:04 +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
4a976545e5 MDEV-4726: Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
Fix a race in test case rpl_gtid_basic.
include/sync_with_master_gtid.inc got confused due to two different
GTIDs both with the same seq_no=9.
2014-02-09 11:15:45 +01:00
unknown
07eaf6ea76 MDEV-5636: Deadlock in RESET MASTER
The problem is a deadlock between MYSQL_BIN_LOG::reset_logs() and
MYSQL_BIN_LOG::mark_xid_done(). The former takes LOCK_log and waits for the
latter to complete. But the latter also tries to take LOCK_log; this can lead
to a deadlock.

There was already code that tries to deal with this, with the flag
reset_master_pending. However, there was still a small opportunity for
deadlock, when an previous mark_xid_done() is still running when reset_logs()
is called and is at the precise point where it first releases LOCK_xid_list
and then re-aquires both LOCK_log and LOCK_xid_list.

Solve by setting reset_master_pending in reset_logs() before taking
LOCK_log. And also count how many invocations of LOCK_xid_list are in the
progress of releasing and re-aquiring locks, and in reset_logs() wait for that
number to drop to zero after setting reset_master_pending and before taking
LOCK_log.
2014-02-09 00:56:18 +01:00
unknown
76e929a92e MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.
Rewrite the gtid_waiting::wait_for_gtid() function.
The code was rubbish (and buggy). Now the logic is
much clearer.

Also fix a missing slave sync that could cause test failure.
2014-02-08 22:28:41 +01:00
unknown
3c97d24f74 MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.
Couple of small fixes following buildbot testing.
2014-02-08 01:16:45 +01:00
unknown
7bb022f3cf MDEV-4726: Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
Some GTID test cases were using include/wait_condition.inc with a
condition like SELECT COUNT(*)=4 FROM t1 to wait for the slave to
catch up with the master. This causes races and test failures, as the
changes to the tables become visible at the COMMIT of the SQL thread
(or even before in case of MyISAM), but the changes to
@@gtid_slave_pos only become visible a little bit after the COMMIT.

Now that we have MASTER_GTID_WAIT(), just use that to sync up in a
GTID-friendly way, wrapped in nice include/save_master_gtid.inc and
include/sync_with_master_gtid.inc scripts.
2014-02-07 20:24:39 +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
Sergei Golubchik
e8193eeb8d skip performance_schema also in spider/bg suite
(as it was done for spider suite)
2014-02-06 21:58:38 +01:00
Sergei Golubchik
5084d8cfc5 update failing test to match recently updated result file 2014-02-06 21:26:00 +01:00
Sergei Golubchik
1b3c15f199 merge with 10.0-monty 2014-02-06 16:38:40 +01:00
Sergei Golubchik
c73718d917 fix tests for solaris - different errno numbers and/or different errno messages 2014-02-06 16:28:05 +01:00
Sergei Golubchik
b7b991add0 fix tests to cleanup after themselves 2014-02-06 16:27:55 +01:00
Sergei Golubchik
3403f06d26 another TLS valgrind suppression 2014-02-06 16:27:44 +01:00
Sergei Golubchik
37b8691cec fix the fix and update test results for MDEV-4439 2014-02-06 16:27:23 +01:00
Alexey Botchkov
bf050b1db2 MDEV-4439 ALTER TABLE .. [ADD|DROP] FOREIGN KEY IF [NOT] EXISTS does not work if constraint name is not used.
Patches for server and the Innodb engine.
  Server is fixed so it does nothing if no indexes left to alter.
  Innodb parser is fixed so it looks for the IF [NOT] EXISTS option in a string.
  Another change is that it uses the index name for the internal dictionary.
  Prior to that it only used the CONSTRAINT name for it.
2014-02-06 16:27:05 +01:00
Sergei Golubchik
73aea0a732 MDEV-5499 install_spider.sql tries to create tables with DEFAULT clause for TEXT columns 2014-02-06 16:25:40 +01:00
Sergei Golubchik
ceae5aaa7e mtr: allow nested plugin suites to be defaults too 2014-02-06 16:25:18 +01:00
Michael Widenius
313f18be5a Fixed errors and warnings found by buildbot
mysql-test/r/lowercase_table2.result:
  Updated result
  (The change happend because we don't try to open the table anymore as part of create table)
mysql-test/suite/rpl/r/create_or_replace_mix.result:
  Fixed result file
mysql-test/suite/rpl/r/create_or_replace_row.result:
  Fixed result file
mysql-test/suite/rpl/r/create_or_replace_statement.result:
  Fixed result file
mysql-test/suite/rpl/t/create_or_replace.inc:
  Drop open temporary table
mysys/my_delete.c:
  Added missing newline
plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result:
  Fixed result
  (Lock names was before off by one. Was corrected by my previous patch)
sql/sql_select.cc:
  Fixed compiler warnings by adding missing casts
storage/connect/ha_connect.cc:
  Fixed compiler warnings
storage/innobase/os/os0file.cc:
  Fixed compiler warnings
storage/xtradb/btr/btr0btr.cc:
  Fixed compiler warnings
storage/xtradb/handler/ha_innodb.cc:
  removed not used function
strings/ctype-uca.c:
  Fixed compiler warnings
support-files/compiler_warnings.supp:
  Added suppression for warnings that are wrong or are not serious andthat we don't plan to fix.
2014-02-06 16:14:09 +02:00
Alexander Barkov
78f11e8ee2 Merge 10.0-connect -> 10.0 2014-02-06 14:21:50 +04:00
Michael Widenius
1695fc4532 MDEV-5602: CREATE OR REPLACE obtains stricter locks than the connection had before
mysql-test/r/create_or_replace.result:
  Added test case
mysql-test/t/create_or_replace.test:
  Added test case
sql/sql_base.cc:
  Downgrade locks in LOCK TABLES + CREATE TABLE OR REPLACE
sql/sql_table.cc:
  Downgrade locks in LOCK TABLES + CREATE TABLE OR REPLACE
2014-02-05 21:36:16 +02:00
Michael Widenius
0557de84f1 Marked some very slow tokudb test with --big_test 2014-02-05 19:25:18 +02:00
Michael Widenius
10001c8e4f Automatic merge 2014-02-05 19:23:11 +02:00
Sergei Golubchik
a0de0fd50e revert bugfix for MDEV-5295 deb upgrade 5.5 to 10.0.6 does not work
it didn't help, instead it only broke upgrades even more
2014-02-05 18:18:51 +01: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
Sergei Golubchik
5eb145858d more solaris fixes. xtradb and spider. 2014-02-05 17:27:41 +01:00
Sergei Golubchik
b25951cc5e fix the test to be independent from the stack size 2014-02-05 17:27:32 +01:00
unknown
2ab48b44da Fix of rpl_parallel.test cleanup. 2014-02-05 20:53:54 +02:00
unknown
52311b72e6 merge 10.0-base ->10.0 2014-02-05 20:35:11 +02:00
unknown
bfdbb17990 merge 5.5->10.0-base 2014-02-05 16:20:37 +02:00
Elena Stepanova
f68eac2ead From MySQL 5.6.13 change log:
Unlike MyISAM, InnoDB does not support boolean full-text searches on 
nonindexed columns, but this restriction was not enforced, resulting 
in queries that returned incorrect results. (Bug #16434374)
2014-02-05 16:41:29 +04:00
Elena Stepanova
e068b7dc40 Intentional change in logging 2014-02-05 16:39:21 +04:00
Elena Stepanova
41fd4844e8 unix_socket fails in some build environments when $USER variable
appears to be unset, or when it contains 'root' even though the user
does not have real root permissions
2014-02-05 14:25:37 +04:00
Alexander Barkov
1b1ffe408c Merge 10.0->10.0-connect 2014-02-05 13:36:17 +04:00
Elena Stepanova
625d9f4ef8 Spider tests failed in buildbot due to the lack of memory.
Turned off Performance Schema for Spider test suite
2014-02-05 03:51:18 +04:00