diff options
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 15e3a765075..daac3f6a86d 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -546,7 +546,7 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root) point. If you do not implement this, the default delete_table() is called from - handler.cc and it will delete all files with the file extentions returned + handler.cc and it will delete all files with the file extensions returned by bas_ext(). Called from handler.cc by delete_table and ha_create_table(). Only used @@ -578,7 +578,7 @@ int ha_partition::delete_table(const char *name) Renames a table from one name to another from alter table call. If you do not implement this, the default rename_table() is called from - handler.cc and it will rename all files with the file extentions returned + handler.cc and it will rename all files with the file extensions returned by bas_ext(). Called from sql_table.cc by mysql_rename_table(). @@ -1432,7 +1432,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, /** - @brief Check and repair the table if neccesary + @brief Check and repair the table if necessary @param thd Thread object @@ -2183,7 +2183,8 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info) sub_elem= subpart_it++; DBUG_ASSERT(sub_elem); part= i * num_subparts + j; - DBUG_ASSERT(part < m_file_tot_parts && m_file[part]); + DBUG_ASSERT(part < m_file_tot_parts); + DBUG_ASSERT(m_file[part]); dummy_info.data_file_name= dummy_info.index_file_name = NULL; m_file[part]->update_create_info(&dummy_info); sub_elem->data_file_name = (char*) dummy_info.data_file_name; @@ -2911,7 +2912,7 @@ error_end: /** Read the .par file to get the partitions engines and names - @param name Name of table file (without extention) + @param name Name of table file (without extension) @return Operation status @retval true Failure @@ -3139,7 +3140,7 @@ static uchar *get_part_name(PART_NAME_DEF *part, size_t *length, @return Operation status @retval true Failure - @retval false Sucess + @retval false Success */ bool ha_partition::insert_partition_name_in_hash(const char *name, uint part_id, @@ -3265,7 +3266,7 @@ err: @return Operation status @retval true Failure - @retval false Sucess + @retval false Success */ bool ha_partition::set_ha_share_ref(Handler_share **ha_share_arg) @@ -3770,7 +3771,8 @@ int ha_partition::external_lock(THD *thd, int lock_type) MY_BITMAP *used_partitions; DBUG_ENTER("ha_partition::external_lock"); - DBUG_ASSERT(!auto_increment_lock && !auto_increment_safe_stmt_log_lock); + DBUG_ASSERT(!auto_increment_lock); + DBUG_ASSERT(!auto_increment_safe_stmt_log_lock); if (lock_type == F_UNLCK) used_partitions= &m_locked_partitions; @@ -4034,8 +4036,8 @@ void ha_partition::unlock_row() bool ha_partition::was_semi_consistent_read() { DBUG_ENTER("ha_partition::was_semi_consistent_read"); - DBUG_ASSERT(m_last_part < m_tot_parts && - bitmap_is_set(&(m_part_info->read_partitions), m_last_part)); + DBUG_ASSERT(m_last_part < m_tot_parts); + DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), m_last_part)); DBUG_RETURN(m_file[m_last_part]->was_semi_consistent_read()); } @@ -4149,7 +4151,7 @@ int ha_partition::write_row(uchar * buf) /* If we have failed to set the auto-increment value for this row, it is highly likely that we will not be able to insert it into - the correct partition. We must check and fail if neccessary. + the correct partition. We must check and fail if necessary. */ if (error) goto exit; @@ -4219,7 +4221,7 @@ exit: have the previous row record in it, while new_data will have the newest data in it. Keep in mind that the server can do updates based on ordering if an - ORDER BY clause was used. Consecutive ordering is not guarenteed. + ORDER BY clause was used. Consecutive ordering is not guaranteed. Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc. new_data is always record[0] @@ -4361,7 +4363,7 @@ exit: (from either a previous rnd_xxx() or index_xxx() call). If you keep a pointer to the last row or can access a primary key it will make doing the deletion quite a bit easier. - Keep in mind that the server does no guarentee consecutive deletions. + Keep in mind that the server does no guarantee consecutive deletions. ORDER BY clauses can be used. Called in sql_acl.cc and sql_udf.cc to manage internal table information. @@ -4745,7 +4747,7 @@ int ha_partition::end_bulk_insert() When scan is used we will scan one handler partition at a time. When preparing for rnd_pos we will init all handler partitions. - No extra cache handling is needed when scannning is not performed. + No extra cache handling is needed when scanning is not performed. Before initialising we will call rnd_end to ensure that we clean up from any previous incarnation of a table scan. @@ -5841,7 +5843,7 @@ int ha_partition::read_range_next() SYNOPSIS ha_partition::partition_scan_set_up() buf Buffer to later return record in (this function - needs it to calculcate partitioning function + needs it to calculate partitioning function values) idx_read_flag TRUE <=> m_start_key has range start endpoint which @@ -5910,8 +5912,8 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag) DBUG_ASSERT(m_part_spec.start_part < m_tot_parts); m_ordered_scan_ongoing= m_ordered; } - DBUG_ASSERT(m_part_spec.start_part < m_tot_parts && - m_part_spec.end_part < m_tot_parts); + DBUG_ASSERT(m_part_spec.start_part < m_tot_parts); + DBUG_ASSERT(m_part_spec.end_part < m_tot_parts); DBUG_RETURN(0); } @@ -6876,7 +6878,7 @@ static int end_keyread_cb(handler* h, void *unused) function after completing a query. 3) It is called when deleting the QUICK_RANGE_SELECT object if the QUICK_RANGE_SELECT object had its own handler object. It is called - immediatley before close of this local handler object. + immediately before close of this local handler object. HA_EXTRA_KEYREAD: HA_EXTRA_NO_KEYREAD: These parameters are used to provide an optimisation hint to the handler. @@ -6913,7 +6915,7 @@ static int end_keyread_cb(handler* h, void *unused) HA_EXTRA_IGNORE_DUP_KEY: HA_EXTRA_NO_IGNORE_DUP_KEY: Informs the handler to we will not stop the transaction if we get an - duplicate key errors during insert/upate. + duplicate key errors during insert/update. Always called in pair, triggered by INSERT IGNORE and other similar SQL constructs. Not used by MyISAM. @@ -8332,7 +8334,7 @@ bool ha_partition::prepare_inplace_alter_table(TABLE *altered_table, /* Changing to similar partitioning, only update metadata. - Non allowed changes would be catched in prep_alter_part_table(). + Non allowed changes would be caught in prep_alter_part_table(). */ if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(false); @@ -8365,7 +8367,7 @@ bool ha_partition::inplace_alter_table(TABLE *altered_table, /* Changing to similar partitioning, only update metadata. - Non allowed changes would be catched in prep_alter_part_table(). + Non allowed changes would be caught in prep_alter_part_table(). */ if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(false); @@ -8410,7 +8412,7 @@ bool ha_partition::commit_inplace_alter_table(TABLE *altered_table, /* Changing to similar partitioning, only update metadata. - Non allowed changes would be catched in prep_alter_part_table(). + Non allowed changes would be caught in prep_alter_part_table(). */ if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(false); @@ -8653,7 +8655,8 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, DBUG_PRINT("info", ("offset: %lu inc: %lu desired_values: %lu " "first_value: %lu", (ulong) offset, (ulong) increment, (ulong) nb_desired_values, (ulong) *first_value)); - DBUG_ASSERT(increment && nb_desired_values); + DBUG_ASSERT(increment); + DBUG_ASSERT(nb_desired_values); *first_value= 0; if (table->s->next_number_keypart) { |