Skip to content

Commit 0792d6f

Browse files
author
Ole John Aske
committed
Merge branch 'mysql-5.5-cluster-7.2' into mysql-5.6-cluster-7.3
2 parents 494a22e + de3a153 commit 0792d6f

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, 2015, 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
@@ -3129,18 +3129,23 @@ NdbIndexScanOperation::setBoundHelperOldApi(OldApiBoundInfo& boundInfo,
31293129
}
31303130
}
31313131

3132-
/* Copy data into correct part of RecAttr */
3133-
assert(byteOffset + valueLen <= maxKeyRecordBytes);
3134-
3135-
memcpy(boundInfo.key + byteOffset,
3136-
aValue,
3137-
valueLen);
3138-
3139-
/* Set Null bit */
3140-
bool nullBit=(aValue == NULL);
3132+
if (aValue != NULL)
3133+
{
3134+
/* Copy data into correct part of RecAttr */
3135+
assert(valueLen > 0);
3136+
assert(byteOffset + valueLen <= maxKeyRecordBytes);
31413137

3142-
boundInfo.key[nullbit_byte_offset]|=
3143-
(nullBit) << nullbit_bit_in_byte;
3138+
memcpy(boundInfo.key + byteOffset,
3139+
aValue,
3140+
valueLen);
3141+
}
3142+
else
3143+
{
3144+
/* Set Null bit */
3145+
assert(valueLen == 0);
3146+
boundInfo.key[nullbit_byte_offset] |=
3147+
(1 << nullbit_bit_in_byte);
3148+
}
31443149

31453150
return 0;
31463151
}

0 commit comments

Comments
 (0)