summaryrefslogtreecommitdiff
path: root/sql/structs.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-11-23 18:55:01 +0400
committerAlexander Barkov <bar@mariadb.org>2015-11-23 18:55:01 +0400
commitd73cf394a5361b33baf40afd2a8c1d4edac548c0 (patch)
tree320158af832dc8e74320ff308c3c51eb5549cbfa /sql/structs.h
parentb7e9bf91221663ca70f87d59846ecad848b5c786 (diff)
downloadmariadb-git-d73cf394a5361b33baf40afd2a8c1d4edac548c0.tar.gz
MDEV-9170 Get rid of LEX::length and LEX::dec
A preparatory task for: MDEV-4912 Add a plugin to field types (column types)
Diffstat (limited to 'sql/structs.h')
-rw-r--r--sql/structs.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/sql/structs.h b/sql/structs.h
index 191463af344..8dc6323bde0 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -550,4 +550,74 @@ public:
};
+struct Lex_length_and_dec_st
+{
+private:
+ const char *m_length;
+ const char *m_dec;
+public:
+ void set(const char *length, const char *dec)
+ {
+ m_length= length;
+ m_dec= dec;
+ }
+ const char *length() const { return m_length; }
+ const char *dec() const { return m_dec; }
+};
+
+
+struct Lex_field_type_st: public Lex_length_and_dec_st
+{
+private:
+ enum_field_types m_type;
+ void set(enum_field_types type, const char *length, const char *dec)
+ {
+ m_type= type;
+ Lex_length_and_dec_st::set(length, dec);
+ }
+public:
+ void set(enum_field_types type, Lex_length_and_dec_st length_and_dec)
+ {
+ m_type= type;
+ Lex_length_and_dec_st::operator=(length_and_dec);
+ }
+ void set(enum_field_types type, const char *length)
+ {
+ set(type, length, 0);
+ }
+ void set(enum_field_types type)
+ {
+ set(type, 0, 0);
+ }
+ enum_field_types field_type() const { return m_type; }
+};
+
+
+struct Lex_dyncol_type_st: public Lex_length_and_dec_st
+{
+private:
+ int m_type; // enum_dynamic_column_type is not visible here, so use int
+public:
+ void set(int type, const char *length, const char *dec)
+ {
+ m_type= type;
+ Lex_length_and_dec_st::set(length, dec);
+ }
+ void set(int type, Lex_length_and_dec_st length_and_dec)
+ {
+ m_type= type;
+ Lex_length_and_dec_st::operator=(length_and_dec);
+ }
+ void set(int type, const char *length)
+ {
+ set(type, length, 0);
+ }
+ void set(int type)
+ {
+ set(type, 0, 0);
+ }
+ int dyncol_type() const { return m_type; }
+};
+
+
#endif /* STRUCTS_INCLUDED */