Commit graph

7920 commits

Author SHA1 Message Date
Nirbhay Choubey
fcc6e12d69 MDEV-7544: Update global_suppressions to include warning related to "gvwstate.dat" 2015-02-18 19:02:00 -05:00
Nirbhay Choubey
3c9137deeb Merge branch '5.5' into 5.5-galera
Merge banch 5.5 till revision :
fdd6c11 - MDEV-7419 Function cli_safe_read not exported

Conflicts:
	.bzrignore
	debian/dist/Debian/mariadb-galera-server-5.5.files.in
	debian/dist/Ubuntu/mariadb-galera-server-5.5.files.in
	storage/tokudb/CMakeLists.txt
	support-files/build-tags
2015-02-18 17:15:57 -05:00
Sergei Golubchik
5dce6aa1fe Merge remote-tracking branch 'bzr/5.5' into bb-5.5-merge 2015-02-12 13:14:55 +01:00
Sergei Golubchik
8e80f91fa3 Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42 2015-02-11 23:50:40 +01:00
Jan Lindström
552f1b3505 Fix test failures on innodb-mdev-7055 and innodb-mdev-7513. 2015-02-10 14:17:23 +02:00
Jan Lindström
ada07435b4 Fix test failure on innodb-mdev-7055. 2015-02-10 08:08:59 +02:00
Jan Lindström
44a9e3f7b4 MDEV-7139: Sporadic failure in innodb.innodb_corrupt_bit on P8
The testcase fails randomly due to ibuf merge happening in the background.
Fix not to do any merges with ibuf_debug enabled.
2015-02-09 16:14:27 +02:00
Alexey Botchkov
919f40e464 Audit plugin v1.2.0. 2015-02-08 22:38:19 +04:00
Jan Lindström
5c6eb5222e Fix test failure. 2015-02-04 16:50:29 +02:00
Jan Lindström
422ffe99b5 InnoDB and XtraDB produce different output on MDEV-7513. 2015-02-04 11:12:46 +02:00
Jan Lindström
f32091532d MDEV-7055: MySQL#74664 - InnoDB: Failing assertion: len <= col->len || col->mtype == 5 || (col->len == 0 && col->mtype == 1) in file rem0rec.cc line 845
Debug assertion maybe too strict.
2015-02-04 10:50:16 +02:00
Jan Lindström
7afbf338aa MDEV-7513: ib_warn_row_too_big dereferences null thd
Analysis: Purge thread does not have thd and no access to
handlerton.

Fix: If thd does not exists we use sql_print_warning instead
of push_warning_printf.
2015-02-04 09:29:54 +02:00
Rich Prohaska
bc605380b1 DB-803 fix the 5733 test to be more tolerant of join type 2015-01-29 08:56:01 -05:00
Nirbhay Choubey
9b7e3801f4 MDEV-7476: Allow SELECT to succeed even when node is not ready
Added a SESSION-only system variable "wsrep_dirty_reads" to allow SELECT
queries to pass even when the node is not prepared to accept queries
(wsrep_ready=OFF). Added a test case.
2015-01-27 16:22:29 -05:00
Nirbhay Choubey
5b6f637caa MDEV-7322: Option to allow setting the binlog_format with Galera
At session scope, allow binlog_format to be changed to
values other than ROW with a warning.
2015-01-27 14:17:40 -05:00
Nirbhay Choubey
248c662cd7 Minor test modifications. 2015-01-26 22:43:46 -05:00
Nirbhay Choubey
fffc9f585d MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
Backport from 10.1.
2015-01-24 18:39:21 -05:00
Jon Olav Hauglid
7a408dbdf4 Bug#19770858: MYSQLD CAN BE DRIVEN TO OOM WITH TWO SIMPLE SESSION VARS
The problem was that the maximum value of the transaction_prealloc_size
session system variable was ULONG_MAX which meant that it was possible
to cause the server to allocate excessive amounts of memory.

This patch fixes the problem by reducing the maxmimum value of
transaction_prealloc_size and transaction_alloc_block_size down
to 128K.

Note that transactions will still be able to allocate more than
128K if needed, this patch just reduces the amount that can be
preallocated - as well as the maximum size of the incremental
allocation blocks.
2015-01-23 10:17:09 +01:00
Rich Prohaska
7c78945c87 DB-801 test case for a tokudb update that should fail but succeeds 2015-01-21 15:55:31 -05:00
Rich Prohaska
e7f48475d9 DB-798 add the tokudb_rpl_check_readonly variable for RFR 2015-01-19 09:45:41 -05:00
s.sujatha
70f5d81a96 Bug#20041860: SLAVE ERROR WHEN DROP DATABASE
Fixing a post push test issue.
2015-01-19 18:22:14 +05:30
Nirbhay Choubey
bb93d46241 Test changes (backported from 10.1). 2015-01-16 13:52:30 -05:00
Rich Prohaska
44bb19b7d1 DB-788 fix optimize by index name test result 2015-01-15 15:49:37 -05:00
Rich Prohaska
c87f8151ac DB-478 DB-788 DB-789 optimize tokudb table enhancements 2015-01-15 14:09:57 -05:00
Sergei Golubchik
5900333aa5 MDEV-7404 REPAIR multiple tables crash in MDL_ticket::has_stronger_or_equal_type
mysql_alter_table() that is used in mysql_recreate_table() doesn't expect
many tables in the TABLE_LIST.
2015-01-14 12:10:13 +01:00
Venkatesh Duggirala
ebb2a3f5e1 Problem: IO thread fails to connect to master if servers are configured with
special character sets like utf16, utf32, ucs2.

