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
8648b9be
Commit
8648b9be
authored
May 04, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.2 into 10.3
parents
7fb73ed1
1cccd3c7
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
17 deletions
+88
-17
mysql-test/suite/innodb/r/foreign_key.result
mysql-test/suite/innodb/r/foreign_key.result
+10
-0
mysql-test/suite/innodb/t/foreign_key.test
mysql-test/suite/innodb/t/foreign_key.test
+13
-0
mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
...pl/include/rpl_parallel_show_binlog_events_purge_logs.inc
+1
-0
storage/innobase/dict/dict0mem.cc
storage/innobase/dict/dict0mem.cc
+39
-7
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+18
-7
storage/innobase/include/trx0trx.h
storage/innobase/include/trx0trx.h
+1
-0
storage/innobase/trx/trx0roll.cc
storage/innobase/trx/trx0roll.cc
+3
-0
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+3
-3
No files found.
mysql-test/suite/innodb/r/foreign_key.result
View file @
8648b9be
...
...
@@ -279,6 +279,16 @@ ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES tx(x);
ALTER TABLE t1 DROP KEY idx;
ALTER TABLE t1 CHANGE a c INT;
DROP TABLE t1;
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, KEY idx(f1)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FOREIGN KEY (f2) REFERENCES t1 (f1);
ALTER TABLE t1 ADD COLUMN f INT;
SET FOREIGN_KEY_CHECKS= OFF;
ALTER TABLE t1 DROP KEY idx;
ALTER TABLE t1 ADD KEY idx (f1);
SET FOREIGN_KEY_CHECKS= ON;
ALTER TABLE t1 DROP f3;
ALTER TABLE t1 CHANGE f f3 INT;
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=1;
# Start of 10.2 tests
#
...
...
mysql-test/suite/innodb/t/foreign_key.test
View file @
8648b9be
...
...
@@ -266,6 +266,19 @@ ALTER TABLE t1 DROP KEY idx;
ALTER
TABLE
t1
CHANGE
a
c
INT
;
# Cleanup
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
INT
,
f2
INT
,
f3
INT
,
KEY
idx
(
f1
))
ENGINE
=
InnoDB
;
ALTER
TABLE
t1
ADD
FOREIGN
KEY
(
f2
)
REFERENCES
t1
(
f1
);
ALTER
TABLE
t1
ADD
COLUMN
f
INT
;
SET
FOREIGN_KEY_CHECKS
=
OFF
;
ALTER
TABLE
t1
DROP
KEY
idx
;
ALTER
TABLE
t1
ADD
KEY
idx
(
f1
);
SET
FOREIGN_KEY_CHECKS
=
ON
;
ALTER
TABLE
t1
DROP
f3
;
ALTER
TABLE
t1
CHANGE
f
f3
INT
;
# Cleanup
DROP
TABLE
t1
;
SET
FOREIGN_KEY_CHECKS
=
1
;
--
echo
# Start of 10.2 tests
...
...
mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
View file @
8648b9be
...
...
@@ -15,6 +15,7 @@
# that with the fix local variable linfo is valid along all
# mysql_show_binlog_events function scope.
#
--
source
include
/
have_debug
.
inc
--
source
include
/
have_debug_sync
.
inc
--
source
include
/
master
-
slave
.
inc
...
...
storage/innobase/dict/dict0mem.cc
View file @
8648b9be
...
...
@@ -592,17 +592,15 @@ dict_mem_table_col_rename_low(
}
}
dict_index_t
*
new_index
=
dict_foreign_find_index
(
/* New index can be null if InnoDB already dropped
the foreign index when FOREIGN_KEY_CHECKS is
disabled */
foreign
->
foreign_index
=
dict_foreign_find_index
(
foreign
->
foreign_table
,
NULL
,
foreign
->
foreign_col_names
,
foreign
->
n_fields
,
NULL
,
true
,
false
,
NULL
,
NULL
,
NULL
);
/* New index can be null if InnoDB already dropped
the foreign index when FOREIGN_KEY_CHECKS is
disabled */
foreign
->
foreign_index
=
new_index
;
}
else
{
for
(
unsigned
f
=
0
;
f
<
foreign
->
n_fields
;
f
++
)
{
...
...
@@ -624,7 +622,41 @@ dict_mem_table_col_rename_low(
foreign
=
*
it
;
ut_ad
(
foreign
->
referenced_index
!=
NULL
);
if
(
!
foreign
->
referenced_index
)
{
/* Referenced index could have been dropped
when foreign_key_checks is disabled. In that case,
rename the corresponding referenced_col_names and
find the equivalent referenced index also */
for
(
unsigned
f
=
0
;
f
<
foreign
->
n_fields
;
f
++
)
{
const
char
*&
rc
=
foreign
->
referenced_col_names
[
f
];
if
(
strcmp
(
rc
,
from
))
{
continue
;
}
if
(
to_len
<=
strlen
(
rc
))
{
memcpy
(
const_cast
<
char
*>
(
rc
),
to
,
to_len
+
1
);
}
else
{
rc
=
static_cast
<
char
*>
(
mem_heap_dup
(
foreign
->
heap
,
to
,
to_len
+
1
));
}
}
/* New index can be null if InnoDB already dropped
the referenced index when FOREIGN_KEY_CHECKS is
disabled */
foreign
->
referenced_index
=
dict_foreign_find_index
(
foreign
->
referenced_table
,
NULL
,
foreign
->
referenced_col_names
,
foreign
->
n_fields
,
NULL
,
true
,
false
,
NULL
,
NULL
,
NULL
);
return
;
}
for
(
unsigned
f
=
0
;
f
<
foreign
->
n_fields
;
f
++
)
{
/* foreign->referenced_col_names[] need to be
...
...
storage/innobase/handler/ha_innodb.cc
View file @
8648b9be
...
...
@@ -4364,26 +4364,34 @@ innobase_commit_low(
{
#ifdef WITH_WSREP
const
char
*
tmp
=
0
;
if
(
trx
->
is_wsrep
())
{
const
bool
is_wsrep
=
trx
->
is_wsrep
();
THD
*
thd
=
trx
->
mysql_thd
;
if
(
is_wsrep
)
{
#ifdef WSREP_PROC_INFO
char
info
[
64
];
info
[
sizeof
(
info
)
-
1
]
=
'\0'
;
snprintf
(
info
,
sizeof
(
info
)
-
1
,
"innobase_commit_low():trx_commit_for_mysql(%lld)"
,
(
long
long
)
wsrep_thd_trx_seqno
(
t
rx
->
mysql_t
hd
));
tmp
=
thd_proc_info
(
t
rx
->
mysql_t
hd
,
info
);
(
long
long
)
wsrep_thd_trx_seqno
(
thd
));
tmp
=
thd_proc_info
(
thd
,
info
);
#else
tmp
=
thd_proc_info
(
t
rx
->
mysql_t
hd
,
"innobase_commit_low()"
);
tmp
=
thd_proc_info
(
thd
,
"innobase_commit_low()"
);
#endif
/* WSREP_PROC_INFO */
}
#endif
/* WITH_WSREP */
if
(
trx_is_started
(
trx
))
{
trx_commit_for_mysql
(
trx
);
}
}
else
{
trx
->
will_lock
=
0
;
#ifdef WITH_WSREP
if
(
trx
->
is_wsrep
())
{
thd_proc_info
(
trx
->
mysql_thd
,
tmp
);
}
trx
->
wsrep
=
false
;
#endif
/* WITH_WSREP */
}
#ifdef WITH_WSREP
if
(
is_wsrep
)
{
thd_proc_info
(
thd
,
tmp
);
}
#endif
/* WITH_WSREP */
}
...
...
@@ -4730,6 +4738,9 @@ innobase_rollback_trx(
if
(
!
trx
->
has_logged
())
{
trx
->
will_lock
=
0
;
#ifdef WITH_WSREP
trx
->
wsrep
=
false
;
#endif
DBUG_RETURN
(
0
);
}
...
...
storage/innobase/include/trx0trx.h
View file @
8648b9be
...
...
@@ -454,6 +454,7 @@ Check transaction state */
ut_ad(!(t)->id); \
ut_ad(!(t)->has_logged()); \
ut_ad(!(t)->is_referenced()); \
ut_ad(!(t)->is_wsrep()); \
ut_ad(!(t)->read_view.is_open()); \
ut_ad((t)->lock.wait_thr == NULL); \
ut_ad(UT_LIST_GET_LEN((t)->lock.trx_locks) == 0); \
...
...
storage/innobase/trx/trx0roll.cc
View file @
8648b9be
...
...
@@ -227,6 +227,9 @@ dberr_t trx_rollback_for_mysql(trx_t* trx)
case
TRX_STATE_NOT_STARTED
:
trx
->
will_lock
=
0
;
ut_ad
(
trx
->
mysql_thd
);
#ifdef WITH_WSREP
trx
->
wsrep
=
false
;
#endif
return
(
DB_SUCCESS
);
case
TRX_STATE_ACTIVE
:
...
...
storage/innobase/trx/trx0trx.cc
View file @
8648b9be
...
...
@@ -109,9 +109,6 @@ trx_init(
trx
->
state
=
TRX_STATE_NOT_STARTED
;
trx
->
is_recovered
=
false
;
#ifdef WITH_WSREP
trx
->
wsrep
=
false
;
#endif
/* WITH_WSREP */
trx
->
op_info
=
""
;
...
...
@@ -1484,6 +1481,9 @@ trx_commit_in_memory(
DBUG_LOG
(
"trx"
,
"Commit in memory: "
<<
trx
);
trx
->
state
=
TRX_STATE_NOT_STARTED
;
#ifdef WITH_WSREP
trx
->
wsrep
=
false
;
#endif
assert_trx_is_free
(
trx
);
...
...
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