Skip to content

Commit d09aec7

Browse files
committed
MDEV-19940 Clean up INFORMATION_SCHEMA.INNODB_ tables
Shorten some VARCHAR attributes to a more reasonable length. INNODB_METRICS: Rename the column STATUS to ENABLED, and make it Boolean. Replace with INT(1) many Boolean attributes that were declared as VARCHAR containing 'NO','YES','disabled','enabled','Uninitialized','Initialized'. Replace some VARCHAR attributes with ENUM. Replace some BIGINT with INT when 32 bits are sufficient. Remove INNODB_SYS_TABLESPACES.SPACE_TYPE. The type of a tablespace can be derived from the tablespace ID. A fixed number is used for the system tablespace and the temporary tablespace. All other tablespaces are single-table or single-partition tablespaces. i_s_locks_row_t::lock_type, lock_get_type_str(): Remove. This is a redundant field. Table and record locks can be distinguished by whether i_s_locks_row_t::lock_index is NULL. fill_trx_row(): Do not unnecessarily copy the constant strings that trx->op_info is pointing to. i_s_locks_row_t::lock_mode: Replace string with integer. lock_get_mode_str(), lock_get_trx_id(), lock_get_trx(): Remove. field_store_ulint(): Remove.
1 parent d8b8f55 commit d09aec7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1415
-1639
lines changed

mysql-test/suite/innodb/include/show_i_s_tables.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ SELECT t.name 'Table Name',
88
t.flag 'Table Flags',
99
t.n_cols 'Columns',
1010
t.row_format 'Row Format',
11-
t.zip_page_size 'Zip Size',
12-
t.space_type 'Space Type'
11+
t.zip_page_size 'Zip Size'
1312
FROM information_schema.innodb_sys_tables t LEFT JOIN
1413
information_schema.innodb_sys_tablespaces s
1514
ON t.space = s.space

mysql-test/suite/innodb/include/show_i_s_tablespaces.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
--replace_regex /#P#/#p#/ /#SP#/#sp#/
77
--replace_result ./ MYSQLD_DATADIR/ $MYSQLD_DATADIR/ MYSQLD_DATADIR/ $MYSQLD_DATADIR MYSQLD_DATADIR/ $MYSQL_TMP_DIR MYSQL_TMP_DIR $INNODB_PAGE_SIZE DEFAULT
88
SELECT s.name 'Space_Name',
9-
s.space_type 'Space_Type',
109
s.page_size 'Page_Size',
1110
s.zip_page_size 'Zip_Size',
1211
s.row_format 'Formats_Permitted',

mysql-test/suite/innodb/r/innodb-stats-modified-counter.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ set global innodb_stats_auto_recalc=off;
22
CREATE TABLE t1 (i int) ENGINE=InnoDB;
33
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
44
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
5-
test/t1 Initialized 0 0
5+
test/t1 1 0 0
66
INSERT INTO t1 VALUES (1);
77
INSERT INTO t1 VALUES (2);
88
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
99
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
10-
test/t1 Initialized 2 2
10+
test/t1 1 2 2
1111
DELETE FROM t1 WHERE i = 1;
1212
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
1313
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
14-
test/t1 Initialized 1 3
14+
test/t1 1 1 3
1515
UPDATE t1 SET i = 4 WHERE i = 2;
1616
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
1717
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
18-
test/t1 Initialized 1 4
18+
test/t1 1 1 4
1919
DROP TABLE t1;
2020
set global innodb_stats_auto_recalc=default;

mysql-test/suite/innodb/r/innodb_information_schema.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ lock_table COUNT(*)
2222
"test"."t_min" 2
2323
"test"."`t'\""_str" 10
2424
Field Type Null Key Default Extra
25-
trx_id varchar(18) NO
25+
trx_id bigint(21) unsigned NO 0
2626
trx_state varchar(13) NO
2727
trx_started datetime NO 0000-00-00 00:00:00
2828
trx_requested_lock_id varchar(81) YES NULL
@@ -38,7 +38,7 @@ trx_lock_memory_bytes bigint(21) unsigned NO 0
3838
trx_rows_locked bigint(21) unsigned NO 0
3939
trx_rows_modified bigint(21) unsigned NO 0
4040
trx_concurrency_tickets bigint(21) unsigned NO 0
41-
trx_isolation_level varchar(16) NO
41+
trx_isolation_level enum('READ UNCOMMITTED','READ COMMITTED','REPEATABLE READ','SERIALIZABLE') NO
4242
trx_unique_checks int(1) NO 0
4343
trx_foreign_key_checks int(1) NO 0
4444
trx_last_foreign_key_error varchar(256) YES NULL

mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result

Lines changed: 252 additions & 252 deletions
Large diffs are not rendered by default.

mysql-test/suite/innodb/r/monitor.result

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set global innodb_monitor_disable = All;
2-
select name, status from information_schema.innodb_metrics;
2+
select name, if(enabled,'enabled','disabled') status
3+
from information_schema.innodb_metrics;
34
name status
45
metadata_table_handles_opened disabled
56
metadata_table_handles_closed disabled
@@ -252,22 +253,23 @@ icp_no_match disabled
252253
icp_out_of_range disabled
253254
icp_match disabled
254255
set global innodb_monitor_enable = all;
255-
select name from information_schema.innodb_metrics where status!='enabled';
256+
select name from information_schema.innodb_metrics where not enabled;
256257
name
257258
set global innodb_monitor_enable = aaa;
258259
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
259260
set global innodb_monitor_disable = All;
260-
select name from information_schema.innodb_metrics where status!='disabled';
261+
select name from information_schema.innodb_metrics where enabled;
261262
name
262263
set global innodb_monitor_reset_all = all;
263264
select name from information_schema.innodb_metrics where count!=0;
264265
name
265266
set global innodb_monitor_enable = "%lock%";
266267
select name from information_schema.innodb_metrics
267-
where status != IF(name like "%lock%", 'enabled', 'disabled');
268+
where enabled != (name like "%lock%");
268269
name
269270
set global innodb_monitor_disable = "%lock%";
270-
select name, status from information_schema.innodb_metrics
271+
select name, if(enabled,'enabled','disabled') status
272+
from information_schema.innodb_metrics
271273
where name like "%lock%";
272274
name status
273275
lock_deadlocks disabled
@@ -298,24 +300,25 @@ innodb_rwlock_sx_os_waits disabled
298300
set global innodb_monitor_enable = "%lock*";
299301
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
300302
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
301-
select name from information_schema.innodb_metrics where status!='enabled';
303+
select name from information_schema.innodb_metrics where not enabled;
302304
name
303305
set global innodb_monitor_disable="%%%%%";
304-
select name from information_schema.innodb_metrics where status!='disabled';
306+
select name from information_schema.innodb_metrics where enabled;
305307
name
306308
set global innodb_monitor_enable="%";
307-
select name from information_schema.innodb_metrics where status!='enabled';
309+
select name from information_schema.innodb_metrics where not enabled;
308310
name
309311
set global innodb_monitor_disable="%_%";
310-
select name from information_schema.innodb_metrics where status!='disabled';
312+
select name from information_schema.innodb_metrics where enabled;
311313
name
312314
set global innodb_monitor_enable="log%%%%";
313315
select name from information_schema.innodb_metrics
314-
where status != IF(name like "log%", 'enabled', 'disabled');
316+
where enabled != (name like "log%");
315317
name
316318
set global innodb_monitor_enable="os_%a_fs_ncs";
317319
set global innodb_monitor_enable="os%pending%";
318-
select name, status from information_schema.innodb_metrics
320+
select name, if(enabled,'enabled','disabled') status
321+
from information_schema.innodb_metrics
319322
where name like "os%";
320323
name status
321324
os_data_reads disabled
@@ -338,14 +341,16 @@ create table monitor_test(col int) engine = innodb;
338341
select * from monitor_test;
339342
col
340343
select name, max_count, min_count, count,
341-
max_count_reset, min_count_reset, count_reset, status
344+
max_count_reset, min_count_reset, count_reset,
345+
if(enabled,'enabled','disabled') status
342346
from information_schema.innodb_metrics
343347
where name = "metadata_table_handles_opened";
344348
name max_count min_count count max_count_reset min_count_reset count_reset status
345349
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
346350
set global innodb_monitor_reset = metadata_table_handles_opened;
347351
select name, max_count, min_count, count,
348-
max_count_reset, min_count_reset, count_reset, status
352+
max_count_reset, min_count_reset, count_reset,
353+
if(enabled,'enabled','disabled') status
349354
from information_schema.innodb_metrics
350355
where name = "metadata_table_handles_opened";
351356
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -355,22 +360,25 @@ create table monitor_test(col int) engine = innodb;
355360
select * from monitor_test;
356361
col
357362
select name, max_count, min_count, count,
358-
max_count_reset, min_count_reset, count_reset, status
363+
max_count_reset, min_count_reset, count_reset,
364+
if(enabled,'enabled','disabled') status
359365
from information_schema.innodb_metrics
360366
where name = "metadata_table_handles_opened";
361367
name max_count min_count count max_count_reset min_count_reset count_reset status
362368
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
363369
set global innodb_monitor_reset_all = metadata_table_handles_opened;
364370
select name, max_count, min_count, count,
365-
max_count_reset, min_count_reset, count_reset, status
371+
max_count_reset, min_count_reset, count_reset,
372+
if(enabled,'enabled','disabled') status
366373
from information_schema.innodb_metrics
367374
where name = "metadata_table_handles_opened";
368375
name max_count min_count count max_count_reset min_count_reset count_reset status
369376
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
370377
set global innodb_monitor_disable = metadata_table_handles_opened;
371378
set global innodb_monitor_reset = metadata_table_handles_opened;
372379
select name, max_count, min_count, count,
373-
max_count_reset, min_count_reset, count_reset, status
380+
max_count_reset, min_count_reset, count_reset,
381+
if(enabled,'enabled','disabled') status
374382
from information_schema.innodb_metrics
375383
where name = "metadata_table_handles_opened";
376384
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -380,14 +388,16 @@ create table monitor_test(col int) engine = innodb;
380388
select * from monitor_test;
381389
col
382390
select name, max_count, min_count, count,
383-
max_count_reset, min_count_reset, count_reset, status
391+
max_count_reset, min_count_reset, count_reset,
392+
if(enabled,'enabled','disabled') status
384393
from information_schema.innodb_metrics
385394
where name = "metadata_table_handles_opened";
386395
name max_count min_count count max_count_reset min_count_reset count_reset status
387396
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
388397
set global innodb_monitor_reset_all = metadata_table_handles_opened;
389398
select name, max_count, min_count, count,
390-
max_count_reset, min_count_reset, count_reset, status
399+
max_count_reset, min_count_reset, count_reset,
400+
if(enabled,'enabled','disabled') status
391401
from information_schema.innodb_metrics
392402
where name = "metadata_table_handles_opened";
393403
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -398,21 +408,24 @@ create table monitor_test(col int) engine = innodb stats_persistent=0;
398408
select * from monitor_test;
399409
col
400410
select name, max_count, min_count, count,
401-
max_count_reset, min_count_reset, count_reset, status
411+
max_count_reset, min_count_reset, count_reset,
412+
if(enabled,'enabled','disabled') status
402413
from information_schema.innodb_metrics
403414
where name = "metadata_table_handles_opened";
404415
name max_count min_count count max_count_reset min_count_reset count_reset status
405416
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
406417
set global innodb_monitor_enable = metadata_table_handles_closed;
407418
create index idx on monitor_test(col);
408419
select name, max_count, min_count, count,
409-
max_count_reset, min_count_reset, count_reset, status
420+
max_count_reset, min_count_reset, count_reset,
421+
if(enabled,'enabled','disabled') status
410422
from information_schema.innodb_metrics
411423
where name = "metadata_table_handles_closed";
412424
name max_count min_count count max_count_reset min_count_reset count_reset status
413425
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
414426
select name, max_count, min_count, count,
415-
max_count_reset, min_count_reset, count_reset, status
427+
max_count_reset, min_count_reset, count_reset,
428+
if(enabled,'enabled','disabled') status
416429
from information_schema.innodb_metrics
417430
where name like "metadata%";
418431
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -422,7 +435,8 @@ metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
422435
set global innodb_monitor_disable = module_metadata;
423436
set global innodb_monitor_reset = module_metadata;
424437
select name, max_count, min_count, count,
425-
max_count_reset, min_count_reset, count_reset, status
438+
max_count_reset, min_count_reset, count_reset,
439+
if(enabled,'enabled','disabled') status
426440
from information_schema.innodb_metrics
427441
where name like "metadata%";
428442
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -431,7 +445,8 @@ metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
431445
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
432446
set global innodb_monitor_reset_all = module_metadata;
433447
select name, max_count, min_count, count,
434-
max_count_reset, min_count_reset, count_reset, status
448+
max_count_reset, min_count_reset, count_reset,
449+
if(enabled,'enabled','disabled') status
435450
from information_schema.innodb_metrics
436451
where name like "metadata%";
437452
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -446,7 +461,8 @@ begin;
446461
insert into monitor_test values(9);
447462
rollback;
448463
select name, max_count, min_count, count,
449-
max_count_reset, min_count_reset, count_reset, status
464+
max_count_reset, min_count_reset, count_reset,
465+
if(enabled,'enabled','disabled') status
450466
from information_schema.innodb_metrics
451467
where name like "trx_rollbacks" or name like "trx_active_transactions";
452468
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -457,7 +473,8 @@ set global innodb_monitor_enable = module_dml;
457473
insert into monitor_test values(9);
458474
update monitor_test set col = 10 where col = 9;
459475
select name, max_count, min_count, count,
460-
max_count_reset, min_count_reset, count_reset, status
476+
max_count_reset, min_count_reset, count_reset,
477+
if(enabled,'enabled','disabled') status
461478
from information_schema.innodb_metrics
462479
where name like "dml%";
463480
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -471,7 +488,8 @@ dml_system_deletes 0 NULL 0 0 NULL 0 enabled
471488
dml_system_updates 0 NULL 0 0 NULL 0 enabled
472489
delete from monitor_test;
473490
select name, max_count, min_count, count,
474-
max_count_reset, min_count_reset, count_reset, status
491+
max_count_reset, min_count_reset, count_reset,
492+
if(enabled,'enabled','disabled') status
475493
from information_schema.innodb_metrics
476494
where name like "dml%";
477495
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -485,7 +503,8 @@ dml_system_deletes 0 NULL 0 0 NULL 0 enabled
485503
dml_system_updates 0 NULL 0 0 NULL 0 enabled
486504
set global innodb_monitor_reset = module_dml;
487505
select name, max_count, min_count, count,
488-
max_count_reset, min_count_reset, count_reset, status
506+
max_count_reset, min_count_reset, count_reset,
507+
if(enabled,'enabled','disabled') status
489508
from information_schema.innodb_metrics
490509
where name like "dml%";
491510
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -501,7 +520,8 @@ insert into monitor_test values(9);
501520
insert into monitor_test values(1);
502521
delete from monitor_test;
503522
select name, max_count, min_count, count,
504-
max_count_reset, min_count_reset, count_reset, status
523+
max_count_reset, min_count_reset, count_reset,
524+
if(enabled,'enabled','disabled') status
505525
from information_schema.innodb_metrics
506526
where name like "dml%";
507527
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -515,7 +535,8 @@ dml_system_deletes 0 NULL 0 0 NULL 0 enabled
515535
dml_system_updates 0 NULL 0 0 NULL 0 enabled
516536
set global innodb_monitor_reset_all = module_dml;
517537
select name, max_count, min_count, count,
518-
max_count_reset, min_count_reset, count_reset, status
538+
max_count_reset, min_count_reset, count_reset,
539+
if(enabled,'enabled','disabled') status
519540
from information_schema.innodb_metrics
520541
where name like "dml%";
521542
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -529,7 +550,8 @@ dml_system_deletes 0 NULL 0 0 NULL 0 enabled
529550
dml_system_updates 0 NULL 0 0 NULL 0 enabled
530551
set global innodb_monitor_disable = module_dml;
531552
select name, max_count, min_count, count,
532-
max_count_reset, min_count_reset, count_reset, status
553+
max_count_reset, min_count_reset, count_reset,
554+
if(enabled,'enabled','disabled') status
533555
from information_schema.innodb_metrics
534556
where name like "dml%";
535557
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -543,7 +565,8 @@ dml_system_deletes 0 NULL 0 0 NULL 0 disabled
543565
dml_system_updates 0 NULL 0 0 NULL 0 disabled
544566
set global innodb_monitor_reset_all = module_dml;
545567
select name, max_count, min_count, count,
546-
max_count_reset, min_count_reset, count_reset, status
568+
max_count_reset, min_count_reset, count_reset,
569+
if(enabled,'enabled','disabled') status
547570
from information_schema.innodb_metrics
548571
where name like "dml%";
549572
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -560,7 +583,8 @@ insert into monitor_test values(9);
560583
insert into monitor_test values(1);
561584
delete from monitor_test;
562585
select name, max_count, min_count, count,
563-
max_count_reset, min_count_reset, count_reset, status
586+
max_count_reset, min_count_reset, count_reset,
587+
if(enabled,'enabled','disabled') status
564588
from information_schema.innodb_metrics
565589
where name like "dml%";
566590
name max_count min_count count max_count_reset min_count_reset count_reset status
@@ -576,7 +600,8 @@ set global innodb_monitor_disable = module_dml;
576600
drop table monitor_test;
577601
set global innodb_monitor_enable = file_num_open_files;
578602
select name, max_count, min_count, count,
579-
max_count_reset, min_count_reset, count_reset, status
603+
max_count_reset, min_count_reset, count_reset,
604+
if(enabled,'enabled','disabled') status
580605
from information_schema.innodb_metrics
581606
where name like "file_num_open_files";
582607
name max_count min_count count max_count_reset min_count_reset count_reset status

0 commit comments

Comments
 (0)