1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-6065 MySQL Bug#13623473 "MISSING ROWS ON SELECT AND JOIN WITH TIME/DATETIME COMPARE"

fix for ref like "indexed_time = datetime"
This commit is contained in:
Sergei Golubchik
2014-06-11 10:08:08 +02:00
parent 2510f9c606
commit 6e8d49b8f5
6 changed files with 2553 additions and 5 deletions

View File

@ -1852,6 +1852,12 @@ public:
class Field_time :public Field_temporal {
/*
when this Field_time instance is used for storing values for index lookups
(see class store_key, Field::new_key_field(), etc), the following
might be set to TO_DAYS(CURDATE()). See also Field_time::store_time_dec()
*/
long curdays;
protected:
virtual void store_TIME(MYSQL_TIME *ltime);
int store_TIME_with_warning(MYSQL_TIME *ltime, const ErrConv *str,
@ -1861,7 +1867,7 @@ public:
uchar null_bit_arg, enum utype unireg_check_arg,
const char *field_name_arg)
:Field_temporal(ptr_arg, length_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg)
unireg_check_arg, field_name_arg), curdays(0)
{}
enum_field_types type() const { return MYSQL_TYPE_TIME;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
@ -1880,6 +1886,10 @@ public:
uint32 pack_length() const { return 3; }
void sql_type(String &str) const;
uint size_of() const { return sizeof(*this); }
void set_curdays(THD *thd);
Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uint32 length,
uchar *new_null_ptr, uint new_null_bit);
};