Skip to content

Commit

Permalink
Merge 10.3 into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Sep 14, 2018
2 parents 30d2256 + aba5c72 commit 171fbbb
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 14 deletions.
1 change: 0 additions & 1 deletion mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
20 changes: 19 additions & 1 deletion mysql-test/suite/innodb/r/instant_alter.result
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
3 changes: 3 additions & 0 deletions mysql-test/suite/innodb/t/instant_alter.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions scripts/galera_new_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion sql/field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions sql/sql_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions storage/innobase/btr/btr0cur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
27 changes: 17 additions & 10 deletions storage/innobase/handler/handler0alter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
Expand All @@ -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. */
Expand All @@ -4438,7 +4439,6 @@ innobase_add_instant_try(
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:
Expand All @@ -4451,8 +4451,7 @@ innobase_add_instant_try(
break;
default:
DBUG_ASSERT(!"wrong page type");
mtr.commit();
return true;
goto func_exit;
}

mlog_write_ulint(root + FIL_PAGE_TYPE,
Expand All @@ -4469,8 +4468,16 @@ innobase_add_instant_try(
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
Expand Down
9 changes: 9 additions & 0 deletions storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_blob_key.result
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_blob_key.test
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 171fbbb

Please sign in to comment.