BUG#16002: After review fixes

Fixes for NDB
parent bda7c1fd
......@@ -9499,6 +9499,7 @@ int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
MYF(0));
uint i;
int error= 0;
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("set_range_data");
if (!range_data)
......@@ -9509,6 +9510,8 @@ int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
for (i= 0; i < part_info->no_parts; i++)
{
longlong range_val= part_info->range_int_array[i];
if (unsigned_flag)
range_val-= 0x8000000000000000ULL;
if (range_val < INT_MIN32 || range_val >= INT_MAX32)
{
if ((i != part_info->no_parts - 1) ||
......@@ -9535,6 +9538,7 @@ int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
* sizeof(int32), MYF(0));
uint32 *part_id, i;
int error= 0;
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("set_list_data");
if (!list_data)
......@@ -9546,6 +9550,8 @@ int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
{
LIST_PART_ENTRY *list_entry= &part_info->list_array[i];
longlong list_val= list_entry->list_value;
if (unsigned_flag)
list_val-= 0x8000000000000000ULL;
if (list_val < INT_MIN32 || list_val > INT_MAX32)
{
my_error(ER_LIMITED_PART_RANGE, MYF(0), "NDB");
......
......@@ -2394,9 +2394,9 @@ int get_partition_id_list(partition_info *part_info,
}
goto notfound;
}
*func_value= part_func_value;
if (unsigned_flag)
part_func_value-= 0x8000000000000000ULL;
*func_value= part_func_value;
while (max_list_index >= min_list_index)
{
list_index= (max_list_index + min_list_index) >> 1;
......@@ -2509,16 +2509,16 @@ int get_partition_id_range(partition_info *part_info,
uint loc_part_id;
longlong part_func_value= part_val_int(part_info->part_expr);
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("get_partition_id_int_range");
DBUG_ENTER("get_partition_id_range");
if (part_info->part_expr->null_value)
{
*part_id= 0;
DBUG_RETURN(0);
}
*func_value= part_func_value;
if (unsigned_flag)
part_func_value-= 0x8000000000000000ULL;
*func_value= part_func_value;
while (max_part_id > min_part_id)
{
loc_part_id= (max_part_id + min_part_id + 1) >> 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment