Commit graph

163973 commits

Author SHA1 Message Date
Kristian Nielsen
3ef0b9b235 Merge MDEV-6589 and MDEV-6403 into 10.0. 2015-03-04 13:36:54 +01:00
Kristian Nielsen
78c74dbe30 MDEV-6403: Temporary tables lost at STOP SLAVE in GTID mode if master has not rotated binlog since restart
The binlog contains specially marked format description events to mark
when a master restart happened (which could have caused temporary
tables to be silently dropped). Such events also cause slave to close
temporary tables.

However, there was a bug that if after this, slave re-connects to the
master in GTID mode, the master can send an old format description
event again. If temporary tables are closed when such event is seen
for the second time, it might drop temporary tables created after that
event, and cause replication failure.

With this patch, the restart flag of the format description event is
cleared by the master when it is sent to the slave in a subsequent
connection, to avoid the errorneous temp table close.
2015-03-04 13:36:29 +01:00
Kristian Nielsen
ad0d203f2e MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication
The problem occurs in parallel replication in GTID mode, when we are using
multiple replication domains. In this case, if the SQL thread stops, the
slave GTID position may refer to a different point in the relay log for each
domain.

The bug was that when the SQL thread was stopped and restarted (but the IO
thread was kept running), the SQL thread would resume applying the relay log
from the point of the most advanced replication domain, silently skipping all
earlier events within other domains. This caused replication corruption.

This patch solves the problem by storing, when the SQL thread stops with
multiple parallel replication domains active, the current GTID
position. Additionally, the current position in the relay logs is moved back
to a point known to be earlier than the current position of any replication
domain. Then when the SQL thread restarts from the earlier position, GTIDs
encountered are compared against the stored GTID position. Any GTID that was
already applied before the stop is skipped to avoid duplicate apply.

This patch should have no effect if multi-domain GTID parallel replication is
not used. Similarly, if both SQL and IO thread are stopped and restarted, the
patch has no effect, as in this case the existing relay logs are removed and
re-fetched from the master at the current global @@gtid_slave_pos.
2015-03-04 13:36:04 +01:00
Sergei Golubchik
e33b48ae8b Merge remote-tracking branch 'origin/10.0' into 10.0 2015-03-02 16:47:43 +01:00
Sergei Golubchik
c06c465a96 10.0-connect merge 2015-03-02 16:45:44 +01:00
Olivier Bertrand
b9a9b82f9e - Make json_udf test work on Windows
modified:
  storage/connect/mysql-test/connect/t/json_udf.inc
2015-03-02 00:35:56 +01:00
Olivier Bertrand
5f4909b31d - Making json_udf test working on linux
added:
  storage/connect/mysql-test/connect/t/json_udf.inc
modified:
  storage/connect/mysql-test/connect/r/json_udf.result
  storage/connect/mysql-test/connect/t/json_udf.test
2015-03-01 23:55:09 +01:00
Olivier Bertrand
34c89597ef - Remove a signed/unsigned warning.
modified:
  storage/connect/jsonudf.cpp
2015-03-01 19:29:56 +01:00
Olivier Bertrand
5c8862ee19 - Fix crash when Json_Value was called without arguments.
Correct memory calculation in Serialize.
  Correct some UDF's messages.
  Add and modify the json tests
removed:
  storage/connect/mysql-test/connect/std_data/biblio.jsn
  storage/connect/mysql-test/connect/std_data/expense.jsn
  storage/connect/mysql-test/connect/std_data/mulexp3.jsn
  storage/connect/mysql-test/connect/std_data/mulexp4.jsn
  storage/connect/mysql-test/connect/std_data/mulexp5.jsn
added:
  storage/connect/mysql-test/connect/r/json_udf.result
  storage/connect/mysql-test/connect/std_data/biblio.json
  storage/connect/mysql-test/connect/std_data/expense.json
  storage/connect/mysql-test/connect/std_data/mulexp3.json
  storage/connect/mysql-test/connect/std_data/mulexp4.json
  storage/connect/mysql-test/connect/std_data/mulexp5.json
  storage/connect/mysql-test/connect/t/json_udf.test
modified:
  storage/connect/json.cpp
  storage/connect/jsonudf.cpp
  storage/connect/mysql-test/connect/r/json.result
  storage/connect/mysql-test/connect/t/json.test
2015-03-01 19:20:40 +01:00
Olivier Bertrand
d862d7c049 - Implement random access to ODBC tables
modified:
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h

- Fix get proper length of ODBC DECIMAL column in discovery
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/odbc_oracle.result

- Implement random access to JSON tables
modified:
  storage/connect/tabjson.cpp
  storage/connect/tabjson.h

- Fix MDEV-7636
modified:
  storage/connect/tabutil.cpp
2015-02-28 23:01:55 +01:00
Kristian Nielsen
aa845d123c MDEV-6391: GTID binlog state not recovered if mariadb-bin.state is removed
When the server starts up, check if the master-bin.state file was lost.
If it was, recover its contents by scanning the last binlog file, thus
avoiding running with a corrupt binlog state.
2015-02-27 14:34:52 +01:00
Vicențiu Ciorbaru
ec4ff9a2e7 MDEV-7586: Merged derived tables/VIEWs increment created_tmp_tables
Temporary table count fix. The number of temporary tables was increased
when the table is not actually created. (when do_not_open was passed
as TRUE to create_tmp_table).
2015-02-26 23:09:54 +02:00
Sergei Golubchik
5c66abf0b0 Merge remote-tracking branch 'origin/10.0' into 10.0 2015-02-25 16:34:33 +01:00
Sergey Petrunya
4a3e94e025 MDEV-7413: optimizer_use_condition_selectivity > 2 crashes 10.0.15+maria-1~wheezy
Add a testcase. The bug itself was fixed by the fix for MDEV-7316.
2015-02-25 16:58:36 +03:00
Olivier Bertrand
aa107ef3ab - FIX assert failure when sorting JSON tables
modified:
  storage/connect/tabjson.cpp
  storage/connect/tabjson.h
2015-02-25 11:59:00 +01:00
Alexander Barkov
f825b5a4ee MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 2015-02-25 14:13:32 +04:00
Sergei Golubchik
cbf8cdc252 MDEV-7530 !includedir reads files in random order 2015-02-25 09:43:31 +01:00
Olivier Bertrand
e027f5e8d5 - Fix MDEV-7616 by adding SQLCOM_SET_OPTION to the accepted command list.
modified:
  storage/connect/ha_connect.cc

- Add new JSON UDF functions and JSON functionalities.
modified:
  storage/connect/json.cpp
  storage/connect/json.h
  storage/connect/jsonudf.cpp
  storage/connect/tabjson.cpp
2015-02-24 23:18:04 +01:00
Sergei Golubchik
6c09a72af5 Merge remote-tracking branch 'origin/10.0' into 10.0 2015-02-24 20:52:37 +01:00
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
Sergei Golubchik
73033e5e1a fix mroonga to compile w/o performance schema 2015-02-24 15:54:59 +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
Sergei Golubchik
723be51678 Merge 2015-02-24 14:17:00 +01:00
Jan Lindström
8799f87075 MDEV-7623: Add lock wait time and hold time to every record/table lock in
InnoDB transaction lock printout.
2015-02-24 10:33:49 +02: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
Kristian Nielsen
41cfdc838e Add error handling on realpath() call.
(Without this, it happened for me that realpath() failed returning
undef for the default vardir. This in turn caused mysql-test-run.pl to
delete the source mysql-test/ directory.)

Backport from 10.1, it's not nice to get one's source directory nuked
by a rouge mysql-test-run.
2015-02-23 13:36:52 +01:00
Jan Lindström
90635c6fb5 MDEV-7620: Transaction lock wait is missing number of lock
waits and total wait time.
2015-02-23 11:24:19 +02:00
Sergei Golubchik
f2cb45daf3 Merge remote-tracking branch 'origin/10.0' into 10.0 2015-02-22 21:45:24 +01:00
Olivier Bertrand
a736e63f7c - Add new Json UDF's Json_Array_Add, Json_Array_Grp and Json_Object_Grp.
Handle longjmp's raised during json processing.
modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/json.cpp
  storage/connect/jsonudf.cpp

- Fix wrong references to the suppressed g->Trace variables.
modified:
  storage/connect/global.h
  storage/connect/plugutil.c
  storage/connect/tabjson.cpp
  storage/connect/tabodbc.cpp
2015-02-22 17:53:02 +01:00
Sergei Golubchik
3653de82e5 test failure on labrador: account for a different errno on Mac OS X 2015-02-22 12:54:52 +01:00
Sergei Golubchik
dc94bd09b8 MDEV-7520 gtid replication broken during upgrade to debian 10.0.16
Don't binlog mariadb setup sql statements:
* use "mysql_install_db --disable-log-bin"
* use "mysqld --bootstrap --disable-log-bin"
* use "SET sql_log_bin=0"
2015-02-22 12:54:52 +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
Nirbhay Choubey
2a798cef78 MDEV-7615: Remove --galera-sst-mode option from mysqldump
Removed 'galera-sst-mode' option from mysqldump as its no longer needed.
2015-02-20 17:45:18 -05:00
Jan Lindström
8366ce4760 Fix test failure on labrador. 2015-02-20 18:48:29 +02:00
Sergei Golubchik
7b6beef9e7 disable -Werror in MYSQL_MAINTAINER_MODE=ON until all plugins are ready
only activate it on MYSQL_MAINTAINER_MODE=ERRON
2015-02-20 14:21:27 +01:00
Sergei Golubchik
6a1d44339b fix after 5.5 merge, debian packaging
* oqgraph is in a separate package in 10.0
* sphinx udf is in the ha_sphinx.so
2015-02-20 14:10:25 +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 Golubchik
77e6e74a26 merge 10.0-spider 2015-02-19 22:05:33 +01: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
Kentoku SHIBA
cf3b51b1d5 Merge Spider 3.2.18 2015-02-20 00:41:26 +09: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
c1ebb4a60f compiler warnings in spider 2015-02-19 11:28:03 +01:00
Sergei Golubchik
16c01c7004 after merge: fix mroonga to compile and pass its tests 2015-02-19 10:26:52 +01:00
Sergei Golubchik
da637137ba merge 10.0-mroonga 2015-02-19 09:57:34 +01:00
Sergei Golubchik
56114a416f merge 10.0-connect 2015-02-19 09:37:11 +01:00
Olivier Bertrand
d9175f3822 - Remove GCC warnings
modified:
  storage/connect/jsonudf.cpp
  storage/connect/tabutil.h
2015-02-19 01:25:31 +01:00
Olivier Bertrand
564d41faf4 - Work on JSON and JSON UDF's
modified:
  storage/connect/json.cpp
  storage/connect/jsonudf.cpp
  storage/connect/tabjson.cpp

- CntReadNext: Enable EvalColumns for longjmp
modified:
  storage/connect/connect.cc
2015-02-19 00:59:02 +01:00
Sergei Golubchik
174bccd3ff xtradb 5.6.22-72.0 2015-02-18 20:31:40 +01:00