Skip to content

Commit

Permalink
MDEV-19342 Merge new release of InnoDB 5.7.26 to 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 26, 2019
2 parents 4e9f8c9 + f3a9f12 commit 1a5ba2a
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 7 deletions.
30 changes: 30 additions & 0 deletions mysql-test/suite/gcol/r/innodb_virtual_debug.result
Expand Up @@ -94,3 +94,33 @@ NULL
29
DROP TABLE t;
SET DEBUG_SYNC = 'RESET';
#
# Bug#28825718 - ASSERTION FAILURE: TRX0REC.CC:NNN:N_IDX > 0 WHILE DOING REPLACE/INSERT
#
CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT GENERATED ALWAYS AS(b+1) VIRTUAL) ENGINE=InnoDB;
INSERT INTO t1(a, b) VALUES(1, 1);
connect con1,localhost,root,,;
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL s1 WAIT_FOR s2';
SET lock_wait_timeout = 1;
ALTER TABLE t1 ADD UNIQUE INDEX(c, b);
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR s1';
SET DEBUG_SYNC = 'row_ins_sec_index_enter SIGNAL s2 WAIT_FOR s3';
INSERT INTO t1(a, b) VALUES(2, 2);
connection con1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC = 'now SIGNAL s3';
disconnect con1;
connection default;
SET DEBUG_SYNC = 'RESET';
ALTER TABLE t1 ADD KEY(b);
INSERT INTO t1(a, b) VALUES(3, 3);
SELECT * FROM t1;
a b c
1 1 2
2 2 3
3 3 4
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
34 changes: 33 additions & 1 deletion mysql-test/suite/gcol/t/innodb_virtual_debug.test
Expand Up @@ -60,7 +60,6 @@ SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR
--send ALTER TABLE t FORCE

connection con1;

SET DEBUG_SYNC = 'now WAIT_FOR start_create';
start transaction;
update t set a=1 where a = 0;
Expand Down Expand Up @@ -280,4 +279,37 @@ disconnect con1;
}
SET DEBUG_SYNC = 'RESET';


--echo #
--echo # Bug#28825718 - ASSERTION FAILURE: TRX0REC.CC:NNN:N_IDX > 0 WHILE DOING REPLACE/INSERT
--echo #

CREATE TABLE t1(a INT PRIMARY KEY, b INT, c INT GENERATED ALWAYS AS(b+1) VIRTUAL) ENGINE=InnoDB;

INSERT INTO t1(a, b) VALUES(1, 1);

connect (con1,localhost,root,,);
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL s1 WAIT_FOR s2';
SET lock_wait_timeout = 1;
--send ALTER TABLE t1 ADD UNIQUE INDEX(c, b)

connection default;
SET DEBUG_SYNC = 'now WAIT_FOR s1';
SET DEBUG_SYNC = 'row_ins_sec_index_enter SIGNAL s2 WAIT_FOR s3';
--send INSERT INTO t1(a, b) VALUES(2, 2)

connection con1;
--error ER_LOCK_WAIT_TIMEOUT
reap;
SET DEBUG_SYNC = 'now SIGNAL s3';
disconnect con1;
connection default;
reap;
SET DEBUG_SYNC = 'RESET';
ALTER TABLE t1 ADD KEY(b);
INSERT INTO t1(a, b) VALUES(3, 3);
SELECT * FROM t1;
CHECK TABLE t1;
DROP TABLE t1;

--source include/wait_until_count_sessions.inc
2 changes: 1 addition & 1 deletion mysql-test/suite/sys_vars/r/sysvars_innodb.result
Expand Up @@ -3074,7 +3074,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE 5.7.25
GLOBAL_VALUE 5.7.26
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/handler/ha_innodb.cc
@@ -1,6 +1,6 @@
/*****************************************************************************

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
Expand Down Expand Up @@ -10977,7 +10977,7 @@ innodb_base_col_setup_for_stored(
for (uint i= 0; i < field->table->s->fields; ++i) {
const Field* base_field = field->table->field[i];

if (!base_field->vcol_info
if (base_field->stored_in_db()
&& bitmap_is_set(&field->table->tmp_set, i)) {
ulint z;
for (z = 0; z < table->n_cols; z++) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/univ.i
Expand Up @@ -41,7 +41,7 @@ Created 1/20/1994 Heikki Tuuri

#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 7
#define INNODB_VERSION_BUGFIX 25
#define INNODB_VERSION_BUGFIX 26

/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
Expand Down
18 changes: 16 additions & 2 deletions storage/innobase/os/os0file.cc
Expand Up @@ -1962,10 +1962,24 @@ LinuxAIOHandler::collect()
will be done in the calling function. */
m_array->acquire();

slot->ret = events[i].res2;
/* events[i].res2 should always be ZERO */
ut_ad(events[i].res2 == 0);
slot->io_already_done = true;
slot->n_bytes = events[i].res;

/*Even though events[i].res is an unsigned number
in libaio, it is used to return a negative value
(negated errno value) to indicate error and a positive
value to indicate number of bytes read or written. */

if (events[i].res > slot->len) {
/* failure */
slot->n_bytes = 0;
slot->ret = events[i].res;
} else {
/* success */
slot->n_bytes = events[i].res;
slot->ret = 0;
}
m_array->release();
}

Expand Down

0 comments on commit 1a5ba2a

Please sign in to comment.