Commit 513f5840 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6138 show sysvar's help in I_S tables

INFORMATION_SCHEMA.SYSTEM_VARIABLES
parent beb2422a
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'aria' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
{
--skip Test requires Aria
}
......@@ -48,6 +48,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
......@@ -102,6 +103,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
......
......@@ -75,6 +75,7 @@ SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
STATISTICS
SYSTEM_VARIABLES
TABLES
TABLESPACES
TABLE_CONSTRAINTS
......@@ -819,6 +820,7 @@ information_schema PROCESSLIST INFO
information_schema ROUTINES DTD_IDENTIFIER
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES ROUTINE_COMMENT
information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema VIEWS VIEW_DEFINITION
......
......@@ -46,6 +46,7 @@ SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
STATISTICS
SYSTEM_VARIABLES
TABLES
TABLESPACES
TABLE_CONSTRAINTS
......@@ -115,6 +116,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
......@@ -184,6 +186,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
......@@ -258,6 +261,7 @@ SCHEMA_PRIVILEGES information_schema.SCHEMA_PRIVILEGES 1
SESSION_STATUS information_schema.SESSION_STATUS 1
SESSION_VARIABLES information_schema.SESSION_VARIABLES 1
STATISTICS information_schema.STATISTICS 1
SYSTEM_VARIABLES information_schema.SYSTEM_VARIABLES 1
TABLES information_schema.TABLES 1
TABLESPACES information_schema.TABLESPACES 1
TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
......@@ -317,6 +321,7 @@ Database: information_schema
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
......@@ -376,6 +381,7 @@ Database: INFORMATION_SCHEMA
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
......@@ -393,5 +399,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 54
information_schema 55
mysql 30
......@@ -324,6 +324,19 @@ def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NUL
def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 4 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select
def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 10 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select
def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select
def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 8 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select
def information_schema SYSTEM_VARIABLES READ_ONLY 12 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select
def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select
def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 7 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 5 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
......@@ -813,6 +826,19 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_SCOPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
3.0000 information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE varchar 21 63 utf8 utf8_general_ci varchar(21)
1.0000 information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema SYSTEM_VARIABLES READ_ONLY varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
......
......@@ -324,6 +324,19 @@ def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NUL
def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 4 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 10 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21)
def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21)
def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 8 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21)
def information_schema SYSTEM_VARIABLES READ_ONLY 12 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3)
def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024)
def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 7 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 5 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
......@@ -813,6 +826,19 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_SCOPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SYSTEM_VARIABLES VARIABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
3.0000 information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE varchar 21 63 utf8 utf8_general_ci varchar(21)
3.0000 information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE varchar 21 63 utf8 utf8_general_ci varchar(21)
1.0000 information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema SYSTEM_VARIABLES READ_ONLY varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
......
......@@ -660,6 +660,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SYSTEM_VARIABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......@@ -1529,6 +1552,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SYSTEM_VARIABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......
......@@ -660,6 +660,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SYSTEM_VARIABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......@@ -1529,6 +1552,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SYSTEM_VARIABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME TABLES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......
--vertical_results
# because its current value is printed below
set timestamp=unix_timestamp('2014-09-01 13:40:23');
# ditto
set pseudo_thread_id=10;
# to show session != global, and doesn't affect global_value_origin
set sql_mode=ansi_quotes;
# global_value_origin=SQL
set global div_precision_increment=5;
--replace_regex /^\/\S+/PATH/
--replace_result $MASTER_MYPORT MASTER_MYPORT
select * from information_schema.system_variables
where variable_name not like 'aria%' and
variable_name not like 'debug%' and
variable_name not like 'wsrep%' and
variable_name not in ('large_files_support',
'lower_case_file_system',
'open_files_limit',
'system_time_zone',
'version_comment',
'version_compile_machine', 'version_compile_os',
'version_malloc_library', 'version'
)
order by variable_name;
# now various metadata but no values, for variables where
# values change often
select VARIABLE_NAME, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT,
NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE,
ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT
from information_schema.system_variables
where variable_name in ('large_files_support',
'lower_case_file_system',
'open_files_limit',
'system_time_zone',
'version_comment',
'version_compile_machine', 'version_compile_os',
'version_malloc_library', 'version'
)
order by variable_name;
set global div_precision_increment=default;
use information_schema;
select variable_name, s.variable_value, v.global_value
from global_variables s join system_variables v using (variable_name)
where not (s.variable_value <=> v.global_value);
variable_name variable_value global_value
select variable_name, s.variable_value, v.session_value
from session_variables s join system_variables v using (variable_name)
where v.variable_scope != 'GLOBAL' and
not (s.variable_value <=> v.session_value);
variable_name variable_value session_value
select * from information_schema.system_variables
where variable_name like 'aria%'
order by variable_name;
VARIABLE_NAME ARIA_BLOCK_SIZE
SESSION_VALUE NULL
GLOBAL_VALUE 8192
DEFAULT_VALUE 8192
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Block size to be used for Aria index pages.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 32768
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_CHECKPOINT_INTERVAL
SESSION_VALUE NULL
GLOBAL_VALUE 30
DEFAULT_VALUE 30
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Interval between tries to do an automatic checkpoints. In seconds; 0 means 'no automatic checkpoints' which makes sense only for testing.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_CHECKPOINT_LOG_ACTIVITY
SESSION_VALUE NULL
GLOBAL_VALUE 1048576
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Number of bytes that the transaction log has to grow between checkpoints before a new checkpoint is written to the log.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_FORCE_START_AFTER_RECOVERY_FAILURES
SESSION_VALUE NULL
GLOBAL_VALUE 0
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Number of consecutive log recovery failures after which logs will be automatically deleted to cure the problem; 0 (the default) disables the feature.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_GROUP_COMMIT
SESSION_VALUE NULL
GLOBAL_VALUE none
DEFAULT_VALUE none
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Specifies Aria group commit mode. Possible values are "none" (no group commit), "hard" (with waiting to actual commit), "soft" (no wait for commit (DANGEROUS!!!))
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST none,hard,soft
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_GROUP_COMMIT_INTERVAL
SESSION_VALUE NULL
GLOBAL_VALUE 0
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Interval between commite in microseconds (1/1000000c). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
SESSION_VALUE NULL
GLOBAL_VALUE 104857600
DEFAULT_VALUE 1073741824
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Limit for transaction log size
NUMERIC_MIN_VALUE 8388608
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 8192
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_PURGE_TYPE
SESSION_VALUE NULL
GLOBAL_VALUE immediate
DEFAULT_VALUE immediate
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Specifies how Aria transactional log will be purged
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST immediate,external,at_flush
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_MAX_SORT_FILE_SIZE
SESSION_VALUE NULL
GLOBAL_VALUE 9223372036853727232
DEFAULT_VALUE 9223372036853727232
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 9223372036854775807
NUMERIC_BLOCK_SIZE 1048576
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD
SESSION_VALUE NULL
GLOBAL_VALUE 300
DEFAULT_VALUE 300
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in the page cache.
NUMERIC_MIN_VALUE 100
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 100
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_BUFFER_SIZE
SESSION_VALUE NULL
GLOBAL_VALUE 8388608
DEFAULT_VALUE 134217728
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer used for index blocks for Aria tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford.
NUMERIC_MIN_VALUE 131072
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT
SESSION_VALUE NULL
GLOBAL_VALUE 100
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGE_CHECKSUM
SESSION_VALUE NULL
GLOBAL_VALUE ON
DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Maintain page checksums (can be overridden per table with PAGE_CHECKSUM clause in CREATE TABLE)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_RECOVER
SESSION_VALUE NULL
GLOBAL_VALUE NORMAL
DEFAULT_VALUE NORMAL
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE SET
VARIABLE_COMMENT Specifies how corrupted tables should be automatically repaired
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NORMAL,BACKUP,FORCE,QUICK,OFF
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_REPAIR_THREADS
SESSION_VALUE 1
GLOBAL_VALUE 1
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_SORT_BUFFER_SIZE
SESSION_VALUE 268434432
GLOBAL_VALUE 268434432
DEFAULT_VALUE 268434432
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_STATS_METHOD
SESSION_VALUE nulls_unequal
GLOBAL_VALUE nulls_unequal
DEFAULT_VALUE nulls_unequal
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Specifies how Aria index statistics collection code should treat NULLs
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST nulls_unequal,nulls_equal,nulls_ignored
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_SYNC_LOG_DIR
SESSION_VALUE NULL
GLOBAL_VALUE NEWFILE
DEFAULT_VALUE NEWFILE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Controls syncing directory after log file growth and new file creation
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NEVER,NEWFILE,ALWAYS
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_USED_FOR_TEMP_TABLES
SESSION_VALUE NULL
GLOBAL_VALUE ON
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Whether temporary tables should be MyISAM or Aria
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
select * from information_schema.system_variables
where variable_name like 'debug%'
order by variable_name;
VARIABLE_NAME DEBUG
SESSION_VALUE
GLOBAL_VALUE
DEFAULT_VALUE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Built-in DBUG debugger
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DEBUG_BINLOG_FSYNC_SLEEP
SESSION_VALUE NULL
GLOBAL_VALUE 314
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Extra sleep (in microseconds) to add to binlog fsync(), for debugging
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEBUG_CRC_BREAK
SESSION_VALUE NULL
GLOBAL_VALUE 0
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Call my_debug_put_break_here() if crc matches this number (for debug)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEBUG_DBUG
SESSION_VALUE
GLOBAL_VALUE
DEFAULT_VALUE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Built-in DBUG debugger
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DEBUG_MUTEX_DEADLOCK_DETECTOR
SESSION_VALUE NULL
GLOBAL_VALUE ON
DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable checking of wrong mutex usage
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DEBUG_NO_THREAD_ALARM
SESSION_VALUE NULL
GLOBAL_VALUE OFF
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Disable system thread alarm calls. Disabling it may be useful in debugging or testing, never do it in production
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DEBUG_SYNC
SESSION_VALUE ON - current signal: ''
GLOBAL_VALUE NULL
DEFAULT_VALUE
VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Debug Sync Facility
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# verify that show_status_array and sys_var::val_str print values identically
use information_schema;
select variable_name, s.variable_value, v.global_value
from global_variables s join system_variables v using (variable_name)
where not (s.variable_value <=> v.global_value);
select variable_name, s.variable_value, v.session_value
from session_variables s join system_variables v using (variable_name)
where v.variable_scope != 'GLOBAL' and
not (s.variable_value <=> v.session_value);
--loose-aria-log-file-size=100M
--source include/have_aria.inc
--vertical_results
select * from information_schema.system_variables
where variable_name like 'aria%'
order by variable_name;
--loose-debug-binlog-fsync-sleep=314
--source include/have_debug.inc
--vertical_results
select * from information_schema.system_variables
where variable_name like 'debug%'
order by variable_name;
--loose-innodb-flush-log-at-timeout=3
--source include/have_innodb.inc
--vertical_results
--replace_regex /^\/\S+/PATH/ /\.\//PATH/
select * from information_schema.system_variables
where variable_name like 'innodb%' and not variable_name = 'innodb_disallow_writes'
order by variable_name;
source include/is_embedded.inc;
source inc/sysvars_server.inc;
source include/not_embedded.inc;
source inc/sysvars_server.inc;
--source include/have_wsrep.inc
--vertical_results
select * from information_schema.system_variables
where variable_name like 'wsrep%'
order by variable_name;
......@@ -331,7 +331,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg,
char buf[256];
String sbuf(buf, sizeof(buf), system_charset_info), *str;
if ((str= sysvar->val_str(&sbuf, thd, OPT_SESSION, 0)))
if ((str= sysvar->val_str(&sbuf, thd, OPT_SESSION, &null_lex_str)))
{
LEX_STRING name= { const_cast<char*>(opt->name), opt->name_length };
default_val.str= strmake_root(root, str->ptr(), str->length());
......
......@@ -748,6 +748,7 @@ enum enum_schema_tables
SCH_SESSION_STATUS,
SCH_SESSION_VARIABLES,
SCH_STATISTICS,
SCH_SYSTEM_VARIABLES,
SCH_TABLES,
SCH_TABLESPACES,
SCH_TABLE_CONSTRAINTS,
......
......@@ -35,6 +35,7 @@
#include "tztime.h" // my_tz_find, my_tz_SYSTEM, struct Time_zone
#include "sql_acl.h" // SUPER_ACL
#include "sql_select.h" // free_underlaid_joins
#include "sql_show.h"
#include "sql_view.h" // updatable_views_with_limit_typelib
#include "lock.h" // lock_global_read_lock,
// make_global_read_lock_block_commit,
......@@ -240,6 +241,7 @@ bool sys_var::check(THD *thd, set_var *var)
uchar *sys_var::value_ptr(THD *thd, enum_var_type type, const LEX_STRING *base)
{
DBUG_ASSERT(base);
if (type == OPT_GLOBAL || scope() == GLOBAL)
{
mysql_mutex_assert_owner(&LOCK_global_system_variables);
......@@ -468,6 +470,7 @@ CHARSET_INFO *sys_var::charset(THD *thd)
system_charset_info;
}
typedef struct old_names_map_st
{
const char *old_name;
......@@ -938,3 +941,185 @@ int set_var_collation_client::update(THD *thd)
return 0;
}
/*****************************************************************************
INFORMATION_SCHEMA.SYSTEM_VARIABLES
*****************************************************************************/
static void store_value_ptr(Field *field, sys_var *var, String *str,
uchar *value_ptr)
{
field->set_notnull();
str= var->val_str_nolock(str, field->table->in_use, value_ptr);
if (str)
field->store(str->ptr(), str->length(), str->charset());
}
static void store_var(Field *field, sys_var *var, enum_var_type scope,
String *str)
{
if (var->check_type(scope))
return;
store_value_ptr(field, var, str,
var->value_ptr(field->table->in_use, scope, &null_lex_str));
}
int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
{
char name_buffer[NAME_CHAR_LEN];
enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
bool res= 1;
CHARSET_INFO *scs= system_charset_info;
StringBuffer<STRING_BUFFER_USUAL_SIZE> strbuf(scs);
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : 0;
Field **fields=tables->table->field;
DBUG_ASSERT(tables->table->in_use == thd);
cond= make_cond_for_info_schema(cond, tables);
thd->count_cuted_fields= CHECK_FIELD_WARN;
mysql_rwlock_rdlock(&LOCK_system_variables_hash);
for (uint i= 0; i < system_variable_hash.records; i++)
{
sys_var *var= (sys_var*) my_hash_element(&system_variable_hash, i);
strmake_buf(name_buffer, var->name.str);
my_caseup_str(system_charset_info, name_buffer);
/* this must be done before evaluating cond */
restore_record(tables->table, s->default_values);
fields[0]->store(name_buffer, strlen(name_buffer), scs);
if ((wild && wild_case_compare(system_charset_info, name_buffer, wild))
|| (cond && !cond->val_int()))
continue;
mysql_mutex_lock(&LOCK_global_system_variables);
// SESSION_VALUE
store_var(fields[1], var, OPT_SESSION, &strbuf);
// GLOBAL_VALUE
store_var(fields[2], var, OPT_GLOBAL, &strbuf);
// DEFAULT_VALUE
uchar *def= var->is_readonly() && var->option.id < 0
? 0 : var->default_value_ptr(thd);
if (def)
store_value_ptr(fields[3], var, &strbuf, def);
mysql_mutex_unlock(&LOCK_global_system_variables);
static const LEX_CSTRING scopes[]=
{
{ STRING_WITH_LEN("GLOBAL") },
{ STRING_WITH_LEN("SESSION") },
{ STRING_WITH_LEN("SESSION ONLY") }
};
const LEX_CSTRING *scope= scopes + var->scope();
fields[4]->store(scope->str, scope->length, scs);
#if SIZEOF_LONG == SIZEOF_INT
#define LONG_TYPE "INT"
#else
#define LONG_TYPE "BIGINT"
#endif
static const LEX_CSTRING types[]=
{
{ 0, 0 }, // unused 0
{ 0, 0 }, // GET_NO_ARG 1
{ STRING_WITH_LEN("BOOLEAN") }, // GET_BOOL 2
{ STRING_WITH_LEN("INT") }, // GET_INT 3
{ STRING_WITH_LEN("INT UNSIGNED") }, // GET_UINT 4
{ STRING_WITH_LEN(LONG_TYPE) }, // GET_LONG 5
{ STRING_WITH_LEN(LONG_TYPE " UNSIGNED") }, // GET_ULONG 6
{ STRING_WITH_LEN("BIGINT") }, // GET_LL 7
{ STRING_WITH_LEN("BIGINT UNSIGNED") }, // GET_ULL 8
{ STRING_WITH_LEN("VARCHAR") }, // GET_STR 9
{ STRING_WITH_LEN("VARCHAR") }, // GET_STR_ALLOC 10
{ 0, 0 }, // GET_DISABLED 11
{ STRING_WITH_LEN("ENUM") }, // GET_ENUM 12
{ STRING_WITH_LEN("SET") }, // GET_SET 13
{ STRING_WITH_LEN("DOUBLE") }, // GET_DOUBLE 14
{ STRING_WITH_LEN("FLAGSET") }, // GET_FLAGSET 15
};
const LEX_CSTRING *type= types + (var->option.var_type & GET_TYPE_MASK);
fields[5]->store(type->str, type->length, scs);
fields[6]->store(var->option.comment, strlen(var->option.comment),
scs);
bool is_unsigned= true;
switch (var->option.var_type)
{
case GET_INT:
case GET_LONG:
case GET_LL:
is_unsigned= false;
/* fall through */
case GET_UINT:
case GET_ULONG:
case GET_ULL:
fields[7]->set_notnull();
fields[8]->set_notnull();
fields[9]->set_notnull();
fields[7]->store(var->option.min_value, is_unsigned);
fields[8]->store(var->option.max_value, is_unsigned);
fields[9]->store(var->option.block_size, is_unsigned);
break;
case GET_DOUBLE:
fields[7]->set_notnull();
fields[8]->set_notnull();
fields[7]->store(getopt_ulonglong2double(var->option.min_value));
fields[8]->store(getopt_ulonglong2double(var->option.max_value));
}
TYPELIB *tl= var->option.typelib;
if (tl)
{
uint i;
strbuf.length(0);
for (i=0; i + 1 < tl->count; i++)
{
strbuf.append(tl->type_names[i]);
strbuf.append(',');
}
strbuf.append(tl->type_names[i]);
fields[10]->set_notnull();
fields[10]->store(strbuf.ptr(), strbuf.length(), scs);
}
static const LEX_CSTRING yesno[]=
{
{ STRING_WITH_LEN("NO") },
{ STRING_WITH_LEN("YES") }
};
const LEX_CSTRING *yn = yesno + var->is_readonly();
fields[11]->store(yn->str, yn->length, scs);
if (var->option.id >= 0)
{
static const LEX_CSTRING args[]=
{
{ STRING_WITH_LEN("NONE") }, // NO_ARG
{ STRING_WITH_LEN("OPTIONAL") }, // OPT_ARG
{ STRING_WITH_LEN("REQUIRED") } // REQUIRED_ARG
};
const LEX_CSTRING *arg= args + var->option.arg_type;
fields[12]->set_notnull();
fields[12]->store(arg->str, arg->length, scs);
}
if (schema_table_store_record(thd, tables->table))
goto end;
thd->get_stmt_da()->inc_current_row_for_warning();
}
res= 0;
end:
mysql_rwlock_unlock(&LOCK_system_variables_hash);
thd->count_cuted_fields= save_count_cuted_fields;
return res;
}
......@@ -190,6 +190,9 @@ public:
}
void do_deprecated_warning(THD *thd);
virtual uchar *default_value_ptr(THD *thd)
{ return (uchar*)&option.def_value; }
private:
virtual bool do_check(THD *thd, set_var *var) = 0;
/**
......@@ -382,6 +385,7 @@ extern SHOW_COMP_OPTION have_openssl;
*/
SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type);
int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond);
sys_var *find_sys_var(THD *thd, const char *str, uint length=0);
int sql_set_variables(THD *thd, List<set_var_base> *var_list);
......
......@@ -266,6 +266,8 @@ public:
{ return do_value_ptr(thd, OPT_SESSION, base); }
uchar* global_value_ptr(THD *thd, const LEX_STRING *base)
{ return do_value_ptr(thd, OPT_GLOBAL, base); }
uchar *default_value_ptr(THD *thd)
{ return do_value_ptr(thd, OPT_DEFAULT, 0); }
bool do_check(THD *thd, set_var *var);
virtual void session_save_default(THD *thd, set_var *var) {}
virtual void global_save_default(THD *thd, set_var *var) {}
......@@ -3239,6 +3241,9 @@ sys_var_pluginvar::sys_var_pluginvar(sys_var_chain *chain, const char *name_arg,
uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type)
{
if (type == OPT_DEFAULT)
return (uchar*)&option.def_value;
DBUG_ASSERT(thd || (type == OPT_GLOBAL));
if (plugin_var->flags & PLUGIN_VAR_THDLOCAL)
{
......@@ -3307,7 +3312,7 @@ bool sys_var_pluginvar::session_update(THD *thd, set_var *var)
DBUG_ASSERT(thd == current_thd);
mysql_mutex_lock(&LOCK_global_system_variables);
void *tgt= real_value_ptr(thd, var->type);
void *tgt= real_value_ptr(thd, OPT_SESSION);
const void *src= var->value ? (void*)&var->save_result
: (void*)real_value_ptr(thd, OPT_GLOBAL);
mysql_mutex_unlock(&LOCK_global_system_variables);
......@@ -3322,7 +3327,7 @@ bool sys_var_pluginvar::global_update(THD *thd, set_var *var)
DBUG_ASSERT(!is_readonly());
mysql_mutex_assert_owner(&LOCK_global_system_variables);
void *tgt= real_value_ptr(thd, var->type);
void *tgt= real_value_ptr(thd, OPT_GLOBAL);
const void *src= &var->save_result;
if (!var->value)
......
......@@ -116,10 +116,7 @@ static void get_cs_converted_string_value(THD *thd,
bool use_hex);
#endif
static void
append_algorithm(TABLE_LIST *table, String *buff);
static COND * make_cond_for_info_schema(COND *cond, TABLE_LIST *table);
static void append_algorithm(TABLE_LIST *table, String *buff);
bool get_lookup_field_values(THD *, COND *, TABLE_LIST *, LOOKUP_FIELD_VALUES *);
......@@ -3691,7 +3688,7 @@ bool uses_only_table_name_fields(Item *item, TABLE_LIST *table)
}
static COND * make_cond_for_info_schema(COND *cond, TABLE_LIST *table)
COND *make_cond_for_info_schema(COND *cond, TABLE_LIST *table)
{
if (!cond)
return (COND*) 0;
......@@ -8855,6 +8852,25 @@ ST_FIELD_INFO variables_fields_info[]=
};
ST_FIELD_INFO sysvars_fields_info[]=
{
{"VARIABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, 0},
{"SESSION_VALUE", 1024, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"GLOBAL_VALUE", 1024, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"DEFAULT_VALUE", 1024, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"VARIABLE_SCOPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, 0},
{"VARIABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, 0},
{"VARIABLE_COMMENT", TABLE_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0, 0, 0},
{"NUMERIC_MIN_VALUE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"NUMERIC_MAX_VALUE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"NUMERIC_BLOCK_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"ENUM_VALUE_LIST", 65535, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{"READ_ONLY", 3, MYSQL_TYPE_STRING, 0, 0, 0, 0},
{"COMMAND_LINE_ARGUMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, 0},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0}
};
ST_FIELD_INFO processlist_fields_info[]=
{
{"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", SKIP_OPEN_TABLE},
......@@ -9174,6 +9190,8 @@ ST_SCHEMA_TABLE schema_tables[]=
{"STATISTICS", stat_fields_info, create_schema_table,
get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0,
OPEN_TABLE_ONLY|OPTIMIZE_I_S_TABLE},
{"SYSTEM_VARIABLES", sysvars_fields_info, create_schema_table,
fill_sysvars, make_old_format, 0, 0, -1, 0, 0},
{"TABLES", tables_fields_info, create_schema_table,
get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0,
OPTIMIZE_I_S_TABLE},
......
......@@ -112,6 +112,7 @@ void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
void init_fill_schema_files_row(TABLE* table);
bool schema_table_store_record(THD *thd, TABLE *table);
void initialize_information_schema_acl();
COND *make_cond_for_info_schema(COND *cond, TABLE_LIST *table);
ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name);
ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
......
This diff is collapsed.
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