summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSven Sandberg <sven@mysql.com>2008-08-04 07:04:47 +0200
committerSven Sandberg <sven@mysql.com>2008-08-04 07:04:47 +0200
commit4cf30d44ef4798aea542a13c799d591ae74f4e0a (patch)
treec4c5392cc5a65fb4236f8e309a373a02b05f0ef3 /sql
parente113042588f0388e94f16be9c946fb3efd7b592d (diff)
parente948f38eae03fb938c43f9ecfafac96aaa7a8077 (diff)
downloadmariadb-git-4cf30d44ef4798aea542a13c799d591ae74f4e0a.tar.gz
merged 5.1 main to 5.1-rpl
manually resolved conflicts: Text conflict in client/mysqltest.c Contents conflict in mysql-test/include/have_bug25714.inc Text conflict in mysql-test/include/have_ndbapi_examples.inc Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/suite/parts/inc/partition_check_drop.inc Text conflict in mysql-test/suite/parts/inc/partition_layout.inc Text conflict in mysql-test/suite/parts/inc/partition_layout_check1.inc Text conflict in mysql-test/suite/parts/inc/partition_layout_check2.inc Text conflict in mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result Text conflict in mysql-test/suite/parts/r/partition_alter1_1_myisam.result Text conflict in mysql-test/suite/parts/r/partition_alter1_2_myisam.result Text conflict in mysql-test/suite/parts/r/partition_alter2_myisam.result Text conflict in mysql-test/suite/parts/r/partition_alter3_innodb.result Text conflict in mysql-test/suite/parts/r/partition_alter3_myisam.result Text conflict in mysql-test/suite/parts/r/partition_basic_innodb.result Text conflict in mysql-test/suite/parts/r/partition_basic_myisam.result Text conflict in mysql-test/suite/parts/r/partition_basic_symlink_myisam.result Text conflict in mysql-test/suite/parts/r/partition_engine_myisam.result Text conflict in mysql-test/suite/parts/r/partition_syntax_myisam.result Text conflict in mysql-test/suite/rpl_ndb/t/disabled.def Text conflict in mysql-test/t/disabled.def
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.cc10
-rw-r--r--sql/ha_ndbcluster_binlog.cc19
-rw-r--r--sql/log_event.cc8
3 files changed, 24 insertions, 13 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 1cfe403407e..c97ed6fada8 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -5209,6 +5209,7 @@ int ha_ndbcluster::create(const char *name,
strcmp(m_tabname, NDB_SCHEMA_TABLE) == 0))
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
single_user_mode = NdbDictionary::Table::SingleUserModeReadWrite;
@@ -6036,6 +6037,7 @@ ha_ndbcluster::delete_table(ha_ndbcluster *h, Ndb *ndb,
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
/* ndb_share reference temporary */
@@ -6217,6 +6219,7 @@ int ha_ndbcluster::delete_table(const char *name)
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
#endif
@@ -6503,8 +6506,11 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(res);
}
#ifdef HAVE_NDB_BINLOG
- if (!ndb_binlog_tables_inited && ndb_binlog_running)
+ if (!ndb_binlog_tables_inited)
+ {
table->db_stat|= HA_READ_ONLY;
+ sql_print_information("table '%s' opened read only", name);
+ }
#endif
DBUG_RETURN(0);
}
@@ -6868,8 +6874,8 @@ static void ndbcluster_drop_database(handlerton *hton, char *path)
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
+ DBUG_ASSERT(ndb_schema_share);
DBUG_VOID_RETURN;
- //DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
#endif
ndbcluster_drop_database_impl(path);
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 4fd5ee1b402..baf86d739eb 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -815,9 +815,10 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd)
" end_pos BIGINT UNSIGNED NOT NULL, "
" PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB CHARACTER SET latin1");
- const int no_print_error[5]= {ER_TABLE_EXISTS_ERROR,
+ const int no_print_error[6]= {ER_TABLE_EXISTS_ERROR,
701,
702,
+ 721, // Table already exist
4009,
0}; // do not print error 701 etc
run_query(thd, buf, end, no_print_error, TRUE);
@@ -876,9 +877,10 @@ static int ndbcluster_create_schema_table(THD *thd)
" type INT UNSIGNED NOT NULL,"
" PRIMARY KEY USING HASH (db,name) ) ENGINE=NDB CHARACTER SET latin1");
- const int no_print_error[5]= {ER_TABLE_EXISTS_ERROR,
+ const int no_print_error[6]= {ER_TABLE_EXISTS_ERROR,
701,
702,
+ 721, // Table already exist
4009,
0}; // do not print error 701 etc
run_query(thd, buf, end, no_print_error, TRUE);
@@ -919,12 +921,9 @@ int ndbcluster_setup_binlog_table_shares(THD *thd)
{
pthread_mutex_lock(&LOCK_open);
ndb_binlog_tables_inited= TRUE;
- if (ndb_binlog_running)
- {
- if (ndb_extra_logging)
- sql_print_information("NDB Binlog: ndb tables writable");
- close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE);
- }
+ if (ndb_extra_logging)
+ sql_print_information("NDB Binlog: ndb tables writable");
+ close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE);
pthread_mutex_unlock(&LOCK_open);
/* Signal injector thread that all is setup */
pthread_cond_signal(&injector_cond);
@@ -2069,6 +2068,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
ndb_schema_share->use_count));
free_share(&ndb_schema_share);
ndb_schema_share= 0;
+ ndb_binlog_tables_inited= 0;
pthread_mutex_unlock(&ndb_schema_share_mutex);
/* end protect ndb_schema_share */
@@ -3269,6 +3269,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
share->key, share->use_count));
free_share(&ndb_apply_status_share);
ndb_apply_status_share= 0;
+ ndb_binlog_tables_inited= 0;
}
DBUG_PRINT("error", ("CLUSTER FAILURE EVENT: "
"%s received share: 0x%lx op: 0x%lx share op: 0x%lx "
@@ -3288,6 +3289,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
share->key, share->use_count));
free_share(&ndb_apply_status_share);
ndb_apply_status_share= 0;
+ ndb_binlog_tables_inited= 0;
}
/* ToDo: remove printout */
if (ndb_extra_logging)
@@ -4311,6 +4313,7 @@ err:
ndb_schema_share->use_count));
free_share(&ndb_schema_share);
ndb_schema_share= 0;
+ ndb_binlog_tables_inited= 0;
pthread_mutex_unlock(&ndb_schema_share_mutex);
/* end protect ndb_schema_share */
}
diff --git a/sql/log_event.cc b/sql/log_event.cc
index ff6afd013c5..9a1342e4a13 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2143,11 +2143,13 @@ void Query_log_event::print_query_header(IO_CACHE* file,
bool need_comma= 0;
my_b_printf(file, "SET ");
print_set_option(file, tmp, OPTION_NO_FOREIGN_KEY_CHECKS, ~flags2,
- "@@session.foreign_key_checks", &need_comma);
+ "@@session.foreign_key_checks", &need_comma);
print_set_option(file, tmp, OPTION_AUTO_IS_NULL, flags2,
- "@@session.sql_auto_is_null", &need_comma);
+ "@@session.sql_auto_is_null", &need_comma);
print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2,
- "@@session.unique_checks", &need_comma);
+ "@@session.unique_checks", &need_comma);
+ print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2,
+ "@@session.autocommit", &need_comma);
my_b_printf(file,"%s\n", print_event_info->delimiter);
print_event_info->flags2= flags2;
}