Commit graph

170714 commits

Author SHA1 Message Date
Kristian Nielsen
83c7b1e95b Merge MDEV-8725 into 10.0 2015-09-02 10:40:34 +02:00
Kristian Nielsen
09bfaf3a13 Fix a potential lost wakeup for binlog_commit_wait_usec
If a transaction T1 needs to wait for a transaction T2, T2's commit will
skip the normal binlog_commit_wait_usec delay, in order not to needlessly
stall throughput.

This works by checking if T2 is already ready to commit. If so, it is woken
up. If not, we set a flag in T2 so that when it gets ready to commit, it
will do so immediately.

But there was a potential race due to insufficient locking, if T2 gets ready
to commit just at the point where T1 does the check. If the race hits, the
wakeup (and early commit) of T2 might be lost.

The race is only theoretical (from code inspection, no known test case), but
seems best to fix it anyway, by properly locking LOCK_prepare_ordered around
the check.
2015-09-02 10:08:09 +02:00
Kristian Nielsen
999c43aeb7 MDEV-8725: Assertion `!(thd->rgi_slave && thd-> rgi_slave->did_mark_start_commit)' failed in ha_rollback_trans
The assertion is there to catch cases where we rollback while
mark_start_commit() is active. This can allow following event groups
to be replicated too early, causing conflicts.

But in this case, we have an _explicit_ ROLLBACK event in the binlog,
which should not assert.

We fix this by delaying the mark_start_commit() in the explicit
ROLLBACK case. It seems safest to delay this in ROLLBACK case anyway,
and there should be no reason to try to optimise this corner case.
2015-09-02 09:57:18 +02:00
Oleksandr Byelkin
4b41e3c7f3 MDEV-6219: Server crashes in Bitmap<64u>::merge (this=0x180, map2=...) on 2nd execution of PS with INSERT .. SELECT, derived_merge
Problem: Not all permanent Item_direct_view_ref was in permanent list of used items of the view.

Solution: Detect creating permenent view/derived table reference and put them in the permanent list at once.
2015-08-31 18:40:24 +02:00
Elena Stepanova
b66455f67d Increase the version number 2015-08-24 01:41:12 +03:00
Elena Stepanova
aef8bfdc82 MDEV-8670 main.mdev-504 fails on Windows (in buildbot and outside)
Test failed because it hit net_write_timeout. It might happen in
different circumstances, and that's not what the testcase tests,
so the timeout is now set to a bigger value.
2015-08-24 01:37:21 +03:00
Sergei Petrunia
9b475ee3c1 MDEV-8289: Semijoin inflates number of rows in query result
- Make semi-join optimizer not to choose LooseScan
  when 1) the index is not covered and 2) full index
  scan will be required.

- Make sure that the code in make_join_select() that may change
  full index scan into a range scan is not invoked when the table
  uses full scan.
2015-08-18 22:54:42 +03:00
Monty
1bfe4da1e9 Fixed mysqltest run failure:
Test did not clean up after itself properly
2015-08-13 01:28:15 +03:00
Monty
afa9cb7519 Fixed overrun in key cache if one tried to allocate a key cache
of more than 45G with a key_cache_block_size of 1024 or less.

The problem was that some of the arguments to my_multi_malloc() got to be
more than 4G.

Fix:
- Inntroduced my_multi_malloc_large() that can handle big regions.
- Changed MyISAM and Aria key caches to use my_multi_malloc_large().

I didn't change the default my_multi_malloc() as this would be a too big
patch and we don't allocate 4G blocks anywhere else.
2015-08-13 01:27:23 +03:00
Sergei Golubchik
0403790722 increase the VERSION 2015-08-05 20:07:46 +02:00
Sergei Golubchik
50ef006633 Merge branch '10.0' into bb-10.0-serg 2015-08-05 09:45:36 +02:00
Sergei Golubchik
928edb5a91 Merge branch '5.5' into 10.0
5.5 without InnoDB/XtraDB changes
2015-08-05 09:45:17 +02:00
Sergei Golubchik
1610c4285a Merge branch 'bb-10.0-jan' into 10.0
5.5 with our InnoDB changes
2015-08-05 00:02:46 +02:00
Sergei Golubchik
fa51f70dc6 correct the NULL-pointer test 2015-08-04 23:42:44 +02:00
Sergei Golubchik
006ffca56e after-merge fixes 2015-08-04 23:40:25 +02:00
Kristian Nielsen
d6d54584ee Merge fix of embedded server build. 2015-08-04 15:38:03 +02:00
Kristian Nielsen
5ca061e65f Fix embedded server build 2015-08-04 15:35:04 +02:00
Kristian Nielsen
e8e2ef470c Merge MDEV-8302 into 10.0 2015-08-04 11:53:14 +02:00
Kristian Nielsen
9b9c5e890c MDEV-8302: Duplicate key with parallel replication
This bug is essentially another variant of MDEV-7458.

If a transaction conflict caused a deadlock kill of T2 in record_gtid()
during commit, the code would do a rollback _before_ running
rgi->unmark_start_commit(). This creates a race where following transactions
could start too early (before T2 has completed its transaction retry). This
in turn could lead to replication failure, if there was a conflict that
caused eg. duplicate key error or similar.

The fix is to remove these rollbacks (in Query_log_event::do_apply_event()
and Xid_log_event::do_apply_event(). They seem out-of-place; code in
log_event.cc generally does not roll back on error, this is handled higher
up.

In addition, because of the extreme difficulty of reproducing bugs like
MDEV-7458 and MDEV-8302, this patch adds some extra precations to try to
detect (in debug builds) or prevent (in release builds) similar bugs.
ha_rollback_trans() will now call unmark_start_commit() if needed (and
assert in debug build when a caller does rollback without unmark first).

We also add an extra check for thd->killed() so that we avoid doing
mark_start_commit() if we already have a pending deadlock kill.

And we add a missing unmark_start_commit() call in the error case, found by
the above assertion.
2015-08-04 11:40:19 +02:00
Jan Lindström
d71b584069 Fix merge error. 2015-08-04 08:33:31 +03:00
Jan Lindström
9a5787db51 Merge commit '96badb16afcf' into 10.0
Conflicts:
	client/mysql_upgrade.c
	mysql-test/r/func_misc.result
	mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
	mysql-test/suite/innodb/r/innodb-fk.result
	mysql-test/t/subselect_sj_mat.test
	sql/item.cc
	sql/item_func.cc
	sql/log.cc
	sql/log_event.cc
	sql/rpl_utility.cc
	sql/slave.cc
	sql/sql_class.cc
	sql/sql_class.h
	sql/sql_select.cc
	storage/innobase/dict/dict0crea.c
	storage/innobase/dict/dict0dict.c
	storage/innobase/handler/ha_innodb.cc
	storage/xtradb/dict/dict0crea.c
	storage/xtradb/dict/dict0dict.c
	storage/xtradb/handler/ha_innodb.cc
	vio/viosslfactories.c
2015-08-03 23:09:43 +03:00
Sergei Petrunia
b74795b00c MDEV-7040: Crash in field_conv, memcpy_field_possible, part#2
The problem was with Materialized_cursor and temporary table it uses.
Temorary table's fields had Field::orig_table pointing to the tables
that were used in the query that produced data for the cursor.
When "FETCH INTO sp_var" statement is executed, those original tables
were already closed.  However, copying from Materialized_cursor's table
into SP variable may cause field_conv() to be invoked which calls
field->type() which may access field->orig_table (for certain field types).

Fixed by setting Materialized_cursor->table->field[i]->orig_table to point
to Materialized_cursor->table.  (this is how it is done for regular base
tables)
2015-08-03 21:02:27 +03:00
Sergei Petrunia
cb925491d4 Merge branch 'tmp' into 10.0 2015-08-03 20:47:43 +03:00
Sergei Petrunia
193faa57e5 MDEV-8554: Server crashes in base_list_iterator::next_fast ...
THD::>save_prep_leaf_list was set to true by multi-table update
statements with mergeable selects and never reset.

Make every statement reset it at start.
2015-08-03 20:46:00 +03:00
Sergei Petrunia
877de3af28 MDEV-8554: Server crashes in base_list_iterator::next_fast ...
THD::>save_prep_leaf_list was set to true by multi-table update
statements with mergeable selects and never reset.

Make every statement reset it at start.
2015-08-03 20:42:08 +03:00
Sergei Golubchik
0785b2d55d Merge 'https://github.com/Buggynours/MariaDB 10.0' into 10.0 2015-08-03 17:10:20 +02:00
Sergei Golubchik
58a73e70e2 remove generated CONNECT files 2015-08-03 16:48:19 +02:00
Sergei Golubchik
0a99293db3 Merge branch 'merge-perfschema-5.6' into 10.0
5.6.26
2015-08-03 16:34:59 +02:00
Sergei Golubchik
ab7b672983 Merge branch 'merge-innodb-5.6' into 10.0
5.6.26
2015-08-03 16:23:58 +02:00
Sergei Golubchik
4f479fb13f Merge branch 'merge-xtradb-5.6' into 10.0
XtraDB 5.6.25-73.1
2015-08-03 14:03:46 +02:00
Sergei Golubchik
167c540048 5.6.26 2015-08-03 13:05:40 +02:00
Sergei Golubchik
56544122c7 5.6.26 2015-08-03 13:03:47 +02:00
Sergei Golubchik
772c3f3702 .gitattributes: pcre/testdata/greppatN4 -text 2015-08-01 17:48:41 +02:00
Sergei Golubchik
a0107d9c1d MDEV-8296 MSVS 2013 & WiX 3.9
removed unused directory
2015-08-01 17:48:41 +02:00
Sergei Golubchik
9cb8cff312 MDEV-8296 MSVS 2013 & WiX 3.9
Support for VS2013 and WiX 3.9

(patch by Andrey Kuznetsov)
2015-08-01 17:48:41 +02:00
Sergei Golubchik
17a4a39c15 Merge branch 'merge-xtradb-5.5' into 5.5
5.5.44-37.3
2015-08-01 15:08:33 +02:00
Sergei Golubchik
0b3eb4559b 5.6.25-73.1 2015-08-01 15:04:20 +02:00
Sergei Golubchik
1b0c81c917 5.5.44-37.3 2015-08-01 15:02:14 +02:00
Sergei Golubchik
6300f2f274 Merge tag 'mysql-5.5.45' into 5.5 2015-08-01 14:56:18 +02:00
Sergei Golubchik
96badb16af MDEV-7821 Server crashes in Item_func_group_concat::fix_fields on 2nd execution of PS
Correct fix for this bug.

The problem was that Item_func_group_concat() was calling
setup_order(), passing args as the second argument,
ref_pointer_array. While ref_pointer_array should have free
space at the end, as setup_order() can append elements to it.

In this particular case args[] elements were overwritten when
setup_order() was pushing new elements into ref_pointer_array.
2015-07-31 22:09:46 +02:00
Sergei Golubchik
409709ec7e compilation error on windows 2015-07-31 20:33:10 +02:00
Sergei Golubchik
79deefc4d7 MDEV-8340 Add "mysqlbinlog --binlog-row-event-max-size" support for MariaDB 5.5
Cherry-pick from 10.0:

  commit 126523d190
  Author: Sergei Golubchik <serg@mariadb.org>
  Date:   Mon Feb 23 20:53:41 2015 +0100

  MDEV-6703 Add "mysqlbinlog --binlog-row-event-max-size" support
2015-07-31 17:17:33 +02:00
Sergei Golubchik
4d5772c578 MDEV-7810 Wrong result on execution of a query as a PS (both 1st and further executions)
Alternative fix that doesn't cause view.test crash in --ps:
Remember when Item_ref was fixed right in the constructor
and did not have a full Item_ref::fix_fields() call. Later
in PS/SP, after Item_ref::cleanup, we use this knowledge
to avoid doing full fix_fields() for items that were never
supposed to be fix_field'ed.

Simplify the test case.
2015-07-31 17:17:33 +02:00
Sergei Golubchik
2721d69f79 MDEV-8352 Increase Diffie-Helman modulus to 2048-bits 2015-07-31 17:17:33 +02:00
Sergey Vojtovich
bfe2689cf6 MDEV-8379 - SUSE mariadb patches
Let mysql_upgrade return zero exit status when installation is up to date.
2015-07-31 14:29:04 +04:00
Jan Lindström
360e597c3c Make sure name buffer has string end marker on correct place. 2015-07-31 12:07:23 +03:00
Sergey Vojtovich
1ad294e064 MDEV-7821 - Server crashes in Item_func_group_concat::fix_fields on 2nd
execution of PS

GROUP_CONCAT() with ORDER BY column position may crash server on PS reexecution.

The problem was that arguments array of GROUP_CONCAT() was adjusted to point to
temporary elements (resolved ORDER BY fields) during first execution.

This patch expands rev. 08763096cb to restore original arguments array as well.
2015-07-31 13:05:10 +04:00
Jan Lindström
fa765a4525 MDEV-6697: Improve foreign keys warnings/errors
There is several different ways to incorrectly define
foreign key constraint. In many cases earlier MariaDB
versions the error messages produced by these cases
are not very clear and helpful. This patch improves
the warning messages produced by foreign key parsing.
2015-07-31 08:59:13 +03:00
Jan Lindström
e05cd97b8a MDEV-8524: Improve error messaging when there is duplicate key or foreign key names
Added better error message that will be printed when foreign key
constraint name in create table is not unique in database.
2015-07-31 08:59:13 +03:00
Olivier Bertrand
8ab46a5129 Merge branch 'ob-10.0' into 10.0 2015-07-30 13:27:56 +02:00