Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e374755b
Commit
e374755b
authored
Mar 12, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
69abd437
32de60bb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
24 deletions
+48
-24
mysql-test/suite/innodb/r/foreign-keys.result
mysql-test/suite/innodb/r/foreign-keys.result
+13
-0
mysql-test/suite/innodb/t/foreign-keys.test
mysql-test/suite/innodb/t/foreign-keys.test
+15
-0
sql/sql_table.cc
sql/sql_table.cc
+8
-12
storage/innobase/row/row0ftsort.cc
storage/innobase/row/row0ftsort.cc
+6
-6
storage/xtradb/row/row0ftsort.cc
storage/xtradb/row/row0ftsort.cc
+6
-6
No files found.
mysql-test/suite/innodb/r/foreign-keys.result
View file @
e374755b
...
@@ -87,6 +87,19 @@ drop table t3;
...
@@ -87,6 +87,19 @@ drop table t3;
drop table t2;
drop table t2;
drop table t1;
drop table t1;
set debug_sync='reset';
set debug_sync='reset';
#
# MDEV-17595 - Server crashes in copy_data_between_tables or
# Assertion `thd->transaction.stmt.is_empty() ||
# (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)'
# fails in close_tables_for_reopen upon concurrent
# ALTER TABLE and FLUSH
#
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1),(2);
CREATE TABLE t2 (b INT, KEY(b)) ENGINE=InnoDB;
INSERT INTO t2 VALUES(2);
ALTER TABLE t2 ADD FOREIGN KEY(b) REFERENCES t1(a), LOCK=EXCLUSIVE;
DROP TABLE t2, t1;
create table t1 (a int primary key, b int) engine=innodb;
create table t1 (a int primary key, b int) engine=innodb;
create table t2 (c int primary key, d int,
create table t2 (c int primary key, d int,
foreign key (d) references t1 (a) on update cascade) engine=innodb;
foreign key (d) references t1 (a) on update cascade) engine=innodb;
...
...
mysql-test/suite/innodb/t/foreign-keys.test
View file @
e374755b
...
@@ -112,6 +112,21 @@ drop table t2;
...
@@ -112,6 +112,21 @@ drop table t2;
drop
table
t1
;
drop
table
t1
;
set
debug_sync
=
'reset'
;
set
debug_sync
=
'reset'
;
--
echo
#
--
echo
# MDEV-17595 - Server crashes in copy_data_between_tables or
--
echo
# Assertion `thd->transaction.stmt.is_empty() ||
--
echo
# (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)'
--
echo
# fails in close_tables_for_reopen upon concurrent
--
echo
# ALTER TABLE and FLUSH
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
KEY
(
a
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
TABLE
t2
(
b
INT
,
KEY
(
b
))
ENGINE
=
InnoDB
;
INSERT
INTO
t2
VALUES
(
2
);
ALTER
TABLE
t2
ADD
FOREIGN
KEY
(
b
)
REFERENCES
t1
(
a
),
LOCK
=
EXCLUSIVE
;
DROP
TABLE
t2
,
t1
;
#
#
# FK and prelocking:
# FK and prelocking:
# child table accesses (reads and writes) wait for locks.
# child table accesses (reads and writes) wait for locks.
...
...
sql/sql_table.cc
View file @
e374755b
...
@@ -9547,6 +9547,8 @@ do_continue:;
...
@@ -9547,6 +9547,8 @@ do_continue:;
new_table
->
file
->
get_foreign_key_list
(
thd
,
&
fk_list
);
new_table
->
file
->
get_foreign_key_list
(
thd
,
&
fk_list
);
while
((
fk
=
fk_list_it
++
))
while
((
fk
=
fk_list_it
++
))
{
{
MDL_request
mdl_request
;
if
(
lower_case_table_names
)
if
(
lower_case_table_names
)
{
{
char
buf
[
NAME_LEN
];
char
buf
[
NAME_LEN
];
...
@@ -9558,20 +9560,14 @@ do_continue:;
...
@@ -9558,20 +9560,14 @@ do_continue:;
len
=
my_casedn_str
(
files_charset_info
,
buf
);
len
=
my_casedn_str
(
files_charset_info
,
buf
);
thd
->
make_lex_string
(
fk
->
referenced_table
,
buf
,
len
);
thd
->
make_lex_string
(
fk
->
referenced_table
,
buf
,
len
);
}
}
if
(
table_already_fk_prelocked
(
table_list
,
fk
->
referenced_db
,
fk
->
referenced_table
,
TL_READ_NO_INSERT
))
continue
;
TABLE_LIST
*
tl
=
(
TABLE_LIST
*
)
thd
->
alloc
(
sizeof
(
TABLE_LIST
));
mdl_request
.
init
(
MDL_key
::
TABLE
,
tl
->
init_one_table_for_prelocking
(
fk
->
referenced_db
->
str
,
fk
->
referenced_db
->
length
,
fk
->
referenced_db
->
str
,
fk
->
referenced_table
->
str
,
fk
->
referenced_table
->
str
,
fk
->
referenced_table
->
length
,
MDL_SHARED_NO_WRITE
,
MDL_TRANSACTION
);
NULL
,
TL_READ_NO_INSERT
,
false
,
NULL
,
0
,
if
(
thd
->
mdl_context
.
acquire_lock
(
&
mdl_request
,
&
thd
->
lex
->
query_tables_last
);
thd
->
variables
.
lock_wait_timeout
))
goto
err_new_table_cleanup
;
}
}
if
(
open_tables
(
thd
,
&
table_list
->
next_global
,
&
tables_opened
,
0
,
&
alter_prelocking_strategy
))
goto
err_new_table_cleanup
;
}
}
}
}
...
...
storage/innobase/row/row0ftsort.cc
View file @
e374755b
...
@@ -98,8 +98,8 @@ row_merge_create_fts_sort_index(
...
@@ -98,8 +98,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
0
);
field
=
dict_index_get_nth_field
(
new_index
,
0
);
field
->
name
=
NULL
;
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
prefix_len
=
0
;
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
field
->
col
=
static_cast
<
dict_col_t
*>
(
dict_col_t
(
);
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
->
prtype
=
idx_field
->
col
->
prtype
|
DATA_NOT_NULL
;
field
->
col
->
prtype
=
idx_field
->
col
->
prtype
|
DATA_NOT_NULL
;
field
->
col
->
mtype
=
charset
==
&
my_charset_latin1
field
->
col
->
mtype
=
charset
==
&
my_charset_latin1
?
DATA_VARCHAR
:
DATA_VARMYSQL
;
?
DATA_VARCHAR
:
DATA_VARMYSQL
;
...
@@ -113,8 +113,8 @@ row_merge_create_fts_sort_index(
...
@@ -113,8 +113,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
1
);
field
=
dict_index_get_nth_field
(
new_index
,
1
);
field
->
name
=
NULL
;
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
prefix_len
=
0
;
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
field
->
col
=
static_cast
<
dict_col_t
*>
(
dict_col_t
(
);
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
mtype
=
DATA_INT
;
*
opt_doc_id_size
=
FALSE
;
*
opt_doc_id_size
=
FALSE
;
...
@@ -152,8 +152,8 @@ row_merge_create_fts_sort_index(
...
@@ -152,8 +152,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
2
);
field
=
dict_index_get_nth_field
(
new_index
,
2
);
field
->
name
=
NULL
;
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
prefix_len
=
0
;
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
field
->
col
=
static_cast
<
dict_col_t
*>
(
dict_col_t
(
);
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
len
=
4
;
field
->
col
->
len
=
4
;
field
->
fixed_len
=
4
;
field
->
fixed_len
=
4
;
...
...
storage/xtradb/row/row0ftsort.cc
View file @
e374755b
...
@@ -101,8 +101,8 @@ row_merge_create_fts_sort_index(
...
@@ -101,8 +101,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
0
);
field
=
dict_index_get_nth_field
(
new_index
,
0
);
field
->
name
=
NULL
;
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
prefix_len
=
0
;
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
field
->
col
=
static_cast
<
dict_col_t
*>
(
dict_col_t
(
);
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
->
prtype
=
idx_field
->
col
->
prtype
|
DATA_NOT_NULL
;
field
->
col
->
prtype
=
idx_field
->
col
->
prtype
|
DATA_NOT_NULL
;
field
->
col
->
mtype
=
charset
==
&
my_charset_latin1
field
->
col
->
mtype
=
charset
==
&
my_charset_latin1
?
DATA_VARCHAR
:
DATA_VARMYSQL
;
?
DATA_VARCHAR
:
DATA_VARMYSQL
;
...
@@ -116,8 +116,8 @@ row_merge_create_fts_sort_index(
...
@@ -116,8 +116,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
1
);
field
=
dict_index_get_nth_field
(
new_index
,
1
);
field
->
name
=
NULL
;
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
prefix_len
=
0
;
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
field
->
col
=
static_cast
<
dict_col_t
*>
(
dict_col_t
(
);
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
mtype
=
DATA_INT
;
*
opt_doc_id_size
=
FALSE
;
*
opt_doc_id_size
=
FALSE
;
...
@@ -155,8 +155,8 @@ row_merge_create_fts_sort_index(
...
@@ -155,8 +155,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
2
);
field
=
dict_index_get_nth_field
(
new_index
,
2
);
field
->
name
=
NULL
;
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
prefix_len
=
0
;
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
field
->
col
=
static_cast
<
dict_col_t
*>
(
dict_col_t
(
);
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
len
=
4
;
field
->
col
->
len
=
4
;
field
->
fixed_len
=
4
;
field
->
fixed_len
=
4
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment