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
3b229393
Commit
3b229393
authored
Oct 04, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the I_S.GLOBAL_STATUS counter innodb_instant_alter_column
parent
08e4d3fe
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
6 deletions
+15
-6
mysql-test/suite/innodb/r/instant_alter.result
mysql-test/suite/innodb/r/instant_alter.result
+0
-0
mysql-test/suite/innodb/t/instant_alter.test
mysql-test/suite/innodb/t/instant_alter.test
+7
-6
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+3
-0
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+2
-0
storage/innobase/include/srv0srv.h
storage/innobase/include/srv0srv.h
+3
-0
No files found.
mysql-test/suite/innodb/r/instant_alter.result
View file @
3b229393
No preview for this file type
mysql-test/suite/innodb/t/instant_alter.test
View file @
3b229393
...
@@ -18,6 +18,10 @@ SET time_zone='+03:00';
...
@@ -18,6 +18,10 @@ SET time_zone='+03:00';
SET
@
saved_frequency
=
@@
GLOBAL
.
innodb_purge_rseg_truncate_frequency
;
SET
@
saved_frequency
=
@@
GLOBAL
.
innodb_purge_rseg_truncate_frequency
;
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
1
;
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
1
;
SET
@
old_instant
=
(
SELECT
variable_value
FROM
information_schema
.
global_status
WHERE
variable_name
=
'innodb_instant_alter_column'
);
let
$format
=
3
;
let
$format
=
3
;
while
(
$format
)
{
while
(
$format
)
{
let
$engine
=
`SELECT CONCAT('ENGINE=InnoDB ROW_FORMAT=',CASE $format
let
$engine
=
`SELECT CONCAT('ENGINE=InnoDB ROW_FORMAT=',CASE $format
...
@@ -33,7 +37,6 @@ eval CREATE TABLE t1
...
@@ -33,7 +37,6 @@ eval CREATE TABLE t1
INSERT
INTO
t1
(
id
,
c2
)
values
(
1
,
1
);
INSERT
INTO
t1
(
id
,
c2
)
values
(
1
,
1
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
SET
GLOBAL
innodb_monitor_enable
=
module_ddl
;
--
enable_info
--
enable_info
ALTER
TABLE
t1
ADD
COLUMN
(
ALTER
TABLE
t1
ADD
COLUMN
(
d1
INT
,
d2
INT
UNSIGNED
DEFAULT
10
,
d3
VARCHAR
(
20
)
NOT
NULL
DEFAULT
'abcde'
,
d1
INT
,
d2
INT
UNSIGNED
DEFAULT
10
,
d3
VARCHAR
(
20
)
NOT
NULL
DEFAULT
'abcde'
,
...
@@ -252,9 +255,7 @@ DROP TABLE t1,t2,t3,big;
...
@@ -252,9 +255,7 @@ DROP TABLE t1,t2,t3,big;
dec
$format
;
dec
$format
;
}
}
disconnect
analyze
;
disconnect
analyze
;
SET
GLOBAL
innodb_monitor_disable
=
module_ddl
;
SELECT
variable_value
-@
old_instant
instants
--
disable_warnings
FROM
information_schema
.
global_status
SET
GLOBAL
innodb_monitor_enable
=
default
;
WHERE
variable_name
=
'innodb_instant_alter_column'
;
SET
GLOBAL
innodb_monitor_disable
=
default
;
--
enable_warnings
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
@
saved_frequency
;
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
@
saved_frequency
;
storage/innobase/handler/ha_innodb.cc
View file @
3b229393
...
@@ -1100,6 +1100,9 @@ static SHOW_VAR innodb_status_variables[]= {
...
@@ -1100,6 +1100,9 @@ static SHOW_VAR innodb_status_variables[]= {
{
"defragment_count"
,
{
"defragment_count"
,
(
char
*
)
&
export_vars
.
innodb_defragment_count
,
SHOW_LONG
},
(
char
*
)
&
export_vars
.
innodb_defragment_count
,
SHOW_LONG
},
{
"instant_alter_column"
,
(
char
*
)
&
export_vars
.
innodb_instant_alter_column
,
SHOW_LONG
},
/* Online alter table status variables */
/* Online alter table status variables */
{
"onlineddl_rowlog_rows"
,
{
"onlineddl_rowlog_rows"
,
(
char
*
)
&
export_vars
.
innodb_onlineddl_rowlog_rows
,
SHOW_LONG
},
(
char
*
)
&
export_vars
.
innodb_onlineddl_rowlog_rows
,
SHOW_LONG
},
...
...
storage/innobase/handler/handler0alter.cc
View file @
3b229393
...
@@ -50,6 +50,7 @@ Smart ALTER TABLE
...
@@ -50,6 +50,7 @@ Smart ALTER TABLE
#include "trx0roll.h"
#include "trx0roll.h"
#include "handler0alter.h"
#include "handler0alter.h"
#include "srv0mon.h"
#include "srv0mon.h"
#include "srv0srv.h"
#include "fts0priv.h"
#include "fts0priv.h"
#include "fts0plugin.h"
#include "fts0plugin.h"
#include "pars0pars.h"
#include "pars0pars.h"
...
@@ -304,6 +305,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
...
@@ -304,6 +305,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
}
}
new_table
=
old_table
;
new_table
=
old_table
;
export_vars
.
innodb_instant_alter_column
++
;
}
}
/** @return whether this is instant ALTER TABLE */
/** @return whether this is instant ALTER TABLE */
...
...
storage/innobase/include/srv0srv.h
View file @
3b229393
...
@@ -1007,6 +1007,9 @@ struct export_var_t{
...
@@ -1007,6 +1007,9 @@ struct export_var_t{
ulint
innodb_defragment_count
;
/*!< Number of defragment
ulint
innodb_defragment_count
;
/*!< Number of defragment
operations*/
operations*/
/** Number of instant ALTER TABLE operations that affect columns */
ulong
innodb_instant_alter_column
;
ulint
innodb_onlineddl_rowlog_rows
;
/*!< Online alter rows */
ulint
innodb_onlineddl_rowlog_rows
;
/*!< Online alter rows */
ulint
innodb_onlineddl_rowlog_pct_used
;
/*!< Online alter percentage
ulint
innodb_onlineddl_rowlog_pct_used
;
/*!< Online alter percentage
of used row log buffer */
of used row log buffer */
...
...
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