summaryrefslogtreecommitdiff
path: root/sql/structs.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-19 19:58:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-19 20:22:33 +0200
commitdde2ca4aa108b611b5fdfc970146b28461ef08bf (patch)
tree08f90bb9d54413af23230ccf99f18391596afa34 /sql/structs.h
parentb5ac863f1494920b5e7035c9dfa0ebfdaa50a15d (diff)
parentfd58bb71e22196c3c5e8d20b92bce6f343f1dea1 (diff)
downloadmariadb-git-dde2ca4aa108b611b5fdfc970146b28461ef08bf.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/structs.h')
-rw-r--r--sql/structs.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/sql/structs.h b/sql/structs.h
index 9ff52bccb40..c9b973d351a 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -691,26 +691,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;
}
@@ -718,7 +733,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;