diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 7 | ||||
-rw-r--r-- | sql/ha_partition.cc | 4 | ||||
-rw-r--r-- | sql/partition_info.cc | 2 | ||||
-rw-r--r-- | sql/partition_info.h | 5 | ||||
-rw-r--r-- | sql/sql_partition.cc | 4 |
5 files changed, 17 insertions, 5 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0739b704462..ccfe8e717fb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1899,7 +1899,10 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record) error= m_part_info->get_partition_id(m_part_info, &part_id, &func_value); dbug_tmp_restore_column_map(table->read_set, old_map); if (error) + { + m_part_info->err_value= func_value; DBUG_RETURN(error); + } op->setPartitionId(part_id); } } @@ -2534,7 +2537,10 @@ int ha_ndbcluster::write_row(byte *record) error= m_part_info->get_partition_id(m_part_info, &part_id, &func_value); dbug_tmp_restore_column_map(table->read_set, old_map); if (error) + { + m_part_info->err_value= func_value; DBUG_RETURN(error); + } op->setPartitionId(part_id); } @@ -2726,6 +2732,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) m_part_info, &old_part_id, &new_part_id, &func_value))) { + m_part_info->err_value= func_value; DBUG_RETURN(error); } diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 3cb855b1035..1e75dd08f38 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2670,7 +2670,10 @@ int ha_partition::write_row(byte * buf) #endif dbug_tmp_restore_column_map(table->read_set, old_map); if (unlikely(error)) + { + m_part_info->err_value= func_value; DBUG_RETURN(error); + } m_last_part= part_id; DBUG_PRINT("info", ("Insert in partition %d", part_id)); DBUG_RETURN(m_file[part_id]->write_row(buf)); @@ -2719,6 +2722,7 @@ int ha_partition::update_row(const byte *old_data, byte *new_data) m_part_info, &old_part_id, &new_part_id, &func_value))) { + m_part_info->err_value= func_value; DBUG_RETURN(error); } diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 1f84d3f1e83..2a06a649eca 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -855,7 +855,7 @@ void partition_info::print_no_partition_found(TABLE *table) if (part_expr->null_value) buf_ptr= (char*)"NULL"; else - longlong2str(part_expr->val_int(), buf, + longlong2str(err_value, buf, part_expr->unsigned_flag ? 10 : -10); my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr); dbug_tmp_restore_column_map(table->read_set, old_map); diff --git a/sql/partition_info.h b/sql/partition_info.h index b45789c4bae..09d827d44c4 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -150,7 +150,8 @@ public: /******************************************** * INTERVAL ANALYSIS ENDS ********************************************/ - + + longlong err_value; char* part_info_string; char *part_func_string; @@ -227,7 +228,7 @@ public: restore_full_part_field_ptrs(NULL), part_expr(NULL), subpart_expr(NULL), item_free_list(NULL), first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL), - list_array(NULL), + list_array(NULL), err_value(0), part_info_string(NULL), part_func_string(NULL), subpart_func_string(NULL), part_state(NULL), diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 0944db9ccb8..a20e5dd512b 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -2771,8 +2771,8 @@ notfound: int get_partition_id_range(partition_info *part_info, - uint32 *part_id, - longlong *func_value) + uint32 *part_id, + longlong *func_value) { longlong *range_array= part_info->range_int_array; uint max_partition= part_info->no_parts - 1; |