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
45eaed0c
Commit
45eaed0c
authored
Sep 19, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
4a246fec
90b292ce
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
45 additions
and
39 deletions
+45
-39
mysql-test/suite/innodb/include/alter_nocopy.inc
mysql-test/suite/innodb/include/alter_nocopy.inc
+3
-3
mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
+3
-3
mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
+3
-3
mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
+3
-3
mysql-test/suite/innodb/r/alter_algorithm.result
mysql-test/suite/innodb/r/alter_algorithm.result
+3
-3
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+12
-6
storage/innobase/include/row0mysql.h
storage/innobase/include/row0mysql.h
+1
-1
storage/innobase/include/trx0rec.h
storage/innobase/include/trx0rec.h
+3
-3
storage/innobase/row/row0purge.cc
storage/innobase/row/row0purge.cc
+5
-5
storage/innobase/row/row0uins.cc
storage/innobase/row/row0uins.cc
+4
-4
storage/innobase/row/row0undo.cc
storage/innobase/row/row0undo.cc
+1
-1
storage/innobase/trx/trx0rec.cc
storage/innobase/trx/trx0rec.cc
+3
-3
storage/innobase/trx/trx0roll.cc
storage/innobase/trx/trx0roll.cc
+1
-1
No files found.
mysql-test/suite/innodb/include/alter_nocopy.inc
View file @
45eaed0c
...
...
@@ -14,16 +14,16 @@ SELECT @@alter_algorithm;
--
enable_info
--
error
$error_code
--
eval
ALTER
TABLE
t1
ADD
INDEX
idx1
(
f4
)
--
eval
ALTER
TABLE
t1
ADD
INDEX
idx1
(
f4
)
,
page_compressed
=
1
--
error
$error_code
--
eval
ALTER
TABLE
t1
DROP
INDEX
idx
--
eval
ALTER
TABLE
t1
DROP
INDEX
idx
,
page_compression_level
=
5
--
error
$error_code
--
eval
ALTER
TABLE
t1
ADD
UNIQUE
INDEX
u1
(
f2
)
--
error
$error_code
--
eval
ALTER
TABLE
t1
DROP
INDEX
f4
--
eval
ALTER
TABLE
t1
DROP
INDEX
f4
,
page_compression_level
=
9
SET
foreign_key_checks
=
0
;
--
error
$error_code
...
...
mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
View file @
45eaed0c
...
...
@@ -70,12 +70,12 @@
@@alter_algorithm
-COPY
+INPLACE
ALTER TABLE t1 ADD INDEX idx1(f4);
ALTER TABLE t1 ADD INDEX idx1(f4)
, page_compressed=1
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 DROP INDEX idx;
ALTER TABLE t1 DROP INDEX idx
, page_compression_level=5
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
...
...
@@ -85,7 +85,7 @@
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 DROP INDEX f4;
ALTER TABLE t1 DROP INDEX f4
, page_compression_level=9
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
...
...
mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
View file @
45eaed0c
...
...
@@ -61,11 +61,11 @@
@@alter_algorithm
-COPY
+INSTANT
ALTER TABLE t1 ADD INDEX idx1(f4);
ALTER TABLE t1 ADD INDEX idx1(f4)
, page_compressed=1
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
ALTER TABLE t1 DROP INDEX idx;
ALTER TABLE t1 DROP INDEX idx
, page_compression_level=5
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
...
...
@@ -73,7 +73,7 @@
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
ALTER TABLE t1 DROP INDEX f4;
ALTER TABLE t1 DROP INDEX f4
, page_compression_level=9
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
...
...
mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
View file @
45eaed0c
...
...
@@ -61,12 +61,12 @@
@@alter_algorithm
-COPY
+NOCOPY
ALTER TABLE t1 ADD INDEX idx1(f4);
ALTER TABLE t1 ADD INDEX idx1(f4)
, page_compressed=1
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 DROP INDEX idx;
ALTER TABLE t1 DROP INDEX idx
, page_compression_level=5
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
...
...
@@ -76,7 +76,7 @@
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 DROP INDEX f4;
ALTER TABLE t1 DROP INDEX f4
, page_compression_level=9
;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
...
...
mysql-test/suite/innodb/r/alter_algorithm.result
View file @
45eaed0c
...
...
@@ -59,16 +59,16 @@ INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
SELECT @@alter_algorithm;
@@alter_algorithm
COPY
ALTER TABLE t1 ADD INDEX idx1(f4);
ALTER TABLE t1 ADD INDEX idx1(f4)
, page_compressed=1
;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 DROP INDEX idx;
ALTER TABLE t1 DROP INDEX idx
, page_compression_level=5
;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 ADD UNIQUE INDEX u1(f2);
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 DROP INDEX f4;
ALTER TABLE t1 DROP INDEX f4
, page_compression_level=9
;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
SET foreign_key_checks = 0;
...
...
storage/innobase/handler/handler0alter.cc
View file @
45eaed0c
...
...
@@ -110,20 +110,23 @@ static const alter_table_operations INNOBASE_FOREIGN_OPERATIONS
=
ALTER_DROP_FOREIGN_KEY
|
ALTER_ADD_FOREIGN_KEY
;
/** Operations that InnoDB cares about and can perform without creating data */
static
const
alter_table_operations
INNOBASE_ALTER_NOCREATE
=
ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX
|
ALTER_DROP_UNIQUE_INDEX
;
/** Operations that InnoDB cares about and can perform without rebuild */
static
const
alter_table_operations
INNOBASE_ALTER_NOREBUILD
=
INNOBASE_ONLINE_CREATE
|
ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX
|
ALTER_DROP_UNIQUE_INDEX
#ifdef MYSQL_RENAME_INDEX
|
ALTER_RENAME_INDEX
#endif
;
|
INNOBASE_ALTER_NOCREATE
;
/** Operations that can be performed instantly, without inplace_alter_table() */
static
const
alter_table_operations
INNOBASE_ALTER_INSTANT
=
ALTER_VIRTUAL_COLUMN_ORDER
|
ALTER_COLUMN_NAME
#ifdef MYSQL_RENAME_INDEX
|
ALTER_RENAME_INDEX
#endif
|
ALTER_ADD_VIRTUAL_COLUMN
|
INNOBASE_FOREIGN_OPERATIONS
|
ALTER_COLUMN_EQUAL_PACK_LENGTH
...
...
@@ -550,6 +553,7 @@ innobase_need_rebuild(
const
TABLE
*
table
)
{
if
((
ha_alter_info
->
handler_flags
&
~
(
INNOBASE_INPLACE_IGNORE
|
INNOBASE_ALTER_NOREBUILD
|
INNOBASE_ALTER_INSTANT
))
==
ALTER_OPTIONS
)
{
return
alter_options_need_rebuild
(
ha_alter_info
,
table
);
...
...
@@ -6836,6 +6840,7 @@ ha_innobase::prepare_inplace_alter_table(
if
(
!
(
ha_alter_info
->
handler_flags
&
INNOBASE_ALTER_DATA
)
||
((
ha_alter_info
->
handler_flags
&
~
(
INNOBASE_INPLACE_IGNORE
|
INNOBASE_ALTER_NOCREATE
|
INNOBASE_ALTER_INSTANT
))
==
ALTER_OPTIONS
&&
!
alter_options_need_rebuild
(
ha_alter_info
,
table
)))
{
...
...
@@ -7121,6 +7126,7 @@ ha_innobase::inplace_alter_table(
}
if
((
ha_alter_info
->
handler_flags
&
~
(
INNOBASE_INPLACE_IGNORE
|
INNOBASE_ALTER_NOCREATE
|
INNOBASE_ALTER_INSTANT
))
==
ALTER_OPTIONS
&&
!
alter_options_need_rebuild
(
ha_alter_info
,
table
))
{
...
...
storage/innobase/include/row0mysql.h
View file @
45eaed0c
...
...
@@ -688,7 +688,7 @@ struct row_prebuilt_t {
to the Innobase format from the MySQL
format */
const
byte
*
default_rec
;
/*!< the default values of all columns
(a "
metadata
") in MySQL format */
(a "
default row
") in MySQL format */
ulint
hint_need_to_fetch_extra_cols
;
/*!< normally this is set to 0; if this
is set to ROW_RETRIEVE_PRIMARY_KEY,
...
...
storage/innobase/include/trx0rec.h
View file @
45eaed0c
...
...
@@ -311,7 +311,7 @@ compilation info multiplied by 16 is ORed to this value in an undo log
record */
#define TRX_UNDO_RENAME_TABLE 9
/*!< RENAME TABLE */
#define TRX_UNDO_INSERT_
DEFAULT 10
/*!< insert a "default value"
#define TRX_UNDO_INSERT_
METADATA 10
/*!< insert a metadata
pseudo-record for instant ALTER */
#define TRX_UNDO_INSERT_REC 11
/* fresh insert into clustered index */
#define TRX_UNDO_UPD_EXIST_REC 12
/* update of a non-delete-marked
...
...
@@ -328,8 +328,8 @@ record */
storage fields: used by purge to
free the external storage */
/** The search tuple corresponding to TRX_UNDO_INSERT_
DEFAULT
*/
extern
const
dtuple_t
trx_undo_
default_rec
;
/** The search tuple corresponding to TRX_UNDO_INSERT_
METADATA
*/
extern
const
dtuple_t
trx_undo_
metadata
;
#include "trx0rec.ic"
...
...
storage/innobase/row/row0purge.cc
View file @
45eaed0c
...
...
@@ -1043,7 +1043,7 @@ row_purge_parse_undo_rec(
switch
(
type
)
{
case
TRX_UNDO_RENAME_TABLE
:
return
false
;
case
TRX_UNDO_INSERT_
DEFAULT
:
case
TRX_UNDO_INSERT_
METADATA
:
case
TRX_UNDO_INSERT_REC
:
break
;
default:
...
...
@@ -1080,7 +1080,7 @@ row_purge_parse_undo_rec(
}
switch
(
type
)
{
case
TRX_UNDO_INSERT_
DEFAULT
:
case
TRX_UNDO_INSERT_
METADATA
:
case
TRX_UNDO_INSERT_REC
:
break
;
default:
...
...
@@ -1118,8 +1118,8 @@ row_purge_parse_undo_rec(
return
(
false
);
}
if
(
type
==
TRX_UNDO_INSERT_
DEFAULT
)
{
node
->
ref
=
&
trx_undo_
default_rec
;
if
(
type
==
TRX_UNDO_INSERT_
METADATA
)
{
node
->
ref
=
&
trx_undo_
metadata
;
return
(
true
);
}
...
...
@@ -1186,7 +1186,7 @@ row_purge_record_func(
MONITOR_INC
(
MONITOR_N_DEL_ROW_PURGE
);
}
break
;
case
TRX_UNDO_INSERT_
DEFAULT
:
case
TRX_UNDO_INSERT_
METADATA
:
case
TRX_UNDO_INSERT_REC
:
node
->
roll_ptr
|=
1ULL
<<
ROLL_PTR_INSERT_FLAG_POS
;
/* fall through */
...
...
storage/innobase/row/row0uins.cc
View file @
45eaed0c
...
...
@@ -227,7 +227,7 @@ row_undo_ins_remove_clust_rec(
func_exit:
btr_pcur_commit_specify_mtr
(
&
node
->
pcur
,
&
mtr
);
if
(
err
==
DB_SUCCESS
&&
node
->
rec_type
==
TRX_UNDO_INSERT_
DEFAULT
)
{
if
(
err
==
DB_SUCCESS
&&
node
->
rec_type
==
TRX_UNDO_INSERT_
METADATA
)
{
/* When rolling back the very first instant ADD COLUMN
operation, reset the root page to the basic state. */
ut_ad
(
!
index
->
table
->
is_temporary
());
...
...
@@ -422,7 +422,7 @@ row_undo_ins_parse_undo_rec(
default:
ut_ad
(
!
"wrong undo record type"
);
goto
close_table
;
case
TRX_UNDO_INSERT_
DEFAULT
:
case
TRX_UNDO_INSERT_
METADATA
:
case
TRX_UNDO_INSERT_REC
:
break
;
case
TRX_UNDO_RENAME_TABLE
:
...
...
@@ -464,7 +464,7 @@ row_undo_ins_parse_undo_rec(
ptr
,
clust_index
,
&
node
->
ref
,
node
->
heap
);
}
else
{
node
->
ref
=
&
trx_undo_
default_rec
;
node
->
ref
=
&
trx_undo_
metadata
;
}
if
(
!
row_undo_search_clust_to_pcur
(
node
))
{
...
...
@@ -596,7 +596,7 @@ row_undo_ins(
}
/* fall through */
case
TRX_UNDO_INSERT_
DEFAULT
:
case
TRX_UNDO_INSERT_
METADATA
:
log_free_check
();
if
(
node
->
table
->
id
==
DICT_INDEXES_ID
)
{
...
...
storage/innobase/row/row0undo.cc
View file @
45eaed0c
...
...
@@ -236,7 +236,7 @@ row_undo_search_clust_to_pcur(
clust_index
,
node
->
update
,
node
->
heap
);
}
else
{
ut_ad
((
node
->
row
->
info_bits
==
REC_INFO_MIN_REC_FLAG
)
==
(
node
->
rec_type
==
TRX_UNDO_INSERT_
DEFAULT
));
==
(
node
->
rec_type
==
TRX_UNDO_INSERT_
METADATA
));
node
->
undo_row
=
NULL
;
node
->
undo_ext
=
NULL
;
}
...
...
storage/innobase/trx/trx0rec.cc
View file @
45eaed0c
...
...
@@ -40,8 +40,8 @@ Created 3/26/1996 Heikki Tuuri
#include "fsp0sysspace.h"
#include "row0mysql.h"
/** The search tuple corresponding to TRX_UNDO_INSERT_
DEFAULT
*/
const
dtuple_t
trx_undo_
default_rec
=
{
/** The search tuple corresponding to TRX_UNDO_INSERT_
METADATA
*/
const
dtuple_t
trx_undo_
metadata
=
{
REC_INFO_METADATA
,
0
,
0
,
NULL
,
0
,
NULL
,
UT_LIST_NODE_T
(
dtuple_t
)()
...
...
@@ -510,7 +510,7 @@ trx_undo_page_report_insert(
ut_ad
(
index
->
is_instant
());
ut_ad
(
undo_block
->
frame
[
first_free
+
2
]
==
TRX_UNDO_INSERT_REC
);
undo_block
->
frame
[
first_free
+
2
]
=
TRX_UNDO_INSERT_
DEFAULT
;
undo_block
->
frame
[
first_free
+
2
]
=
TRX_UNDO_INSERT_
METADATA
;
goto
done
;
}
...
...
storage/innobase/trx/trx0roll.cc
View file @
45eaed0c
...
...
@@ -1019,7 +1019,7 @@ trx_roll_pop_top_rec_of_trx(trx_t* trx, roll_ptr_t* roll_ptr, mem_heap_t* heap)
trx_undo_rec_t
*
undo_rec
=
trx_roll_pop_top_rec
(
trx
,
undo
,
&
mtr
);
const
undo_no_t
undo_no
=
trx_undo_rec_get_undo_no
(
undo_rec
);
switch
(
trx_undo_rec_get_type
(
undo_rec
))
{
case
TRX_UNDO_INSERT_
DEFAULT
:
case
TRX_UNDO_INSERT_
METADATA
:
/* This record type was introduced in MDEV-11369
instant ADD COLUMN, which was implemented after
MDEV-12288 removed the insert_undo log. There is no
...
...
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