diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-08-02 11:05:29 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-08-02 11:05:29 +0200 |
commit | ef7cb0a0b5108b74c23bf6190f7df2cbfe2996a6 (patch) | |
tree | 5c5c70ee11cdf4414a9cc9a5eacdae881933c70a /sql/field.h | |
parent | 5ec40fbb2704a0bf1369836d88a5def4721809c8 (diff) | |
parent | 09ec8e2e2246f9fb67fd41631c5669d9ae26b2e5 (diff) | |
download | mariadb-git-ef7cb0a0b5108b74c23bf6190f7df2cbfe2996a6.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sql/field.h b/sql/field.h index d5e2cb25788..18e44f1d9d4 100644 --- a/sql/field.h +++ b/sql/field.h @@ -270,7 +270,7 @@ protected: }; - // String-to-number convertion methods for the old code compatibility + // String-to-number conversion methods for the old code compatibility longlong longlong_from_string_with_check(CHARSET_INFO *cs, const char *cptr, const char *end) const { @@ -351,7 +351,7 @@ public: /* Item context attributes. Comparison functions pass their attributes to propagate_equal_fields(). - For exmple, for string comparison, the collation of the comparison + For example, for string comparison, the collation of the comparison operation is important inside propagate_equal_fields(). */ class Context @@ -484,7 +484,7 @@ inline bool is_timestamp_type(enum_field_types type) /** - Convert temporal real types as retuned by field->real_type() + Convert temporal real types as returned by field->real_type() to field type as returned by field->type(). @param real_type Real type. @@ -1055,9 +1055,13 @@ public: return type(); } inline int cmp(const uchar *str) { return cmp(ptr,str); } - virtual int cmp_max(const uchar *a, const uchar *b, uint max_len) - { return cmp(a, b); } virtual int cmp(const uchar *,const uchar *)=0; + /* + The following method is used for comparing prefix keys. + Currently it's only used in partitioning. + */ + virtual int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) + { return cmp(a, b); } virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) { return memcmp(a,b,pack_length()); } virtual int cmp_offset(uint row_offset) @@ -3268,11 +3272,8 @@ public: longlong val_int(void); String *val_str(String*,String *); my_decimal *val_decimal(my_decimal *); - int cmp_max(const uchar *, const uchar *, uint max_length); - int cmp(const uchar *a,const uchar *b) - { - return cmp_max(a, b, ~0U); - } + int cmp(const uchar *a,const uchar *b); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); void sort_string(uchar *buff,uint length); uint get_key_image(uchar *buff,uint length, imagetype type); void set_key_image(const uchar *buff,uint length); @@ -3389,9 +3390,8 @@ public: longlong val_int(void); String *val_str(String*,String *); my_decimal *val_decimal(my_decimal *); - int cmp_max(const uchar *, const uchar *, uint max_length); - int cmp(const uchar *a,const uchar *b) - { return cmp_max(a, b, ~0U); } + int cmp(const uchar *a,const uchar *b); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length); int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U); int key_cmp(const uchar *,const uchar*); @@ -3725,7 +3725,7 @@ private: This is the reason: - Field_bit::cmp_binary() is only implemented in the base class (Field::cmp_binary()). - - Field::cmp_binary() currenly use pack_length() to calculate how + - Field::cmp_binary() currently uses pack_length() to calculate how long the data is. - pack_length() includes size of the bits stored in the NULL bytes of the record. @@ -3780,7 +3780,7 @@ public: } int cmp_binary_offset(uint row_offset) { return cmp_offset(row_offset); } - int cmp_max(const uchar *a, const uchar *b, uint max_length); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); int key_cmp(const uchar *a, const uchar *b) { return cmp_binary((uchar *) a, (uchar *) b); } int key_cmp(const uchar *str, uint length); |