summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-08-19 14:43:51 +0300
committerunknown <monty@hundin.mysql.fi>2001-08-19 14:43:51 +0300
commitcfdf5fee2087dde1db4239b4d9a9f16bfb78ac05 (patch)
treee2a8b10d8dae9fee5283beb230210199e135ef74 /myisam
parente3a9e7e40e63e8bed554cfbceacf29490df1a14a (diff)
downloadmariadb-git-cfdf5fee2087dde1db4239b4d9a9f16bfb78ac05.tar.gz
Fix of UNION code
Added heap_delete_table Added HA_EXTRA_PREPARE_FOR_DELETE Added and use my_dup() for faster open of tables. Removed not working no-mix-table-type BitKeeper/deleted/.del-=6~33f33b0a159dc5d5: Delete: =6 heap/hp_clear.c: Cleanup heap/hp_close.c: Added delayed delete heap/hp_create.c: Added heap_delete_table heap/hp_delete.c: cleanup heap/hp_test2.c: Added heap_delete_table include/heap.h: Added heap_delete_table include/my_base.h: Added HA_EXTRA_PREPARE_FOR_DELETE include/my_sys.h: Adde my_dup and set_prealloc_root isam/extra.c: Added HA_EXTRA_PREPARE_FOR_DELETE myisam/mi_check.c: use my_dup myisam/mi_extra.c: use my_dup myisam/mi_open.c: use my_dup myisam/myisamchk.c: use my_dup myisam/myisamdef.h: use my_dup mysys/Makefile.am: my_dup mysys/hash.c: Add hash_replace mysys/mf_pack.c: cleanup mysys/my_alloc.c: Add set_prealloc_root mysys/my_fstream.c: cleanup mysys/my_lib.c: cleanup mysys/my_seek.c: cleanup sql/ha_heap.cc: Uses heap_delete_table() sql/mysqld.cc: Fix SIGHUP usage Remove no-mix-table-types sql/share/czech/errmsg.txt: new error message sql/share/danish/errmsg.txt: new error message sql/share/dutch/errmsg.txt: new error message sql/share/english/errmsg.txt: new error message sql/share/estonian/errmsg.txt: new error message sql/share/french/errmsg.txt: new error message sql/share/german/errmsg.txt: new error message sql/share/greek/errmsg.txt: new error message sql/share/hungarian/errmsg.txt: new error message sql/share/italian/errmsg.txt: new error message sql/share/japanese/errmsg.txt: new error message sql/share/korean/errmsg.txt: new error message sql/share/norwegian-ny/errmsg.txt: new error message sql/share/norwegian/errmsg.txt: new error message sql/share/polish/errmsg.txt: new error message sql/share/portuguese/errmsg.txt: new error message sql/share/romanian/errmsg.txt: new error message sql/share/russian/errmsg.txt: new error message sql/share/slovak/errmsg.txt: new error message sql/share/spanish/errmsg.txt: new error message sql/share/swedish/errmsg.txt: new error message sql/sql_base.cc: remove no-mix-table-type sql/sql_parse.cc: Fix UNION code
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c4
-rw-r--r--myisam/mi_extra.c5
-rw-r--r--myisam/mi_open.c29
-rw-r--r--myisam/myisamchk.c2
-rw-r--r--myisam/myisamdef.h6
5 files changed, 25 insertions, 21 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index a02652f0b48..e5557e5f842 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -1321,7 +1321,7 @@ err:
DATA_TMP_EXT, share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
- mi_open_datafile(info,share))
+ mi_open_datafile(info,share,-1))
got_error=1;
}
}
@@ -2039,7 +2039,7 @@ err:
DATA_TMP_EXT, share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
- mi_open_datafile(info,share))
+ mi_open_datafile(info,share,-1))
got_error=1;
}
}
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index d7f3e4dc04a..eb7285491ed 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -245,12 +245,15 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
}
break;
case HA_EXTRA_FORCE_REOPEN:
+ case HA_EXTRA_PREPARE_FOR_DELETE:
pthread_mutex_lock(&THR_LOCK_myisam);
share->last_version= 0L; /* Impossible version */
#ifdef __WIN__
/* Close the isam and data files as Win32 can't drop an open table */
pthread_mutex_lock(&share->intern_lock);
- if (flush_key_blocks(share->kfile,FLUSH_RELEASE))
+ if (flush_key_blocks(share->kfile,
+ (function == HA_EXTRA_FORCE_REOPEN ?
+ FLUSH_RELEASE : FLUSH_IGNORE_CHANGED)))
{
error=my_errno;
share->changed=1;
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 4d8a5c2a1d6..36cf8cfd6bd 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -366,7 +366,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
lock_error=1; /* Database unlocked */
}
- if (mi_open_datafile(&info, share))
+ if (mi_open_datafile(&info, share, -1))
goto err;
errpos=5;
@@ -439,7 +439,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
my_errno=EACCES; /* Can't open in write mode */
goto err;
}
- if (mi_open_datafile(&info, share))
+ if (mi_open_datafile(&info, share, old_info->dfile))
goto err;
errpos=5;
}
@@ -1012,25 +1012,26 @@ char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo)
** Help functions for recover
*************************************************************************/
-int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share)
+int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup)
{
#ifdef USE_RAID
if (share->base.raid_type)
{
- if ((info->dfile=my_raid_open(share->data_file_name,
- share->mode | O_SHARE,
- share->base.raid_type,
- share->base.raid_chunks,
- share->base.raid_chunksize,
- MYF(MY_WME | MY_RAID))) < 0)
- return 1;
+ info->dfile=my_raid_open(share->data_file_name,
+ share->mode | O_SHARE,
+ share->base.raid_type,
+ share->base.raid_chunks,
+ share->base.raid_chunksize,
+ MYF(MY_WME | MY_RAID));
}
else
#endif
- if ((info->dfile=my_open(share->data_file_name, share->mode | O_SHARE,
- MYF(MY_WME))) < 0)
- return 1;
- return 0;
+ if (file_to_dup >= 0)
+ info->dfile=my_dup(file_to_dup,MYF(MY_WME));
+ else
+ info->dfile=my_open(share->data_file_name, share->mode | O_SHARE,
+ MYF(MY_WME));
+ return info->dfile >= 0 ? 0 : 1;
}
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index f650e4312f7..fa07d19ddbd 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -712,7 +712,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
raid_chunks,
MYF(0));
- if (mi_open_datafile(info,info->s))
+ if (mi_open_datafile(info,info->s, -1))
error=1;
param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */
param->read_cache.file=info->dfile;
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 865c47fb7ea..9da669e8438 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -169,8 +169,8 @@ typedef struct st_mi_isam_share { /* Shared between opens */
ulong last_version; /* Version on start */
ulong options; /* Options used */
uint rec_reflength; /* rec_reflength in use now */
- int kfile; /* Shared keyfile */
- int data_file; /* Shared data file */
+ File kfile; /* Shared keyfile */
+ File data_file; /* Shared data file */
int mode; /* mode of file on open */
uint reopen; /* How many times reopened */
uint w_locks,r_locks; /* Number of read/write locks */
@@ -642,7 +642,7 @@ my_bool mi_check_status(void* param);
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
my_bool check_table_is_closed(const char *name, const char *where);
-int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share);
+int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup);
int mi_open_keyfile(MYISAM_SHARE *share);
int _mi_init_bulk_insert(MI_INFO *info);