mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-36503 add Pad_attribute column to INFORMATION_SCHEMA.COLLATIONS
Adding a new column in INFORMATION_SCHEMA.COLLATIONS: PAD_ATTRIBUTE ENUM('PAD SPACE','NO PAD') and a new column Pad_attribute into SHOW COLLATION. The new column has been added after SORTLEN but before COMMENT. This order is compatible with MySQL-8.0 order, with the exception that MariaDB has an extra last column COMMENT: MariaDB [test]> desc information_schema.collations; +--------------------+----------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------+----------------------------+------+-----+---------+-------+ | COLLATION_NAME | varchar(64) | NO | | NULL | | | CHARACTER_SET_NAME | varchar(32) | YES | | NULL | | | ID | bigint(11) | YES | | NULL | | | IS_DEFAULT | varchar(3) | YES | | NULL | | | IS_COMPILED | varchar(3) | NO | | NULL | | | SORTLEN | bigint(3) | NO | | NULL | | | PAD_ATTRIBUTE | enum('PAD SPACE','NO PAD') | NO | | NULL | | | COMMENT | varchar(80) | NO | | NULL | | +--------------------+----------------------------+------+-----+---------+-------+ The new Pad_attribute in SHOW COLLATION has been added as the last column. This is also compatible with MySQL: MariaDB [test]> show collation like 'utf8mb4_bin'; +-------------+---------+------+---------+----------+---------+---------------+ | Collation | Charset | Id | Default | Compiled | Sortlen | Pad_attribute | +-------------+---------+------+---------+----------+---------+---------------+ | utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 | PAD SPACE | +-------------+---------+------+---------+----------+---------+---------------+
This commit is contained in:
@ -18,11 +18,11 @@ AND (collation_name LIKE CONCAT(character_set_name,'_general_ci')
|
||||
OR
|
||||
collation_name LIKE CONCAT(character_set_name,'_bin'))
|
||||
ORDER BY collation_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN COMMENT
|
||||
latin1_bin latin1 47 Yes 1 cp1252 West European
|
||||
latin1_general_ci latin1 48 Yes 1 cp1252 West European
|
||||
utf8mb3_bin utf8mb3 83 Yes 1 UTF-8 Unicode
|
||||
utf8mb3_general_ci utf8mb3 33 Yes 1 UTF-8 Unicode
|
||||
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN PAD_ATTRIBUTE COMMENT
|
||||
latin1_bin latin1 47 Yes 1 PAD SPACE cp1252 West European
|
||||
latin1_general_ci latin1 48 Yes 1 PAD SPACE cp1252 West European
|
||||
utf8mb3_bin utf8mb3 83 Yes 1 PAD SPACE UTF-8 Unicode
|
||||
utf8mb3_general_ci utf8mb3 33 Yes 1 PAD SPACE UTF-8 Unicode
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collation_character_set_applicability
|
||||
|
@ -34,6 +34,7 @@ ID bigint(11) YES NULL
|
||||
IS_DEFAULT varchar(3) YES NULL
|
||||
IS_COMPILED varchar(3) NO NULL
|
||||
SORTLEN bigint(3) NO NULL
|
||||
PAD_ATTRIBUTE enum('PAD SPACE','NO PAD') NO NULL
|
||||
COMMENT varchar(80) NO NULL
|
||||
SHOW CREATE TABLE information_schema.COLLATIONS;
|
||||
Table Create Table
|
||||
@ -44,6 +45,7 @@ COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` (
|
||||
`IS_DEFAULT` varchar(3),
|
||||
`IS_COMPILED` varchar(3) NOT NULL,
|
||||
`SORTLEN` bigint(3) NOT NULL,
|
||||
`PAD_ATTRIBUTE` enum('PAD SPACE','NO PAD') NOT NULL,
|
||||
`COMMENT` varchar(80) NOT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
SHOW COLUMNS FROM information_schema.COLLATIONS;
|
||||
@ -54,6 +56,7 @@ ID bigint(11) YES NULL
|
||||
IS_DEFAULT varchar(3) YES NULL
|
||||
IS_COMPILED varchar(3) NO NULL
|
||||
SORTLEN bigint(3) NO NULL
|
||||
PAD_ATTRIBUTE enum('PAD SPACE','NO PAD') NO NULL
|
||||
COMMENT varchar(80) NO NULL
|
||||
# Testcases 3.2.3.2 and 3.2.3.3 are checked in suite/funcs_1/t/charset_collation*.test
|
||||
########################################################################
|
||||
|
@ -59,10 +59,11 @@ def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 26 NULL NO bigint
|
||||
def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS COMMENT 7 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS COMMENT 8 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS ID 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS PAD_ATTRIBUTE 7 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('PAD SPACE','NO PAD') select NEVER NULL NO NO
|
||||
def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL NO NO
|
||||
def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
|
||||
def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
|
||||
@ -643,6 +644,7 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
3.0000 enum utf8mb3 utf8mb3_general_ci
|
||||
3.0000 varchar utf8mb3 utf8mb3_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
@ -740,6 +742,7 @@ NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
|
||||
3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
|
||||
3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
|
||||
NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema COLLATIONS PAD_ATTRIBUTE enum 3 9 utf8mb3 utf8mb3_general_ci enum('PAD SPACE','NO PAD')
|
||||
3.0000 information_schema COLLATIONS COMMENT varchar 80 240 utf8mb3 utf8mb3_general_ci varchar(80)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 32 96 utf8mb3 utf8mb3_general_ci varchar(32)
|
||||
|
@ -59,10 +59,11 @@ def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 26 NULL NO bigint
|
||||
def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS COMMENT 7 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS COMMENT 8 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS ID 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
|
||||
def information_schema COLLATIONS PAD_ATTRIBUTE 7 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('PAD SPACE','NO PAD') NEVER NULL NO NO
|
||||
def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL NO NO
|
||||
def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
|
||||
def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
|
||||
@ -576,6 +577,7 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
3.0000 enum utf8mb3 utf8mb3_general_ci
|
||||
3.0000 varchar utf8mb3 utf8mb3_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
@ -672,6 +674,7 @@ NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
|
||||
3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
|
||||
3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
|
||||
NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema COLLATIONS PAD_ATTRIBUTE enum 3 9 utf8mb3 utf8mb3_general_ci enum('PAD SPACE','NO PAD')
|
||||
3.0000 information_schema COLLATIONS COMMENT varchar 80 240 utf8mb3 utf8mb3_general_ci varchar(80)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 32 96 utf8mb3 utf8mb3_general_ci varchar(32)
|
||||
|
Reference in New Issue
Block a user