Analysis: MySQL server does not support few special character sets like
  utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
  It is known limitation listed in the documentation
  http://dev.mysql.com/doc/refman/5.5/en/charset-connection.html.

  The default value for default-character-set parameter is 'auto'
  which means that if the server's character set is not supported,
  then server automatically changes client's character set to
  predefined character-set which is 'latin1' in the current code.

  Eg:
  $ ./mysql -uroot -S$SOCKET_FILE --default-character-set=utf16
  ERROR 1231 (42000): Variable 'character_set_client' can't be set to the value of 'utf16'

  $ ./mysql -uroot -S$SOCKET_FILE will be successfully connected to
  server with 'latin1' as default client side character set.

  When IO thread is trying to connect to Master, it sets server's character
  set as client's character set. When Slave server is started with these
  special character sets, IO thread (which is like a connection to Master)
  fails because of the above said limitation.

 Fix: Now even IO thread also behaves the same as a regular client behaves.
  i.e., If server's character set is not supported as client's character set,
  then set default's client character set(latin1) as client's character set.
2015-01-14 14:13:52 +05:30
Rich Prohaska
ba000b3db3 DB-791 remove memcache patch 2015-01-12 14:07:14 -05:00
Sergei Golubchik
2ab49689c6 MDEV-7410 Temporary table name conflict between sessions
workaround for missing SP auto-reparse.
allow the user to disable stored_program_cache_size, if he wants
2015-01-10 14:07:46 +01:00
Nirbhay Choubey
952b575272 MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
Synchronous read view should not be needed for
SHOW commands.
2014-12-31 19:28:20 -05:00
s.sujatha
5da083ef67 Bug#20041860: SLAVE ERROR WHEN DROP DATABASE
Fix:
===
Backport Bug#11756194 to mysql-5.5. slave breaks if
'drop database' fails on master and mismatched tables on
slave.

'DROP TABLE <deleted tables>' was binlogged when
'DROP DATABASE' failed and at least one table was deleted
from the database. The log event would lead slave SQL thread
stop if some of the tables did not exist on slave.

After this patch, It is always binlogged with 'IF EXISTS'
option.
2014-12-29 12:17:55 +05:30
Nirbhay Choubey
eda3db826f Merge revisions from maria/5.5 (5.5.41)
bzr merge -r4393 lp:maria/5.5
2014-12-22 20:09:25 -05:00
Thiru
e7391e472e Bug #19815702 TIS620: CRASH WITH MULTI TABLE DELETE
- Moving the test case to correct place.
2014-12-22 13:33:48 +05:30
Sergei Golubchik
a978bdda1e mysql-5.5.41 merge 2014-12-19 11:35:44 +01:00
Rich Prohaska
03a0eb3f7b FT-635 adjust test result with new status variable 2014-12-17 10:48:34 -05:00
Nirbhay Choubey
89b2bc42f4 Merge revisions from maria/5.5
bzr merge -r4388 lp:maria/5.5
2014-12-16 20:07:34 -05:00
Michael Widenius
10ab3e6887 MDEV-4010 Deadlock on concurrent INSERT .. SELECT into an Aria table with statement binary logging
There was a bug in lock handling when mixing INSERT ... SELECT on the same table.


mysql-test/suite/maria/insert_select.result:
  Test case for MDEV_4010
mysql-test/suite/maria/insert_select.test:
  Test case for MDEV_4010
mysys/thr_lock.c:
  We wrongly alldoed TL_WRITE_CONCURRENT_INSERT when there was a TL_READ_NO_INSERT lock
2014-12-15 14:49:23 +02:00
Michael Widenius
4a32d9c058 MDEV-6871 Multi-value insert on MyISAM table that makes slaves crash (when using --skip-external-locking=0)
Problem was that repair() did lock and unlock tables, which leaved already locked tables in wrong state

include/my_check_opt.h:
  Added option T_NO_LOCKS to disable locking during repair()
  Fixed duplicated bit T_NO_CREATE_RENAME_LSN
mysql-test/suite/rpl/r/myisam_external_lock.result:
  Test case for MDEV-6871
mysql-test/suite/rpl/t/myisam_external_lock-slave.opt:
  Test case for MDEV-6871
mysql-test/suite/rpl/t/myisam_external_lock.test:
  Test case for MDEV-6871
storage/maria/ha_maria.cc:
  Don't lock tables during enable_indexes()
  Removed some calls to current_thd
storage/myisam/ha_myisam.cc:
  Don't lock tables during enable_indexes()
  Removed some calls to current_thd
2014-12-15 11:16:33 +02:00
Rich Prohaska
f6d2798f8a relax the time constraints on the bulk fetch tests again 2014-12-12 09:21:08 -05:00
Rich Prohaska
cef4e0a650 relax the time constraints on the bulk fetch tests 2014-12-11 19:59:48 -05:00
Jan Lindström
df20184c03 MDEV-7252: Test failure on innodb.innodb_bug12400341 at Windows
Problem is that there could be undo slots from previous runs.
2014-12-03 13:38:39 +02:00
Jan Lindström
e544bcd16d MDEV-7243: innodb-change-buffer-recovery fails on windows
Problem is that on Windows command "perl" failed with error: 255  my_errno: 0  errno: 0.
Do not run on Windows.
2014-12-02 12:19:29 +02:00
Elena Stepanova
e0c71a9ab8 MDEV-7169: innodb.innodb_bug14147491 fails in buildbot on Windows
Applied the fix previously pushed into 10.0. 
Initial Jan's commit comment:
Problem is that test could open Microsoft C++ Client Debugger
windows with abort exception. Lets not try to test this on
windows.
2014-12-02 01:31:49 +04:00
Rich Prohaska
e790efdf80 DB-755 speed up 5585.test 2014-11-28 08:53:03 -05:00
Jan Lindström
e5802c38f9 Better comments and add a test case. 2014-11-25 08:06:41 +02:00
Rich Prohaska
e64b621179 DB-771 fix incorrect assert in update callback for varchar expansion 2014-11-21 07:13:07 -05:00
Jan Lindström
8ff66501ca Forgot to add test file. 2014-11-21 13:32:53 +02:00
Jan Lindström
8bc5eabea8 MDEV-7084: innodb index stats inadequate using constant
innodb_stats_sample_pages

