|
1 | 1 | /*
|
2 |
| - Copyright (c) 2003, 2022, Oracle and/or its affiliates. |
| 2 | + Copyright (c) 2003, 2023, Oracle and/or its affiliates. |
3 | 3 |
|
4 | 4 | This program is free software; you can redistribute it and/or modify
|
5 | 5 | it under the terms of the GNU General Public License, version 2.0,
|
@@ -762,11 +762,11 @@ NdbIndexScanOperation::getDistKeyFromRange(const NdbRecord *key_record,
|
762 | 762 | const char *row,
|
763 | 763 | Uint32* distKey)
|
764 | 764 | {
|
765 |
| - const Uint32 MaxKeySizeInLongWords= (NDB_MAX_KEY_SIZE + 7) / 8; |
766 |
| - // Note: xfrm:ed key can/will be bigger than MaxKeySizeInLongWords |
767 |
| - Uint64 tmp[ MaxKeySizeInLongWords * MAX_XFRM_MULTIPLY ]; |
768 |
| - char* tmpshrink = (char*)tmp; |
769 |
| - Uint32 tmplen = (Uint32)sizeof(tmp); |
| 765 | + // Note: xfrm:ed key can/will be bigger than MAX_KEY_SIZE_IN_WORDS |
| 766 | + Uint32 xfrmbuf[MAX_KEY_SIZE_IN_WORDS * MAX_XFRM_MULTIPLY]; |
| 767 | + char shrinkbuf[NDB_MAX_KEY_SIZE]; |
| 768 | + char* tmpshrink = shrinkbuf; |
| 769 | + Uint32 tmplen = (Uint32)sizeof(shrinkbuf); |
770 | 770 |
|
771 | 771 | /* This can't work for User Defined partitioning */
|
772 | 772 | assert(key_record->table->m_fragmentType !=
|
@@ -811,7 +811,7 @@ NdbIndexScanOperation::getDistKeyFromRange(const NdbRecord *key_record,
|
811 | 811 |
|
812 | 812 | Uint32 hashValue;
|
813 | 813 | int ret = Ndb::computeHash(&hashValue, result_record->table,
|
814 |
| - ptrs, tmpshrink, tmplen); |
| 814 | + ptrs, xfrmbuf, sizeof(xfrmbuf)); |
815 | 815 | if (ret == 0)
|
816 | 816 | {
|
817 | 817 | *distKey = hashValue;
|
|
0 commit comments