Commit graph

63039 commits

Author SHA1 Message Date
Sergei Golubchik
126523d190 MDEV-6703 Add "mysqlbinlog --binlog-row-event-max-size" support
partially cherry-pick from mysql/5.6.
No test case (mysql/5.6 test case is useless, the correct
test case uses too much memory)

commit e061985813db54948f99892d89f7e076242473a5
Author:  <Dao-Gang.Qu@sun.com>
Date:   Tue Jun 1 15:02:22 2010 +0800

    Bug #49931          Incorrect type in read_log_event error
    Bug #49932          mysqlbinlog max_allowed_packet hard coded to 1GB
2015-02-24 15:55:00 +01:00
Kristian Nielsen
a227cf8046 MDEV-7335: Potential parallel slave deadlock with specific binlog corruption
If somehow the COMMIT or XID event in an event group was missing, the code in
parallel replication to handle this was not sufficient, leading to server
deadlock.
2015-02-24 14:39:15 +01:00
Kristian Nielsen
79e9ff44d1 MDEV-7458: Deadlock in parallel replication can allow following transaction to start replicating too early
In parallel replication, don't rollback inside ha_commit_trans() in case of
error.

The rollback will be done later, but the parallel replication code needs to
run unmark_start_commit() before the rollback to properly control the
sequencing of transactions.

I did not manage to come up with a reliable automatic test case for this, but
I tested it manually.
2015-02-23 13:37:34 +01:00
Sergei Golubchik
f2cb45daf3 Merge remote-tracking branch 'origin/10.0' into 10.0 2015-02-22 21:45:24 +01:00
Sergei Golubchik
0ba168020e MDEV-6769 DROP TRIGGER IF NOT EXIST binlogged on master but not on slave
don't return from DROP TRIGGER IF NOT EXISTS on the slave side
early when the trigger couldn't be read
2015-02-22 12:54:52 +01:00
Sergei Golubchik
b739103f12 MDEV-7591 master crashed when slave specfied a future position with semi-repl plugin
cherry-pick the upstream fix

commit d4ba10184cd7bde9c31c610e664ecd0c93605c46
Author: Sujatha Sivakumar <sujatha.sivakumar@oracle.com>
Date:   Wed Jul 2 11:34:11 2014 +0530

    Bug#17453826:ASSERTION ERROR WHEN SETTING FUTURE BINLOG
    FILE/POS WITH SEMISYNC

    Problem:
    ========
    When DMLs are in progress on the master stopping a slave and
    setting ahead binlog name/pos will cause an assert on the
    master.
    ...
2015-02-22 12:54:52 +01:00
Sergei Golubchik
22cf2f117a MDEV-7482 VIEW containing INTERVAL(...)
Item_func::print() prints itself as name + "(" + arguments + ")".
Normally that works, but Item_func_interval internally implements its
arguments as one single Item_row. Item_row prints itself as
"(" + values + ")". As a result, "INTERVAL(1,2)" was being printed
as "INTERVAL((1,2))". Fixed with a custom Item_func_interval::print().
2015-02-22 12:54:52 +01:00
Sergei Petrunia
775528ada3 MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT
Enable subquery materialization for non-SELECT queries with a SELECT part
2015-02-20 03:17:46 +03:00
Sergei Petrunia
0f8b194146 MDEV-6687: Assertion `0' failed in Protocol::end_statement on query
Redefine FT_KEYPART in a way that it does not conflict with Hash Join.
Hash join stores field->field_index in KEYUSE::keypart, so we must
use a value of FT_KEYPART that's greater than MAX_FIELDS.
2015-02-19 20:54:20 +03:00
Kristian Nielsen
004dd0aaa8 MDEV-7568: STOP SLAVE crashes the server
The order of initialisation during server startup was incorrect. The slave
threads were started before the parallel replication worker thread pool was
initialised, allowing a race where uninitialised data could be accessed.
2015-02-19 15:43:27 +01:00
Sergei Golubchik
d7e7862364 Merge branch '5.5' into 10.0 2015-02-18 15:16:27 +01:00
Sergei Golubchik
44cf4d6751 fix a case where automatic procedure grant was changing user's password
phase out make_password_from_salt() to be removed in 10.1
2015-02-17 18:07:56 +01: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
Sergei Golubchik
63108dc9d2 Fix the tree to work in git. Backport corresponing 10.1 changes. 2015-02-10 12:26:21 +01:00
unknown
c233d6e120 MDEV-7260: Crash in get_best_combination when executing multi-table UPDATE with nested views
Do not use merge_for_insert for commands which use SELECT because optimizer can't work with such tables.

Fixes which makes multi-delete working with normally merged views.
2015-02-11 01:26:50 +01:00
Alexey Botchkov
cfb7d5d78a MDEV-7516 Assertion `!cur_p->event' failed in Gcalc_scan_iterator::arrange_event(int, int).
When the distance in ST_BUFFER is too far negative the coordinates can run out of the operational
    area. We should just return an empty geometry in this case.
