diff options
Diffstat (limited to 'sql/structs.h')
-rw-r--r-- | sql/structs.h | 93 |
1 files changed, 85 insertions, 8 deletions
diff --git a/sql/structs.h b/sql/structs.h index 1aa26eec4eb..743dee66c57 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -1,8 +1,8 @@ #ifndef STRUCTS_INCLUDED #define STRUCTS_INCLUDED -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2017, MariaDB Corporation. +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. + Copyright (c) 2009, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,15 @@ #include "thr_lock.h" /* thr_lock_type */ #include "my_base.h" /* ha_rows, ha_key_alg */ #include <mysql_com.h> /* USERNAME_LENGTH */ +#include "sql_bitmap.h" + +#if MAX_INDEXES <= 64 +typedef Bitmap<64> key_map; /* Used for finding keys */ +#elif MAX_INDEXES > 128 +#error "MAX_INDEXES values greater than 128 is not supported." +#else +typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */ +#endif struct TABLE; class Type_handler; @@ -110,6 +119,13 @@ typedef struct st_key { ext_key_part_map.is_set(1) == false */ key_part_map ext_key_part_map; + /* + Bitmap of indexes having common parts with this index + (only key parts from key definitions are taken into account) + */ + key_map overlapped; + /* Set of keys constraint correlated with this key */ + key_map constraint_correlated; LEX_CSTRING name; uint block_size; enum ha_key_alg algorithm; @@ -200,6 +216,17 @@ extern const char *show_comp_option_name[]; typedef int *(*update_var)(THD *, struct st_mysql_show_var *); +struct USER_AUTH : public Sql_alloc +{ + LEX_CSTRING plugin, auth_str, pwtext; + USER_AUTH *next; + USER_AUTH() : next(NULL) + { + plugin.str= auth_str.str= ""; + pwtext.str= NULL; + plugin.length= auth_str.length= pwtext.length= 0; + } +}; struct AUTHID { @@ -224,13 +251,10 @@ struct AUTHID struct LEX_USER: public AUTHID { - LEX_CSTRING plugin, auth; - LEX_CSTRING pwtext, pwhash; - void reset_auth() + USER_AUTH *auth; + bool has_auth() { - pwtext.length= pwhash.length= plugin.length= auth.length= 0; - pwtext.str= pwhash.str= 0; - plugin.str= auth.str= ""; + return auth && (auth->plugin.length || auth->auth_str.length || auth->pwtext.length); } }; @@ -770,6 +794,43 @@ public: }; +class st_select_lex; + +class Lex_select_lock +{ +public: + struct + { + uint defined_lock:1; + uint update_lock:1; + uint defined_timeout:1; + }; + ulong timeout; + + + void empty() + { + defined_lock= update_lock= defined_timeout= FALSE; + timeout= 0; + } + void set_to(st_select_lex *sel); +}; + +class Lex_select_limit +{ +public: + bool explicit_limit; + Item *select_limit, *offset_limit; + + void empty() + { + explicit_limit= FALSE; + select_limit= offset_limit= NULL; + } +}; + +struct st_order; + class Load_data_param { protected: @@ -806,4 +867,20 @@ public: }; +class Timeval: public timeval +{ +protected: + Timeval() { } +public: + Timeval(my_time_t sec, ulong usec) + { + tv_sec= sec; + tv_usec= usec; + } + explicit Timeval(const timeval &tv) + :timeval(tv) + { } +}; + + #endif /* STRUCTS_INCLUDED */ |