Analysis: If you set the number of analyzed pages 
to very low number compared to actual pages on 
that table/index it randomly pics those pages 
(default 8 pages), this leads to fact that query 
after analyze table returns different results. If 
the index tree is small, smaller than 10 * 
n_sample_pages + total_external_size, then the 
estimate is ok. For bigger index trees it is 
common that we do not see any borders between 
key values in the few pages we pick. But still 
there may be n_sample_pages different key values, 
or even more. And it just tries to 
approximate to n_sample_pages (8).

Fix: (1) Introduced new dynamic configuration variable
innodb_stats_sample_traditional  that retains
the current design. Default false.

(2) If traditional sample is not used we use
n_sample_pages = max(min(srv_stats_sample_pages,
                         index->stat_index_size),
                     log2(index->stat_index_size)*
                          srv_stats_sample_pages);

(3) Introduced new dynamic configuration variable
stat_modified_counter (default = 0) if set
sets lower bound for row updates when statistics is re-estimated.

If user has provided upper bound for how many rows needs to be updated
before we calculate new statistics we use minimum of provided value
and 1/16 of table every 16th round. If no upper bound is provided
(srv_stats_modified_counter = 0, default) then calculate new statistics
if 1 / 16 of table has been modified
since the last time a statistics batch was run.
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often.
@param t table
@return true if the table has changed too much and stats need to be
recalculated
*/
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
	((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
	ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
		16 + (t)->stat_n_rows / 16))
2014-11-19 20:27:34 +02:00
Rich Prohaska
3f3e058f5a DB-762 create tokudb trx when needed in tokudb::start_stmt 2014-11-19 12:31:34 -05:00
Sergei Golubchik
5d0122bd77 MDEV-7113 difference between check_vcol_func_processor and check_partition_func_processor
MDEV-6789 segfault in Item_func_from_unixtime::get_date on updating table with virtual columns

* prohibit VALUES in partitioning expression
* prohibit user and system variables in virtual column expressions
* fix Item_func_date_format to cache locale (for %M/%W to return the same as MONTHNAME/DAYNAME)
* fix Item_func_from_unixtime to cache time_zone directly, not THD (and not to crash)
* added tests for other incorrectly allowed (in vcols) functions to see that they don't crash
2014-11-18 15:42:40 +01:00
Sergei Golubchik
84f25c25f2 MDEV-3940 Server crash or assertion `item->type() == Item::STRING_ITEM' failure on LOAD DATA through a view with statement binary logging
A "field" could be either an Item_field or
(if loading into a view) an Item_direct_ref that references Item_field.

Also: when iterating fields, use fields of the TABLE_LIST (table or view),
not fields of a TABLE (actual underlying table - might have more columns).
2014-11-18 15:42:32 +01:00
Rich Prohaska
340bc1bd99 DB-768 test case for 5.6 crash 2014-11-17 13:36:29 -05:00
Rich Prohaska
a3aa1defcf DB-766 add reproducer 2014-11-17 13:20:47 -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
Rich Prohaska
2db029048f DB-759 test and fix alter table bug with cardinality data 2014-11-13 10:53:22 -05:00
Elena Stepanova
116baede50 Sporadic failure in storage_engine/trx.xa_recovery test
The test complains that the server failed to disappear upon shutdown /
wait_for_disconnect. Trying to solve the probably race condition by 
adding a wait before restart.
2014-11-17 20:10:57 +04:00
Kristian Nielsen
356451fca8 MDEV-7103: Sporadic test falure in rpl.rpl_parallel_show_binlog_events_purge_logs
The test case had a classic mistake: SET DEBUG_SYNC='now SIGNAL xxx'
followed immediately by SET DEBUG_SYNC='RESET'. This makes it
possible for the waiter to miss the signal, if it does not manage
to wake up prior to the RESET.
2014-11-13 10:04:45 +01:00
Kristian Nielsen
3180e76262 MDEV-7089: Test failures in main.failed_auth_unixsocket and plugins.unix_socket depending on environment
The test cases had some --replace_result $USER USER. The problem is that the
value of $USER can be anything, depending on the name of the unix account that
runs the test suite. So random parts of the result can be errorneously
replaced, causing test failures.

Fix by making the replacements more specific, so they will match only the
intended stuff regardless of the value of $USER.
2014-11-12 11:10:13 +01:00
Rich Prohaska
b26799dcc7 DB-757 compute cardinality when alter table analyze partition is run 2014-11-08 10:36:33 -05:00
Rich Prohaska
0a4446d72b DB-756 set cardinality data for partitioned tokudb tables 2014-11-08 08:59:55 -05:00
Thirunarayanan B
821dfcd8d2 Bug #19815702 TIS620: CRASH WITH MULTI TABLE DELETE
Description:
  Using correct length when moving to next field in cmp_ref. The store
length already includes the length bytes of blobs, which is already considered
earlier for blob types.
	Approved by Mattias, Jimmy [rb-7088]
2014-11-04 17:40:29 +05:30
Rich Prohaska
18951c10fa mark 5585.test as a big test 2014-11-03 15:03:57 -05:00
Marko Makela
a265914018 Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 CAUSES INFINITE PAGE SPLIT
The debug configuration parameter innodb_optimistic_insert_debug
which was introduced for testing corner cases in B-tree handling
had a bug in it. The value 1 would trigger an infinite sequence
of page splits.

Fix: When the value 1 is specified, disable this debug feature.
Approved by Yasufumi Kinoshita
2014-10-30 08:53:46 +02:00
Marko Makela
ff906f032f Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 CAUSES INFINITE PAGE SPLIT
The debug configuration parameter innodb_optimistic_insert_debug
which was introduced for testing corner cases in B-tree handling
had a bug in it. The value 1 would trigger an infinite sequence
of page splits.

Fix: When the value 1 is specified, disable this debug feature.
Approved by Yasufumi Kinoshita
2014-10-30 08:53:46 +02:00
Marko Makela
c978f6988d Bug#19584379 Reporting corruption may corrupt the innodb data dictionary
dict_set_corrupted(): Use the canonical way of searching for
less-than-equal (PAGE_CUR_LE) and then checking low_match.

The code that was introduced in MySQL 5.5.17 in
    Bug#11830883 SUPPORT "CORRUPTED" BIT FOR INNODB TABLES AND INDEXES
could position the cursor on the page supremum, and then attempt
to overwrite non-existing 7th field of the 1-field supremum record.

Approved by Jimmy Yang
2014-10-27 14:27:08 +02:00
Marko Makela
352b6bc9a8 Bug#19584379 Reporting corruption may corrupt the innodb data dictionary
dict_set_corrupted(): Use the canonical way of searching for
less-than-equal (PAGE_CUR_LE) and then checking low_match.

The code that was introduced in MySQL 5.5.17 in
    Bug#11830883 SUPPORT "CORRUPTED" BIT FOR INNODB TABLES AND INDEXES
could position the cursor on the page supremum, and then attempt
to overwrite non-existing 7th field of the 1-field supremum record.

Approved by Jimmy Yang
2014-10-27 14:27:08 +02:00
Rich Prohaska
070b1011c3 DB-743 test case for TC get_active_from_pool crash 2014-10-21 13:21:42 -04:00
Annamalai Gurusami
5c41d52904 The test case innodb.foreign-keys is failing in pb2 5.5. This is because
some of the tables are created in InnoDB and some tables are created in MyISAM.
We need to create all tables on InnoDB.  Fix is to add engine=innodb to the
CREATE TABLE statements.  

approved in IM by Marko and Vasil.
2014-10-20 15:43:28 +05:30
Annamalai Gurusami
a6ed922e8c The test case innodb.foreign-keys is failing in pb2 5.5. This is because
some of the tables are created in InnoDB and some tables are created in MyISAM.
We need to create all tables on InnoDB.  Fix is to add engine=innodb to the
CREATE TABLE statements.  

approved in IM by Marko and Vasil.
2014-10-20 15:43:28 +05:30
Kristian Nielsen
848d1166b6 Attempt to fix a failure in test case innodb.innodb_information_schema seen occasionally in Buildbot.
The test case waits for other threads to complete, but the wait is only 2
seconds. This is likely to sometimes be too little on our heavily loaded
buildbot VMs, that can easily stall for more than 2 seconds from time to time.

So let's try to increase the timeout (to about 40 seconds) and see if it
helps.
2014-10-29 15:10:02 +01:00
Kristian Nielsen
2fdb88e870 Fix a spurious test failure in rpl.rpl_show_slave_hosts
The test case runs SHOW SLAVE HOSTS. The output of this is only stable after
all slaves have had time to register with the master; this happens
asynchroneously.

The test was waiting for the slave with server_id=3 to appear in the output,
but it was missing a similar wait for server_id=2. Thus, if server_id=2 was
much slower to connect for some reason, it could be missing from the output,
causing the test to fail.
2014-10-29 14:44:40 +01:00
Kristian Nielsen
2b4445e60e Fix test failure in perfschema.myisam_file_io when perfschema is not compiled into the server. 2014-10-20 09:36:41 +02:00
Sergey Vojtovich
f09a8ba6a0 MDEV-6872 - innodb.innodb fails on PPC64
innodb_buffer_pool_pages_total depends on page size. On Power8 it is 65k
compared to 4k on Intel. As we round allocations on page size we may get
slightly more memory for buffer pool.
2014-10-15 12:11:34 +04:00
Rich Prohaska
ef5d3fd205 DB-739 add test cases 2014-10-13 11:01:39 -04:00
Nirbhay Choubey
068fb8569f bzr merge -rtag:mariadb-5.5.40 maria/5.5 2014-10-09 17:25:08 -04:00
Rich Prohaska
d589648edd DB-736 fix tokudb IS table errors 2014-10-08 08:39:40 -04:00
Sergei Golubchik
e5bc21af37 MDEV-4813 Replication fails on updating a MEMORY table with an index using btree
skip NULL VARCHAR key parts like it's done elsewhere
2014-10-07 10:54:14 +02:00
Sergei Golubchik
7989c62bc0 post-merge fixes 2014-10-07 10:53:06 +02:00
Sergei Golubchik
1ddfce4840 mysql-5.5.40 2014-10-06 19:53:55 +02:00
Sergei Golubchik
384999f3e8 MDEV-6528 review debian patches for mysql
and apply whatever was reasonable
2014-10-02 11:58:24 +02:00
Rich Prohaska
b30150a0e4 DB-724 run bf_create_select_hash_part on PS 5.6.21 2014-09-30 16:21:04 -04:00
Rich Prohaska
81f6ecc465 DB-724 speed up and simplify the bulk fetch tests 2014-09-27 14:57:16 -04:00
Rich Prohaska
460e7716de DB-397 remove table lock for tables with triggers in tokudb::start_stmt 2014-09-26 08:02:24 -04:00
Bill Qu
cdb8e6ed38 Bug #15868071 USING SET GLOBAL SQL_LOG_BIN SHOULD NOT BE ALLOWED
Normally, SET SESSION SQL_LOG_BIN is used by DBAs to run a
non-conflicting command locally only, ensuring it does not
get replicated.
Setting GLOBAL SQL_LOG_BIN would not require all sessions to
disconnect. When SQL_LOG_BIN is changed globally, it does not
immediately take effect for any sessions. It takes effect by
becoming the session-level default inherited at the start of
each new session, and this setting is kept and cached for the
duration of that session. Setting it intentionally is unlikely
to have a useful effect under any circumstance; setting it
unintentionally, such as while intending to use SET [SESSION]
is potentially disastrous. Accidentally using SET GLOBAL
SQL_LOG_BIN will not show an immediate effect to the user,
instead not having the desired session-level effect, and thus
causing other potential problems with local-only maintenance
being binlogged and executed on slaves; And transactions from
new sessions (after SQL_LOG_BIN is changed globally) are not
binlogged and replicated, which would result in irrecoverable
or difficult data loss.
This is the regular GLOBAL variables way to work, but in
replication context it does not look right on a working server
(with connected sessions) 'set global sql_log_bin' and none of
that connections is affected. Unexperienced DBA after noticing
that the command did "nothing" will change the session var and
most probably won't unset the global var, causing new sessions
to not be binlog.
Setting GLOBAL SQL_LOG_BIN allows DBA to stop binlogging on all
new sessions, which can be used to make a server "replication
read-only" without restarting the server. But this has such big
requirements, stop all existing connections, that it is more
likely to make a mess, it is too risky to allow the GLOBAL variable.

The statement 'SET GLOBAL SQL_LOG_BIN=N' will produce an error
in 5.5, 5.6 and 5.7. Reading the GLOBAL SQL_LOG_BIN will produce
a deprecation warning in 5.7.
2014-09-24 09:44:48 +08:00
Bill Qu
5693b1e4a4 Bug #15868071 USING SET GLOBAL SQL_LOG_BIN SHOULD NOT BE ALLOWED
Normally, SET SESSION SQL_LOG_BIN is used by DBAs to run a
non-conflicting command locally only, ensuring it does not
get replicated.
Setting GLOBAL SQL_LOG_BIN would not require all sessions to
disconnect. When SQL_LOG_BIN is changed globally, it does not
immediately take effect for any sessions. It takes effect by
becoming the session-level default inherited at the start of
each new session, and this setting is kept and cached for the
duration of that session. Setting it intentionally is unlikely
to have a useful effect under any circumstance; setting it
unintentionally, such as while intending to use SET [SESSION]
is potentially disastrous. Accidentally using SET GLOBAL
SQL_LOG_BIN will not show an immediate effect to the user,
instead not having the desired session-level effect, and thus
causing other potential problems with local-only maintenance
being binlogged and executed on slaves; And transactions from
new sessions (after SQL_LOG_BIN is changed globally) are not
binlogged and replicated, which would result in irrecoverable
or difficult data loss.
This is the regular GLOBAL variables way to work, but in
replication context it does not look right on a working server
(with connected sessions) 'set global sql_log_bin' and none of
that connections is affected. Unexperienced DBA after noticing
that the command did "nothing" will change the session var and
most probably won't unset the global var, causing new sessions
to not be binlog.
Setting GLOBAL SQL_LOG_BIN allows DBA to stop binlogging on all
new sessions, which can be used to make a server "replication
read-only" without restarting the server. But this has such big
requirements, stop all existing connections, that it is more
likely to make a mess, it is too risky to allow the GLOBAL variable.

The statement 'SET GLOBAL SQL_LOG_BIN=N' will produce an error
in 5.5, 5.6 and 5.7. Reading the GLOBAL SQL_LOG_BIN will produce
a deprecation warning in 5.7.
2014-09-24 09:44:48 +08:00
unknown
0e5fe8e412 Merge from mysql-5.5.40-release 2014-09-23 08:51:23 +02:00
murthy.narkedimilli@oracle.com
abb9945965 Merge from mysql-5.5.40-release 2014-09-23 08:51:23 +02:00
Annamalai Gurusami
b8c9d93bf3 Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED
FROM A FUNCTION

Scenario:

In a stored procedure, CREATE TABLE statement is not allowed.  But an
exception is provided for CREATE TEMPORARY TABLE.  We can create a temporary
table in a stored procedure.

Let there be two stored functions f1 and f2 and two stored procedures p1 and
p2.  Their properties are as follows:

. stored function f1() calls stored procedure p1().
. stored function f2() calls stored procedure p2().
. stored procedure p1() creates temporary table t1.
. stored procedure p2() does DML on t1.

Consider the following situation:

1.  Autocommit mode is on. 
2.  select f1()
3.  select f2()

Step 2:  In this step, t1 would be created via p1().  A table level transaction
lock would have been taken.  The ::external_lock() would not have been called
on this table.  At the end of step 2, because of autocommit mode on, this table
level lock will be released.

Step 3:  When we execute DML on table t1 via p2() we have two problems:

Problem 1:

The function ha_innobase::external_lock() would have been called but since
it is a select query no table level locks would have been taken.  Hence the
following assert will fail:

ut_ad(lock_table_has(thr_get_trx(thr), index->table, LOCK_IX));

Solution:

The solution would be to identify this situation and take a table level lock
and use the proper lock type prebuilt->select_lock_type = LOCK_X for DML
operations.

Problem 2:

Another problem is that in step 3, ha_innobase::open() is never called on
the table t1.  

Solution:

The solution would be to identify this situation and call re-init the handler
of table t1.

rb#6429 approved by Krunal.
2014-09-18 15:17:39 +05:30
Annamalai Gurusami
db78f29b31 Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED
FROM A FUNCTION

Scenario:

In a stored procedure, CREATE TABLE statement is not allowed.  But an
exception is provided for CREATE TEMPORARY TABLE.  We can create a temporary
table in a stored procedure.

Let there be two stored functions f1 and f2 and two stored procedures p1 and
p2.  Their properties are as follows:

. stored function f1() calls stored procedure p1().
. stored function f2() calls stored procedure p2().
. stored procedure p1() creates temporary table t1.
. stored procedure p2() does DML on t1.

Consider the following situation:

1.  Autocommit mode is on. 
2.  select f1()
3.  select f2()

Step 2:  In this step, t1 would be created via p1().  A table level transaction
lock would have been taken.  The ::external_lock() would not have been called
on this table.  At the end of step 2, because of autocommit mode on, this table
level lock will be released.

Step 3:  When we execute DML on table t1 via p2() we have two problems:

Problem 1:

The function ha_innobase::external_lock() would have been called but since
it is a select query no table level locks would have been taken.  Hence the
following assert will fail:

ut_ad(lock_table_has(thr_get_trx(thr), index->table, LOCK_IX));

Solution:

The solution would be to identify this situation and take a table level lock
and use the proper lock type prebuilt->select_lock_type = LOCK_X for DML
operations.

Problem 2:

Another problem is that in step 3, ha_innobase::open() is never called on
the table t1.  

Solution:

The solution would be to identify this situation and call re-init the handler
of table t1.

rb#6429 approved by Krunal.
2014-09-18 15:17:39 +05:30
Nirbhay Choubey
9a0566b09b MDEV-6447: Galera: Enable QC
* Added galera/query_cache test
* Merged patch for lp:1296403
2014-09-17 14:12:00 -04:00
Annamalai Gurusami
40f30ee6cc Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN INNODB_STRICT_MODE = 1
Problem:

Creation of a table fails when innodb_strict_mode is enabled, but the same
table is created without any warning when innodb_strict_mode is enabled.

Solution:

If creation of a table fails with an error when innodb_strict_mode is
enabled, it must issue a warning when innodb_strict_mode is disabled.

rb#6723 approved by Krunal.
2014-09-17 10:42:31 +05:30
Annamalai Gurusami
44fd241a22 Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN INNODB_STRICT_MODE = 1
Problem:

Creation of a table fails when innodb_strict_mode is enabled, but the same
table is created without any warning when innodb_strict_mode is enabled.

Solution:

If creation of a table fails with an error when innodb_strict_mode is
enabled, it must issue a warning when innodb_strict_mode is disabled.

rb#6723 approved by Krunal.
2014-09-17 10:42:31 +05:30
Rich Prohaska
52030b5971 DB-720 run the cluster key partition test on mariadb 2014-09-15 14:08:50 -04:00
Rich Prohaska
8978487477 DB-714 read free replication 2014-09-15 07:47:43 -04:00
Rich Prohaska
3c64729c89 DB-720 test case for clustering keys on partitioned tokudb tables 2014-09-15 07:27:18 -04:00
Rich Prohaska
7b061ff6a3 DB-504 redo bulk fetch select tests in partitioned tables 2014-09-13 16:06:55 -04:00
Nirbhay Choubey
be055b3835 Minor improvements in mtr and wsrep test files. 2014-09-09 19:05:25 -04:00
Nirbhay Choubey
e5267cae8a MDEV-6717 : wsrep_data_home_dir should default to @@datadir
Used mysql_real_data_home as wsrep_data_home_dir's default.
Added a test case.
2014-09-09 13:41:22 -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
Murthy Narkedimilli
3139aa87b4 Adding patch for security bug 19471516 2014-09-08 11:33:55 +02:00
Murthy Narkedimilli
a2375bdbe0 Adding patch for security bug 19471516 2014-09-08 11:33:55 +02:00
Rich Prohaska
f1dc0a9671 DB-310 run tokudb_support_xa.test on mysql and mariadb 5.5 2014-09-05 09:49:27 -04:00
BohuTANG
856dd95b71 DB-310 add tokudb_support_xa variable
this variable scope is Global, Session
type is boolean and default value is TRUE
2014-09-05 13:17:54 +08:00
Jan Lindström
9e63cc0780 MDEV-6651: MariaDB galera cluster crashes in file row0mysql.cc line 684
DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516'
where table ports have foreign keys.

Verified that current 5.5-galera is not affected and added test case
to regression set.
2014-09-03 18:51:02 +03:00
Rich Prohaska
613b729ae9 DB-718 test case for broken error handling in tokudb_fractal_tree_info info schema plugin 2014-09-03 08:13:49 -04:00
Jan Lindström
454037b794 MDEV-6682 innodb.innodb_simulate_comp_failures_small is too slow
if it's run on a real disk
  
  Made test smaller.
2014-09-03 07:37:13 +03:00
Rich Prohaska
9b4e15d50c DB-712 fix tokudb locks info schema test results due to new schema 2014-08-28 15:11:55 -04:00
Rich Prohaska
4f45481eb2 DB-713 separate some long running tokudb tests so that valgrind runs without --big-test can exclude them 2014-08-27 18:00:19 -04:00
Nirbhay Choubey
bc59e4c17f Switched wsrep_causal_reads ON for galera test suite. 2014-08-26 16:14:46 -04:00
Annamalai Gurusami
2f8bd757cd Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD FOREIGN KEY
Problem:

We maintain two rb trees in each dict_table_t.  The foreign_rbt must be in
sync with foreign_list.  The referenced_rbt must be in sync with
referenced_list. There is one function which checks this consistency and it
failed, resulting in an assert failure.

The root cause of the problem was identified that the search order was 
lost in the referenced_rbt.  This is because while renaming the table,
we didn't not refresh this referenced_rbt.

Solution:

When a foreign key is renamed, we must delete and re-insert into both
foreign_rbt and referenced_rbt.  

rb#6412 approved by Jimmy.
2014-08-25 16:25:07 +02:00
Annamalai Gurusami
f97dfa81a5 Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD FOREIGN KEY
Problem:

We maintain two rb trees in each dict_table_t.  The foreign_rbt must be in
sync with foreign_list.  The referenced_rbt must be in sync with
referenced_list. There is one function which checks this consistency and it
failed, resulting in an assert failure.

The root cause of the problem was identified that the search order was 
lost in the referenced_rbt.  This is because while renaming the table,
we didn't not refresh this referenced_rbt.

Solution:

When a foreign key is renamed, we must delete and re-insert into both
foreign_rbt and referenced_rbt.  

rb#6412 approved by Jimmy.
2014-08-25 16:25:07 +02:00
Rich Prohaska
f90c40ef73 DB-504 test replace select triggers for bulk fetch 2014-08-18 15:58:49 -04:00
Rich Prohaska
c92be4c8b5 DB-504 move bulk fetch tests 2014-08-18 15:57:12 -04:00
Rich Prohaska
945ffb2f10 DB-504 test insert select with various triggers to make sure that bulk fetch will work 2014-08-18 14:45:39 -04:00
Rich Prohaska
56126798a8 DB-500 allow simple deletes to use bulk fetch 2014-08-18 13:38:51 -04:00
Nirbhay Choubey
dc0f1864ae Fix for binlog tests. 2014-08-15 18:41:36 -04:00
Nirbhay Choubey
a2d5a54374 Added a basic test for wsrep_sync_wait system variable.
Also made some coding style related changes.
2014-08-13 10:39:01 -04:00
Kristian Nielsen
f2cbca793c Change a couple of permissions that cause lintian warnings in .deb packaging and don't really hurt to fix. 2014-08-13 15:46:39 +02:00
Jan Lindström
9dc738bf5f MDEV-6546: innodb.innodb_simulate_comp_failures_small fails
sporadically

Fix: Modify test to be smaller so that testcase timeout does not
trigger. We already have a test for --big-test setup
(innodb.innodb_simulate_comp_failures).
2014-08-13 09:37:12 +03:00
joel9001
c2f39e80e0 #268 Adding bulk fetch MTR test and result files 2014-08-12 16:03:34 -04:00
Nirbhay Choubey
e1facda416 Fix for some failing tests. 2014-08-11 17:09:59 -04:00
Rich Prohaska
89d33f7e49 Tokutek/mariadb-5.5#71 run part_index_scan on mariadb 2014-08-11 16:46:06 -04: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
50e192a04f Bug#17638477 UNINSTALL AND INSTALL SEMI-SYNC PLUGIN CAUSES SLAVES TO BREAK
Fix the bug properly (plugin cannot be unloaded as long as it's locked).
Enable and fix the test case.
Significantly reduce number of LOCK_plugin locks for semisync
(practically all locks were removed)
2014-08-03 12:45:14 +02:00
Sergei Golubchik
1c6ad62a26 mysql-5.5.39 merge
~40% bugfixed(*) applied
~40$ bugfixed reverted (incorrect or we're not buggy)
~20% bugfixed applied, despite us being not buggy
(*) only changes in the server code, e.g. not cmakefiles
2014-08-02 21:26:16 +02:00
Sergei Golubchik
4b4de01fae 5.3 merge 2014-08-01 16:51:12 +02:00
Jan Lindström
d8a9bb4585 Add missing results file. 2014-08-01 14:33:49 +03:00
Michael Widenius
5364315229 Fix for MDEV-6493: Assertion `table->file->stats.records > 0 || error' failure, or 'Invalid write' valgrind warnings, or crash on scenario with Aria table, view, LOCK TABLES
This bug only happens in case of paritioned tables used in LOCK TABLES and implicit_commit() was called
(as part of trying to execute a CREATE TABLE withing lock tables)

The problem was that Aria could not move the tables from one transaction to the new one, as thd->open_tables contained
a partitioned tables and not an Aria table.

Fix:
- Store a list of all open tables that are part of a share in share->open_tables
- In maria::implict_commit() use transaction->used_tables & share->open_tables to find out which tables
  was part of the current transaction instead of using thd->open_tables, which may contain partitioned tables.


mysql-test/suite/maria/maria_partition.result:
  Added test case
mysql-test/suite/maria/maria_partition.test:
  Added test case
storage/maria/ha_maria.cc:
  Use trn->used tables and share->open_tables to find out which tables was part of the current transaction instead of using thd->open_tables.
storage/maria/ma_close.c:
  Remove closed table from share->open_list
storage/maria/ma_open.c:
  Add table to share->open_list
storage/maria/ma_state.c:
  Added comment
storage/maria/maria_def.h:
  Added share->open_list, a list of all tables that is using this share.
2014-07-30 13:27:52 +03:00
Elena Stepanova
0aa40c35ca MDEV-6378 mtr engines iuds time tests fail
- adjusted a test result according to the change made for MDEV-6100;
- added explicit timezone for engines/iuds, since MTR in
  MariaDB does not set it like MySQL's, and tests with constant TIMESTAMP
  can have different outcome
2014-07-28 13:31:46 +04:00
Rich Prohaska
0cfbaccf64 #261 run multiple queries in part_index_scan 2014-07-23 13:50:34 -04:00
Sergei Golubchik
4e6e720160 MDEV-6290 Crash in KILL HARD QUERY USER x@y when slave threads are running
KILL USER should ignore system threads where sctx->user=sctx->host=NULL
2014-07-23 19:36:15 +02:00
Rich Prohaska
b196bddb59 #267 fix mdev5932 test and result 2014-07-23 10:00:13 -04:00
Sergei Golubchik
1907bf042a MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_view
fix by Sriram Patil
2014-07-23 12:01:05 +02:00
Rich Prohaska
db8a35c03d #261 Tokutek/mariadb-5.5#69 run part_index_scan test on mariadb 2014-07-22 11:03:08 -04:00
Nirbhay Choubey
79750be187 MDEV-6377 : Test cases for wsrep system variables. 2014-07-22 09:41:10 -04:00
Rich Prohaska
5f034b7a50 #261 auto detect index scans to fix perf problem with partitions 2014-07-18 06:39:07 -04:00
Nirbhay Choubey
3ce3647055 MDEV#6399 - Make galera test suite run with --parallel
Galera tests used default base/SST ports which led to
failures due to port conflicts when run in parallel.
Fixed by setting them to ones generated by mtr framework.
2014-07-12 18:20:45 -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
Rich Prohaska
3f916598ef #259 add TOKUDB_CACHETABLE_SIZE_CLONED variable 2014-07-08 09:08:45 -04:00
Luis Soares
5111df0814 BUG#13874553: rpl.rpl_stop_slave fails sporadically on pb2
The test case makes use of the fine DEBUG_SYNC facility. Furthermore,
since it needs synchronization on internal threads (dump and SQL
threads) the server code has DEBUG_SYNC commands internally deployed
and activated through the DBUG_EXECUTE_IF macro. The internal
DBUG_SYNC commands are then controlled from the test case through the
DEBUG variable.

