Skip to content

Commit 5eb510f

Browse files
author
Ole John Aske
committed
Merge branch 'mysql-5.6-cluster-7.3' into mysql-5.6-cluster-7.4
2 parents f7795ae + 0792d6f commit 5eb510f

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

storage/ndb/src/ndbapi/NdbScanOperation.cpp

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -3161,18 +3161,23 @@ NdbIndexScanOperation::setBoundHelperOldApi(OldApiBoundInfo& boundInfo,
31613161
}
31623162
}
31633163

3164-
/* Copy data into correct part of RecAttr */
3165-
assert(byteOffset + valueLen <= maxKeyRecordBytes);
3166-
3167-
memcpy(boundInfo.key + byteOffset,
3168-
aValue,
3169-
valueLen);
3170-
3171-
/* Set Null bit */
3172-
bool nullBit=(aValue == NULL);
3164+
if (aValue != NULL)
3165+
{
3166+
/* Copy data into correct part of RecAttr */
3167+
assert(valueLen > 0);
3168+
assert(byteOffset + valueLen <= maxKeyRecordBytes);
31733169

3174-
boundInfo.key[nullbit_byte_offset]|=
3175-
(nullBit) << nullbit_bit_in_byte;
3170+
memcpy(boundInfo.key + byteOffset,
3171+
aValue,
3172+
valueLen);
3173+
}
3174+
else
3175+
{
3176+
/* Set Null bit */
3177+
assert(valueLen == 0);
3178+
boundInfo.key[nullbit_byte_offset] |=
3179+
(1 << nullbit_bit_in_byte);
3180+
}
31763181

31773182
return 0;
31783183
}

0 commit comments

Comments
 (0)