summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <lars/lthalmann@dl145h.mysql.com>2006-11-07 19:26:31 +0100
committerunknown <lars/lthalmann@dl145h.mysql.com>2006-11-07 19:26:31 +0100
commit3763edd393c7c10b6aa3d91253986ad44492d52f (patch)
treecb0d57b5036a121d4e718097614fdee010c3c24b /sql/handler.cc
parentdd72647032cf157b063fe9a7f02ed2994734b1c0 (diff)
parent4c3283b3b306fc4f9ede3ef3bd8244d45a9b4fac (diff)
downloadmariadb-git-3763edd393c7c10b6aa3d91253986ad44492d52f.tar.gz
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge BitKeeper/etc/collapsed: auto-union include/m_ctype.h: Auto merged mysql-test/r/binlog_row_mix_innodb_myisam.result: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/disabled.def: Auto merged mysql-test/t/view.test: Auto merged sql/Makefile.am: Auto merged sql/field.cc: Auto merged sql/handler.cc: Auto merged sql/log.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_view.cc: Auto merged unittest/mytap/tap.c: Auto merged sql/log_event.cc: manual merge sql/sql_class.cc: manual merge
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc35
1 files changed, 6 insertions, 29 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 13fe1ce6f1d..31d13dd03a3 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3468,38 +3468,15 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
declared static, but it works by putting it into an anonymous
namespace. */
namespace {
- struct st_table_data {
- char const *db;
- char const *name;
- };
-
- static int table_name_compare(void const *a, void const *b)
- {
- st_table_data const *x = (st_table_data const*) a;
- st_table_data const *y = (st_table_data const*) b;
-
- /* Doing lexical compare in order (db,name) */
- int const res= strcmp(x->db, y->db);
- return res != 0 ? res : strcmp(x->name, y->name);
- }
-
bool check_table_binlog_row_based(THD *thd, TABLE *table)
{
- static st_table_data const ignore[] = {
- { "mysql", "event" },
- { "mysql", "general_log" },
- { "mysql", "slow_log" }
- };
-
- my_size_t const ignore_size = sizeof(ignore)/sizeof(*ignore);
- st_table_data const item = { table->s->db.str, table->s->table_name.str };
-
if (table->s->cached_row_logging_check == -1)
- table->s->cached_row_logging_check=
- (table->s->tmp_table == NO_TMP_TABLE) &&
- binlog_filter->db_ok(table->s->db.str) &&
- bsearch(&item, ignore, ignore_size,
- sizeof(st_table_data), table_name_compare) == NULL;
+ {
+ int const check(table->s->tmp_table == NO_TMP_TABLE &&
+ binlog_filter->db_ok(table->s->db.str) &&
+ strcmp("mysql", table->s->db.str) != 0);
+ table->s->cached_row_logging_check= check;
+ }
DBUG_ASSERT(table->s->cached_row_logging_check == 0 ||
table->s->cached_row_logging_check == 1);