Below is the list of changes that have just been committed into a local
5.1 repository of tomash. When tomash 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@stripped, 2006-08-09 16:42:21+04:00, kroki@stripped +4 -0
Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-merge
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-rt-merge
MERGE: 1.2243.1.4
sql/handler.cc@stripped, 2006-08-09 16:42:15+04:00, kroki@stripped +0 -0
Auto merged
MERGE: 1.250.1.1
sql/mysqld.cc@stripped, 2006-08-09 16:42:15+04:00, kroki@stripped +0 -0
Auto merged
MERGE: 1.570.1.4
sql/share/errmsg.txt@stripped, 2006-08-09 16:42:16+04:00, kroki@stripped +0 -0
Auto merged
MERGE: 1.113.1.1
sql/sql_base.cc@stripped, 2006-08-09 16:42:15+04:00, kroki@stripped +0 -0
Auto merged
MERGE: 1.336.1.1
# 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: kroki
# Host: moonlight.intranet
# Root: /home/tomash/src/mysql_ab/mysql-5.1-rt-merge/RESYNC
--- 1.253/sql/handler.cc 2006-08-09 16:42:29 +04:00
+++ 1.254/sql/handler.cc 2006-08-09 16:42:29 +04:00
@@ -1423,6 +1423,34 @@ void handler::ha_statistic_increment(ulo
statistic_increment(table->in_use->status_var.*offset, &LOCK_status);
}
+
+bool handler::check_if_log_table_locking_is_allowed(uint sql_command,
+ ulong type, TABLE *table)
+{
+ /*
+ Deny locking of the log tables, which is incompatible with
+ concurrent insert. Unless called from a logger THD:
+ general_log_thd or slow_log_thd.
+ */
+ if (table->s->log_table &&
+ sql_command != SQLCOM_TRUNCATE &&
+ sql_command != SQLCOM_ALTER_TABLE &&
+ !(sql_command == SQLCOM_FLUSH &&
+ type & REFRESH_LOG) &&
+ (table->reginfo.lock_type >= TL_READ_NO_INSERT))
+ {
+ /*
+ The check >= TL_READ_NO_INSERT denies all write locks
+ plus the only read lock (TL_READ_NO_INSERT itself)
+ */
+ table->reginfo.lock_type == TL_READ_NO_INSERT ?
+ my_error(ER_CANT_READ_LOCK_LOG_TABLE, MYF(0)) :
+ my_error(ER_CANT_WRITE_LOCK_LOG_TABLE, MYF(0));
+ return FALSE;
+ }
+ return TRUE;
+}
+
/*
Open database-handler.
--- 1.572/sql/mysqld.cc 2006-08-09 16:42:29 +04:00
+++ 1.573/sql/mysqld.cc 2006-08-09 16:42:29 +04:00
@@ -310,7 +310,7 @@ static bool lower_case_table_names_used=
static bool volatile select_thread_in_use, signal_thread_in_use;
static bool volatile ready_to_exit;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
-static my_bool opt_bdb, opt_isam, opt_ndbcluster;
+static my_bool opt_bdb, opt_isam, opt_ndbcluster, opt_merge;
static my_bool opt_short_log_format= 0;
static uint kill_cached_threads, wake_thread;
static ulong killed_threads, thread_created;
@@ -402,6 +402,7 @@ extern ulong srv_n_free_tickets_to_enter
extern ulong srv_thread_sleep_delay;
extern ulong srv_thread_concurrency;
extern ulong srv_commit_concurrency;
+extern ulong srv_flush_log_at_trx_commit;
}
#endif
#ifdef WITH_BERKELEY_STORAGE_ENGINE
@@ -4850,7 +4851,8 @@ enum options_mysqld
OPT_LOG_OUTPUT,
OPT_PORT_OPEN_TIMEOUT,
OPT_GENERAL_LOG,
- OPT_SLOW_LOG
+ OPT_SLOW_LOG,
+ OPT_MERGE
};
@@ -5140,8 +5142,8 @@ Disable with --skip-innodb-doublewrite."
(gptr*) &innobase_file_per_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"innodb_flush_log_at_trx_commit", OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
"Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second).",
- (gptr*) &innobase_flush_log_at_trx_commit,
- (gptr*) &innobase_flush_log_at_trx_commit,
+ (gptr*) &srv_flush_log_at_trx_commit,
+ (gptr*) &srv_flush_log_at_trx_commit,
0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
{"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
"With which method to flush data.", (gptr*) &innobase_unix_file_flush_method,
@@ -5358,6 +5360,9 @@ master-ssl",
#endif /* HAVE_REPLICATION */
{"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (gptr*) &locked_in_memory,
(gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \
+--skip-merge.",
+ (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0},
{"myisam-recover", OPT_MYISAM_RECOVER,
"Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
(gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,
@@ -5912,9 +5917,11 @@ log and this option does nothing anymore
(gptr*) &srv_n_spin_wait_rounds,
0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0},
{"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY,
- "Helps in performance tuning in heavily concurrent environments.",
+ "Helps in performance tuning in heavily concurrent environments. "
+ "Sets the maximum number of threads allowed inside InnoDB. Value 0"
+ " will disable the thread throttling.",
(gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency,
- 0, GET_LONG, REQUIRED_ARG, 8, 1, 1000, 0, 1, 0},
+ 0, GET_LONG, REQUIRED_ARG, 8, 0, 1000, 0, 1, 0},
{"innodb_thread_sleep_delay", OPT_INNODB_THREAD_SLEEP_DELAY,
"Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0"
" disable a sleep",
@@ -7566,6 +7573,11 @@ get_one_option(int optid, const struct m
global_system_variables.tx_isolation= (type-1);
break;
}
+ case OPT_MERGE:
+ if (opt_merge)
+ have_merge_db= SHOW_OPTION_YES;
+ else
+ have_merge_db= SHOW_OPTION_DISABLED;
#ifdef WITH_BERKELEY_STORAGE_ENGINE
case OPT_BDB_NOSYNC:
/* Deprecated option */
--- 1.337/sql/sql_base.cc 2006-08-09 16:42:29 +04:00
+++ 1.338/sql/sql_base.cc 2006-08-09 16:42:29 +04:00
@@ -1997,17 +1997,17 @@ TABLE *open_table(THD *thd, TABLE_LIST *
table= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
&state))
{
- if (table->s->version != refresh_version)
+ /*
+ Here we flush tables marked for flush. However we never flush log
+ tables here. They are flushed only on FLUSH LOGS.
+ */
+ if (table->s->version != refresh_version && !table->s->log_table)
{
DBUG_PRINT("note",
("Found table '%s.%s' with different refresh version",
table_list->db, table_list->table_name));
- /*
- Don't close tables if we are working with a log table or were
- asked not to close the table explicitly
- */
- if (flags & MYSQL_LOCK_IGNORE_FLUSH || table->s->log_table)
+ if (flags & MYSQL_LOCK_IGNORE_FLUSH)
{
/* Force close at once after usage */
thd->version= table->s->version;
@@ -2346,7 +2346,11 @@ void close_old_data_files(THD *thd, TABL
for (; table ; table=table->next)
{
- if (table->s->version != refresh_version)
+ /*
+ Reopen marked for flush. But close log tables. They are flushed only
+ explicitly on FLUSH LOGS
+ */
+ if (table->s->version != refresh_version && !table->s->log_table)
{
found=1;
if (table->db_stat)
--- 1.114/sql/share/errmsg.txt 2006-08-09 16:42:29 +04:00
+++ 1.115/sql/share/errmsg.txt 2006-08-09 16:42:30 +04:00
@@ -5843,3 +5843,9 @@ ER_RBR_NOT_AVAILABLE
eng "The server was not built with row-based replication"
ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
eng "Triggers can not be created on system tables"
+ER_CANT_ALTER_LOG_TABLE
+ eng "You can't alter a log table if logging is enabled"
+ER_BAD_LOG_ENGINE
+ eng "One can use only CSV and MyISAM engines for the log tables"
+ER_CANT_DROP_LOG_TABLE
+ eng "Cannot drop log table if log is enabled"
| Thread |
|---|
| • bk commit into 5.1 tree (kroki:1.2269) | kroki | 9 Aug |