diff options
author | unknown <kostja@bodhi.(none)> | 2007-12-20 21:16:55 +0300 |
---|---|---|
committer | unknown <kostja@bodhi.(none)> | 2007-12-20 21:16:55 +0300 |
commit | 0fbc29c197d931fdcf99c071e3ac1e31bf8761ee (patch) | |
tree | f154da404267333803f8dc058a8c8d0bc0fea5d6 /sql/sql_select.cc | |
parent | 5473858b644f2b3c7b6aed186a4f39917af7248e (diff) | |
download | mariadb-git-0fbc29c197d931fdcf99c071e3ac1e31bf8761ee.tar.gz |
A pre-requisite for the fix for Bug#12713 "Error in a stored function
called from a SELECT doesn't cause ROLLBACK of state"
Make private all class handler methods (PSEA API) that may modify
data. Introduce and deploy public ha_* wrappers for these methods in
all sql/.
This necessary to keep track of all data modifications in sql/,
which is in turn necessary to be able to optimize two-phase
commit of those transactions that do not modify data.
sql/ha_partition.cc:
Class ha_partition is no longer a friend of class handler.
Use the public handler interface (handler::ha_ methods) for partition
operations.
Remove unnecessary casts from char[] to const char *.ppзи выафвыаafa
sql/handler.cc:
Function ha_create_table() is no longer a friend of class handler.
Use public handler::change_table_ptr() to access private members.
This fixes a subtle bug (no test case in the test suite) when a
deletion error occurs inside one partition of a partitioned engine.
The old code would crash in handler::print_error() in this case.
Implement the newly introduced public ha_* wrappers of the private
virtual handler methods.
sql/handler.h:
Introduce ha_* wrappers to all class handler methods that may
modify data. This is necessary to be able to keep track of
data modifying operations of class handler and optimize read-only
transactions.
sql/item_sum.cc:
delete_all_rows -> ha_delete_all_rows
sql/sql_base.cc:
Use the new public wrappers.
sql/sql_delete.cc:
delete_all_rows -> ha_delete_all_rows
sql/sql_partition.cc:
Use the new public wrappers.
sql/sql_select.cc:
delete_all_rows -> ha_delete_all_rows
delete_table -> ha_delete_table
disabe_indexes -> ha_disable_idnexes
sql/sql_show.cc:
delete_all_rows -> ha_delete_all_rows
sql/sql_table.cc:
Use the public wrappers for class handler DDL methods.
All methods which may change handler data are now accessed via a public
wrapper.
sql/sql_union.cc:
delete_all_rows -> ha_delete_all_rows
{enable,disable}_indexes -> ha_{enable,disable}_indexes
sql/sql_update.cc:
bulk_update_row -> ha_bulk_update_row
sql/unireg.cc:
create_handler_files -> ha_create_handler_files
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cde9d501f83..7421bdabcdb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1534,14 +1534,14 @@ JOIN::reinit() if (exec_tmp_table1) { exec_tmp_table1->file->extra(HA_EXTRA_RESET_STATE); - exec_tmp_table1->file->delete_all_rows(); + exec_tmp_table1->file->ha_delete_all_rows(); free_io_cache(exec_tmp_table1); filesort_free_buffers(exec_tmp_table1,0); } if (exec_tmp_table2) { exec_tmp_table2->file->extra(HA_EXTRA_RESET_STATE); - exec_tmp_table2->file->delete_all_rows(); + exec_tmp_table2->file->ha_delete_all_rows(); free_io_cache(exec_tmp_table2); filesort_free_buffers(exec_tmp_table2,0); } @@ -10467,9 +10467,9 @@ free_tmp_table(THD *thd, TABLE *entry) if (entry->file) { if (entry->db_stat) - entry->file->drop_table(entry->s->table_name.str); + entry->file->ha_drop_table(entry->s->table_name.str); else - entry->file->delete_table(entry->s->table_name.str); + entry->file->ha_delete_table(entry->s->table_name.str); delete entry->file; } @@ -10525,7 +10525,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, if (open_tmp_table(&new_table)) goto err1; if (table->file->indexes_are_disabled()) - new_table.file->disable_indexes(HA_KEY_SWITCH_ALL); + new_table.file->ha_disable_indexes(HA_KEY_SWITCH_ALL); table->file->ha_index_or_rnd_end(); table->file->ha_rnd_init(1); if (table->no_rows) @@ -10591,7 +10591,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, (void) table->file->ha_rnd_end(); (void) new_table.file->close(); err1: - new_table.file->delete_table(new_table.s->table_name.str); + new_table.file->ha_delete_table(new_table.s->table_name.str); err2: delete new_table.file; thd->proc_info=save_proc_info; |