diff options
author | unknown <monty@mashka.mysql.fi> | 2003-01-03 00:04:33 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-01-03 00:04:33 +0200 |
commit | eebc67f6f8df9e0bdcde7770e383992ff6cad451 (patch) | |
tree | 461fafebcf70ffd880e85f8342601eaade292e1b /myisammrg | |
parent | 5265a1656ea58d9534ebadfbd45c662080f89bb0 (diff) | |
parent | 62b38d20ddcf4fb0f519e8b647916d7b367e894c (diff) | |
download | mariadb-git-eebc67f6f8df9e0bdcde7770e383992ff6cad451.tar.gz |
Merge with 4.0.8
BitKeeper/etc/logging_ok:
auto-union
VC++Files/sql/mysqld.dsp:
Auto merged
acinclude.m4:
Auto merged
include/my_base.h:
Auto merged
include/myisam.h:
Auto merged
include/myisammrg.h:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_write.c:
Auto merged
myisam/myisamdef.h:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/case.result:
Auto merged
mysql-test/r/distinct.result:
Auto merged
mysql-test/r/fulltext.result:
Auto merged
mysql-test/r/key_diff.result:
Auto merged
mysql-test/r/multi_update.result:
Auto merged
mysql-test/r/order_by.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/show_check.result:
Auto merged
mysql-test/t/multi_update.test:
Auto merged
mysql-test/t/rpl_log_pos.test:
Auto merged
mysys/Makefile.am:
Auto merged
scripts/Makefile.am:
Auto merged
sql/field.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/ha_myisammrg.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_create.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/lex.h:
Auto merged
sql/log.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql-bench/crash-me.sh:
Auto merged
sql-bench/server-cfg.sh:
Auto merged
sql/share/english/errmsg.txt:
Auto merged
sql/structs.h:
Auto merged
Diffstat (limited to 'myisammrg')
-rw-r--r-- | myisammrg/myrg_info.c | 17 | ||||
-rw-r--r-- | myisammrg/myrg_open.c | 21 |
2 files changed, 26 insertions, 12 deletions
diff --git a/myisammrg/myrg_info.c b/myisammrg/myrg_info.c index 14bc228cc1f..ba840ac444b 100644 --- a/myisammrg/myrg_info.c +++ b/myisammrg/myrg_info.c @@ -28,8 +28,6 @@ ulonglong myrg_position(MYRG_INFO *info) ~(ulonglong) 0; } - /* If flag != 0 one only gets pos of last record */ - int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag) { MYRG_TABLE *current_table; @@ -55,15 +53,16 @@ int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag) DBUG_PRINT("info2",("table: %s, offset: %lu", file->table->filename,(ulong) file->file_offset)); } - x->records = info->records; - x->deleted = info->del; - x->data_file_length = info->data_file_length; - x->reclength = info->reclength; - x->options = info->options; + x->records= info->records; + x->deleted= info->del; + x->data_file_length= info->data_file_length; + x->reclength= info->reclength; + x->options= info->options; if (current_table) - x->errkey = current_table->table->errkey; + x->errkey= current_table->table->errkey; else - x->errkey=0; + x->errkey= 0; + x->rec_per_key = info->rec_per_key_part; } DBUG_RETURN(0); } diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c index 9360f582958..f996277d287 100644 --- a/myisammrg/myrg_open.c +++ b/myisammrg/myrg_open.c @@ -33,7 +33,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { int save_errno,i,errpos; - uint files,dir_length,length,options; + uint files,dir_length,length,options, key_parts; ulonglong file_offset; char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; MYRG_INFO info,*m_info; @@ -89,24 +89,39 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) } info.reclength=isam->s->base.reclength; } + key_parts=(isam ? isam->s->base.key_parts : 0); if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO)+ - files*sizeof(MYRG_TABLE), + files*sizeof(MYRG_TABLE)+ + sizeof(long)*key_parts, MYF(MY_WME)))) goto err; *m_info=info; - m_info->open_tables=(files) ? (MYRG_TABLE *) (m_info+1) : 0; m_info->tables=files; + if (files) + { + m_info->open_tables=(MYRG_TABLE *) (m_info+1); + m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); + bzero((char*) m_info->rec_per_key_part,sizeof(long)*key_parts); + } + else + { + m_info->open_tables=0; + m_info->rec_per_key_part=0; + } errpos=2; options= (uint) ~0; for (i=files ; i-- > 0 ; ) { + uint j; m_info->open_tables[i].table=isam; m_info->options|=isam->s->options; options&=isam->s->options; m_info->records+=isam->state->records; m_info->del+=isam->state->del; m_info->data_file_length+=isam->state->data_file_length; + for (j=0; j < key_parts; j++) + m_info->rec_per_key_part[j]+=isam->s->state.rec_per_key_part[j] / files; if (i) isam=(MI_INFO*) (isam->open_list.next->data); } |