diff options
author | unknown <monty@hundin.mysql.fi> | 2001-06-15 05:03:15 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-06-15 05:03:15 +0300 |
commit | e96fcbcfe97c8d9f0b244071575b5ccc3248d5ff (patch) | |
tree | 90883e19e7220eb27c1fa092220fe373c7e82d80 /myisam/mi_statrec.c | |
parent | 8d6348f650b544b65dea17ad853f1127cce78f79 (diff) | |
download | mariadb-git-e96fcbcfe97c8d9f0b244071575b5ccc3248d5ff.tar.gz |
Fixed multi-table-delete
Optimize fixed length MyISAM rows to use pread/pwrite.
BUILD/compile-pentium-debug-max:
Also build embedded server
libmysqld/lib_vio.c:
Add vio_poll_read()
myisam/mi_statrec.c:
Use pread()/pwrite() instead of seek+read/write
mysql-test/r/multi_update.result:
Fix multi-table-delete test
mysql-test/t/multi_update.test:
Fix multi-table-delete test
sql/filesort.cc:
Fix multi-table-delete
sql/mysql_priv.h:
Fix multi-table-delete
sql/sql_class.h:
Fix multi-table-delete
sql/sql_delete.cc:
Fix multi-table-delete
sql/sql_parse.cc:
Fix multi-table-delete
sql/sql_select.cc:
Fix multi-table-delete
sql/sql_table.cc:
cleanup
sql/sql_unions.cc:
cleanup
sql/sql_yacc.yy:
cleanup/ optimize
sql/structs.h:
Fix multi-table-delete
sql/uniques.cc:
Fix multi-table-delete
Diffstat (limited to 'myisam/mi_statrec.c')
-rw-r--r-- | myisam/mi_statrec.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/myisam/mi_statrec.c b/myisam/mi_statrec.c index 05ff40d8921..7af8c304c0f 100644 --- a/myisam/mi_statrec.c +++ b/myisam/mi_statrec.c @@ -27,17 +27,16 @@ int _mi_write_static_record(MI_INFO *info, const byte *record) { my_off_t filepos=info->s->state.dellink; info->rec_cache.seek_not_done=1; /* We have done a seek */ - VOID(my_seek(info->dfile,info->s->state.dellink+1,MY_SEEK_SET,MYF(0))); - - if (my_read(info->dfile,(char*) &temp[0],info->s->base.rec_reflength, - MYF(MY_NABP))) + if (my_pread(info->dfile,(char*) &temp[0],info->s->base.rec_reflength, + info->s->state.dellink+1, + MYF(MY_NABP))) goto err; info->s->state.dellink= _mi_rec_pos(info->s,temp); info->state->del--; info->state->empty-=info->s->base.pack_reclength; - VOID(my_seek(info->dfile,filepos,MY_SEEK_SET,MYF(0))); - if (my_write(info->dfile, (char*) record, info->s->base.reclength, - MYF(MY_NABP))) + if (my_pwrite(info->dfile, (char*) record, info->s->base.reclength, + filepos, + MYF(MY_NABP))) goto err; } else @@ -64,16 +63,18 @@ int _mi_write_static_record(MI_INFO *info, const byte *record) else { info->rec_cache.seek_not_done=1; /* We have done a seek */ - VOID(my_seek(info->dfile,info->state->data_file_length, - MY_SEEK_SET,MYF(0))); - if (my_write(info->dfile,(char*) record,info->s->base.reclength, - info->s->write_flag)) + if (my_pwrite(info->dfile,(char*) record,info->s->base.reclength, + info->state->data_file_length, + info->s->write_flag)) goto err; if (info->s->base.pack_reclength != info->s->base.reclength) { uint length=info->s->base.pack_reclength - info->s->base.reclength; bzero((char*) temp,length); - if (my_write(info->dfile, (byte*) temp,length, info->s->write_flag)) + if (my_pwrite(info->dfile, (byte*) temp,length, + info->state->data_file_length+ + info->s->base.pack_reclength, + info->s->write_flag)) goto err; } } @@ -88,9 +89,10 @@ int _mi_write_static_record(MI_INFO *info, const byte *record) int _mi_update_static_record(MI_INFO *info, my_off_t pos, const byte *record) { info->rec_cache.seek_not_done=1; /* We have done a seek */ - VOID(my_seek(info->dfile,pos,MY_SEEK_SET,MYF(0))); - return (my_write(info->dfile,(char*) record,info->s->base.reclength, - MYF(MY_NABP)) != 0); + return (my_pwrite(info->dfile, + (char*) record,info->s->base.reclength, + pos, + MYF(MY_NABP)) != 0); } @@ -104,9 +106,8 @@ int _mi_delete_static_record(MI_INFO *info) _mi_dpointer(info,temp+1,info->s->state.dellink); info->s->state.dellink = info->lastpos; info->rec_cache.seek_not_done=1; - VOID(my_seek(info->dfile,info->lastpos,MY_SEEK_SET,MYF(0))); - return (my_write(info->dfile,(byte*) temp, 1+info->s->rec_reflength, - MYF(MY_NABP)) != 0); + return (my_pwrite(info->dfile,(byte*) temp, 1+info->s->rec_reflength, + info->lastpos, MYF(MY_NABP)) != 0); } @@ -129,9 +130,9 @@ int _mi_cmp_static_record(register MI_INFO *info, register const byte *old) if ((info->opt_flag & READ_CHECK_USED)) { /* If check isn't disabled */ info->rec_cache.seek_not_done=1; /* We have done a seek */ - VOID(my_seek(info->dfile,info->lastpos,MY_SEEK_SET,MYF(0))); - if (my_read(info->dfile, (char*) info->rec_buff, info->s->base.reclength, - MYF(MY_NABP))) + if (my_pread(info->dfile, (char*) info->rec_buff, info->s->base.reclength, + info->lastpos, + MYF(MY_NABP))) DBUG_RETURN(-1); if (memcmp((byte*) info->rec_buff, (byte*) old, (uint) info->s->base.reclength)) @@ -152,9 +153,8 @@ int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def, DBUG_ENTER("_mi_cmp_static_unique"); info->rec_cache.seek_not_done=1; /* We have done a seek */ - VOID(my_seek(info->dfile,pos,MY_SEEK_SET,MYF(0))); - if (my_read(info->dfile, (char*) info->rec_buff, info->s->base.reclength, - MYF(MY_NABP))) + if (my_pread(info->dfile, (char*) info->rec_buff, info->s->base.reclength, + pos, MYF(MY_NABP))) DBUG_RETURN(-1); DBUG_RETURN(mi_unique_comp(def, record, info->rec_buff, def->null_are_equal)); |