There were three problems around the DEBUG + DEBUG_SYNC facility
usage:

1. When signaling the SQL thread to continue, the test would reset
   immediately the DEBUG_SYNC variable. This could mean that the SQL
   thread might loose the signal and continue to wait forever;

2. A similar scenario was happening with the dump thread on the
   master. This thread was instructed to wait, and later it would be
   signaled to continue, but immediately after the DEBUG_SYNC would be
   reset. This could lead to the dump thread missing the signal and
   wait forever;

3. The test was not cleaning itself up with respect to the
   instrumentation of the dump thread. This would leave the
   conditional execution of an internal DEBUG_SYNC command active
   (through the usage of DBUG_EXECUTE_IF). 

We fix #1 and #2 by waiting for the threads to receive the signal and
only then issue the reset. We fix #3 by reseting the DEBUG variable,
thus deactivating the dump thread internal DEBUG_SYNC command.
2014-06-26 12:54:27 +01:00
Luis Soares
18fa87d41a BUG#13874553: rpl.rpl_stop_slave fails sporadically on pb2
The test case makes use of the fine DEBUG_SYNC facility. Furthermore,
since it needs synchronization on internal threads (dump and SQL
threads) the server code has DEBUG_SYNC commands internally deployed
and activated through the DBUG_EXECUTE_IF macro. The internal
DBUG_SYNC commands are then controlled from the test case through the
DEBUG variable.

There were three problems around the DEBUG + DEBUG_SYNC facility
usage:

1. When signaling the SQL thread to continue, the test would reset
   immediately the DEBUG_SYNC variable. This could mean that the SQL
   thread might loose the signal and continue to wait forever;

2. A similar scenario was happening with the dump thread on the
   master. This thread was instructed to wait, and later it would be
   signaled to continue, but immediately after the DEBUG_SYNC would be
   reset. This could lead to the dump thread missing the signal and
   wait forever;

3. The test was not cleaning itself up with respect to the
   instrumentation of the dump thread. This would leave the
   conditional execution of an internal DEBUG_SYNC command active
   (through the usage of DBUG_EXECUTE_IF). 

We fix #1 and #2 by waiting for the threads to receive the signal and
only then issue the reset. We fix #3 by reseting the DEBUG variable,
thus deactivating the dump thread internal DEBUG_SYNC command.
2014-06-26 12:54:27 +01:00
Terje Rosten
410b1dd86d Bug#16395459 TEST AND RESULT FILES WITH EXECUTE BIT
Bug#16415173 CRLF INSTEAD OF LF IN SQL-BENCH SCRIPTS
      
Correct perms and converts from Windows style to UNIX style line endings on some files.
Fix perms on installed ini files.

(MySQL 5.5 version)
2014-06-25 12:35:50 +02:00
Terje Rosten
5c4937c101 Bug#16395459 TEST AND RESULT FILES WITH EXECUTE BIT
Bug#16415173 CRLF INSTEAD OF LF IN SQL-BENCH SCRIPTS
      
