diff options
author | Alexander Barkov <bar@mariadb.com> | 2022-04-28 11:23:12 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2022-04-28 12:12:16 +0400 |
commit | 821808c45dd3c5d4bc98cd04810732f647872747 (patch) | |
tree | ce2b40ce40f3c61dd3d0567e453f73d86fad0c17 /sql/sql_show.cc | |
parent | 34b002d0dceeec035b7f55a5026400d2b36918cd (diff) | |
download | mariadb-git-821808c45dd3c5d4bc98cd04810732f647872747.tar.gz |
A clean-up for "MDEV-19772 Add helper classes for ST_FIELD_INFO"
As agreed with Serg, renaming class Yesno to Yes_or_empty,
to reflect better its behavior.
This helper class is used to define INFORMATION_SCHEMA columns
that return either "Yes" or an empty string.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 647bbfe1f8d..85169783393 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -9035,7 +9035,7 @@ ST_FIELD_INFO columns_fields_info[]= Column("ORDINAL_POSITION", ULonglong(), NOT_NULL, OPEN_FRM_ONLY), Column("COLUMN_DEFAULT", Longtext(MAX_FIELD_VARCHARLENGTH), NULLABLE, "Default",OPEN_FRM_ONLY), - Column("IS_NULLABLE", Yesno(), NOT_NULL, "Null", OPEN_FRM_ONLY), + Column("IS_NULLABLE", Yes_or_empty(), NOT_NULL, "Null", OPEN_FRM_ONLY), Column("DATA_TYPE", Name(), NOT_NULL, OPEN_FRM_ONLY), Column("CHARACTER_MAXIMUM_LENGTH",ULonglong(), NULLABLE, OPEN_FRM_ONLY), Column("CHARACTER_OCTET_LENGTH", ULonglong(), NULLABLE, OPEN_FRM_ONLY), @@ -9072,8 +9072,8 @@ ST_FIELD_INFO collation_fields_info[]= Column("COLLATION_NAME", CSName(), NOT_NULL, "Collation"), Column("CHARACTER_SET_NAME", CSName(), NOT_NULL, "Charset"), Column("ID", SLonglong(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL, "Id"), - Column("IS_DEFAULT", Yesno(), NOT_NULL, "Default"), - Column("IS_COMPILED", Yesno(), NOT_NULL, "Compiled"), + Column("IS_DEFAULT", Yes_or_empty(), NOT_NULL, "Default"), + Column("IS_COMPILED", Yes_or_empty(), NOT_NULL, "Compiled"), Column("SORTLEN", SLonglong(3), NOT_NULL, "Sortlen"), CEnd() }; @@ -9081,10 +9081,10 @@ ST_FIELD_INFO collation_fields_info[]= ST_FIELD_INFO applicable_roles_fields_info[]= { - Column("GRANTEE", Userhost(), NOT_NULL), + Column("GRANTEE", Userhost(), NOT_NULL), Column("ROLE_NAME", Varchar(USERNAME_CHAR_LENGTH), NOT_NULL), - Column("IS_GRANTABLE", Yesno(), NOT_NULL), - Column("IS_DEFAULT", Yesno(), NULLABLE), + Column("IS_GRANTABLE", Yes_or_empty(), NOT_NULL), + Column("IS_DEFAULT", Yes_or_empty(), NULLABLE), CEnd() }; @@ -9227,7 +9227,7 @@ ST_FIELD_INFO view_fields_info[]= Column("TABLE_NAME", Name(), NOT_NULL, OPEN_FRM_ONLY), Column("VIEW_DEFINITION", Longtext(65535), NOT_NULL, OPEN_FRM_ONLY), Column("CHECK_OPTION", Varchar(8), NOT_NULL, OPEN_FRM_ONLY), - Column("IS_UPDATABLE", Yesno(), NOT_NULL, OPEN_FULL_TABLE), + Column("IS_UPDATABLE", Yes_or_empty(), NOT_NULL, OPEN_FULL_TABLE), Column("DEFINER", Definer(), NOT_NULL, OPEN_FRM_ONLY), Column("SECURITY_TYPE", Varchar(7), NOT_NULL, OPEN_FRM_ONLY), Column("CHARACTER_SET_CLIENT", CSName(), NOT_NULL, OPEN_FRM_ONLY), @@ -9239,46 +9239,46 @@ ST_FIELD_INFO view_fields_info[]= ST_FIELD_INFO user_privileges_fields_info[]= { - Column("GRANTEE", Userhost(), NOT_NULL), - Column("TABLE_CATALOG", Catalog(), NOT_NULL), - Column("PRIVILEGE_TYPE", Name(), NOT_NULL), - Column("IS_GRANTABLE", Yesno(), NOT_NULL), + Column("GRANTEE", Userhost(), NOT_NULL), + Column("TABLE_CATALOG", Catalog(), NOT_NULL), + Column("PRIVILEGE_TYPE", Name(), NOT_NULL), + Column("IS_GRANTABLE", Yes_or_empty(), NOT_NULL), CEnd() }; ST_FIELD_INFO schema_privileges_fields_info[]= { - Column("GRANTEE", Userhost(), NOT_NULL), - Column("TABLE_CATALOG", Catalog(), NOT_NULL), - Column("TABLE_SCHEMA", Name(), NOT_NULL), - Column("PRIVILEGE_TYPE", Name(), NOT_NULL), - Column("IS_GRANTABLE", Yesno(), NOT_NULL), + Column("GRANTEE", Userhost(), NOT_NULL), + Column("TABLE_CATALOG", Catalog(), NOT_NULL), + Column("TABLE_SCHEMA", Name(), NOT_NULL), + Column("PRIVILEGE_TYPE", Name(), NOT_NULL), + Column("IS_GRANTABLE", Yes_or_empty(), NOT_NULL), CEnd() }; ST_FIELD_INFO table_privileges_fields_info[]= { - Column("GRANTEE", Userhost(), NOT_NULL), - Column("TABLE_CATALOG", Catalog(), NOT_NULL), - Column("TABLE_SCHEMA", Name(), NOT_NULL), - Column("TABLE_NAME", Name(), NOT_NULL), - Column("PRIVILEGE_TYPE", Name(), NOT_NULL), - Column("IS_GRANTABLE", Yesno(), NOT_NULL), + Column("GRANTEE", Userhost(), NOT_NULL), + Column("TABLE_CATALOG", Catalog(), NOT_NULL), + Column("TABLE_SCHEMA", Name(), NOT_NULL), + Column("TABLE_NAME", Name(), NOT_NULL), + Column("PRIVILEGE_TYPE", Name(), NOT_NULL), + Column("IS_GRANTABLE", Yes_or_empty(), NOT_NULL), CEnd() }; ST_FIELD_INFO column_privileges_fields_info[]= { - Column("GRANTEE", Userhost(), NOT_NULL), - Column("TABLE_CATALOG", Catalog(), NOT_NULL), - Column("TABLE_SCHEMA", Name(), NOT_NULL), - Column("TABLE_NAME", Name(), NOT_NULL), - Column("COLUMN_NAME", Name(), NOT_NULL), - Column("PRIVILEGE_TYPE", Name(), NOT_NULL), - Column("IS_GRANTABLE", Yesno(), NOT_NULL), + Column("GRANTEE", Userhost(), NOT_NULL), + Column("TABLE_CATALOG", Catalog(), NOT_NULL), + Column("TABLE_SCHEMA", Name(), NOT_NULL), + Column("TABLE_NAME", Name(), NOT_NULL), + Column("COLUMN_NAME", Name(), NOT_NULL), + Column("PRIVILEGE_TYPE", Name(), NOT_NULL), + Column("IS_GRANTABLE", Yes_or_empty(), NOT_NULL), CEnd() }; @@ -9419,7 +9419,7 @@ ST_FIELD_INFO sysvars_fields_info[]= Column("NUMERIC_MAX_VALUE", Varchar(MY_INT64_NUM_DECIMAL_DIGITS), NULLABLE), Column("NUMERIC_BLOCK_SIZE", Varchar(MY_INT64_NUM_DECIMAL_DIGITS), NULLABLE), Column("ENUM_VALUE_LIST", Longtext(65535), NULLABLE), - Column("READ_ONLY", Yesno(), NOT_NULL), + Column("READ_ONLY", Yes_or_empty(), NOT_NULL), Column("COMMAND_LINE_ARGUMENT",Name(), NULLABLE), Column("GLOBAL_VALUE_PATH", Varchar(2048), NULLABLE), CEnd() |