Skip to content

Commit 321231c

Browse files
committed
Merge branch 'mysql-5.7' of myrepo.no.oracle.com:mysql into mysql-5.7
2 parents 4bbed79 + b438ae9 commit 321231c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sql/sql_cache.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ using std::max;
402402
#define QC_DEBUG_SYNC(name)
403403
#endif
404404

405+
// Max aligned size for ulong type query_cache_min_res_unit.
406+
static const ulong max_aligned_min_res_unit_size= ((ULONG_MAX) &
407+
(~(sizeof(double) - 1)));
405408

406409
/**
407410
Thread state to be used when the query cache lock needs to be acquired.
@@ -1239,6 +1242,9 @@ ulong Query_cache::set_min_res_unit(ulong size)
12391242
{
12401243
if (size < min_allocation_unit)
12411244
size= min_allocation_unit;
1245+
else if (size > max_aligned_min_res_unit_size)
1246+
size= max_aligned_min_res_unit_size;
1247+
12421248
return (min_result_data_size= ALIGN_SIZE(size));
12431249
}
12441250

0 commit comments

Comments
 (0)