summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-11-30 11:56:02 +0200
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-30 11:56:02 +0200
commitb8d1398b1d061566ada0714fb2407cdd45ff42b2 (patch)
tree44138f54e7bd45680918dff097b196620a694316 /sql/table.cc
parent9b53e541f03d74e2777e0d1e7618b6246b81c721 (diff)
downloadmariadb-git-b8d1398b1d061566ada0714fb2407cdd45ff42b2.tar.gz
MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
For BIT field null_bit is not set to 0 even for a field defined as NOT NULL. So now in the function TABLE::create_key_part_by_field, if the bit field is not nullable then the null_bit is explicitly set to 0
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 9d52d5f87a2..fbcd91f5326 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -5987,6 +5987,14 @@ void TABLE::create_key_part_by_field(KEY_PART_INFO *key_part_info,
might be reused.
*/
key_part_info->store_length= key_part_info->length;
+ /*
+ For BIT fields null_bit is not set to 0 even if the field is defined
+ as NOT NULL, look at Field_bit::Field_bit
+ */
+ if (!field->real_maybe_null())
+ {
+ key_part_info->null_bit= 0;
+ }
/*
The total store length of the key part is the raw length of the field +