Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1853 05/04/05 13:17:49 serg@stripped +17 -0
remove the rest of isam/merge references
fix a race condition in TC_LOG_BINLOG::unlog
sql/sql_class.h
1.228 05/04/05 13:17:40 serg@stripped +5 -4
cleanup
sql/sql_base.cc
1.231 05/04/05 13:17:40 serg@stripped +0 -1
remove the rest of isam/merge references
sql/set_var.cc
1.103 05/04/05 13:17:40 serg@stripped +3 -9
hide unused variables. simplify sync_binlog code
sql/opt_range.cc
1.150 05/04/05 13:17:40 serg@stripped +1 -2
remove the rest of isam/merge references
sql/mysqld.cc
1.447 05/04/05 13:17:39 serg@stripped +14 -40
remove the rest of isam/merge references
sql/mysql_priv.h
1.284 05/04/05 13:17:39 serg@stripped +3 -6
remove duplicates
sql/log.cc
1.159 05/04/05 13:17:39 serg@stripped +29 -24
fix a race condition in TC_LOG_BINLOG::unlog
preparation for binlog group commit
sql/handler.cc
1.156 05/04/05 13:17:39 serg@stripped +0 -4
remove the rest of isam/merge references
mysys/my_sync.c
1.3 05/04/05 13:17:39 serg@stripped +17 -5
MY_IGNORE_BADFD flag
mysql-test/t/xa.test
1.2 05/04/05 13:17:39 serg@stripped +1 -0
comment
mysql-test/t/replace.test
1.11 05/04/05 13:17:39 serg@stripped +2 -6
remove the rest of isam/merge references
mysql-test/r/replace.result
1.9 05/04/05 13:17:39 serg@stripped +1 -3
remove the rest of isam/merge references
include/mysql_embed.h
1.13 05/04/05 13:17:39 serg@stripped +0 -1
remove the rest of isam/merge references
include/my_sys.h
1.148 05/04/05 13:17:39 serg@stripped +5 -6
MY_IGNORE_BADFD flag
include/my_pthread.h
1.81 05/04/05 13:17:39 serg@stripped +0 -17
unused and abused macro removed
include/config-win.h
1.57 05/04/05 13:17:39 serg@stripped +0 -1
unused and abused macro removed
include/Makefile.am
1.52 05/04/05 13:17:39 serg@stripped +1 -1
remove the rest of isam/merge references
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: serg
# Host: serg.mylan
# Root: /usr/home/serg/Abk/mysql-5.0
--- 1.51/include/Makefile.am Fri Jan 28 17:13:55 2005
+++ 1.52/include/Makefile.am Tue Apr 5 13:17:39 2005
@@ -24,7 +24,7 @@
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
mysql_time.h $(BUILT_SOURCES)
noinst_HEADERS = config-win.h config-os2.h config-netware.h \
- nisam.h heap.h merge.h my_bitmap.h\
+ heap.h my_bitmap.h\
myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h help_start.h help_end.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
--- 1.56/include/config-win.h Sat Mar 5 22:10:03 2005
+++ 1.57/include/config-win.h Tue Apr 5 13:17:39 2005
@@ -351,7 +351,6 @@
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
-#define thread_safe_dec_and_test(V, L) thread_safe_decrement(V,L)
/* The following is only used for statistics, so it should be good enough */
#ifdef __NT__ /* This should also work on Win98 but .. */
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
--- 1.80/include/my_pthread.h Mon Feb 14 18:45:23 2005
+++ 1.81/include/my_pthread.h Tue Apr 5 13:17:39 2005
@@ -678,7 +678,6 @@
#ifdef HAVE_ATOMIC_ADD
#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
-#define thread_safe_dec_and_test(V, L) atomic_dec_and_test((atomic_t*) &V)
#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V)
#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V)
#else
@@ -689,22 +688,6 @@
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C),
pthread_mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
-#ifdef __cplusplus
-static inline bool thread_safe_dec_and_test(ulong &V, pthread_mutex_t *L)
-{
- ulong res;
- pthread_mutex_lock(L);
- res=--V;
- pthread_mutex_unlock(L);
- return res==0;
-}
-#else
-/*
- what should we do ? define it as static ?
- a regular function somewhere in mysys/ ?
- for now it's only used in c++ code, so there's no need to bother
-*/
-#endif
#endif /* HAVE_ATOMIC_ADD */
#ifdef SAFE_STATISTICS
#define statistic_increment(V,L) thread_safe_increment((V),(L))
--- 1.147/include/my_sys.h Fri Mar 25 23:44:49 2005
+++ 1.148/include/my_sys.h Tue Apr 5 13:17:39 2005
@@ -54,11 +54,10 @@
#define MY_FAE 8 /* Fatal if any error */
#define MY_WME 16 /* Write message on error */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
-#define MY_RAID 64 /* Support for RAID (not the "Johnson&Johnson"-s one
;) */
-#define MY_FULL_IO 512 /* For my_read - loop intil I/O
- is complete
- */
-#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
+#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
+#define MY_RAID 64 /* Support for RAID */
+#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
+#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
#define MY_COPYTIME 64 /* my_redel() copys time */
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
@@ -72,7 +71,7 @@
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
-#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */
+#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
--- 1.155/sql/handler.cc Mon Apr 4 00:49:52 2005
+++ 1.156/sql/handler.cc Tue Apr 5 13:17:39 2005
@@ -25,10 +25,6 @@
#include "ha_heap.h"
#include "ha_myisam.h"
#include "ha_myisammrg.h"
-#ifdef HAVE_ISAM
-#include "ha_isam.h"
-#include "ha_isammrg.h"
-#endif
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h"
#endif
--- 1.158/sql/log.cc Tue Mar 22 00:28:31 2005
+++ 1.159/sql/log.cc Tue Apr 5 13:17:39 2005
@@ -1531,18 +1531,20 @@
return 0;
}
-
-inline bool sync_binlog(IO_CACHE *cache)
+bool MYSQL_LOG::flush_and_sync()
{
- if (sync_binlog_period == ++sync_binlog_counter && sync_binlog_period)
+ int err=0, fd=log_file.file;
+ safe_mutex_assert_owner(&LOCK_log);
+ if (flush_io_cache(&log_file))
+ return 1;
+ if (++sync_binlog_counter >= sync_binlog_period && sync_binlog_period)
{
sync_binlog_counter= 0;
- return my_sync(cache->file, MYF(MY_WME));
+ err=my_sync(fd, MYF(MY_WME));
}
- return 0;
+ return err;
}
-
/*
Write an event to the binary log
*/
@@ -1675,8 +1677,8 @@
}
}
- /*
- Write the SQL command
+ /*
+ Write the SQL command
*/
if (event_info->write(file))
@@ -1684,8 +1686,10 @@
if (file == &log_file) // we are writing to the real log (disk)
{
- if (flush_io_cache(file) || sync_binlog(file))
+ if (flush_and_sync())
goto err;
+ signal_update();
+ rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
}
error=0;
@@ -1698,15 +1702,9 @@
my_error(ER_ERROR_ON_WRITE, MYF(0), name, errno);
write_error=1;
}
- if (file == &log_file)
- {
- signal_update();
- rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
- }
}
pthread_mutex_unlock(&LOCK_log);
-
DBUG_RETURN(error);
}
@@ -1813,7 +1811,7 @@
if (commit_event->write(&log_file))
goto err;
DBUG_skip_commit:
- if (flush_io_cache(&log_file) || sync_binlog(&log_file))
+ if (flush_and_sync())
goto err;
DBUG_EXECUTE_IF("half_binlogged_transaction", abort(););
if (cache->error) // Error on read
@@ -1983,26 +1981,26 @@
SYNOPSIS
wait_for_update()
thd Thread variable
- master_or_slave If 0, the caller is the Binlog_dump thread from master;
+ is_slave If 0, the caller is the Binlog_dump thread from master;
if 1, the caller is the SQL thread from the slave. This
influences only thd->proc_info.
NOTES
One must have a lock on LOCK_log before calling this function.
- This lock will be freed before return! That's required by
+ This lock will be released before return! That's required by
THD::enter_cond() (see NOTES in sql_class.h).
*/
-void MYSQL_LOG::wait_for_update(THD* thd, bool master_or_slave)
+void MYSQL_LOG::wait_for_update(THD* thd, bool is_slave)
{
const char *old_msg;
DBUG_ENTER("wait_for_update");
old_msg= thd->enter_cond(&update_cond, &LOCK_log,
- master_or_slave ?
+ is_slave ?
"Has read all relay log; waiting for the slave I/O "
- "thread to update it" :
+ "thread to update it" :
"Has sent all binlog to slave; waiting for binlog "
- "to be updated");
+ "to be updated");
pthread_cond_wait(&update_cond, &LOCK_log);
thd->exit_cond(old_msg);
DBUG_VOID_RETURN;
@@ -2051,7 +2049,12 @@
my_pwrite(log_file.file, &flags, 1, offset, MYF(0));
}
- if (my_close(log_file.file,MYF(0)) < 0 && ! write_error)
+ if (my_sync(log_file.file,MYF(MY_WME)) && ! write_error)
+ {
+ write_error=1;
+ sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
+ }
+ if (my_close(log_file.file,MYF(MY_WME)) && ! write_error)
{
write_error=1;
sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
@@ -2945,8 +2948,10 @@
void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
{
- if (thread_safe_dec_and_test(prepared_xids, &LOCK_prep_xids))
+ pthread_mutex_lock(&LOCK_prep_xids);
+ if (--prepared_xids == 0)
pthread_cond_signal(&COND_prep_xids);
+ pthread_mutex_unlock(&LOCK_prep_xids);
rotate_and_purge(0); // as ::write() did not rotate
}
--- 1.283/sql/mysql_priv.h Fri Mar 25 19:11:10 2005
+++ 1.284/sql/mysql_priv.h Tue Apr 5 13:17:39 2005
@@ -1126,10 +1126,6 @@
extern String my_empty_string;
extern const String my_null_string;
extern SHOW_VAR init_vars[],status_vars[], internal_vars[];
-extern SHOW_COMP_OPTION have_isam;
-extern SHOW_COMP_OPTION have_innodb;
-extern SHOW_COMP_OPTION have_berkeley_db;
-extern SHOW_COMP_OPTION have_ndbcluster;
extern struct system_variables global_system_variables;
extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
@@ -1150,12 +1146,13 @@
extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db;
extern SHOW_COMP_OPTION have_example_db, have_archive_db, have_csv_db;
extern SHOW_COMP_OPTION have_federated_db;
+extern SHOW_COMP_OPTION have_blackhole_db;
+extern SHOW_COMP_OPTION have_ndbcluster;
extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink;
-extern SHOW_COMP_OPTION have_query_cache, have_berkeley_db, have_innodb;
+extern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
extern SHOW_COMP_OPTION have_compress;
-extern SHOW_COMP_OPTION have_blackhole_db;
#ifndef __WIN__
extern pthread_t signal_thread;
--- 1.446/sql/mysqld.cc Tue Mar 29 14:22:35 2005
+++ 1.447/sql/mysqld.cc Tue Apr 5 13:17:39 2005
@@ -30,9 +30,6 @@
#include "ha_innodb.h"
#endif
#include "ha_myisam.h"
-#ifdef HAVE_ISAM
-#include "ha_isam.h"
-#endif
#ifdef HAVE_NDBCLUSTER_DB
#include "ha_ndbcluster.h"
#endif
@@ -47,11 +44,6 @@
#else
#define OPT_BDB_DEFAULT 0
#endif
-#ifdef HAVE_ISAM_DB
-#define OPT_ISAM_DEFAULT 1
-#else
-#define OPT_ISAM_DEFAULT 0
-#endif
#ifdef HAVE_NDBCLUSTER_DB
#define OPT_NDBCLUSTER_DEFAULT 0
#if defined(NOT_ENOUGH_TESTED) \
@@ -64,7 +56,6 @@
#define OPT_NDBCLUSTER_DEFAULT 0
#endif
-#include <nisam.h>
#include <thr_alarm.h>
#include <ft_global.h>
#include <errmsg.h>
@@ -4342,7 +4333,7 @@
"Don't try to recover Berkeley DB tables on start.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"bdb-no-sync", OPT_BDB_NOSYNC,
- "Disable synchronously flushing logs. This option is deprecated, use
--skip-sync-bdb-logs or sync-bdb-logs=0 instead",
+ "This option is deprecated, use --skip-sync-bdb-logs instead",
// (gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"bdb-shared-data", OPT_BDB_SHARED,
@@ -4551,9 +4542,8 @@
(gptr*) &global_system_variables.innodb_support_xa,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
#endif /* End HAVE_INNOBASE_DB */
- {"isam", OPT_ISAM, "Enable ISAM (if this version of MySQL supports it). \
-Disable with --skip-isam.",
- (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, OPT_ISAM_DEFAULT,
0, 0,
+ {"isam", OPT_ISAM, "Obsolete. ISAM storage engine is no longer supported.",
+ (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"language", 'L',
"Client error messages in given language. May be given as a full path.",
@@ -5469,36 +5459,35 @@
1, 0},
#ifdef HAVE_BERKELEY_DB
{"sync-bdb-logs", OPT_BDB_SYNC,
- "Synchronously flush logs. Enabled by default",
+ "Synchronously flush Berkeley DB logs. Enabled by default",
(gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
#endif /* HAVE_BERKELEY_DB */
{"sync-binlog", OPT_SYNC_BINLOG,
- "Sync the binlog to disk after every #th event. \
-#=0 (the default) does no sync. Syncing slows MySQL down",
- (gptr*) &sync_binlog_period,
- (gptr*) &sync_binlog_period, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1,
- 0},
+ "Synchronously flush binary log to disk after every #th event. "
+ "Use 0 (default) to disable synchronous flushing.",
+ (gptr*) &sync_binlog_period, (gptr*) &sync_binlog_period, 0, GET_ULONG,
+ REQUIRED_ARG, 1, 0, ~0L, 0, 1, 0},
+ {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
+ (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
+ 0, 0, 0, 0},
#ifdef DOES_NOTHING_YET
{"sync-replication", OPT_SYNC_REPLICATION,
- "Enable synchronous replication",
+ "Enable synchronous replication.",
(gptr*) &global_system_variables.sync_replication,
(gptr*) &global_system_variables.sync_replication,
0, GET_ULONG, REQUIRED_ARG, 0, 0, 1, 0, 1, 0},
{"sync-replication-slave-id", OPT_SYNC_REPLICATION_SLAVE_ID,
- "Synchronous replication is wished for this slave",
+ "Synchronous replication is wished for this slave.",
(gptr*) &global_system_variables.sync_replication_slave_id,
(gptr*) &global_system_variables.sync_replication_slave_id,
0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0},
{"sync-replication-timeout", OPT_SYNC_REPLICATION_TIMEOUT,
- "Synchronous replication timeout",
+ "Synchronous replication timeout.",
(gptr*) &global_system_variables.sync_replication_timeout,
(gptr*) &global_system_variables.sync_replication_timeout,
0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0},
#endif
- {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default",
- (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
- 0, 0, 0, 0},
{"table_cache", OPT_TABLE_CACHE,
"The number of open tables for all threads.", (gptr*) &table_cache_size,
(gptr*) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, 64, 1, 512*1024L,
@@ -5962,11 +5951,7 @@
#else
have_innodb=SHOW_OPTION_NO;
#endif
-#ifdef HAVE_ISAM
- have_isam=SHOW_OPTION_YES;
-#else
have_isam=SHOW_OPTION_NO;
-#endif
#ifdef HAVE_EXAMPLE_DB
have_example_db= SHOW_OPTION_YES;
#else
@@ -6375,9 +6360,6 @@
opt_error_log= 0; // Force logs to stdout
break;
case (int) OPT_FLUSH:
-#ifdef HAVE_ISAM
- nisam_flush=1;
-#endif
myisam_flush=1;
flush_time=0; // No auto flush
break;
@@ -6482,14 +6464,6 @@
have_berkeley_db= SHOW_OPTION_YES;
else
have_berkeley_db= SHOW_OPTION_DISABLED;
-#endif
- break;
- case OPT_ISAM:
-#ifdef HAVE_ISAM
- if (opt_isam)
- have_isam= SHOW_OPTION_YES;
- else
- have_isam= SHOW_OPTION_DISABLED;
#endif
break;
case OPT_NDBCLUSTER:
--- 1.149/sql/opt_range.cc Wed Mar 23 19:31:12 2005
+++ 1.150/sql/opt_range.cc Tue Apr 5 13:17:40 2005
@@ -42,7 +42,6 @@
#include "mysql_priv.h"
#include <m_ctype.h>
-#include <nisam.h>
#include "sql_select.h"
#ifndef EXTRA_DEBUG
@@ -51,7 +50,7 @@
#endif
/*
- Convert double value to #rows. Currently this does floor(), and we
+ Convert double value to #rows. Currently this does floor(), and we
might consider using round() instead.
*/
#define double2rows(x) ((ha_rows)(x))
--- 1.230/sql/sql_base.cc Wed Mar 16 15:10:55 2005
+++ 1.231/sql/sql_base.cc Tue Apr 5 13:17:40 2005
@@ -25,7 +25,6 @@
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
-#include <nisam.h>
#ifdef __WIN__
#include <io.h>
#endif
--- 1.227/sql/sql_class.h Sat Mar 19 01:12:22 2005
+++ 1.228/sql/sql_class.h Tue Apr 5 13:17:40 2005
@@ -327,6 +327,7 @@
bool is_active(const char* log_file_name);
int update_log_index(LOG_INFO* linfo, bool need_update_threads);
void rotate_and_purge(uint flags);
+ bool flush_and_sync();
int purge_logs(const char *to_log, bool included,
bool need_mutex, bool need_update_threads,
ulonglong *decrease_log_space);
@@ -1283,18 +1284,18 @@
pthread_mutex_unlock(&LOCK_delete);
}
void close_active_vio();
-#endif
+#endif
void awake(THD::killed_state state_to_set);
/*
For enter_cond() / exit_cond() to work the mutex must be got before
- enter_cond() (in 4.1 an assertion will soon ensure this); this mutex is
- then released by exit_cond(). Use must be:
- lock mutex; enter_cond(); your code; exit_cond().
+ enter_cond(); this mutex is then released by exit_cond().
+ Usage must be: lock mutex; enter_cond(); your code; exit_cond().
*/
inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex,
const char* msg)
{
const char* old_msg = proc_info;
+ safe_mutex_assert_owner(mutex);
mysys_var->current_mutex = mutex;
mysys_var->current_cond = cond;
proc_info = msg;
--- 1.12/include/mysql_embed.h Wed May 19 22:50:08 2004
+++ 1.13/include/mysql_embed.h Tue Apr 5 13:17:39 2005
@@ -24,7 +24,6 @@
#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_OPENSSL
-#undef HAVE_ISAM
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
--- 1.102/sql/set_var.cc Fri Mar 25 19:11:10 2005
+++ 1.103/sql/set_var.cc Tue Apr 5 13:17:40 2005
@@ -954,10 +954,12 @@
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
#ifdef HAVE_REPLICATION
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
+#ifdef DOES_NOTHING_YET
{sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS},
{sys_sync_replication_slave_id.name, (char*)
&sys_sync_replication_slave_id,SHOW_SYS},
{sys_sync_replication_timeout.name, (char*)
&sys_sync_replication_timeout,SHOW_SYS},
#endif
+#endif
{sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS},
#ifdef HAVE_TZNAME
{"system_time_zone", system_time_zone, SHOW_CHAR},
@@ -2495,14 +2497,6 @@
{
pthread_mutex_t *lock_log= mysql_bin_log.get_log_lock();
sync_binlog_period= (ulong) var->save_result.ulonglong_value;
- /*
- Must reset the counter otherwise it may already be beyond the new period
- and so the new period will not be taken into account. Need mutex otherwise
- might be cancelled by a simultanate ++ in MYSQL_LOG::write().
- */
- pthread_mutex_lock(lock_log);
- sync_binlog_counter= 0;
- pthread_mutex_unlock(lock_log);
return 0;
}
#endif /* HAVE_REPLICATION */
@@ -2522,7 +2516,7 @@
bool sys_var_thd_time_zone::check(THD *thd, set_var *var)
{
- char buff[MAX_TIME_ZONE_NAME_LENGTH];
+ char buff[MAX_TIME_ZONE_NAME_LENGTH];
String str(buff, sizeof(buff), &my_charset_latin1);
String *res= var->value->val_str(&str);
--- 1.2/mysys/my_sync.c Tue Jan 11 00:14:39 2005
+++ 1.3/mysys/my_sync.c Tue Apr 5 13:17:39 2005
@@ -27,7 +27,14 @@
my_flags Flags (now only MY_WME is supported)
NOTE
- If file system supports its, only file data is synced, not inode date
+ If file system supports its, only file data is synced, not inode data.
+
+ MY_IGNORE_BADFD is useful when fd is "volatile" - not protected by a
+ mutex. In this case by the time of fsync(), fd may be already closed by
+ another thread, or even reassigned to a different file. With this flag -
+ MY_IGNORE_BADFD - such a situation will not be considered an error.
+ (which is correct behaviour, if we know that the other thread synced the
+ file before closing)
RETURN
0 ok
@@ -55,10 +62,15 @@
if (res)
{
- if (!(my_errno= errno))
- my_errno= -1; /* Unknown error */
- if (my_flags & MY_WME)
+ int er= errno;
+ if (!(my_errno= er))
+ my_errno= -1; /* Unknown error */
+ if (my_flags & MY_IGNORE_BADFD &&
+ (er == EBADF || er == EINVAL || er == EROFS))
+ res= 0;
+ else if (my_flags & MY_WME)
my_error(EE_SYNC, MYF(ME_BELL+ME_WAITTANG), my_filename(fd), my_errno);
}
DBUG_RETURN(res);
-} /* my_read */
+} /* my_sync */
+
--- 1.1/mysql-test/t/xa.test Mon Apr 4 00:49:54 2005
+++ 1.2/mysql-test/t/xa.test Tue Apr 5 13:17:39 2005
@@ -31,6 +31,7 @@
connect (con1,localhost,,,);
connection con1;
+# gtrid [ , bqual [ , formatID ] ]
xa start 0x7465737462, 0x2030405060, 0xb;
insert t1 values (40);
xa end 'testb',' 0@P`',11;
--- 1.8/mysql-test/r/replace.result Wed Dec 10 05:30:23 2003
+++ 1.9/mysql-test/r/replace.result Tue Apr 5 13:17:39 2005
@@ -3,11 +3,9 @@
gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (gesuchnr,benutzer_id)
-) engine=ISAM;
+);
replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-alter table t1 engine=myisam;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 engine=heap;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
--- 1.10/mysql-test/t/replace.test Wed Dec 10 05:30:38 2003
+++ 1.11/mysql-test/t/replace.test Tue Apr 5 13:17:39 2005
@@ -1,7 +1,5 @@
--- source include/have_isam.inc
-
#
-# Test of REPLACE with ISAM and MyISAM and HEAP
+# Test of REPLACE with MyISAM and HEAP
#
--disable_warnings
@@ -12,12 +10,10 @@
gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (gesuchnr,benutzer_id)
-) engine=ISAM;
+);
replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-alter table t1 engine=myisam;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 engine=heap;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
| Thread |
|---|
| • bk commit into 5.0 tree (serg:1.1853) | Sergei Golubchik | 5 Apr |