Commit 217ef71a authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Fixes for IO_CACHE

parent a9097ca3
......@@ -148,7 +148,8 @@ version see the relevant distribution.
* Function Index:: SQL command, type and function index
* Concept Index:: Concept Index
@detailmenu --- The Detailed Node Listing ---
@detailmenu
--- The Detailed Node Listing ---
General Information About MySQL
......@@ -592,7 +593,7 @@ Speed of queries that access or update data
MySQL Utilites
* Programs:: What do the executables do?
* safe_mysqld:: safe_mysqld, the wrapper around mysqld
* safe_mysqld::
* mysql:: The command line tool
* mysqladmin:: Administering a @strong{MySQL} server
* mysqldump:: Dumping the structure and data from @strong{MySQL} databases and tables
......@@ -947,6 +948,7 @@ Changes in release 3.19.x
MySQL and the future (The TODO)
* TODO MySQL 4.0::
* TODO future:: Things that must done in the very near future
* TODO sometime:: Things that have to be done sometime
* TODO unplanned:: Some things we don't have any plans to do
......@@ -42925,6 +42927,7 @@ For platform-specific bugs, see the sections about compiling and porting.
@appendix MySQL and the future (The TODO)
@menu
* TODO MySQL 4.0:: Things that should be in 4.0
* TODO future:: Things that must done in the very near future
* TODO sometime:: Things that have to be done sometime
* TODO unplanned:: Some things we don't have any plans to do
......@@ -42934,16 +42937,66 @@ Everything in this list is in the order it will be done. If you want to
affect the priority order, please register a license or support us and
tell us what you want to have done more quickly. @xref{Licensing and Support}.
@node TODO future, TODO sometime, TODO, TODO
@appendixsec Things that must done in the real near future
@node TODO MySQL 4.0, TODO future, TODO, TODO
@appendixsec Things that should be in 4.0
We plan to make @strong{MySQL} 4.0 a 'quick' release where we only add
some new stuff to enable others to help us with developing new features
into 4.1. The @strong{MySQL} 4.0 version should only take us about a
month to make after which we want to stabilize it and start working on
4.1. 4.0 should have the following new features:
@itemize @bullet
@item
Fail safe replication.
New table definition file format (@code{.frm} files) This will enable us
to not run out of bits when adding more table options. One will still
be able to use the old .frm file format with 4.0; All new created tables
will however use the new format.
The new file format will enable us to add new column types, more options
for keys and @code{FOREIGN KEYS}.
@item
@code{mysqld} as a library. This will have the same interface as the
standard MySQL client (with an extra function to just set up startup
parameters) but will be faster (no TCP/IP or socket overhead), smaller
and much easer to use from embedded products.
One will be able to define at link time if one wants to use the
client/server model or a stand-alone application just by defining which
library to link with.
The @code{mysqld} will support all standard @strong{MySQL} features and
one can use it in a threaded client to run different queries in each
thread.
@item
Online backup with very low performance penalty. The online backup will
make it easy to add a new replication slave without taking down the
master.
@item
@code{DELETE FROM table_name} will return the number of deleted rows. For
fast execution one should use @code{TRUNCATE table_name}.
@item
Multi table deletes (cascading deletes) and multi table updates.
@item
Optimize, test and document transactions safe tables (BDB tables)
Better replication.
@item
Allow users to change startup options.
More functions for full text search.
@item
Character set casts and syntax for handling multiple character sets.
@item
Allow users to change startup options without taking down the server.
@item
Help for all commands from the client.
@item
Secure connections (with SSL).
@end itemize
@node TODO future, TODO sometime, TODO MySQL 4.0, TODO
@appendixsec Things that must done in the real near future
@itemize @bullet
@item
Fail safe replication.
@item
Subqueries. @code{select id from t where grp in (select grp from g where u > 100)}
@item
......@@ -40,7 +40,7 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
else
fd = open((my_string) FileName, Flags | O_BINARY);
#elif !defined(NO_OPEN_3)
fd = open(FileName, Flags, 0); /* Normal unix */
fd = open(FileName, Flags, my_umask); /* Normal unix */
#else
fd = open((my_string) FileName, Flags);
#endif
......
......@@ -156,7 +156,7 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
do_magic = ((log_type == LOG_BIN) && !my_stat(log_file_name,
&tmp_stat, MYF(0)));
if ((file=my_open(log_file_name,O_APPEND | O_WRONLY | O_BINARY,
if ((file=my_open(log_file_name,O_CREAT | O_APPEND | O_WRONLY | O_BINARY,
MYF(MY_WME | ME_WAITTANG))) < 0 ||
init_io_cache(&log_file, file, IO_SIZE, WRITE_CACHE,
my_tell(file,MYF(MY_WME)), 0, MYF(MY_WME | MY_NABP)))
......@@ -194,28 +194,38 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
}
else if (log_type == LOG_BIN)
{
// Explanation of the boolean black magic:
//
// if we are supposed to write magic number try write
// clean up if failed
// then if index_file has not been previously opened, try to open it
// clean up if failed
/*
Explanation of the boolean black magic:
if we are supposed to write magic number try write
clean up if failed
then if index_file has not been previously opened, try to open it
clean up if failed
*/
if ((do_magic && my_b_write(&log_file, (byte*) BINLOG_MAGIC, 4)) ||
(index_file < 0 &&
(index_file = my_open(index_file_name,O_APPEND | O_BINARY | O_RDWR,
(index_file = my_open(index_file_name, O_CREAT | O_APPEND |
O_BINARY | O_RDWR,
MYF(MY_WME))) < 0))
goto err;
Start_log_event s;
bool error;
s.write(&log_file);
pthread_mutex_lock(&LOCK_index);
my_write(index_file, log_file_name,strlen(log_file_name), MYF(0));
my_write(index_file, "\n",1, MYF(0));
error=(my_write(index_file, log_file_name,strlen(log_file_name),
MYF(MY_NABP | MY_WME)) ||
my_write(index_file, "\n", 1, MYF(MY_NABP | MY_WME)));
pthread_mutex_unlock(&LOCK_index);
if (error)
{
my_close(index_file,MYF(0));
index_file= -1;
goto err;
}
}
return;
err:
sql_print_error("Could not use %s for logging (error %d)", log_name,errno);
if (file >= 0)
my_close(file,MYF(0));
end_io_cache(&log_file);
......@@ -409,7 +419,7 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log)
#ifdef HAVE_FTRUNCATE
if (ftruncate(index_file,0))
{
sql_print_error("Ouch! Could not truncate the binlog index file \
sql_print_error("Could not truncate the binlog index file \
during log purge for write");
error = LOG_INFO_FATAL;
goto err;
......@@ -418,10 +428,11 @@ during log purge for write");
#else
my_close(index_file, MYF(MY_WME));
my_delete(index_file_name, MYF(MY_WME));
if(!(index_file = my_open(index_file_name, O_BINARY | O_RDWR | O_APPEND,
if(!(index_file = my_open(index_file_name,
O_CREAT | O_BINARY | O_RDWR | O_APPEND,
MYF(MY_WME))))
{
sql_print_error("Ouch! Could not re-open the binlog index file \
sql_print_error("Could not re-open the binlog index file \
during log purge for write");
error = LOG_INFO_FATAL;
goto err;
......
......@@ -2308,7 +2308,7 @@ static struct option long_options[] = {
(int) OPT_REPLICATE_REWRITE_DB},
{"safe-mode", no_argument, 0, (int) OPT_SAFE},
{"socket", required_argument, 0, (int) OPT_SOCKET},
{"server-id", required_argument, 0, (int)OPT_SERVER_ID},
{"server-id", required_argument, 0, (int)OPT_SERVER_ID},
{"set-variable", required_argument, 0, 'O'},
#ifdef HAVE_BERKELEY_DB
{"skip-bdb", no_argument, 0, (int) OPT_BDB_SKIP},
......
......@@ -114,7 +114,7 @@ THD::THD()
ull=0;
system_thread=0;
bzero((char*) &mem_root,sizeof(mem_root));
#if defined(HAVE_BDB) || defined(HAVE_INNOBASE) || defined(HAVE_GEMENI)
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB)
if (open_cached_file(&transactions.trans_log,
mysql_tempdir,LOG_PREFIX,0,MYF(MY_WME)))
killed=1;
......@@ -143,7 +143,7 @@ THD::~THD()
close_thread_tables(this);
}
close_temporary_tables(this);
#if defined(HAVE_BDB) || defined(HAVE_INNOBASE) || defined(HAVE_GEMENI)
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB)
close_cached_file(transactions.trans_log);
#endif
if (global_read_lock)
......
......@@ -238,7 +238,7 @@ public:
const char *where;
char* last_nx_table; // last non-existent table, we need this for replication
char* last_nx_db; // database of the last nx table
time_t start_time,time_after_lock;
time_t start_time,time_after_lock,user_time;
time_t connect_time,thr_create_time; // track down slow pthread_create
thr_lock_type update_lock_default;
delayed_insert *di;
......@@ -265,7 +265,7 @@ public:
char scramble[9];
bool set_query_id,locked,count_cuted_fields,some_tables_deleted;
bool no_errors, allow_sum_func, password, fatal_error;
bool query_start_used,last_insert_id_used,insert_id_used,user_time;
bool query_start_used,last_insert_id_used,insert_id_used;
bool volatile killed,bootstrap;
bool system_thread,in_lock_tables,global_read_lock;
bool query_error;
......@@ -277,9 +277,9 @@ public:
~THD();
bool store_globals();
inline time_t query_start() { query_start_used=1; return start_time; }
inline void set_time() { if (!user_time) time_after_lock=time(&start_time); }
inline void set_time() { if (user_time) start_time=time_after_lock=user_time; else time_after_lock=time(&start_time); }
inline void end_time() { time(&start_time); }
inline void set_time(time_t t) { time_after_lock=start_time=t; user_time=1; }
inline void set_time(time_t t) { time_after_lock=start_time=user_time=t; }
inline void lock_time() { time(&time_after_lock); }
inline void insert_id(ulonglong id)
{ last_insert_id=id; insert_id_used=1; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment