summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-09-14 15:23:34 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-09-14 15:23:34 +0300
commit171fbbb968ed52dc7e2bbd33a6f8f72bbc6f5e88 (patch)
tree33b96b94f1bd731f58b9d40a9f4675012dd5e438
parent30d225698fe83cdfdec01315980cbc36e47bbc64 (diff)
parentaba5c72be28cbd3028623070b7bf3d7d1e128be1 (diff)
downloadmariadb-git-171fbbb968ed52dc7e2bbd33a6f8f72bbc6f5e88.tar.gz
Merge 10.3 into 10.4
-rw-r--r--mysql-test/suite/galera/disabled.def1
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result2
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result20
-rw-r--r--mysql-test/suite/innodb/t/instant_alter.test3
-rwxr-xr-xscripts/galera_new_cluster.sh4
-rw-r--r--sql/field.cc4
-rw-r--r--sql/sql_base.cc4
-rw-r--r--storage/innobase/btr/btr0cur.cc1
-rw-r--r--storage/innobase/handler/handler0alter.cc27
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_blob_key.result9
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_blob_key.test15
11 files changed, 76 insertions, 14 deletions
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 28fc908c237..0bc4da39991 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -34,7 +34,6 @@ galera.MW-44 : MDEV-15809 Test failure on galera.MW-44
galera.galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
galera_kill_applier : race condition at the start of the test
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
-galera_concurrent_ctas : MDEV-15845 Test failure on galera.galera_concurrent_ctas
pxc-421: Lock timeout exceeded
galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure
galera_sst_xtrabackup-v2-options : Failed to read uuid:seqno and wsrep_gtid_domain_id from joiner script
diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result
index c2fdfc38dd5..e1528c6f74f 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result
@@ -11,6 +11,6 @@ connection node_3;
INSERT INTO t2 VALUES (1);
connection node_1;
COMMIT;
-ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index bb15b665d49..2f56d0eca4f 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -464,6 +464,12 @@ ALGORITHM=INSTANT;
SET foreign_key_checks=1;
ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t1 check status OK
DROP TABLE t2, t1;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
@@ -875,6 +881,12 @@ ALGORITHM=INSTANT;
SET foreign_key_checks=1;
ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t1 check status OK
DROP TABLE t2, t1;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
@@ -1286,11 +1298,17 @@ ALGORITHM=INSTANT;
SET foreign_key_checks=1;
ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t1 check status OK
DROP TABLE t2, t1;
disconnect analyze;
SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-45
+48
SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test
index 18c07bdac73..720e495e3a7 100644
--- a/mysql-test/suite/innodb/t/instant_alter.test
+++ b/mysql-test/suite/innodb/t/instant_alter.test
@@ -338,6 +338,9 @@ ALGORITHM=INSTANT;
SET foreign_key_checks=1;
ALTER TABLE t2 COMMENT 'domestic keys only', DROP FOREIGN KEY fk;
ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1;
+ALTER TABLE t1 ADD COLUMN big BLOB NOT NULL
+DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75);
+CHECK TABLE t2, t1;
DROP TABLE t2, t1;
dec $format;
diff --git a/scripts/galera_new_cluster.sh b/scripts/galera_new_cluster.sh
index 8bf2fa35cec..e4e2ac39b52 100755
--- a/scripts/galera_new_cluster.sh
+++ b/scripts/galera_new_cluster.sh
@@ -27,4 +27,8 @@ COMPILATION_COMMENT="@COMPILATION_COMMENT@"
systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
systemctl start ${1:-mariadb}
+extcode=$?
+
systemctl set-environment _WSREP_NEW_CLUSTER=''
+
+return $extcode
diff --git a/sql/field.cc b/sql/field.cc
index a8ee5696aaa..7f3498079ac 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -8380,7 +8380,9 @@ void Field_blob::sort_string(uchar *to,uint length)
Store length of blob last in blob to shorter blobs before longer blobs
*/
length-= packlength;
- store_bigendian(buf.length(), to + length, packlength);
+
+ uint key_length = MY_MIN(buf.length(), length);
+ store_bigendian(key_length, to + length, packlength);
}
#ifdef DBUG_ASSERT_EXISTS
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 7327484469a..b6ab2a0dbcc 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3815,6 +3815,10 @@ lock_table_names(THD *thd, const DDL_options_st &options,
mdl_requests.push_front(&global_request);
if (create_table)
+ #ifdef WITH_WSREP
+ if (thd->lex->sql_command != SQLCOM_CREATE_TABLE &&
+ thd->wsrep_exec_mode != REPL_RECV)
+ #endif
lock_wait_timeout= 0; // Don't wait for timeout
}
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index e6b9fc93658..8febcb76a3b 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -4764,6 +4764,7 @@ btr_cur_pessimistic_update(
know the size of the freed record. */
btr_page_reorganize(page_cursor, index, mtr);
rec = page_cursor->rec;
+ rec_offs_make_valid(rec, index, true, *offsets);
} else if (!dict_table_is_locking_disabled(index->table)) {
lock_rec_restore_from_page_infimum(
btr_cur_get_block(cursor), rec, block);
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index a7a3f81a22e..f0009b2e0df 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -4379,6 +4379,7 @@ innobase_add_instant_try(
que_thr_t* thr = pars_complete_graph_for_exec(
NULL, trx, ctx->heap, NULL);
+ dberr_t err;
if (rec_is_default_row(rec, index)) {
ut_ad(page_rec_is_user_rec(rec));
if (!page_has_next(block->frame)
@@ -4403,14 +4404,15 @@ innobase_add_instant_try(
ulint* offsets = NULL;
mem_heap_t* offsets_heap = NULL;
big_rec_t* big_rec;
- dberr_t error = btr_cur_pessimistic_update(
- BTR_NO_LOCKING_FLAG, btr_pcur_get_btr_cur(&pcur),
+ err = btr_cur_pessimistic_update(
+ BTR_NO_LOCKING_FLAG | BTR_KEEP_POS_FLAG,
+ btr_pcur_get_btr_cur(&pcur),
&offsets, &offsets_heap, ctx->heap,
&big_rec, update, UPD_NODE_NO_ORD_CHANGE,
thr, trx->id, &mtr);
if (big_rec) {
- if (error == DB_SUCCESS) {
- error = btr_store_big_rec_extern_fields(
+ if (err == DB_SUCCESS) {
+ err = btr_store_big_rec_extern_fields(
&pcur, offsets, big_rec, &mtr,
BTR_STORE_UPDATE);
}
@@ -4421,8 +4423,7 @@ innobase_add_instant_try(
mem_heap_free(offsets_heap);
}
btr_pcur_close(&pcur);
- mtr.commit();
- return error != DB_SUCCESS;
+ goto func_exit;
} else if (page_rec_is_supremum(rec)) {
empty_table:
/* The table is empty. */
@@ -4438,7 +4439,6 @@ empty_table:
mtr.commit();
mtr.start();
index->set_modified(mtr);
- dberr_t err;
if (page_t* root = btr_root_get(index, &mtr)) {
switch (fil_page_get_type(root)) {
case FIL_PAGE_TYPE_INSTANT:
@@ -4451,8 +4451,7 @@ empty_table:
break;
default:
DBUG_ASSERT(!"wrong page type");
- mtr.commit();
- return true;
+ goto func_exit;
}
mlog_write_ulint(root + FIL_PAGE_TYPE,
@@ -4469,8 +4468,16 @@ empty_table:
err = DB_CORRUPTION;
}
+func_exit:
mtr.commit();
- return err != DB_SUCCESS;
+
+ if (err != DB_SUCCESS) {
+ my_error_innodb(err, table->s->table_name.str,
+ user_table->flags);
+ return true;
+ }
+
+ return false;
}
/** Update INNODB SYS_COLUMNS on new virtual column's position
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_blob_key.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_blob_key.result
new file mode 100644
index 00000000000..6a18bcdeecc
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_blob_key.result
@@ -0,0 +1,9 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (b BLOB, i INT, KEY(b(8))) ENGINE=RocksDB;
+INSERT INTO t1 VALUES (REPEAT('a',9),1);
+UPDATE t1 SET i = 2;
+connection slave;
+connection master;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_blob_key.test b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_blob_key.test
new file mode 100644
index 00000000000..8c64ac979cb
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_blob_key.test
@@ -0,0 +1,15 @@
+--source include/have_rocksdb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+CREATE TABLE t1 (b BLOB, i INT, KEY(b(8))) ENGINE=RocksDB;
+INSERT INTO t1 VALUES (REPEAT('a',9),1);
+
+UPDATE t1 SET i = 2;
+
+--sync_slave_with_master
+
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc