Skip to content

Commit c567369

Browse files
committed
Merge 10.2 into bb-10.2-ext
2 parents 3cad31f + f01ce62 commit c567369

File tree

21 files changed

+176
-48
lines changed

21 files changed

+176
-48
lines changed

mysql-test/r/dyncol.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,6 +1883,16 @@ SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json;
18831883
json
18841884
{"test":"First line\u000ASecond line"}
18851885
#
1886+
# MDEV-15230: column_json breaks cyrillic in 10.1.31
1887+
#
1888+
set names utf8;
1889+
create table t1 (b blob);
1890+
insert into t1 values (column_create('description',column_create('title','Описание')));
1891+
select column_json(b) from t1;
1892+
column_json(b)
1893+
{"description":{"title":"Описание"}}
1894+
drop table t1;
1895+
#
18861896
# end of 10.0 tests
18871897
#
18881898
#

mysql-test/suite/innodb/r/mvcc.result

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
SET @save_per_table= @@GLOBAL.innodb_file_per_table;
2+
SET GLOBAL innodb_file_per_table= 1;
3+
#
4+
# MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE
5+
#
6+
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
7+
INSERT INTO t1 VALUES(0);
8+
FLUSH TABLES t1 WITH READ LOCK;
9+
UNLOCK TABLES;
10+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
11+
connect con1,localhost,root,,;
12+
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
13+
connection default;
14+
SELECT * FROM t1;
15+
ERROR HY000: Table definition has changed, please retry transaction
16+
COMMIT;
17+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
18+
connection con1;
19+
ALTER TABLE t1 DISCARD TABLESPACE;
20+
ALTER TABLE t1 IMPORT TABLESPACE;
21+
disconnect con1;
22+
connection default;
23+
# FIXME: Block this with ER_TABLE_DEF_CHANGED
24+
SELECT * FROM t1;
25+
a
26+
COMMIT;
27+
SELECT * FROM t1;
28+
a
29+
0
30+
DROP TABLE t1;
31+
SET GLOBAL innodb_file_per_table= @save_per_table;

mysql-test/suite/innodb/r/recovery_shutdown.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ INSERT INTO t1(a) SELECT NULL FROM t1;
6161
connection default;
6262
SET GLOBAL innodb_flush_log_at_trx_commit=1;
6363
CREATE TABLE u(a SERIAL) ENGINE=INNODB;
64+
FLUSH TABLES;
6465
DROP TABLE t,u;

mysql-test/suite/innodb/t/mvcc.test

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--source include/have_innodb.inc
2+
3+
SET @save_per_table= @@GLOBAL.innodb_file_per_table;
4+
SET GLOBAL innodb_file_per_table= 1;
5+
6+
let MYSQLD_DATADIR =`SELECT @@datadir`;
7+
8+
--echo #
9+
--echo # MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE
10+
--echo #
11+
12+
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
13+
INSERT INTO t1 VALUES(0);
14+
FLUSH TABLES t1 WITH READ LOCK;
15+
perl;
16+
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
17+
ib_backup_tablespace("test", "t1");
18+
EOF
19+
UNLOCK TABLES;
20+
21+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
22+
23+
connect (con1,localhost,root,,);
24+
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
25+
26+
connection default;
27+
--error ER_TABLE_DEF_CHANGED
28+
SELECT * FROM t1;
29+
COMMIT;
30+
START TRANSACTION WITH CONSISTENT SNAPSHOT;
31+
32+
connection con1;
33+
34+
ALTER TABLE t1 DISCARD TABLESPACE;
35+
36+
perl;
37+
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
38+
ib_restore_tablespace("test", "t1");
39+
EOF
40+
41+
ALTER TABLE t1 IMPORT TABLESPACE;
42+
disconnect con1;
43+
44+
connection default;
45+
--echo # FIXME: Block this with ER_TABLE_DEF_CHANGED
46+
SELECT * FROM t1;
47+
COMMIT;
48+
SELECT * FROM t1;
49+
50+
DROP TABLE t1;
51+
52+
SET GLOBAL innodb_file_per_table= @save_per_table;

mysql-test/suite/innodb/t/recovery_shutdown.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ INSERT INTO t1(a) SELECT NULL FROM t1;
4141
SET GLOBAL innodb_flush_log_at_trx_commit=1;
4242
CREATE TABLE u(a SERIAL) ENGINE=INNODB;
4343

44+
FLUSH TABLES;
45+
4446
--let $shutdown_timeout=0
4547
--source include/restart_mysqld.inc
4648
--let $shutdown_timeout=60

mysql-test/t/dyncol.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,15 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL));
928928
SELECT COLUMN_JSON(COLUMN_CREATE('test','"\\\t\n\Z')) AS json;
929929
SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json;
930930

931+
--echo #
932+
--echo # MDEV-15230: column_json breaks cyrillic in 10.1.31
933+
--echo #
934+
set names utf8;
935+
create table t1 (b blob);
936+
insert into t1 values (column_create('description',column_create('title','Описание')));
937+
select column_json(b) from t1;
938+
drop table t1;
939+
931940
--echo #
932941
--echo # end of 10.0 tests
933942
--echo #

mysql-test/unstable-tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ main.innodb_mysql_lock : MDEV-7861 - Wrong result
5858
main.join_outer : Modified in 10.2.12
5959
main.kill-2 : MDEV-13257 - Wrong result
6060
main.log_slow : MDEV-13263 - Wrong result
61+
main.mdev-504 : MDEV-15171 - warning
6162
main.mysql_client_test_nonblock : CONC-208 - Error on Power
6263
main.mysql_upgrade_noengine : MDEV-14355 - Wrong result
6364
main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error

mysys/ma_dyncol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@ my_bool dynstr_append_json_quoted(DYNAMIC_STRING *str,
38333833
for (i= 0; i < len; i++)
38343834
{
38353835
register char c= append[i];
3836-
if (unlikely(c <= 0x1F))
3836+
if (unlikely(((uchar)c) <= 0x1F))
38373837
{
38383838
if (lim < 5)
38393839
{

storage/innobase/btr/btr0cur.cc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ btr_cur_ins_lock_and_undo(
28112811
}
28122812

28132813
if (flags & BTR_NO_UNDO_LOG_FLAG) {
2814-
roll_ptr = 0;
2814+
roll_ptr = roll_ptr_t(1) << ROLL_PTR_INSERT_FLAG_POS;
28152815
} else {
28162816
err = trx_undo_report_row_operation(thr, index, entry,
28172817
NULL, 0, NULL, NULL,
@@ -3016,7 +3016,7 @@ btr_cur_optimistic_insert(
30163016

30173017
DBUG_LOG("ib_cur",
30183018
"insert " << index->name << " (" << index->id << ") by "
3019-
<< ib::hex(thr ? trx_get_id_for_print(thr_get_trx(thr)) : 0)
3019+
<< ib::hex(thr ? thr->graph->trx->id : 0)
30203020
<< ' ' << rec_printer(entry).str());
30213021
DBUG_EXECUTE_IF("do_page_reorganize",
30223022
btr_page_reorganize(page_cursor, index, mtr););
@@ -3033,6 +3033,29 @@ btr_cur_optimistic_insert(
30333033
goto fail_err;
30343034
}
30353035

3036+
#ifdef UNIV_DEBUG
3037+
if (!(flags & BTR_CREATE_FLAG)
3038+
&& index->is_primary() && page_is_leaf(page)) {
3039+
const dfield_t* trx_id = dtuple_get_nth_field(
3040+
entry, dict_col_get_clust_pos(
3041+
dict_table_get_sys_col(index->table,
3042+
DATA_TRX_ID),
3043+
index));
3044+
3045+
ut_ad(trx_id->len == DATA_TRX_ID_LEN);
3046+
ut_ad(trx_id[1].len == DATA_ROLL_PTR_LEN);
3047+
ut_ad(*static_cast<const byte*>
3048+
(trx_id[1].data) & 0x80);
3049+
if (!(flags & BTR_NO_UNDO_LOG_FLAG)) {
3050+
ut_ad(thr->graph->trx->id);
3051+
ut_ad(thr->graph->trx->id
3052+
== trx_read_trx_id(
3053+
static_cast<const byte*>(
3054+
trx_id->data)));
3055+
}
3056+
}
3057+
#endif
3058+
30363059
*rec = page_cur_tuple_insert(
30373060
page_cursor, entry, index, offsets, heap,
30383061
n_ext, mtr);

storage/innobase/include/dict0mem.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,13 @@ struct dict_index_t{
993993
and the .ibd file is missing, or a
994994
page cannot be read or decrypted */
995995
inline bool is_readable() const;
996+
997+
/** @return whether the index is the primary key index
998+
(not the clustered index of the change buffer) */
999+
bool is_primary() const
1000+
{
1001+
return DICT_CLUSTERED == (type & (DICT_CLUSTERED | DICT_IBUF));
1002+
}
9961003
};
9971004

9981005
/** The status of online index creation */

0 commit comments

Comments
 (0)