Commit 821808c4 authored by Alexander Barkov's avatar Alexander Barkov

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.
parent 34b002d0
......@@ -156,10 +156,10 @@ class Longtext: public Type
};
class Yesno: public Varchar
class Yes_or_empty: public Varchar
{
public:
Yesno(): Varchar(3) { }
Yes_or_empty(): Varchar(3) { }
};
......
......@@ -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()
......
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