From 2a0b6de41bfd6cbd2ab2c02381ea89bb6bb612a4 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 13 Nov 2018 18:02:08 +0400 Subject: MDEV-17253 Oracle compatibility: The REVERSE key word for FOR loop behaves incorrectly --- sql/structs.h | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index d8b95a3509a..be9abbf4613 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -692,26 +692,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; } @@ -719,7 +734,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; -- cgit v1.2.1 From 740ce108a52120fe6b2933ce8f3e82d8cf12ae8c Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 22 Nov 2018 14:53:25 +0400 Subject: MDEV-17792 New class Timestamp and cleanups in Date, Datetime, Field for rounding --- sql/structs.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index c9b973d351a..dec1e4de0c7 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -853,11 +853,6 @@ public: tv_sec= sec; tv_usec= usec; } - Timeval &trunc(uint dec) - { - my_timeval_trunc(this, dec); - return *this; - } }; -- cgit v1.2.1 From a25ce5ab4b38f0557abba8c5eb71b0839dc1ec4b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 8 Dec 2018 16:10:44 +0400 Subject: MDEV-17928 Conversion from TIMESTAMP to VARCHAR SP variables does not work well on fractional digits --- sql/structs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index dec1e4de0c7..c7af86ee6a5 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -853,6 +853,9 @@ public: tv_sec= sec; tv_usec= usec; } + explicit Timeval(const timeval &tv) + :timeval(tv) + { } }; -- cgit v1.2.1 From 34eb98387f8f46a80fb053081dbe20d415f23b39 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 8 Dec 2018 19:39:23 +0400 Subject: MDEV-13995 MAX(timestamp) returns a wrong result near DST change --- sql/structs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index c7af86ee6a5..8728dee1918 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -847,6 +847,8 @@ public: class Timeval: public timeval { +protected: + Timeval() { } public: Timeval(my_time_t sec, ulong usec) { -- cgit v1.2.1 From dce2cc1c6a82d1ed9f4db9c39bc9cb1d3815a019 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 12 Dec 2018 11:35:21 +0100 Subject: fix handler test failures on s390x keyinfo->name is a LEX_CSTRING also, fix the location comment (that applied to ext_key_part_map) --- sql/structs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index be9abbf4613..5cc392c33b7 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -109,8 +109,8 @@ 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; + LEX_CSTRING name; uint block_size; enum ha_key_alg algorithm; /* -- cgit v1.2.1