summaryrefslogtreecommitdiff
path: root/sql/sql_i_s.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-01-21 14:27:17 +0400
committerAlexander Barkov <bar@mariadb.com>2020-01-22 08:04:53 +0400
commitdaf28db027a8bdcb7b2b69c54639fec35a2dd259 (patch)
tree7caff6125234c89859c50163550fe10f4c6b6796 /sql/sql_i_s.h
parentc20bf8fd494edd4e4931557395b8a2bdf6cc48ab (diff)
downloadmariadb-git-daf28db027a8bdcb7b2b69c54639fec35a2dd259.tar.gz
MDEV-21537 InnoDB INFORMATION_SCHEMA tables fail to define DEFAULT for ENUM NOT NULL
- Adding a way to define I_S columns without DEFAULT. - Fixing all ENUM columns in I_S.INNODB* table definitions to have no DEFAULT.
Diffstat (limited to 'sql/sql_i_s.h')
-rw-r--r--sql/sql_i_s.h43
1 files changed, 38 insertions, 5 deletions
diff --git a/sql/sql_i_s.h b/sql/sql_i_s.h
index 4ca669a5610..b9a768f1452 100644
--- a/sql/sql_i_s.h
+++ b/sql/sql_i_s.h
@@ -45,6 +45,13 @@ enum enum_show_open_table
};
+enum enum_show_default
+{
+ DEFAULT_TYPE_IMPLICIT= 0,
+ DEFAULT_NONE
+};
+
+
namespace Show {
class Type
{
@@ -88,21 +95,30 @@ class ST_FIELD_INFO: public Show::Type
protected:
LEX_CSTRING m_name; // I_S column name
enum_nullability m_nullability; // NULLABLE or NOT NULL
+ enum_show_default m_def; // Whether has a DEFAULT value
LEX_CSTRING m_old_name; // SHOW column name
enum_show_open_table m_open_method;
public:
ST_FIELD_INFO(const LEX_CSTRING &name, const Type &type,
enum_nullability nullability,
+ enum_show_default def,
LEX_CSTRING &old_name,
enum_show_open_table open_method)
- :Type(type), m_name(name), m_nullability(nullability), m_old_name(old_name),
+ :Type(type), m_name(name),
+ m_nullability(nullability),
+ m_def(def),
+ m_old_name(old_name),
m_open_method(open_method)
{ }
ST_FIELD_INFO(const char *name, const Type &type,
enum_nullability nullability,
+ enum_show_default def,
const char *old_name,
enum_show_open_table open_method)
- :Type(type), m_nullability(nullability), m_open_method(open_method)
+ :Type(type),
+ m_nullability(nullability),
+ m_def(def),
+ m_open_method(open_method)
{
m_name.str= name;
m_name.length= safe_strlen(name);
@@ -111,6 +127,7 @@ public:
}
const LEX_CSTRING &name() const { return m_name; }
bool nullable() const { return m_nullability == NULLABLE; }
+ enum_show_default def() const { return m_def; }
const LEX_CSTRING &old_name() const { return m_old_name; }
enum_show_open_table open_method() const { return m_open_method; }
bool end_marker() const { return m_name.str == NULL; }
@@ -279,14 +296,30 @@ public:
class Column: public ST_FIELD_INFO
{
public:
- Column(const char *name, const Type &type, enum_nullability nullability,
+ Column(const char *name, const Type &type,
+ enum_nullability nullability,
+ enum_show_default def,
const char *old_name,
enum_show_open_table open_method= SKIP_OPEN_TABLE)
- :ST_FIELD_INFO(name, type, nullability, old_name, open_method)
+ :ST_FIELD_INFO(name, type, nullability, def, old_name, open_method)
{ }
Column(const char *name, const Type &type, enum_nullability nullability,
+ enum_show_default def,
+ enum_show_open_table open_method= SKIP_OPEN_TABLE)
+ :ST_FIELD_INFO(name, type, nullability, def, NullS, open_method)
+ { }
+ Column(const char *name, const Type &type,
+ enum_nullability nullability,
+ const char *old_name,
+ enum_show_open_table open_method= SKIP_OPEN_TABLE)
+ :ST_FIELD_INFO(name, type, nullability, DEFAULT_TYPE_IMPLICIT,
+ old_name, open_method)
+ { }
+ Column(const char *name, const Type &type,
+ enum_nullability nullability,
enum_show_open_table open_method= SKIP_OPEN_TABLE)
- :Column(name, type, nullability, NullS, open_method)
+ :ST_FIELD_INFO(name, type, nullability, DEFAULT_TYPE_IMPLICIT,
+ NullS, open_method)
{ }
};