summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-12-19 22:15:02 +0300
committerunknown <kostja@bodhi.(none)>2007-12-19 22:15:02 +0300
commit226700ee51a827bf1271225394628a3d65a0dc79 (patch)
treec2e3e4b89a84e607beb2229dcc3a4660d78f89e3 /sql/sql_select.cc
parent554599e854a8a15d8ca12631182b376b818fdf3a (diff)
downloadmariadb-git-226700ee51a827bf1271225394628a3d65a0dc79.tar.gz
Make handler::{write,delete,update}_row private. It's critical
that the entire server uses their public ha_* counterparts instead, since only then we can ensure proper tracing of these calls that is necessary for Bug#12713. A pre-requisite for Bug#12713 "Error in a stored function called from a SELECT doesn't cause ROLLBACK of statem" sql/ha_partition.cc: Use ha_write_row, ha_update_row, ha_delete_row instead of now-private write_row, update_row, delete_row. In future ha_* calls will contain more than just a call to the binary log, so it's essential they are used consistently everywhere in the server. Disable the undesired effect of double binary logging of changes to partitioned tables with tmp_disable_binlog. sql/handler.h: Make write_row, update_row, delete_row private. It's critical that the entire code base uses ha_write_row, ha_update_row, ha_delete_row instead -- in future, ha_* counterparts will have more common functionality than just a call to the binary log. sql/sql_select.cc: Use ha_write_row, ha_update_row, ha_delete_row instead of write_row, update_row, delete_row respectively. The change affects the join execution code that works with an intermediate internal temporary table. Do not disable binary logging, since it's unnecessary - temporary tables are not replicated by row level replication. sql/sql_table.cc: Use ha_write_row in copy_data_between_tables - the function that writes data from the original table to a temporary copy when executing ALTER TABLE. Do not disable binary logging since temporary tables are not replicated by row level replication anyway.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 93486aa7b65..cde9d501f83 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10554,13 +10554,13 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
*/
while (!table->file->rnd_next(new_table.record[1]))
{
- write_err= new_table.file->write_row(new_table.record[1]);
+ write_err= new_table.file->ha_write_row(new_table.record[1]);
DBUG_EXECUTE_IF("raise_error", write_err= HA_ERR_FOUND_DUPP_KEY ;);
if (write_err)
goto err;
}
/* copy row that filled HEAP table */
- if ((write_err=new_table.file->write_row(table->record[0])))
+ if ((write_err=new_table.file->ha_write_row(table->record[0])))
{
if (new_table.file->is_fatal_error(write_err, HA_CHECK_DUP) ||
!ignore_last_dupp_key_error)
@@ -12023,7 +12023,7 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
{
int error;
join->found_records++;
- if ((error=table->file->write_row(table->record[0])))
+ if ((error=table->file->ha_write_row(table->record[0])))
{
if (!table->file->is_fatal_error(error, HA_CHECK_DUP))
goto end;
@@ -12085,8 +12085,8 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
{ /* Update old record */
restore_record(table,record[1]);
update_tmptable_sum_func(join->sum_funcs,table);
- if ((error=table->file->update_row(table->record[1],
- table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])))
{
table->file->print_error(error,MYF(0)); /* purecov: inspected */
DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */
@@ -12109,7 +12109,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
}
init_tmptable_sum_functions(join->sum_funcs);
copy_funcs(join->tmp_table_param.items_to_copy);
- if ((error=table->file->write_row(table->record[0])))
+ if ((error=table->file->ha_write_row(table->record[0])))
{
if (create_myisam_from_heap(join->thd, table, &join->tmp_table_param,
error, 0))
@@ -12145,7 +12145,7 @@ end_unique_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
copy_fields(&join->tmp_table_param); // Groups are copied twice.
copy_funcs(join->tmp_table_param.items_to_copy);
- if (!(error=table->file->write_row(table->record[0])))
+ if (!(error=table->file->ha_write_row(table->record[0])))
join->send_records++; // New group
else
{
@@ -12161,8 +12161,8 @@ end_unique_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
}
restore_record(table,record[1]);
update_tmptable_sum_func(join->sum_funcs,table);
- if ((error=table->file->update_row(table->record[1],
- table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])))
{
table->file->print_error(error,MYF(0)); /* purecov: inspected */
DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */
@@ -12205,7 +12205,7 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
join->sum_funcs_end[send_group_parts]);
if (!join->having || join->having->val_int())
{
- int error= table->file->write_row(table->record[0]);
+ int error= table->file->ha_write_row(table->record[0]);
if (error && create_myisam_from_heap(join->thd, table,
&join->tmp_table_param,
error, 0))
@@ -13433,7 +13433,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
}
if (having && !having->val_int())
{
- if ((error=file->delete_row(record)))
+ if ((error=file->ha_delete_row(record)))
goto err;
error=file->rnd_next(record);
continue;
@@ -13460,7 +13460,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
}
if (compare_record(table, first_field) == 0)
{
- if ((error=file->delete_row(record)))
+ if ((error=file->ha_delete_row(record)))
goto err;
}
else if (!found)
@@ -13557,7 +13557,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
}
if (having && !having->val_int())
{
- if ((error=file->delete_row(record)))
+ if ((error=file->ha_delete_row(record)))
goto err;
continue;
}
@@ -13574,7 +13574,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
if (hash_search(&hash, org_key_pos, key_length))
{
/* Duplicated found ; Remove the row */
- if ((error=file->delete_row(record)))
+ if ((error=file->ha_delete_row(record)))
goto err;
}
else
@@ -15582,7 +15582,7 @@ int JOIN::rollup_write_data(uint idx, TABLE *table_arg)
item->save_in_result_field(1);
}
copy_sum_funcs(sum_funcs_end[i+1], sum_funcs_end[i]);
- if ((write_error= table_arg->file->write_row(table_arg->record[0])))
+ if ((write_error= table_arg->file->ha_write_row(table_arg->record[0])))
{
if (create_myisam_from_heap(thd, table_arg, &tmp_table_param,
write_error, 0))