summaryrefslogtreecommitdiff
path: root/myisam/mi_open.c
diff options
context:
space:
mode:
authorunknown <monty@tramp.mysql.fi>2000-09-26 00:33:25 +0300
committerunknown <monty@tramp.mysql.fi>2000-09-26 00:33:25 +0300
commit7fe58c4f5bea627bb38bfbcb0cc5885e3f6129c6 (patch)
tree047c90e932cb7b90a58fe795b855351027725c29 /myisam/mi_open.c
parent5f12486229fb578f2e170238ab2cdd7c9bf42a82 (diff)
downloadmariadb-git-7fe58c4f5bea627bb38bfbcb0cc5885e3f6129c6.tar.gz
RIGHT JOIN, part of automatic repair of MyISAM tables, backup on repair,
reading from FIFO, fixes for FULLTEXT, @@IDENTITY Docs/manual.texi: Update of RIGHT JOIN client/mysql.cc: Faster HTML generation extra/perror.c: Added MyISAM error messages include/my_base.h: Update for automatic repair of MyISAM tables include/my_sys.h: Backup files and FIFO include/myisam.h: Automatic repair and backup files include/mysqld_error.h: New error message myisam/mi_check.c: Update for automatic repair of MyISAM tables myisam/mi_locking.c: Fixed comment myisam/mi_open.c: Update for automatic repair of MyISAM tables myisam/myisamchk.c: Update for automatic repair of MyISAM tables myisam/myisamdef.h: Update for automatic repair of MyISAM tables mysys/mf_getdate.c: Added new parameter option for backup files mysys/my_open.c: Added debug information mysys/my_redel.c: Backup file handling sql/ha_berkeley.cc: Updated interface sql/ha_berkeley.h: Updated interface sql/ha_heap.cc: Updated interface sql/ha_heap.h: Updated interface sql/ha_isam.cc: Updated interface sql/ha_isam.h: Updated interface sql/ha_isammrg.cc: Updated interface sql/ha_isammrg.h: Updated interface sql/ha_myisam.cc: Update for automatic repair of MyISAM tables sql/ha_myisam.h: Updated interface sql/ha_myisammrg.cc: Updated interface sql/ha_myisammrg.h: Updated interface sql/handler.h: Updated interface sql/item.h: Added @@identity sql/item_func.cc: Added @@identity sql/lex.h: Added RIGHT JOIN sql/mf_iocache.cc: Update for reading from FIFO sql/mysqld.cc: Update for automatic repair of MyISAM tables sql/share/czech/errmsg.sys: Added @@identity sql/share/czech/errmsg.txt: Added @@identity sql/share/danish/errmsg.sys: Added @@identity sql/share/danish/errmsg.txt: Added @@identity sql/share/dutch/errmsg.sys: Added @@identity sql/share/dutch/errmsg.txt: Added @@identity sql/share/english/errmsg.sys: Added @@identity sql/share/english/errmsg.txt: Added @@identity sql/share/estonian/errmsg.sys: Added @@identity sql/share/estonian/errmsg.txt: Added @@identity sql/share/french/errmsg.sys: Added @@identity sql/share/french/errmsg.txt: Added @@identity sql/share/german/errmsg.sys: Added @@identity sql/share/german/errmsg.txt: Added @@identity sql/share/greek/errmsg.sys: Added @@identity sql/share/greek/errmsg.txt: Added @@identity sql/share/hungarian/errmsg.sys: Added @@identity sql/share/hungarian/errmsg.txt: Added @@identity sql/share/italian/errmsg.sys: Added @@identity sql/share/italian/errmsg.txt: Added @@identity sql/share/japanese/errmsg.sys: Added @@identity sql/share/japanese/errmsg.txt: Added @@identity sql/share/korean/errmsg.sys: Added @@identity sql/share/korean/errmsg.txt: Added @@identity sql/share/norwegian-ny/errmsg.txt: Added @@identity sql/share/norwegian/errmsg.txt: Added @@identity sql/share/polish/errmsg.sys: Added @@identity sql/share/polish/errmsg.txt: Added @@identity sql/share/portuguese/errmsg.sys: Added @@identity sql/share/portuguese/errmsg.txt: Added @@identity sql/share/romanian/errmsg.txt: Added @@identity sql/share/russian/errmsg.sys: Added @@identity sql/share/russian/errmsg.txt: Added @@identity sql/share/slovak/errmsg.sys: Added @@identity sql/share/slovak/errmsg.txt: Added @@identity sql/share/spanish/errmsg.sys: Added @@identity sql/share/spanish/errmsg.txt: Added @@identity sql/share/swedish/errmsg.OLD: Added @@identity sql/share/swedish/errmsg.sys: Added @@identity sql/share/swedish/errmsg.txt: Added @@identity sql/sql_base.cc: Fix for RIGHT JOIN sql/sql_db.cc: Update for automatic repair of MyISAM tables sql/sql_load.cc: Added reading from FIFO sql/sql_parse.cc: Fix for RIGHT JOIN sql/sql_select.cc: Fix for RIGHT JOIN sql/sql_table.cc: cleanup sql/sql_yacc.yy: Added RIGHT JOIN sql/table.cc: Fix handling of FULLTEXT index sql/table.h: Added RIGHT JOIN BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'myisam/mi_open.c')
-rw-r--r--myisam/mi_open.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 70096f33c5e..f962d0485c8 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -57,16 +57,14 @@ static MI_INFO *test_if_reopen(char *filename)
/******************************************************************************
- open a isam database.
- if handle_locking is 0 then exit with error if database is locked
- if handle_locking is 1 then wait if database is locked
- if handle_locking is 2 then continue, but count-vars in st_i_info
- may be wrong. count-vars are automaticly fixed after next isam
- request.
+ open a MyISAM database.
+ See my_base.h for the handle_locking argument
+ if handle_locking and HA_OPEN_ABORT_IF_CRASHED then abort if the table
+ is marked crashed or if we are not using locking and the table doesn't
+ have an open count of 0.
******************************************************************************/
-
-MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
+MI_INFO *mi_open(const char *name, int mode, uint open_flags)
{
int lock_error,kfile,open_mode,save_errno;
uint i,j,len,errpos,head_length,base_pos,offset,info_length,extra,keys,
@@ -139,12 +137,12 @@ MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
errpos=2;
VOID(my_seek(kfile,0L,MY_SEEK_SET,MYF(0)));
- if (!(handle_locking & HA_OPEN_TMP_TABLE))
+ if (!(open_flags & HA_OPEN_TMP_TABLE))
{
if ((lock_error=my_lock(kfile,F_RDLCK,0L,F_TO_EOF,
- MYF(handle_locking & HA_OPEN_WAIT_IF_LOCKED ?
+ MYF(open_flags & HA_OPEN_WAIT_IF_LOCKED ?
0 : MY_DONT_WAIT))) &&
- !(handle_locking & HA_OPEN_IGNORE_IF_LOCKED))
+ !(open_flags & HA_OPEN_IGNORE_IF_LOCKED))
goto err;
}
errpos=3;
@@ -176,6 +174,14 @@ MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
disk_pos=my_n_base_info_read(disk_cache+base_pos, &share->base);
share->state.state_length=base_pos;
+ if ((open_flags & HA_OPEN_ABORT_IF_CRASHED) &&
+ ((share->state.changed & STATE_CRASHED) ||
+ (my_disable_locking && share->state.open_count)))
+ {
+ my_errno=((share->state.changed & STATE_CRASHED_ON_REPAIR) ?
+ HA_ERR_CRASHED_ON_REPAIR : HA_ERR_CRASHED);
+ goto err;
+ }
/* Correct max_file_length based on length of sizeof_t */
max_data_file_length=
(share->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ?
@@ -273,7 +279,10 @@ MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
}
}
if (share->keyinfo[i].flag & HA_FULLTEXT) /* SerG */
+ {
share->keyinfo[i].seg=pos-FT_SEGS; /* SerG */
+ share->fulltext_index=1;
+ }
share->keyinfo[i].end=pos;
pos->type=HA_KEYTYPE_END; /* End */
pos->length=share->base.rec_reflength;
@@ -401,7 +410,7 @@ MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
((share->options & (HA_OPTION_READ_ONLY_DATA | HA_OPTION_TMP_TABLE |
HA_OPTION_COMPRESS_RECORD |
HA_OPTION_TEMP_COMPRESS_RECORD)) ||
- (handle_locking & HA_OPEN_TMP_TABLE)) ? 0 : 1;
+ (open_flags & HA_OPEN_TMP_TABLE)) ? 0 : 1;
if (share->concurrent_insert)
{
share->lock.get_status=mi_get_status;
@@ -484,7 +493,7 @@ MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
info.lock_type=F_RDLCK;
share->r_locks++;
}
- if ((handle_locking & HA_OPEN_TMP_TABLE) ||
+ if ((open_flags & HA_OPEN_TMP_TABLE) ||
(share->options & HA_OPTION_TMP_TABLE))
{
share->temporary=share->delay_key_write=1;
@@ -492,7 +501,7 @@ MI_INFO *mi_open(const char *name, int mode, uint handle_locking)
share->w_locks++; /* We don't have to update status */
info.lock_type=F_WRLCK;
}
- if (((handle_locking & HA_OPEN_DELAY_KEY_WRITE) ||
+ if (((open_flags & HA_OPEN_DELAY_KEY_WRITE) ||
(share->options & HA_OPTION_DELAY_KEY_WRITE)) &&
myisam_delay_key_write)
share->delay_key_write=1;