summaryrefslogtreecommitdiff
path: root/sql/ha_myisammrg.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-06-04 21:05:22 +0300
committerunknown <monty@mysql.com>2006-06-04 21:05:22 +0300
commit555eb848f2aa3ac5eb09b251072930eb38cd8f7e (patch)
tree8e3365da0e05942d80e6e6ae092f7e0e40832fe2 /sql/ha_myisammrg.cc
parent14e1d69aeaa09075fe3ec609d5ccdcf899508d7d (diff)
parent01d03e7b4b14b805a0d19c8473a495f05b34de65 (diff)
downloadmariadb-git-555eb848f2aa3ac5eb09b251072930eb38cd8f7e.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/my/mysql-5.1 BitKeeper/etc/ignore: auto-union include/heap.h: Auto merged include/my_base.h: Auto merged include/mysql_com.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Auto merged mysql-test/r/binlog_stm_mix_innodb_myisam.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/ndb_index_unique.result: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/view_grant.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_berkeley.h: Auto merged mysql-test/r/view_grant.result: Auto merged sql/ha_federated.cc: Auto merged sql/ha_federated.h: Auto merged sql/ha_heap.h: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/ha_myisam.h: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/ha_partition.h: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/log.cc: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/spatial.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_bitmap.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/share/errmsg.txt: Auto merged sql/sql_handler.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.h: Auto merged storage/archive/ha_archive.cc: Auto merged storage/archive/ha_archive.h: Auto merged storage/example/ha_example.cc: Auto merged storage/myisam/ft_boolean_search.c: Auto merged unittest/mysys/base64-t.c: Auto merged mysql-test/r/innodb_mysql.result: manual merge mysql-test/t/innodb_mysql.test: manual merge mysql-test/valgrind.supp: manual merge sql/event.cc: manual merge sql/ha_heap.cc: manual merge sql/ha_myisam.cc: manual merge sql/ha_ndbcluster.cc: manual merge sql/ha_ndbcluster_binlog.cc: manual merge sql/ha_partition.cc: manual merge sql/handler.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/handler.h: manual merge renamed print_key_dupp_error to print_key_dup_error sql/item.h: automatic merge sql/item_cmpfunc.cc: automatic merge sql/log_event.cc: manual merge Trivial cleanup sql/mysql_priv.h: manual merge renamed print_key_dupp_error to print_key_dup_error sql/opt_range.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_delete.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_insert.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_load.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_select.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_show.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_table.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/sql_update.cc: manual merge renamed print_key_dupp_error to print_key_dup_error sql/table.cc: manual merge renamed print_key_dupp_error to print_key_dup_error storage/blackhole/ha_blackhole.cc: manual merge renamed print_key_dupp_error to print_key_dup_error storage/csv/ha_tina.cc: manual merge renamed print_key_dupp_error to print_key_dup_error mysql-test/valgrind.supp.orig: Manual merge
Diffstat (limited to 'sql/ha_myisammrg.cc')
-rw-r--r--sql/ha_myisammrg.cc35
1 files changed, 22 insertions, 13 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index b874923a077..afeed5f79df 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -34,15 +34,17 @@
** MyISAM MERGE tables
*****************************************************************************/
-static handler *myisammrg_create_handler(TABLE_SHARE *table);
+static handler *myisammrg_create_handler(TABLE_SHARE *table,
+ MEM_ROOT *mem_root);
/* MyISAM MERGE handlerton */
handlerton myisammrg_hton;
-static handler *myisammrg_create_handler(TABLE_SHARE *table)
+static handler *myisammrg_create_handler(TABLE_SHARE *table,
+ MEM_ROOT *mem_root)
{
- return new ha_myisammrg(table);
+ return new (mem_root) ha_myisammrg(table);
}
@@ -94,10 +96,10 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
myrg_extra(file,HA_EXTRA_WAIT_LOCK,0);
- if (table->s->reclength != mean_rec_length && mean_rec_length)
+ if (table->s->reclength != stats.mean_rec_length && stats.mean_rec_length)
{
DBUG_PRINT("error",("reclength: %d mean_rec_length: %d",
- table->s->reclength, mean_rec_length));
+ table->s->reclength, stats.mean_rec_length));
goto err;
}
#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
@@ -218,11 +220,13 @@ int ha_myisammrg::index_next_same(byte * buf,
return error;
}
+
int ha_myisammrg::rnd_init(bool scan)
{
- return myrg_extra(file,HA_EXTRA_RESET,0);
+ return myrg_reset(file);
}
+
int ha_myisammrg::rnd_next(byte *buf)
{
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
@@ -232,6 +236,7 @@ int ha_myisammrg::rnd_next(byte *buf)
return error;
}
+
int ha_myisammrg::rnd_pos(byte * buf, byte *pos)
{
statistic_increment(table->in_use->status_var.ha_read_rnd_count,
@@ -263,18 +268,18 @@ void ha_myisammrg::info(uint flag)
The following fails if one has not compiled MySQL with -DBIG_TABLES
and one has more than 2^32 rows in the merge tables.
*/
- records = (ha_rows) info.records;
- deleted = (ha_rows) info.deleted;
+ stats.records = (ha_rows) info.records;
+ stats.deleted = (ha_rows) info.deleted;
#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
if ((info.records >= (ulonglong) 1 << 32) ||
(info.deleted >= (ulonglong) 1 << 32))
table->s->crashed= 1;
#endif
- data_file_length=info.data_file_length;
+ stats.data_file_length=info.data_file_length;
errkey = info.errkey;
table->s->keys_in_use.set_prefix(table->s->keys);
table->s->db_options_in_use= info.options;
- mean_rec_length= info.reclength;
+ stats.mean_rec_length= info.reclength;
/*
The handler::block_size is used all over the code in index scan cost
@@ -292,11 +297,11 @@ void ha_myisammrg::info(uint flag)
TODO: In 5.2 index scan cost calculation will be factored out into a
virtual function in class handler and we'll be able to remove this hack.
*/
- block_size= 0;
+ stats.block_size= 0;
if (file->tables)
- block_size= myisam_block_size / file->tables;
+ stats.block_size= myisam_block_size / file->tables;
- update_time=0;
+ stats.update_time= 0;
#if SIZEOF_OFF_T > 4
ref_length=6; // Should be big enough
#else
@@ -322,6 +327,10 @@ int ha_myisammrg::extra(enum ha_extra_function operation)
return myrg_extra(file,operation,0);
}
+int ha_myisammrg::reset(void)
+{
+ return myrg_reset(file);
+}
/* To be used with WRITE_CACHE, EXTRA_CACHE and BULK_INSERT_BEGIN */