Commit 3b229393 authored by Marko Mäkelä's avatar Marko Mäkelä

Add the I_S.GLOBAL_STATUS counter innodb_instant_alter_column

parent 08e4d3fe
......@@ -18,6 +18,10 @@ SET time_zone='+03:00';
SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
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;
while ($format) {
let $engine= `SELECT CONCAT('ENGINE=InnoDB ROW_FORMAT=',CASE $format
......@@ -33,7 +37,6 @@ eval CREATE TABLE t1
INSERT INTO t1 (id, c2) values(1,1);
SELECT * FROM t1;
SET GLOBAL innodb_monitor_enable = module_ddl;
--enable_info
ALTER TABLE t1 ADD COLUMN (
d1 INT, d2 INT UNSIGNED DEFAULT 10, d3 VARCHAR(20) NOT NULL DEFAULT 'abcde',
......@@ -252,9 +255,7 @@ DROP TABLE t1,t2,t3,big;
dec $format;
}
disconnect analyze;
SET GLOBAL innodb_monitor_disable = module_ddl;
--disable_warnings
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
--enable_warnings
SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
......@@ -1100,6 +1100,9 @@ static SHOW_VAR innodb_status_variables[]= {
{"defragment_count",
(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 */
{"onlineddl_rowlog_rows",
(char*) &export_vars.innodb_onlineddl_rowlog_rows, SHOW_LONG},
......
......@@ -50,6 +50,7 @@ Smart ALTER TABLE
#include "trx0roll.h"
#include "handler0alter.h"
#include "srv0mon.h"
#include "srv0srv.h"
#include "fts0priv.h"
#include "fts0plugin.h"
#include "pars0pars.h"
......@@ -304,6 +305,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
}
new_table = old_table;
export_vars.innodb_instant_alter_column++;
}
/** @return whether this is instant ALTER TABLE */
......
......@@ -1007,6 +1007,9 @@ struct export_var_t{
ulint innodb_defragment_count; /*!< Number of defragment
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_pct_used; /*!< Online alter percentage
of used row log buffer */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment