diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-05-05 16:12:54 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-05-05 16:12:54 +0400 |
commit | ac53b49b1be807f588aebd83883ec93b764f5d54 (patch) | |
tree | c86cbdb535eefb15e2077a7ac2ffaeff9d76955e /sql/field.h | |
parent | 583b68e89961c35fa95a06c38988f82e33c73f4a (diff) | |
parent | db0917f68f2681882974afd53935aa8cba29c6b8 (diff) | |
download | mariadb-git-ac53b49b1be807f588aebd83883ec93b764f5d54.tar.gz |
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/sql/field.h b/sql/field.h index ccc116f7a25..1333c924fa5 100644 --- a/sql/field.h +++ b/sql/field.h @@ -518,7 +518,10 @@ inline bool is_temporal_type(enum_field_types type) enum enum_vcol_info_type { VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED, - VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE + VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE, + /* Additional types should be added here */ + /* Following is the highest value last */ + VCOL_TYPE_NONE = 127 // Since the 0 value is already in use }; static inline const char *vcol_type_name(enum_vcol_info_type type) @@ -533,6 +536,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type) case VCOL_CHECK_FIELD: case VCOL_CHECK_TABLE: return "CHECK"; + case VCOL_TYPE_NONE: + return "UNTYPED"; } return 0; } @@ -546,7 +551,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type) #define VCOL_NON_DETERMINISTIC 2 #define VCOL_SESSION_FUNC 4 /* uses session data, e.g. USER or DAYNAME */ #define VCOL_TIME_FUNC 8 -#define VCOL_IMPOSSIBLE 16 +#define VCOL_AUTO_INC 16 +#define VCOL_IMPOSSIBLE 32 #define VCOL_NOT_STRICTLY_DETERMINISTIC \ (VCOL_NON_DETERMINISTIC | VCOL_TIME_FUNC | VCOL_SESSION_FUNC) @@ -564,6 +570,7 @@ static inline const char *vcol_type_name(enum_vcol_info_type type) class Virtual_column_info: public Sql_alloc { private: + enum_vcol_info_type vcol_type; /* Virtual column expression type */ /* The following data is only updated by the parser and read when a Create_field object is created/initialized. @@ -581,7 +588,8 @@ public: uint flags; Virtual_column_info() - : field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), + : vcol_type((enum_vcol_info_type)VCOL_TYPE_NONE), + field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), in_partitioning_expr(FALSE), stored_in_db(FALSE), utf8(TRUE), expr(NULL), flags(0) { @@ -589,6 +597,19 @@ public: name.length= 0; }; ~Virtual_column_info() {} + enum_vcol_info_type get_vcol_type() const + { + return vcol_type; + } + void set_vcol_type(enum_vcol_info_type v_type) + { + vcol_type= v_type; + } + const char *get_vcol_type_name() const + { + DBUG_ASSERT(vcol_type != VCOL_TYPE_NONE); + return vcol_type_name(vcol_type); + } enum_field_types get_real_type() const { return field_type; |