diff options
author | unknown <monty@donna.mysql.com> | 2000-12-07 14:08:48 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-12-07 14:08:48 +0200 |
commit | 29907fc5a4e0982e4bd287355bf79ab6e429795a (patch) | |
tree | 8a5c9d678d477bb2c3fa95057c9299dcf9560aab /sql/mf_iocache.cc | |
parent | e5c585861e6bf411fd64a18d3a08dbacf039d21a (diff) | |
download | mariadb-git-29907fc5a4e0982e4bd287355bf79ab6e429795a.tar.gz |
Only write full transactions to binary log
A lot of new functions for BDB tables
Fix for DROP DATABASE on windows
Default server_id variables
Docs/manual.texi:
Update of BDB info + Changes
configure.in:
Added test of readlink
include/mysqld_error.h:
Added new error message
sql/ha_berkeley.cc:
Added storing of status, CHECK, ANALYZE and OPTIMIZE TABLE
sql/ha_berkeley.h:
Added storing of status, CHECK, ANALYZE and OPTIMIZE TABLE
sql/handler.cc:
Only write full transactions to binary log
sql/hostname.cc:
cleanup
sql/log.cc:
Only write full transactions to binary log
sql/log_event.h:
Only write full transactions to binary log
sql/mf_iocache.cc:
Changes to be able to use IO_CACHE to save statements in a transaction
sql/mysql_priv.h:
New variables
sql/mysqld.cc:
Only write full transactions to binary log
Added default values for server_id
Lots of new bdb options
sql/share/czech/errmsg.sys:
Added new error message
sql/share/czech/errmsg.txt:
Added new error message
sql/share/danish/errmsg.sys:
Added new error message
sql/share/danish/errmsg.txt:
Added new error message
sql/share/dutch/errmsg.sys:
Added new error message
sql/share/dutch/errmsg.txt:
Added new error message
sql/share/english/errmsg.sys:
Added new error message
sql/share/english/errmsg.txt:
Added new error message
sql/share/estonian/errmsg.sys:
Added new error message
sql/share/estonian/errmsg.txt:
Added new error message
sql/share/french/errmsg.sys:
Added new error message
sql/share/french/errmsg.txt:
Added new error message
sql/share/german/errmsg.sys:
Added new error message
sql/share/german/errmsg.txt:
Added new error message
sql/share/greek/errmsg.sys:
Added new error message
sql/share/greek/errmsg.txt:
Added new error message
sql/share/hungarian/errmsg.sys:
Added new error message
sql/share/hungarian/errmsg.txt:
Added new error message
sql/share/italian/errmsg.sys:
Added new error message
sql/share/italian/errmsg.txt:
Added new error message
sql/share/japanese/errmsg.sys:
Added new error message
sql/share/japanese/errmsg.txt:
Added new error message
sql/share/korean/errmsg.sys:
Added new error message
sql/share/korean/errmsg.txt:
Added new error message
sql/share/norwegian-ny/errmsg.txt:
Added new error message
sql/share/norwegian/errmsg.txt:
Added new error message
sql/share/polish/errmsg.sys:
Added new error message
sql/share/polish/errmsg.txt:
Added new error message
sql/share/portuguese/errmsg.sys:
Added new error message
sql/share/portuguese/errmsg.txt:
Added new error message
sql/share/romanian/errmsg.txt:
Added new error message
sql/share/russian/errmsg.sys:
Added new error message
sql/share/russian/errmsg.txt:
Added new error message
sql/share/slovak/errmsg.sys:
Added new error message
sql/share/slovak/errmsg.txt:
Added new error message
sql/share/spanish/errmsg.sys:
Added new error message
sql/share/spanish/errmsg.txt:
Added new error message
sql/share/swedish/errmsg.OLD:
Added new error message
sql/share/swedish/errmsg.sys:
Added new error message
sql/share/swedish/errmsg.txt:
Added new error message
sql/sql_base.cc:
cleanup
sql/sql_class.cc:
Only write full transactions to binary log
sql/sql_class.h:
Added error handling of failed writes to logs
sql/sql_db.cc:
Fix for DROP DATABASE on windows
sql/sql_delete.cc:
Only write full transactions to binary log
sql/sql_insert.cc:
Only write full transactions to binary log
sql/sql_load.cc:
Only write full transactions to binary log
sql/sql_parse.cc:
End transaction at DROP, RENAME, CREATE and TRUNCATE
sql/sql_table.cc:
Fixes for ALTER TABLE on BDB tables for windows
sql/sql_update.cc:
Only write full transactions to binary log
sql/sql_yacc.yy:
AGAINST is not anymore a reserved word
support-files/my-huge.cnf.sh:
Changed to use binary log
support-files/my-large.cnf.sh:
Changed to use binary log
support-files/my-medium.cnf.sh:
Changed to use binary log
support-files/my-small.cnf.sh:
Changed to use binary log
Diffstat (limited to 'sql/mf_iocache.cc')
-rw-r--r-- | sql/mf_iocache.cc | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc index f723e35ca93..cddacaa820f 100644 --- a/sql/mf_iocache.cc +++ b/sql/mf_iocache.cc @@ -121,7 +121,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, } /* end_of_file may be changed by user later */ info->end_of_file= ((type == READ_NET || type == READ_FIFO ) ? 0 - : MY_FILEPOS_ERROR); + : ~(my_off_t) 0); info->type=type; info->error=0; info->read_function=(type == READ_NET) ? _my_b_net_read : _my_b_read; /* net | file */ @@ -176,6 +176,8 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, DBUG_ENTER("reinit_io_cache"); info->seek_not_done= test(info->file >= 0); /* Seek not done */ + + /* If the whole file is in memory, avoid flushing to disk */ if (! clear_cache && seek_offset >= info->pos_in_file && seek_offset <= info->pos_in_file + @@ -186,8 +188,12 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, info->rc_end=info->rc_pos; info->end_of_file=my_b_tell(info); } - else if (info->type == READ_CACHE && type == WRITE_CACHE) - info->rc_end=info->buffer+info->buffer_length; + else if (type == WRITE_CACHE) + { + if (info->type == READ_CACHE) + info->rc_end=info->buffer+info->buffer_length; + info->end_of_file = ~(my_off_t) 0; + } info->rc_pos=info->rc_request_pos+(seek_offset-info->pos_in_file); #ifdef HAVE_AIOWAIT my_aiowait(&info->aio_result); /* Wait for outstanding req */ @@ -195,11 +201,20 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, } else { + /* + If we change from WRITE_CACHE to READ_CACHE, assume that everything + after the current positions should be ignored + */ if (info->type == WRITE_CACHE && type == READ_CACHE) info->end_of_file=my_b_tell(info); - if (flush_io_cache(info)) + /* No need to flush cache if we want to reuse it */ + if ((type != WRITE_CACHE || !clear_cache) && flush_io_cache(info)) DBUG_RETURN(1); - info->pos_in_file=seek_offset; + if (info->pos_in_file != seek_offset) + { + info->pos_in_file=seek_offset; + info->seek_not_done=1; + } info->rc_request_pos=info->rc_pos=info->buffer; if (type == READ_CACHE || type == READ_NET || type == READ_FIFO) { @@ -210,7 +225,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, info->rc_end=info->buffer+info->buffer_length- (seek_offset & (IO_SIZE-1)); info->end_of_file= ((type == READ_NET || type == READ_FIFO) ? 0 : - MY_FILEPOS_ERROR); + ~(my_off_t) 0); } } info->type=type; @@ -536,6 +551,11 @@ int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count) Buffer+=rest_length; Count-=rest_length; info->rc_pos+=rest_length; + if (info->pos_in_file+info->buffer_length > info->end_of_file) + { + my_errno=errno=EFBIG; + return info->error = -1; + } if (flush_io_cache(info)) return 1; if (Count >= IO_SIZE) |