Correct perms and converts from Windows style to UNIX style line endings on some files.
Fix perms on installed ini files.

(MySQL 5.5 version)
2014-06-25 12:35:50 +02:00
Rich Prohaska
f34592091a #254 fix i_s_tokudb_lock_waits result files 2014-06-21 06:16:44 -04:00
Jon Olav Hauglid
879fec69fc WL#7436: Deprecate and remove timed_mutexes system variable
This is the 5.5/5.6 version of the patch.

Add deprecation warning for timed_mutexes.
2014-06-19 16:47:41 +02:00
Jon Olav Hauglid
1f1c0faffd WL#7436: Deprecate and remove timed_mutexes system variable
This is the 5.5/5.6 version of the patch.

Add deprecation warning for timed_mutexes.
2014-06-19 16:47:41 +02:00
Namit Sharma
63bc784aaa Bug#18949527 SUITE/BINLOG/T/BINLOG_KILLED.TEST FORGETS TO
DISCONNECT CON1 AND CON2
  
Problem:
The test suite/binlog/t/binlog_killed.test makes the connections
con1 and con2 but forgets to disconnect them + wait till that
operation is finished at test end.
This mistake has the potential to harm subsequent tests in
case these tests depend on the content of the processlist.
 
Solution:
Added disconnect + wait_until_disconnected.inc 
within the test cleanup.
2014-06-18 12:22:09 +05:30
Namit Sharma
6907449d42 Bug#18949527 SUITE/BINLOG/T/BINLOG_KILLED.TEST FORGETS TO
DISCONNECT CON1 AND CON2
  
Problem:
The test suite/binlog/t/binlog_killed.test makes the connections
con1 and con2 but forgets to disconnect them + wait till that
operation is finished at test end.
This mistake has the potential to harm subsequent tests in
case these tests depend on the content of the processlist.
 
Solution:
Added disconnect + wait_until_disconnected.inc 
within the test cleanup.
2014-06-18 12:22:09 +05:30
Jan Lindström
970163d0be MDEV-6348: mariadb crash signal 11
Analysis: sync array output function, should make sure that all 
used pointers are valid before using them.
2014-07-08 17:21:13 +03:00
unknown
081926f3d8 MDEV-6188: master_retry_count (ignored if disconnect happens on SET master_heartbeat_period)
That particular part of slave connect to master was missing code to handle
retry in case of network errors. The same problem is present in MySQL 5.5, but
fixed in MySQL 5.6.

Fixed with this patch, by adding the code (mostly identical to MySQL 5.6), and
also adding a test case.

I checked other queries done towards master during slave connect, and they now
all seem to handle reconnect in case of network failures.
2014-06-17 14:10:13 +02:00
Nirbhay Choubey
93cc06b20c Fixed a warning in mtr script.
Updated wsrep.variables test.
2014-06-10 18:31:07 -04:00