1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00
This commit is contained in:
pappa@c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
2005-07-22 17:05:16 -04:00
parent 2061b38e64
commit 476a4907eb
2 changed files with 8 additions and 2 deletions

View File

@@ -185,6 +185,12 @@ public:
return test(record[(uint) (null_ptr - (uchar*) table->record[0])] &
null_bit);
}
inline bool is_null_in_record_with_offset(my_ptrdiff_t offset)
{
if (!null_ptr)
return 0;
return test(null_ptr[offset] & null_bit);
}
inline void set_null(int row_offset=0)
{ if (null_ptr) null_ptr[row_offset]|= null_bit; }
inline void set_notnull(int row_offset=0)

View File

@@ -473,8 +473,8 @@ int key_rec_cmp(void *key, byte *first_rec, byte *second_rec)
if (key_part->null_bit)
{
/* The key_part can contain NULL values */
bool first_is_null= field->is_null(first_diff);
bool sec_is_null= field->is_null(sec_diff);
bool first_is_null= field->is_null_in_record_with_offset(first_diff);
bool sec_is_null= field->is_null_in_record_with_offset(sec_diff);
/*
NULL is smaller then everything so if first is NULL and the other
not then we know that we should return -1 and for the opposite