Commit 5de39c5a authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm

AES_ENCRYPT(str, key, [, iv [, mode ]])
AES_DECRYPT(str, key, [, iv [, mode ]])

mode is aes-{128,192,256}-{ecb,cbc,ctr} e.g. "aes-128-cbc".

and a @@block_encryption_mode variable for the default value of mode

change in behavior: AES_ENCRYPT(str, key) can no longer
be used in persistent virtual columns (and alike)
parent f94d467d
......@@ -5448,3 +5448,69 @@ Warning 1292 Truncated incorrect BINARY(2) value: '...random bytes...'
#
# End of 10.10 tests
#
#
# MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm
#
select aes_encrypt('foo', 'bar', '1234') = aes_encrypt('foo', 'bar') `expected 1`;
expected 1
1
select aes_encrypt('foo', 'bar', NULL, 'aes-128-ecb') = aes_encrypt('foo', 'bar') `expected 1`;
expected 1
1
select aes_encrypt(1);
ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt'
select aes_encrypt(1,2,3,4,5);
ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt'
select aes_encrypt('foo', 'bar', '0123', 'something');
aes_encrypt('foo', 'bar', '0123', 'something')
NULL
select aes_encrypt('foo', 'bar', '0123', 'aes-111-ecb');
aes_encrypt('foo', 'bar', '0123', 'aes-111-ecb')
NULL
select aes_encrypt('foo', 'bar', '0123', 'aes-128-bar');
aes_encrypt('foo', 'bar', '0123', 'aes-128-bar')
NULL
select aes_encrypt('foo', 'bar', '0123', 'aes-128-cbc');
aes_encrypt('foo', 'bar', '0123', 'aes-128-cbc')
NULL
select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-256-cbc')) `x`;
x
42A3EB91E6DFC40A900D278F99E0726E
select aes_decrypt(x'42A3EB91E6DFC40A900D278F99E0726E', 'bar', '0123456789abcdef###', 'AES-256-CBC') `expected foo`;
expected foo
foo
select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-128-ctr')) `x`;
x
C57C4B
select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef', 'aes-128-ctr') `expected foo`;
expected foo
foo
set @@block_encryption_mode='aes-128-ctr';
select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef');
aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef')
foo
set @@block_encryption_mode='aes-192-cbc';
select hex(aes_encrypt('foo', 'bar'));
hex(aes_encrypt('foo', 'bar'))
NULL
select hex(aes_encrypt('foo', 'bar', 'abcdefghabcdefgh'));
hex(aes_encrypt('foo', 'bar', 'abcdefghabcdefgh'))
9E6F76516B4DE68FED7A77632FC0913D
select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh') `expected foo`;
expected foo
foo
select aes_decrypt(x'00000000000000011111111111111111', 'bar', 'abcdefghabcdefgh') `expected NULL`;
expected NULL
NULL
select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', '0000000011111111') `expected NULL`;
expected NULL
NULL
select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ecb') `expected NULL`;
expected NULL
NULL
select hex(aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ctr')) `expected garbage`;
expected garbage
98D7BC3151620F384B0A953686AF37C9
#
# End of 11.2 tests
#
......@@ -2420,3 +2420,42 @@ select "a" in ("abc", (convert(random_bytes(8) ,binary(2))));
--echo #
--echo # End of 10.10 tests
--echo #
--echo #
--echo # MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm
--echo #
select aes_encrypt('foo', 'bar', '1234') = aes_encrypt('foo', 'bar') `expected 1`;
select aes_encrypt('foo', 'bar', NULL, 'aes-128-ecb') = aes_encrypt('foo', 'bar') `expected 1`;
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
select aes_encrypt(1);
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
select aes_encrypt(1,2,3,4,5);
select aes_encrypt('foo', 'bar', '0123', 'something');
select aes_encrypt('foo', 'bar', '0123', 'aes-111-ecb');
select aes_encrypt('foo', 'bar', '0123', 'aes-128-bar');
select aes_encrypt('foo', 'bar', '0123', 'aes-128-cbc');
select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-256-cbc')) `x`;
select aes_decrypt(x'42A3EB91E6DFC40A900D278F99E0726E', 'bar', '0123456789abcdef###', 'AES-256-CBC') `expected foo`;
select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-128-ctr')) `x`;
select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef', 'aes-128-ctr') `expected foo`;
set @@block_encryption_mode='aes-128-ctr';
select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef');
set @@block_encryption_mode='aes-192-cbc';
select hex(aes_encrypt('foo', 'bar'));
select hex(aes_encrypt('foo', 'bar', 'abcdefghabcdefgh'));
select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh') `expected foo`;
# wrong key
select aes_decrypt(x'00000000000000011111111111111111', 'bar', 'abcdefghabcdefgh') `expected NULL`;
# wrong iv
select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', '0000000011111111') `expected NULL`;
# wrong alg
select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ecb') `expected NULL`;
# but ctr doesn't use padding, so:
select hex(aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ctr')) `expected garbage`;
--echo #
--echo # End of 11.2 tests
--echo #
......@@ -136,6 +136,11 @@ The following specify which files/extra groups are read (specified before remain
non-transactional engines for the binary log. If you
often use statements updating a great number of rows, you
can increase this to get more performance.
--block-encryption-mode=name
Default block encryption mode for AES_ENCRYPT() and
AES_DECRYPT() functions. One of: aes-128-ecb, aes-192-ecb,
aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc,
aes-128-ctr, aes-192-ctr, aes-256-ctr
--bootstrap Used by mysql installation scripts.
--bulk-insert-buffer-size=#
Size of tree cache used in bulk insert optimisation. Note
......@@ -1570,6 +1575,7 @@ binlog-row-event-max-size 8192
binlog-row-image FULL
binlog-row-metadata NO_LOG
binlog-stmt-cache-size 32768
block-encryption-mode aes-128-ecb
bulk-insert-buffer-size 8388608
character-set-client-handshake TRUE
character-set-collations
......
......@@ -45,7 +45,7 @@
VARIABLE_COMMENT Interval between commits in microseconds (1/1000000 sec). 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
@@ -114,7 +114,7 @@ READ_ONLY NO
@@ -124,7 +124,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -54,7 +54,7 @@
VARIABLE_COMMENT Limit for transaction log size
NUMERIC_MIN_VALUE 8388608
NUMERIC_MAX_VALUE 4294967295
@@ -144,10 +144,10 @@ READ_ONLY NO
@@ -154,10 +154,10 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD
VARIABLE_SCOPE GLOBAL
......@@ -67,7 +67,7 @@
NUMERIC_BLOCK_SIZE 100
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -164,7 +164,7 @@ READ_ONLY YES
@@ -174,7 +174,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT
VARIABLE_SCOPE GLOBAL
......@@ -76,7 +76,7 @@
VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
@@ -174,7 +174,7 @@ READ_ONLY NO
@@ -184,7 +184,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_PAGECACHE_FILE_HASH_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -85,7 +85,7 @@
VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files.
NUMERIC_MIN_VALUE 128
NUMERIC_MAX_VALUE 16384
@@ -204,7 +204,7 @@ READ_ONLY NO
@@ -214,7 +214,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ARIA_REPAIR_THREADS
VARIABLE_SCOPE SESSION
......@@ -94,7 +94,7 @@
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
@@ -217,7 +217,7 @@ VARIABLE_SCOPE SESSION
@@ -227,7 +227,7 @@ 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
......@@ -103,7 +103,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -274,7 +274,7 @@ READ_ONLY NO
@@ -284,7 +284,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME AUTO_INCREMENT_INCREMENT
VARIABLE_SCOPE SESSION
......@@ -112,7 +112,7 @@
VARIABLE_COMMENT Auto-increment columns are incremented by this
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
@@ -284,7 +284,7 @@ READ_ONLY NO
@@ -294,7 +294,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME AUTO_INCREMENT_OFFSET
VARIABLE_SCOPE SESSION
......@@ -121,7 +121,7 @@
VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
@@ -294,7 +294,7 @@ READ_ONLY NO
@@ -304,7 +304,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BACK_LOG
VARIABLE_SCOPE GLOBAL
......@@ -130,7 +130,7 @@
VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
@@ -347,7 +347,7 @@ VARIABLE_SCOPE GLOBAL
@@ -357,7 +357,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance
NUMERIC_MIN_VALUE 4096
......@@ -139,7 +139,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -364,20 +364,20 @@ READ_ONLY NO
@@ -374,20 +374,20 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT
VARIABLE_SCOPE GLOBAL
......@@ -164,7 +164,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -394,7 +394,7 @@ READ_ONLY NO
@@ -404,7 +404,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BINLOG_EXPIRE_LOGS_SECONDS
VARIABLE_SCOPE GLOBAL
......@@ -173,7 +173,7 @@
VARIABLE_COMMENT If non-zero, binary logs will be purged after binlog_expire_logs_seconds seconds; It and expire_logs_days are linked, such that changes in one are converted into the other. Possible purges happen at startup and at binary log rotation.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 8553600
@@ -407,7 +407,7 @@ VARIABLE_SCOPE GLOBAL
@@ -417,7 +417,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of file cache for the binary log
NUMERIC_MIN_VALUE 8192
......@@ -182,7 +182,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -457,7 +457,7 @@ VARIABLE_SCOPE GLOBAL
@@ -467,7 +467,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
NUMERIC_MIN_VALUE 4096
......@@ -191,7 +191,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -467,7 +467,7 @@ VARIABLE_SCOPE SESSION
@@ -487,7 +487,7 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
NUMERIC_MIN_VALUE 0
......@@ -200,7 +200,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -654,7 +654,7 @@ READ_ONLY NO
@@ -674,7 +674,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME CONNECT_TIMEOUT
VARIABLE_SCOPE GLOBAL
......@@ -209,7 +209,7 @@
VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 31536000
@@ -704,7 +704,7 @@ READ_ONLY YES
@@ -724,7 +724,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
......@@ -218,7 +218,7 @@
VARIABLE_COMMENT Long search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 33
@@ -714,7 +714,7 @@ READ_ONLY NO
@@ -734,7 +734,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
VARIABLE_SCOPE SESSION
......@@ -227,7 +227,7 @@
VARIABLE_COMMENT Short search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 32
@@ -724,7 +724,7 @@ READ_ONLY NO
@@ -744,7 +744,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
VARIABLE_SCOPE SESSION
......@@ -236,7 +236,7 @@
VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -734,7 +734,7 @@ READ_ONLY NO
@@ -754,7 +754,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
VARIABLE_SCOPE SESSION
......@@ -245,7 +245,7 @@
VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -784,7 +784,7 @@ READ_ONLY NO
@@ -804,7 +804,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DEFAULT_WEEK_FORMAT
VARIABLE_SCOPE SESSION
......@@ -254,7 +254,7 @@
VARIABLE_COMMENT The default week format used by WEEK() functions
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 7
@@ -794,7 +794,7 @@ READ_ONLY NO
@@ -814,7 +814,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_LIMIT
VARIABLE_SCOPE GLOBAL
......@@ -263,7 +263,7 @@
VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -804,7 +804,7 @@ READ_ONLY NO
@@ -824,7 +824,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_TIMEOUT
VARIABLE_SCOPE GLOBAL
......@@ -272,7 +272,7 @@
VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
@@ -814,7 +814,7 @@ READ_ONLY NO
@@ -834,7 +834,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_QUEUE_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -281,7 +281,7 @@
VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -844,7 +844,7 @@ READ_ONLY NO
@@ -864,7 +864,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DIV_PRECISION_INCREMENT
VARIABLE_SCOPE SESSION
......@@ -290,7 +290,7 @@
VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 38
@@ -954,7 +954,7 @@ READ_ONLY YES
@@ -974,7 +974,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME EXTRA_MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
......@@ -299,7 +299,7 @@
VARIABLE_COMMENT The number of connections on extra-port
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
@@ -984,7 +984,7 @@ READ_ONLY NO
@@ -1004,7 +1004,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME FLUSH_TIME
VARIABLE_SCOPE GLOBAL
......@@ -308,7 +308,7 @@
VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
@@ -1014,7 +1014,7 @@ READ_ONLY NO
@@ -1034,7 +1034,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MAX_WORD_LEN
VARIABLE_SCOPE GLOBAL
......@@ -317,7 +317,7 @@
VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
@@ -1024,7 +1024,7 @@ READ_ONLY YES
@@ -1044,7 +1044,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MIN_WORD_LEN
VARIABLE_SCOPE GLOBAL
......@@ -326,7 +326,7 @@
VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 84
@@ -1034,7 +1034,7 @@ READ_ONLY YES
@@ -1054,7 +1054,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
VARIABLE_SCOPE GLOBAL
......@@ -335,7 +335,7 @@
VARIABLE_COMMENT Number of best matches to use for query expansion
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
@@ -1204,7 +1204,7 @@ READ_ONLY YES
@@ -1224,7 +1224,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HISTOGRAM_SIZE
VARIABLE_SCOPE SESSION
......@@ -344,7 +344,7 @@
VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
@@ -1234,7 +1234,7 @@ READ_ONLY YES
@@ -1254,7 +1254,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HOST_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -353,7 +353,7 @@
VARIABLE_COMMENT How many host names should be cached to avoid resolving.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65536
@@ -1344,7 +1344,7 @@ READ_ONLY NO
@@ -1364,7 +1364,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME INTERACTIVE_TIMEOUT
VARIABLE_SCOPE SESSION
......@@ -362,7 +362,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
@@ -1377,7 +1377,7 @@ VARIABLE_SCOPE SESSION
@@ -1397,7 +1397,7 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer that is used for joins
NUMERIC_MIN_VALUE 128
......@@ -371,7 +371,7 @@
NUMERIC_BLOCK_SIZE 128
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1394,7 +1394,7 @@ READ_ONLY NO
@@ -1414,7 +1414,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME JOIN_CACHE_LEVEL
VARIABLE_SCOPE SESSION
......@@ -380,7 +380,7 @@
VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 8
@@ -1417,7 +1417,7 @@ VARIABLE_SCOPE GLOBAL
@@ -1437,7 +1437,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
NUMERIC_MIN_VALUE 0
......@@ -389,7 +389,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1574,7 +1574,7 @@ READ_ONLY YES
@@ -1594,7 +1594,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME LOCK_WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
......@@ -398,7 +398,7 @@
VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
@@ -1694,7 +1694,7 @@ READ_ONLY NO
@@ -1714,7 +1714,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
......@@ -407,7 +407,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -1734,7 +1734,7 @@ READ_ONLY NO
@@ -1754,7 +1754,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
VARIABLE_SCOPE SESSION
......@@ -416,7 +416,7 @@
VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -1764,7 +1764,7 @@ READ_ONLY NO
@@ -1784,7 +1784,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_WARNINGS
VARIABLE_SCOPE SESSION
......@@ -425,7 +425,7 @@
VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -1814,7 +1814,7 @@ READ_ONLY NO
@@ -1834,7 +1834,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MAX_ALLOWED_PACKET
VARIABLE_SCOPE SESSION
......@@ -434,7 +434,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
@@ -1827,14 +1827,14 @@ VARIABLE_SCOPE GLOBAL
@@ -1847,14 +1847,14 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the transactional cache
NUMERIC_MIN_VALUE 4096
......@@ -451,7 +451,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
@@ -1847,14 +1847,14 @@ VARIABLE_SCOPE GLOBAL
@@ -1867,14 +1867,14 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the statement cache
NUMERIC_MIN_VALUE 4096
......@@ -468,7 +468,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
@@ -1864,7 +1864,7 @@ READ_ONLY NO
@@ -1884,7 +1884,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECT_ERRORS
VARIABLE_SCOPE GLOBAL
......@@ -477,7 +477,7 @@
VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -1874,7 +1874,7 @@ READ_ONLY NO
@@ -1894,7 +1894,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_DELAYED_THREADS
VARIABLE_SCOPE SESSION
......@@ -486,7 +486,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
@@ -1894,7 +1894,7 @@ READ_ONLY YES
@@ -1914,7 +1914,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_ERROR_COUNT
VARIABLE_SCOPE SESSION
......@@ -495,7 +495,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
@@ -1907,14 +1907,14 @@ VARIABLE_SCOPE SESSION
@@ -1927,14 +1927,14 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
......@@ -512,7 +512,7 @@
VARIABLE_COMMENT Alias for max_delayed_threads. Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
@@ -1934,7 +1934,7 @@ READ_ONLY NO
@@ -1954,7 +1954,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
VARIABLE_SCOPE SESSION
......@@ -521,7 +521,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
@@ -1964,7 +1964,7 @@ READ_ONLY NO
@@ -1984,7 +1984,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
VARIABLE_SCOPE SESSION
......@@ -530,7 +530,7 @@
VARIABLE_COMMENT Maximum number of iterations when executing recursive queries
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -1977,14 +1977,14 @@ VARIABLE_SCOPE SESSION
@@ -1997,14 +1997,14 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum size of the container of a rowid filter
NUMERIC_MIN_VALUE 1024
......@@ -547,7 +547,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -2004,7 +2004,7 @@ READ_ONLY NO
@@ -2024,7 +2024,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
VARIABLE_SCOPE SESSION
......@@ -556,7 +556,7 @@
VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
NUMERIC_MIN_VALUE 64
NUMERIC_MAX_VALUE 8388608
@@ -2014,7 +2014,7 @@ READ_ONLY NO
@@ -2034,7 +2034,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SP_RECURSION_DEPTH
VARIABLE_SCOPE SESSION
......@@ -565,7 +565,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
@@ -2034,7 +2034,7 @@ READ_ONLY NO
@@ -2054,7 +2054,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_TMP_TABLES
VARIABLE_SCOPE SESSION
......@@ -574,7 +574,7 @@
VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -2054,7 +2054,7 @@ READ_ONLY NO
@@ -2074,7 +2074,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_WRITE_LOCK_COUNT
VARIABLE_SCOPE GLOBAL
......@@ -583,7 +583,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -2064,7 +2064,7 @@ READ_ONLY NO
@@ -2084,7 +2084,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -592,7 +592,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
@@ -2074,7 +2074,7 @@ READ_ONLY YES
@@ -2094,7 +2094,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -601,7 +601,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
@@ -2084,7 +2084,7 @@ READ_ONLY YES
@@ -2104,7 +2104,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
......@@ -610,7 +610,7 @@
VARIABLE_COMMENT Alias for log_slow_min_examined_row_limit. Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -2094,7 +2094,7 @@ READ_ONLY NO
@@ -2114,7 +2114,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MRR_BUFFER_SIZE
VARIABLE_SCOPE SESSION
......@@ -619,7 +619,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
@@ -2104,7 +2104,7 @@ READ_ONLY NO
@@ -2124,7 +2124,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -628,7 +628,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
@@ -2114,7 +2114,7 @@ READ_ONLY YES
@@ -2134,7 +2134,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -637,7 +637,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
@@ -2137,7 +2137,7 @@ VARIABLE_SCOPE GLOBAL
@@ -2157,7 +2157,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
NUMERIC_MIN_VALUE 7
......@@ -646,7 +646,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
@@ -2154,10 +2154,10 @@ READ_ONLY YES
@@ -2174,10 +2174,10 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MYISAM_REPAIR_THREADS
VARIABLE_SCOPE SESSION
......@@ -659,7 +659,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -2167,7 +2167,7 @@ VARIABLE_SCOPE SESSION
@@ -2187,7 +2187,7 @@ 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
......@@ -668,7 +668,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -2204,7 +2204,7 @@ READ_ONLY NO
@@ -2224,7 +2224,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME NET_BUFFER_LENGTH
VARIABLE_SCOPE SESSION
......@@ -677,7 +677,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
@@ -2214,7 +2214,7 @@ READ_ONLY NO
@@ -2234,7 +2234,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_READ_TIMEOUT
VARIABLE_SCOPE SESSION
......@@ -686,7 +686,7 @@
VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
@@ -2224,7 +2224,7 @@ READ_ONLY NO
@@ -2244,7 +2244,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_RETRY_COUNT
VARIABLE_SCOPE SESSION
......@@ -695,7 +695,7 @@
VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -2234,7 +2234,7 @@ READ_ONLY NO
@@ -2254,7 +2254,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_WRITE_TIMEOUT
VARIABLE_SCOPE SESSION
......@@ -704,7 +704,7 @@
VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
@@ -2284,7 +2284,7 @@ READ_ONLY NO
@@ -2294,7 +2294,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
......@@ -713,7 +713,7 @@
VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 or autoset then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -2294,7 +2294,7 @@ READ_ONLY YES
@@ -2324,7 +2324,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_EXTRA_PRUNING_DEPTH
VARIABLE_SCOPE SESSION
......@@ -722,7 +722,7 @@
VARIABLE_COMMENT If the optimizer needs to enumerate join prefix of this size or larger, then it will try aggressively prune away the search space.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
@@ -2304,17 +2304,17 @@ READ_ONLY NO
@@ -2384,17 +2384,17 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARG_WEIGHT
VARIABLE_SCOPE SESSION
......@@ -743,7 +743,7 @@
VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search: 1 - prune plans based on cost and number of retrieved rows eq_ref: 2 - prune also if we find an eq_ref chain
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
@@ -2324,7 +2324,7 @@ READ_ONLY NO
@@ -2464,7 +2464,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
......@@ -752,7 +752,7 @@
VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
@@ -2334,7 +2334,7 @@ READ_ONLY NO
@@ -2474,7 +2474,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
VARIABLE_SCOPE SESSION
......@@ -761,7 +761,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
@@ -2364,17 +2364,17 @@ READ_ONLY NO
@@ -2504,17 +2504,17 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE_MAX_MEM_SIZE
VARIABLE_SCOPE SESSION
......@@ -782,7 +782,7 @@
VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5
@@ -2394,7 +2394,7 @@ READ_ONLY YES
@@ -2544,7 +2544,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -791,7 +791,7 @@
VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2404,7 +2404,7 @@ READ_ONLY YES
@@ -2554,7 +2554,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -800,7 +800,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2414,7 +2414,7 @@ READ_ONLY YES
@@ -2564,7 +2564,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -809,7 +809,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2424,7 +2424,7 @@ READ_ONLY YES
@@ -2574,7 +2574,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -818,7 +818,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
@@ -2434,7 +2434,7 @@ READ_ONLY YES
@@ -2584,7 +2584,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -827,7 +827,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2444,7 +2444,7 @@ READ_ONLY YES
@@ -2594,7 +2594,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -836,7 +836,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
@@ -2454,7 +2454,7 @@ READ_ONLY YES
@@ -2604,7 +2604,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_TRANSACTIONS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -845,7 +845,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_TRANSACTIONS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2464,7 +2464,7 @@ READ_ONLY YES
@@ -2614,7 +2614,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_TRANSACTIONS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -854,7 +854,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_TRANSACTIONS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
@@ -2474,7 +2474,7 @@ READ_ONLY YES
@@ -2624,7 +2624,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -863,7 +863,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2484,7 +2484,7 @@ READ_ONLY YES
@@ -2634,7 +2634,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -872,7 +872,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
@@ -2494,7 +2494,7 @@ READ_ONLY YES
@@ -2644,7 +2644,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -881,7 +881,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2504,7 +2504,7 @@ READ_ONLY YES
@@ -2654,7 +2654,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -890,7 +890,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2514,7 +2514,7 @@ READ_ONLY YES
@@ -2664,7 +2664,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -899,7 +899,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2524,7 +2524,7 @@ READ_ONLY YES
@@ -2674,7 +2674,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
VARIABLE_SCOPE GLOBAL
......@@ -908,7 +908,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
@@ -2534,7 +2534,7 @@ READ_ONLY YES
@@ -2684,7 +2684,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -917,7 +917,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2544,7 +2544,7 @@ READ_ONLY YES
@@ -2694,7 +2694,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
VARIABLE_SCOPE GLOBAL
......@@ -926,7 +926,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
@@ -2554,7 +2554,7 @@ READ_ONLY YES
@@ -2704,7 +2704,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -935,7 +935,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2564,7 +2564,7 @@ READ_ONLY YES
@@ -2714,7 +2714,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_INDEX_STAT
VARIABLE_SCOPE GLOBAL
......@@ -944,7 +944,7 @@
VARIABLE_COMMENT Maximum number of index statistics for instrumented tables. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2574,7 +2574,7 @@ READ_ONLY YES
@@ -2724,7 +2724,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MEMORY_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -953,7 +953,7 @@
VARIABLE_COMMENT Maximum number of memory pool instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
@@ -2584,7 +2584,7 @@ READ_ONLY YES
@@ -2734,7 +2734,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_METADATA_LOCKS
VARIABLE_SCOPE GLOBAL
......@@ -962,7 +962,7 @@
VARIABLE_COMMENT Maximum number of metadata locks. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
@@ -2594,7 +2594,7 @@ READ_ONLY YES
@@ -2744,7 +2744,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -971,7 +971,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2604,7 +2604,7 @@ READ_ONLY YES
@@ -2754,7 +2754,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -980,7 +980,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
@@ -2614,7 +2614,7 @@ READ_ONLY YES
@@ -2764,7 +2764,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_PREPARED_STATEMENTS_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -989,7 +989,7 @@
VARIABLE_COMMENT Maximum number of instrumented prepared statements. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2624,7 +2624,7 @@ READ_ONLY YES
@@ -2774,7 +2774,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_PROGRAM_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -998,7 +998,7 @@
VARIABLE_COMMENT Maximum number of instrumented programs. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2634,7 +2634,7 @@ READ_ONLY YES
@@ -2784,7 +2784,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -1007,7 +1007,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2644,7 +2644,7 @@ READ_ONLY YES
@@ -2794,7 +2794,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -1016,7 +1016,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
@@ -2654,7 +2654,7 @@ READ_ONLY YES
@@ -2804,7 +2804,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -1025,7 +1025,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2664,7 +2664,7 @@ READ_ONLY YES
@@ -2814,7 +2814,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -1034,7 +1034,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2674,7 +2674,7 @@ READ_ONLY YES
@@ -2824,7 +2824,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SQL_TEXT_LENGTH
VARIABLE_SCOPE GLOBAL
......@@ -1043,7 +1043,7 @@
VARIABLE_COMMENT Maximum length of displayed sql text.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
@@ -2684,7 +2684,7 @@ READ_ONLY YES
@@ -2834,7 +2834,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -1052,7 +1052,7 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2694,7 +2694,7 @@ READ_ONLY YES
@@ -2844,7 +2844,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -1061,7 +1061,7 @@
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2704,7 +2704,7 @@ READ_ONLY YES
@@ -2854,7 +2854,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_STACK
VARIABLE_SCOPE GLOBAL
......@@ -1070,7 +1070,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_CURRENT.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 256
@@ -2714,7 +2714,7 @@ READ_ONLY YES
@@ -2864,7 +2864,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
VARIABLE_SCOPE GLOBAL
......@@ -1079,7 +1079,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2724,7 +2724,7 @@ READ_ONLY YES
@@ -2874,7 +2874,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -1088,7 +1088,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2734,7 +2734,7 @@ READ_ONLY YES
@@ -2884,7 +2884,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_LOCK_STAT
VARIABLE_SCOPE GLOBAL
......@@ -1097,7 +1097,7 @@
VARIABLE_COMMENT Maximum number of lock statistics for instrumented tables. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2744,7 +2744,7 @@ READ_ONLY YES
@@ -2894,7 +2894,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
VARIABLE_SCOPE GLOBAL
......@@ -1106,7 +1106,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
@@ -2754,7 +2754,7 @@ READ_ONLY YES
@@ -2904,7 +2904,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
VARIABLE_SCOPE GLOBAL
......@@ -1115,7 +1115,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2764,7 +2764,7 @@ READ_ONLY YES
@@ -2914,7 +2914,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -1124,7 +1124,7 @@
VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2774,7 +2774,7 @@ READ_ONLY YES
@@ -2924,7 +2924,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -1133,7 +1133,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
@@ -2784,7 +2784,7 @@ READ_ONLY YES
@@ -2934,7 +2934,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -1142,7 +1142,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2794,7 +2794,7 @@ READ_ONLY YES
@@ -2944,7 +2944,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -1151,7 +1151,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
@@ -2844,7 +2844,7 @@ READ_ONLY YES
@@ -2994,7 +2994,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PRELOAD_BUFFER_SIZE
VARIABLE_SCOPE SESSION
......@@ -1160,7 +1160,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
@@ -2864,7 +2864,7 @@ READ_ONLY NO
@@ -3014,7 +3014,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME PROFILING_HISTORY_SIZE
VARIABLE_SCOPE SESSION
......@@ -1169,7 +1169,7 @@
VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
@@ -2874,7 +2874,7 @@ READ_ONLY NO
@@ -3024,7 +3024,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PROGRESS_REPORT_TIME
VARIABLE_SCOPE SESSION
......@@ -1178,7 +1178,7 @@
VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -2934,7 +2934,7 @@ READ_ONLY NO
@@ -3084,7 +3084,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
VARIABLE_SCOPE SESSION
......@@ -1187,7 +1187,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
@@ -2944,7 +2944,7 @@ READ_ONLY NO
@@ -3094,7 +3094,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_LIMIT
VARIABLE_SCOPE GLOBAL
......@@ -1196,7 +1196,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -2954,7 +2954,7 @@ READ_ONLY NO
@@ -3104,7 +3104,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
VARIABLE_SCOPE GLOBAL
......@@ -1205,7 +1205,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
@@ -2967,7 +2967,7 @@ VARIABLE_SCOPE GLOBAL
@@ -3117,7 +3117,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
......@@ -1214,7 +1214,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3004,7 +3004,7 @@ READ_ONLY NO
@@ -3154,7 +3154,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME QUERY_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
......@@ -1223,7 +1223,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
@@ -3017,7 +3017,7 @@ VARIABLE_SCOPE SESSION ONLY
@@ -3167,7 +3167,7 @@ VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
......@@ -1232,7 +1232,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3027,14 +3027,14 @@ VARIABLE_SCOPE SESSION ONLY
@@ -3177,14 +3177,14 @@ VARIABLE_SCOPE SESSION ONLY
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
......@@ -1249,7 +1249,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
@@ -3044,7 +3044,7 @@ READ_ONLY NO
@@ -3194,7 +3194,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME READ_BUFFER_SIZE
VARIABLE_SCOPE SESSION
......@@ -1258,7 +1258,7 @@
VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
@@ -3064,7 +3064,7 @@ READ_ONLY NO
@@ -3214,7 +3214,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME READ_RND_BUFFER_SIZE
VARIABLE_SCOPE SESSION
......@@ -1267,7 +1267,7 @@
VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 2147483647
@@ -3084,10 +3084,10 @@ READ_ONLY NO
@@ -3234,10 +3234,10 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ROWID_MERGE_BUFF_SIZE
VARIABLE_SCOPE SESSION
......@@ -1280,7 +1280,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3124,7 +3124,7 @@ READ_ONLY YES
@@ -3274,7 +3274,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
......@@ -1289,7 +1289,7 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
@@ -3204,7 +3204,7 @@ READ_ONLY NO
@@ -3354,7 +3354,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET
VARIABLE_SCOPE GLOBAL
......@@ -1298,7 +1298,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
@@ -3214,7 +3214,7 @@ READ_ONLY NO
@@ -3364,7 +3364,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLOW_LAUNCH_TIME
VARIABLE_SCOPE GLOBAL
......@@ -1307,7 +1307,7 @@
VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
@@ -3257,7 +3257,7 @@ VARIABLE_SCOPE SESSION
@@ -3407,7 +3407,7 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
NUMERIC_MIN_VALUE 1024
......@@ -1316,7 +1316,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3474,7 +3474,7 @@ READ_ONLY NO
@@ -3624,7 +3624,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME STORED_PROGRAM_CACHE
VARIABLE_SCOPE GLOBAL
......@@ -1325,7 +1325,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
@@ -3564,7 +3564,7 @@ READ_ONLY NO
@@ -3714,7 +3714,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
......@@ -1334,7 +1334,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 2097152
@@ -3574,7 +3574,7 @@ READ_ONLY NO
@@ -3724,7 +3724,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
VARIABLE_SCOPE GLOBAL
......@@ -1343,7 +1343,7 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
@@ -3634,7 +3634,7 @@ READ_ONLY NO
@@ -3784,7 +3784,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
......@@ -1352,7 +1352,7 @@
VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
@@ -3717,7 +3717,7 @@ VARIABLE_SCOPE SESSION
@@ -3867,7 +3867,7 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
......@@ -1361,7 +1361,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3727,7 +3727,7 @@ VARIABLE_SCOPE SESSION
@@ -3877,7 +3877,7 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size.
NUMERIC_MIN_VALUE 0
......@@ -1370,7 +1370,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -3737,14 +3737,14 @@ VARIABLE_SCOPE SESSION
@@ -3887,14 +3887,14 @@ VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 0
......@@ -1387,8 +1387,8 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
@@ -3754,7 +3754,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
@@ -3914,7 +3914,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
......@@ -1396,7 +1396,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
@@ -3894,7 +3894,7 @@ READ_ONLY YES
@@ -4064,7 +4064,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
......@@ -1405,7 +1405,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
@@ -3921,7 +3921,7 @@ order by variable_name;
@@ -4091,7 +4091,7 @@ order by variable_name;
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
......
......@@ -472,6 +472,16 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BLOCK_ENCRYPTION_MODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Default block encryption mode for AES_ENCRYPT() and AES_DECRYPT() functions
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST aes-128-ecb,aes-192-ecb,aes-256-ecb,aes-128-cbc,aes-192-cbc,aes-256-cbc,aes-128-ctr,aes-192-ctr,aes-256-ctr
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BULK_INSERT_BUFFER_SIZE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
......
......@@ -512,6 +512,16 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BLOCK_ENCRYPTION_MODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Default block encryption mode for AES_ENCRYPT() and AES_DECRYPT() functions
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST aes-128-ecb,aes-192-ecb,aes-256-ecb,aes-128-cbc,aes-192-cbc,aes-256-cbc,aes-128-ctr,aes-192-ctr,aes-256-ctr
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BULK_INSERT_BUFFER_SIZE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
......
SET @@session.default_storage_engine = 'MyISAM';
# AES_ENCRYPT() without the mode (4th argument)
create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd')) PERSISTENT);
ERROR HY000: Function or expression 'aes_encrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd','def')) PERSISTENT);
ERROR HY000: Function or expression 'aes_encrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd')) PERSISTENT);
ERROR HY000: Function or expression 'aes_decrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd','def')) PERSISTENT);
ERROR HY000: Function or expression 'aes_decrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# RAND()
create or replace table t1 (b double as (rand()));
create or replace table t1 (b double as (rand()) PERSISTENT);
......
......@@ -19,6 +19,16 @@
# to check for things that should not work for either VIRTUAL or PERSISTENT
#
--echo # AES_ENCRYPT() without the mode (4th argument)
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd')) PERSISTENT);
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd','def')) PERSISTENT);
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd')) PERSISTENT);
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd','def')) PERSISTENT);
--echo # RAND()
create or replace table t1 (b double as (rand()));
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
......
......@@ -141,10 +141,11 @@ class Create_func_addtime : public Create_func_arg2
};
class Create_func_aes_encrypt : public Create_func_arg2
class Create_func_aes_encrypt : public Create_native_func
{
public:
virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_aes_encrypt s_singleton;
......@@ -154,10 +155,11 @@ class Create_func_aes_encrypt : public Create_func_arg2
};
class Create_func_aes_decrypt : public Create_func_arg2
class Create_func_aes_decrypt : public Create_native_func
{
public:
virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_aes_decrypt s_singleton;
......@@ -2953,18 +2955,48 @@ Create_func_addtime::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_aes_encrypt Create_func_aes_encrypt::s_singleton;
Item*
Create_func_aes_encrypt::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_aes_encrypt::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
return new (thd->mem_root) Item_func_aes_encrypt(thd, arg1, arg2);
uint arg_count= item_list->elements;
Item *a[4];
for (uint i=0; i < MY_MIN(array_elements(a), arg_count); i++)
a[i]= item_list->pop();
switch (arg_count)
{
case 2:
return new (thd->mem_root) Item_func_aes_encrypt(thd, a[0], a[1]);
case 3:
return new (thd->mem_root) Item_func_aes_encrypt(thd, a[0], a[1], a[2]);
case 4:
return new (thd->mem_root) Item_func_aes_encrypt(thd, a[0], a[1], a[2], a[3]);
}
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
return NULL;
}
Create_func_aes_decrypt Create_func_aes_decrypt::s_singleton;
Item*
Create_func_aes_decrypt::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_aes_decrypt::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
return new (thd->mem_root) Item_func_aes_decrypt(thd, arg1, arg2);
uint arg_count= item_list->elements;
Item *a[4];
for (uint i=0; i < MY_MIN(array_elements(a), arg_count); i++)
a[i]= item_list->pop();
switch (arg_count)
{
case 2:
return new (thd->mem_root) Item_func_aes_decrypt(thd, a[0], a[1]);
case 3:
return new (thd->mem_root) Item_func_aes_decrypt(thd, a[0], a[1], a[2]);
case 4:
return new (thd->mem_root) Item_func_aes_decrypt(thd, a[0], a[1], a[2], a[3]);
}
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
return NULL;
}
......
......@@ -54,6 +54,7 @@ C_MODE_END
#include "sql_show.h" // append_identifier
#include <sql_repl.h>
#include "sql_statistics.h"
#include "strfunc.h"
/* fmtlib include (https://fmt.dev/). */
#define FMT_STATIC_THOUSANDS_SEPARATOR ','
......@@ -309,24 +310,54 @@ bool Item_func_sha2::fix_length_and_dec(THD *thd)
break;
default:
THD *thd= current_thd;
push_warning_printf(thd,
Sql_condition::WARN_LEVEL_WARN,
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_PARAMETERS_TO_NATIVE_FCT,
ER_THD(thd, ER_WRONG_PARAMETERS_TO_NATIVE_FCT),
"sha2");
ER_THD(thd, ER_WRONG_PARAMETERS_TO_NATIVE_FCT), "sha2");
}
return FALSE;
}
const char *block_encryption_mode_values[]= {
"aes-128-ecb", "aes-192-ecb", "aes-256-ecb",
"aes-128-cbc", "aes-192-cbc", "aes-256-cbc",
"aes-128-ctr", "aes-192-ctr", "aes-256-ctr",
NullS };
TYPELIB block_encryption_mode_typelib= {9, 0, block_encryption_mode_values, 0};
static inline uint block_encryption_mode_to_key_length(ulong bem)
{ return (bem % 3 + 2) * 64; }
static inline my_aes_mode block_encryption_mode_to_aes_mode(ulong bem)
{ return (my_aes_mode)(bem / 3); }
/* Implementation of AES encryption routines */
int Item_aes_crypt::parse_mode()
{
StringBuffer<80> buf;
String *ptr= args[3]->val_str_ascii(&buf);
ulong bem;
if (ptr == NULL)
goto err;
bem= find_type(&block_encryption_mode_typelib, ptr->ptr(), ptr->length(), 0);
if (!bem)
goto err;
aes_key_length= block_encryption_mode_to_key_length(bem - 1);
aes_mode= block_encryption_mode_to_aes_mode(bem - 1);
return 0;
err:
return 1;
}
void Item_aes_crypt::create_key(String *user_key, uchar *real_key)
{
uchar *real_key_end= real_key + AES_KEY_LENGTH / 8;
uchar *real_key_end= real_key + aes_key_length / 8;
uchar *ptr;
const char *sptr= user_key->ptr();
const char *key_end= sptr + user_key->length();
bzero(real_key, AES_KEY_LENGTH / 8);
bzero(real_key, aes_key_length / 8);
for (ptr= real_key; sptr < key_end; ptr++, sptr++)
{
......@@ -340,24 +371,36 @@ void Item_aes_crypt::create_key(String *user_key, uchar *real_key)
String *Item_aes_crypt::val_str(String *str2)
{
DBUG_ASSERT(fixed());
StringBuffer<80> user_key_buf;
StringBuffer<80> user_key_buf, iv_buf;
String *sptr= args[0]->val_str(&tmp_value);
String *user_key= args[1]->val_str(&user_key_buf);
String *user_key= args[1]->val_str(&user_key_buf);
String *iv= NULL;
uint32 aes_length;
if (sptr && user_key) // we need both arguments to be not NULL
{
null_value=0;
aes_length=my_aes_get_size(MY_AES_ECB, sptr->length());
if (arg_count > 3 && (null_value= parse_mode()))
return 0;
if (aes_mode != MY_AES_ECB)
{
if (arg_count > 2)
iv= args[2]->val_str(&iv_buf);
if ((null_value= (!iv || iv->length() < MY_AES_BLOCK_SIZE)))
return 0;
}
aes_length=my_aes_get_size(aes_mode, sptr->length());
if (!str2->alloc(aes_length)) // Ensure that memory is free
{
uchar rkey[AES_KEY_LENGTH / 8];
uchar *rkey= (uchar*)alloca(aes_key_length / 8);
create_key(user_key, rkey);
if (!my_aes_crypt(MY_AES_ECB, what, (uchar*)sptr->ptr(), sptr->length(),
if (!my_aes_crypt(aes_mode, what, (uchar*)sptr->ptr(), sptr->length(),
(uchar*)str2->ptr(), &aes_length,
rkey, AES_KEY_LENGTH / 8, 0, 0))
rkey, aes_key_length / 8,
iv ? (uchar*)iv->ptr() : 0, iv ? iv->length() : 0))
{
str2->length((uint) aes_length);
DBUG_ASSERT(collation.collation == &my_charset_bin);
......@@ -370,20 +413,23 @@ String *Item_aes_crypt::val_str(String *str2)
return 0;
}
bool Item_aes_crypt::fix_fields(THD *thd, Item **ref)
{
aes_key_length= block_encryption_mode_to_key_length(thd->variables.block_encryption_mode);
aes_mode= block_encryption_mode_to_aes_mode(thd->variables.block_encryption_mode);
return Item_str_binary_checksum_func::fix_fields(thd, ref);
}
bool Item_func_aes_encrypt::fix_length_and_dec(THD *thd)
{
max_length=my_aes_get_size(MY_AES_ECB, args[0]->max_length);
what= ENCRYPTION_FLAG_ENCRYPT;
return FALSE;
}
bool Item_func_aes_decrypt::fix_length_and_dec(THD *thd)
{
max_length=args[0]->max_length;
set_maybe_null();
what= ENCRYPTION_FLAG_DECRYPT;
return FALSE;
}
......
......@@ -129,6 +129,10 @@ class Item_str_binary_checksum_func: public Item_str_func
:Item_str_func(thd, a) { }
Item_str_binary_checksum_func(THD *thd, Item *a, Item *b)
:Item_str_func(thd, a, b) { }
Item_str_binary_checksum_func(THD *thd, Item *a, Item *b, Item *c)
:Item_str_func(thd, a, b, c) { }
Item_str_binary_checksum_func(THD *thd, Item *a, Item *b, Item *c, Item *d)
:Item_str_func(thd, a, b, c, d) { }
bool eq(const Item *item, bool binary_cmp) const
{
/*
......@@ -229,23 +233,39 @@ class Item_func_from_base64 :public Item_str_binary_checksum_func
class Item_aes_crypt :public Item_str_binary_checksum_func
{
enum { AES_KEY_LENGTH = 128 };
void create_key(String *user_key, uchar* key);
protected:
int what;
int parse_mode();
String tmp_value;
const int what;
uint aes_key_length;
enum my_aes_mode aes_mode;
public:
Item_aes_crypt(THD *thd, Item *a, Item *b)
:Item_str_binary_checksum_func(thd, a, b) {}
String *val_str(String *);
Item_aes_crypt(THD *thd, int what, Item *a, Item *b)
: Item_str_binary_checksum_func(thd, a, b), what(what) {}
Item_aes_crypt(THD *thd, int what, Item *a, Item *b, Item *c)
: Item_str_binary_checksum_func(thd, a, b, c), what(what) {}
Item_aes_crypt(THD *thd, int what, Item *a, Item *b, Item *c, Item *d)
: Item_str_binary_checksum_func(thd, a, b, c, d), what(what) {}
bool fix_fields(THD *thd, Item **ref) override;
String *val_str(String *) override;
bool check_vcol_func_processor(void *arg) override
{
if (arg_count > 3)
return FALSE;
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
};
class Item_func_aes_encrypt :public Item_aes_crypt
{
public:
Item_func_aes_encrypt(THD *thd, Item *a, Item *b)
:Item_aes_crypt(thd, a, b) {}
:Item_aes_crypt(thd, ENCRYPTION_FLAG_ENCRYPT, a, b) {}
Item_func_aes_encrypt(THD *thd, Item *a, Item *b, Item *c)
:Item_aes_crypt(thd, ENCRYPTION_FLAG_ENCRYPT, a, b, c) {}
Item_func_aes_encrypt(THD *thd, Item *a, Item *b, Item *c, Item *d)
:Item_aes_crypt(thd, ENCRYPTION_FLAG_ENCRYPT, a, b, c, d) {}
bool fix_length_and_dec(THD *thd) override;
LEX_CSTRING func_name_cstring() const override
{
......@@ -260,7 +280,11 @@ class Item_func_aes_decrypt :public Item_aes_crypt
{
public:
Item_func_aes_decrypt(THD *thd, Item *a, Item *b):
Item_aes_crypt(thd, a, b) {}
Item_aes_crypt(thd, ENCRYPTION_FLAG_DECRYPT, a, b) {}
Item_func_aes_decrypt(THD *thd, Item *a, Item *b, Item *c):
Item_aes_crypt(thd, ENCRYPTION_FLAG_DECRYPT, a, b, c) {}
Item_func_aes_decrypt(THD *thd, Item *a, Item *b, Item *c, Item *d):
Item_aes_crypt(thd, ENCRYPTION_FLAG_DECRYPT, a, b, c, d) {}
bool fix_length_and_dec(THD *thd) override;
LEX_CSTRING func_name_cstring() const override
{
......
......@@ -781,6 +781,7 @@ typedef struct system_variables
ulong trans_alloc_block_size;
ulong trans_prealloc_size;
ulong log_warnings;
ulong block_encryption_mode;
/* Flags for slow log filtering */
ulong log_slow_rate_limit;
ulong binlog_format; ///< binlog format for this thd (see enum_binlog_format)
......
......@@ -7174,3 +7174,10 @@ static Sys_var_optimizer_cost Sys_optimizer_scan_cost(
CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 100000000), DEFAULT(DEFAULT_TABLE_SCAN_SETUP_COST),
COST_ADJUST(1000));
extern const char *block_encryption_mode_values[];
static Sys_var_enum Sys_block_encryption_mode(
"block_encryption_mode", "Default block encryption mode for "
"AES_ENCRYPT() and AES_DECRYPT() functions",
SESSION_VAR(block_encryption_mode), CMD_LINE(REQUIRED_ARG),
block_encryption_mode_values, DEFAULT(0));
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