diff options
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 76 |
1 files changed, 8 insertions, 68 deletions
diff --git a/sql/table.h b/sql/table.h index 1c721624d5d..1a7e5fbd4dc 100644 --- a/sql/table.h +++ b/sql/table.h @@ -31,6 +31,7 @@ #include "thr_lock.h" /* thr_lock_type */ #include "filesort_utils.h" #include "parse_file.h" +#include "sql_i_s.h" /* Structs that defines the TABLE */ @@ -1108,9 +1109,6 @@ struct st_cond_statistic; #define CHECK_ROW_FOR_NULLS_TO_REJECT (1 << 0) #define REJECT_ROW_DUE_TO_NULL_FIELDS (1 << 1) -/* Bitmap of table's fields */ -typedef Bitmap<MAX_FIELDS> Field_map; - class SplM_opt_info; struct vers_select_conds_t; @@ -1411,6 +1409,13 @@ public: SplM_opt_info *spl_opt_info; key_map keys_usable_for_splitting; + /* + Conjunction of the predicates of the form IS NOT NULL(f) where f refers to + a column of this TABLE such that they can be inferred from the condition + of the WHERE clause or from some ON expression of the processed select + and can be useful for range optimizer. + */ + Item *notnull_cond; inline void reset() { bzero((void*)this, sizeof(*this)); } void init(THD *thd, TABLE_LIST *tl); @@ -1678,71 +1683,6 @@ typedef struct st_foreign_key_info LEX_CSTRING *fk_option_name(enum_fk_option opt); bool fk_modifies_child(enum_fk_option opt); -#define MY_I_S_MAYBE_NULL 1U -#define MY_I_S_UNSIGNED 2U - - -#define SKIP_OPEN_TABLE 0U // do not open table -#define OPEN_FRM_ONLY 1U // open FRM file only -#define OPEN_FULL_TABLE 2U // open FRM,MYD, MYI files - -typedef struct st_field_info -{ - /** - This is used as column name. - */ - const char* field_name; - /** - For string-type columns, this is the maximum number of - characters. Otherwise, it is the 'display-length' for the column. - */ - uint field_length; - /** - This denotes data type for the column. For the most part, there seems to - be one entry in the enum for each SQL data type, although there seem to - be a number of additional entries in the enum. - */ - enum enum_field_types field_type; - int value; - /** - This is used to set column attributes. By default, columns are @c NOT - @c NULL and @c SIGNED, and you can deviate from the default - by setting the appopriate flags. You can use either one of the flags - @c MY_I_S_MAYBE_NULL and @cMY_I_S_UNSIGNED or - combine them using the bitwise or operator @c |. Both flags are - defined in table.h. - */ - uint field_flags; // Field atributes(maybe_null, signed, unsigned etc.) - const char* old_name; - /** - This should be one of @c SKIP_OPEN_TABLE, - @c OPEN_FRM_ONLY or @c OPEN_FULL_TABLE. - */ - uint open_method; -} ST_FIELD_INFO; - - -struct TABLE_LIST; -typedef class Item COND; - -typedef struct st_schema_table -{ - const char *table_name; - ST_FIELD_INFO *fields_info; - /* for FLUSH table_name */ - int (*reset_table) (); - /* Fill table with data */ - int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond); - /* Handle fileds for old SHOW */ - int (*old_format) (THD *thd, struct st_schema_table *schema_table); - int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table, - bool res, const LEX_CSTRING *db_name, - const LEX_CSTRING *table_name); - int idx_field1, idx_field2; - bool hidden; - uint i_s_requested_object; /* the object we need to open(TABLE | VIEW) */ -} ST_SCHEMA_TABLE; - class IS_table_read_plan; /* |