summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-09-28 10:21:25 +0300
committerGeorgi Kodinov <joro@sun.com>2009-09-28 10:21:25 +0300
commit2118bd104c4dd7c2aab0b80fa7053d8a491a90c4 (patch)
tree0600a41e4dca737e1cc98e02c2d8353e5ca4ff5b /sql/field.h
parentdb5c088b456408a1b4bda6f1298ae2ae9b202cac (diff)
downloadmariadb-git-2118bd104c4dd7c2aab0b80fa7053d8a491a90c4.tar.gz
Ported WL#3220 to mysql-next-mr.
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/field.h b/sql/field.h
index a9299256f88..ffcf665d45f 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1934,9 +1934,12 @@ public:
virtual bool str_needs_quotes() { return TRUE; }
my_decimal *val_decimal(my_decimal *);
int cmp(const uchar *a, const uchar *b)
- {
- DBUG_ASSERT(ptr == a);
- return Field_bit::key_cmp(b, bytes_in_rec+test(bit_len));
+ {
+ DBUG_ASSERT(ptr == a || ptr == b);
+ if (ptr == a)
+ return Field_bit::key_cmp(b, bytes_in_rec+test(bit_len));
+ else
+ return Field_bit::key_cmp(a, bytes_in_rec+test(bit_len)) * -1;
}
int cmp_binary_offset(uint row_offset)
{ return cmp_offset(row_offset); }