2015-02-10 16:16:31 +04:00
Igor Babaev
ffd2996e10 Merge 2015-02-05 21:46:04 -08:00
Igor Babaev
587c72088c Fixed bug mdev-7316.
The function table_cond_selectivity() should take into account that condition selectivity
for some fields can be set to 0.
2015-02-05 20:09:08 -08:00
Sergei Golubchik
1e227b8f2c clarify the comment and trivial cleanups 2015-01-29 12:12:29 +01:00
Sergei Golubchik
267fc6f2b7 Master_info_index assumed that file descriptor can never be 0 2015-01-24 09:37:58 +01:00
Michael Widenius
b83f692565 MDEV-6668: Server crashes in check_view_single_update on concurrent DDL/DML flow with views and triggers
Call mysql_derived_reinit() if we are reusing view.
This is needed as during a previous error condition the view may not have been reset

sql/sql_derived.cc:
  More DBUG_PRINT
  Always reset merged_for_insert (no reason to not do that)
sql/sql_derived.h:
  Added prototype
sql/sql_insert.cc:
  More DBUG_PRINT
  Added DBUG_ASSERT
sql/sql_view.cc:
  Call mysql_derived_reinit() if we are reusing view.
  This is needed as during a previous error condition the view may not have been reset
sql/table.cc:
  More DBUG_PRINT
2015-01-29 15:12:32 +02:00
Sergey Petrunya
fb71449b10 MDEV-5719: Wrong result with GROUP BY and LEFT OUTER JOIN
Merged revision 5224 from mysql-5.6 and added a test case.
..
revno: 5224
committer: Sergey Glukhov <sergey.glukhov@oracle.com>
branch nick: mysql-5.6
timestamp: Wed 2013-06-19 14:24:08 +0400
message:
    Bug#16620047 INCORRECT QUERY RESULT (AFTER SERVER UPGRADE)
2015-01-25 16:16:25 +01:00
Sergei Golubchik
d9c01e4b4a 5.5 merge 2015-01-21 12:03:02 +01:00
Sergei Golubchik
595cf636fd MDEV-7475 Wrong implementation of checking PLUGIN_VAR_SET condition
correct the check for PLUGIN_VAR_STR
2015-01-19 16:29:18 +01:00
Sergei Golubchik
919443f7a5 MDEV-5679 MariaDB holds stdin open after startup as mysqld 2015-01-19 16:11:48 +01:00
Sergei Golubchik
510ca9b697 MDEV-7402 'reset master' hangs, waits for signalled COND_xid_list
Using a boolean flag for 'there is a RESET MASTER in progress' doesn't
work very well for multiple concurrent RESET MASTER statements.
Changed to a counter.
2015-01-19 14:32:28 +01:00
Sergei Golubchik
73ebabd2ee MDEV-7299 Assertion `m_status == DA_ERROR || m_status == DA_OK' fails on concurrent execution of DDL, queries from I_S, and KILL QUERY
Fix MDL to report an error when a wait was killed, but preserve
the old documented behavior of GET_LOCK() where killing it is not an error.

Also remove race conditions in main.create_or_replace test
2015-01-19 14:19:14 +01:00
Sergei Golubchik
c75eec8e0d rename st_my_thread_var::opt_info -> st_my_thread_var::keycache_link 2015-01-19 14:19:05 +01:00
Sergei Golubchik
47c844f236 MDEV-7219 SQL_CALC_FOUND_ROWS yields wrong result
revert the code in filesort that conditionally updated 'found_rows',
rely on filesort_limit_arg instead.
2015-01-19 14:18:44 +01:00
Sergei Golubchik
ce0ed977d5 MDEV-7186 get_lock() crashes on Windows, main.sp_notembedded and main.trigger_notembedded fail in buildbot
user locks are not affected by lowed_case_table_names
2015-01-19 14:18:34 +01:00
Sergei Golubchik
56c323c10f MDEV-6728 KILL QUERY executed on an idle connection can interrupt the next query
reset KILL_QUERY when a new query execution is just about to be started
2015-01-19 14:07:41 +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
Alexander Barkov
c11a054a98 MDEV-7152 Wrong result set for WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'
- The code that tested if
     WHERE expr=value AND expr=const
  can be rewritten to:
     WHERE const=value AND expr=const
  was incomplete in case of STRING_RESULT.
- Moving the test into a new function, to reduce duplicate code.
2015-01-18 01:54:11 +04:00
Vicențiu Ciorbaru
09d54b37f5 MDEV-7362: ANALYZE TABLES crash with table-independent-statistics gathering
FULLTEXT indexes do not permit index first lookups. By calling:
ha_index_first() with a garbage parameter, random data gets overwritten
that causes the table->field array to be corrupted. Subsequently, when
the field array is accessed, a segfault occurs.

By not allowing index statistics for FULLTEXT indexes, the problem is
resolved.
2015-01-17 16:58:10 +00:00
Alexander Barkov
6e6750ad6c MDEV-7366 SELECT 'a' = BINARY 'A' returns 1 (utf8 charset, utf8_unicode_ci collation)
Fixing a wrong assymetric code in Arg_comparator::set_cmp_func().
It existed for a long time, but showed up in 10.0.14 after the fix
for "MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)".
2015-01-17 17:52:03 +04:00
Jan Lindström
6164157b3f MDEV-7254: Assigned expression is evaluated twice when updating
column TIMESTAMP NOT NULL
      
Analysis: Problem was that value->is_null() function is called
even when user had explicitly set the value for timestamp
field. Calling this function had the side effect that
expression was evaluated twice.
      
Fix: (by Sergei Golubchik) check instead value->null_value.
2015-01-16 12:00:07 +02: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
Sergei Golubchik
e53b41a9ec cleanup 2015-01-13 19:28:03 +01:00
Sergei Golubchik
7f9f3139d7 MDEV-7333 "'show table status like 'table_name'" on tokudb table lead to MariaDB crash
adjust enum values when reading them from frm
2015-01-13 19:27:28 +01: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
Kristian Nielsen
f27817c1d0 MDEV-7326: Server deadlock in connection with parallel replication
The bug occurs when a transaction does a retry after all transactions have
done mark_start_commit() in a batch of group commit from the master. In this
case, the retrying transaction can unmark_start_commit() after the following
batch has already started running and de-allocated the GCO. Then after retry,
the transaction will re-do mark_start_commit() on a de-allocated GCO, and also
wakeup of later GCOs can be lost.

This was seen "in the wild" by a user, even though it is not known exactly
what circumstances can lead to retry of one transaction after all transactions
in a group have reached the commit phase.

The lifetime around GCO was somewhat clunky anyway. With this patch, a GCO
lives until rpl_parallel_entry::last_committed_sub_id has reached the last
transaction in the GCO. This guarantees that the GCO will still be alive when
a transaction does mark_start_commit(). Also, we now loop over the list of
active GCOs for wakeup, to ensure we do not lose a wakeup even in the
problematic case.
2015-01-07 14:45:39 +01:00
Kristian Nielsen
00649525ee MDEV-7189: main.processlist fails sporadically in buildbot
The test case tried to trigger a DEBUG_SYNC point at the end of a SELECT
SLEEP(5) statement. It did this by using EXECUTE 2, intending to trigger first
at the end of SET DEBUG_SYNC, and second at the end of the SELECT SLEEP(5).

However, in --ps-protocol mode, this does not work, because the SELECT is
executed in two steps (Prepare followed by Execute). Thus, the DEBUG_SYNC got
triggered too early, during the Prepare stage rather than Execute, and the
test case could race and information_schema.processlist see the thread in the
wrong state.

This patch fixes by changing the way the DEBUG_SYNC point is triggered. Now we
add a DBUG injection inside the code for SLEEP(5). This ensures that the
DEBUG_SYNC point is not activated until the SLEEP(5) is running, ensuring
that the following wait for completion will be effective.
2015-01-06 16:32:41 +01: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
unknown
3818bbb0cb Adding mariadb-version on the view creation to view frm. (MDEV-6916 followup) 2014-12-21 19:23:28 +01:00
Sergei Golubchik
0f64a927a9 merge 2014-12-19 11:44:03 +01:00
Sergei Golubchik
a978bdda1e mysql-5.5.41 merge 2014-12-19 11:35:44 +01:00
Sergey Petrunya
13e1acc58f Merge 5.3 -> 5.5 2014-12-18 20:38:47 +03:00
Sergey Petrunya
b75090c7de MDEV-6830: Server crashes in best_access_path after a sequence of SELECTs ...
generate_derived_keys_for_table() did not work correctly in the case where
- it had a potential index on derived table
- however, TABLE::check_tmp_key() would disallow creation of this index 
  after looking at its future key parts (because of the key parts exceeding 
  max. index length)
- the code would leave a KEYUSE structure that refers to a non-existant index.
  Depending on further optimizer calculations, this could cause a crash.
2014-12-18 20:06:49 +03:00
Sergei Golubchik
724dbaabc0 MDEV-7150 Wrong auto increment values on INSERT .. ON DUPLICATE KEY UPDATE when the inserted columns include NULL in an auto-increment column
when restoring auto-inc value in INSERT ... ON DUPLICATE KEY UPDATE, take into account that
1. it may be changed in the UPDATE clause (old code did that)
2. it may be changed in the INSERT clause and then cause a dup key (old code missed that)
2014-12-18 00:13:16 +01:00