summaryrefslogtreecommitdiff
path: root/sql/structs.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/structs.h')
-rw-r--r--sql/structs.h41
1 files changed, 28 insertions, 13 deletions
diff --git a/sql/structs.h b/sql/structs.h
index 12b5dee0055..8aec29bac41 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -118,13 +118,13 @@ typedef struct st_key {
pk2 is explicitly present in idx1, it is not in the extension, so
ext_key_part_map.is_set(1) == false
*/
- LEX_CSTRING name;
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;
+ LEX_CSTRING name;
uint block_size;
enum ha_key_alg algorithm;
/*
@@ -705,26 +705,41 @@ public:
struct Lex_for_loop_bounds_st
{
public:
- class sp_assignment_lex *m_index;
- class sp_assignment_lex *m_upper_bound;
+ class sp_assignment_lex *m_index; // The first iteration value (or cursor)
+ class sp_assignment_lex *m_target_bound; // The last iteration value
int8 m_direction;
bool m_implicit_cursor;
- bool is_for_loop_cursor() const { return m_upper_bound == NULL; }
+ bool is_for_loop_cursor() const { return m_target_bound == NULL; }
+};
+
+
+class Lex_for_loop_bounds_intrange: public Lex_for_loop_bounds_st
+{
+public:
+ Lex_for_loop_bounds_intrange(int8 direction,
+ class sp_assignment_lex *left_expr,
+ class sp_assignment_lex *right_expr)
+ {
+ m_direction= direction;
+ m_index= direction > 0 ? left_expr : right_expr;
+ m_target_bound= direction > 0 ? right_expr : left_expr;
+ m_implicit_cursor= false;
+ }
};
struct Lex_for_loop_st
{
public:
- class sp_variable *m_index;
- class sp_variable *m_upper_bound;
+ class sp_variable *m_index; // The first iteration value (or cursor)
+ class sp_variable *m_target_bound; // The last iteration value
int m_cursor_offset;
int8 m_direction;
bool m_implicit_cursor;
void init()
{
m_index= 0;
- m_upper_bound= 0;
+ m_target_bound= 0;
m_direction= 0;
m_implicit_cursor= false;
}
@@ -732,7 +747,7 @@ public:
{
*this= other;
}
- bool is_for_loop_cursor() const { return m_upper_bound == NULL; }
+ bool is_for_loop_cursor() const { return m_target_bound == NULL; }
bool is_for_loop_explicit_cursor() const
{
return is_for_loop_cursor() && !m_implicit_cursor;
@@ -846,17 +861,17 @@ public:
class Timeval: public timeval
{
+protected:
+ Timeval() { }
public:
Timeval(my_time_t sec, ulong usec)
{
tv_sec= sec;
tv_usec= usec;
}
- Timeval &trunc(uint dec)
- {
- my_timeval_trunc(this, dec);
- return *this;
- }
+ explicit Timeval(const timeval &tv)
+ :timeval(tv)
+ { }
};