summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
Diffstat (limited to 'myisam')
-rw-r--r--myisam/sort.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/myisam/sort.c b/myisam/sort.c
index f918283503e..f48161b7c8e 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -138,8 +138,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
while (memavl >= MIN_SORT_MEMORY)
{
- if ((my_off_t) (records+1)*(sort_length+sizeof(char*)) <=
- (my_off_t) memavl)
+ if ((records < UINT_MAX32) &&
+ ((my_off_t) (records + 1) *
+ (sort_length + sizeof(char*)) <= (my_off_t) memavl))
keys= records+1;
else
do