diff options
author | monty@hundin.mysql.fi <> | 2001-08-19 14:43:51 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-08-19 14:43:51 +0300 |
commit | a1be2a894f339f7b14a6b654c961d77ba13298d4 (patch) | |
tree | e2a8b10d8dae9fee5283beb230210199e135ef74 /myisam/mi_open.c | |
parent | 1e1a1ec064de1f6ddbd0ae433b83d7c8647557a3 (diff) | |
download | mariadb-git-a1be2a894f339f7b14a6b654c961d77ba13298d4.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
Diffstat (limited to 'myisam/mi_open.c')
-rw-r--r-- | myisam/mi_open.c | 29 |
1 files changed, 15 insertions, 14 deletions
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; } |