3249 Magnus Blåudd 2011-03-24 [merge]
Merge
added:
mysql-test/suite/ndb/r/ndb_global_schema_lock_error.result
mysql-test/suite/ndb/t/ndb_global_schema_lock_error.test
mysql-test/suite/ndb/t/ndb_mgm.inc
mysql-test/suite/ndb/t/ndb_restart_nostart.inc
mysql-test/suite/ndb/t/ndb_restart_start.inc
mysql-test/suite/ndb/t/ndb_wait_nostart.inc
mysql-test/suite/ndb/t/ndb_wait_started.inc
mysql-test/suite/ndb/t/ndb_waiter.inc
modified:
sql/ndb_global_schema_lock.cc
sql/ndb_global_schema_lock_guard.h
sql/sql_db.cc
3248 Magnus Blåudd 2011-03-15 [merge]
Merge 7.0 -> 5.5-cluster
removed:
storage/ndb/test/sql/
storage/ndb/test/sql/BANK.sql
storage/ndb/test/sql/T1.sql
storage/ndb/test/sql/test_create_drop.pl
storage/ndb/test/sql/test_range_bounds.pl
storage/ndb/tools/clean-links.sh
storage/ndb/tools/make-errors.pl
storage/ndb/tools/make-links.sh
added:
mysql-test/include/check_qep.inc
mysql-test/include/execute_with_statistics.inc
mysql-test/include/expect_qep.inc
mysql-test/suite/binlog/r/binlog_incident_ignore.result
mysql-test/suite/binlog/t/binlog_incident_ignore-master.opt
mysql-test/suite/binlog/t/binlog_incident_ignore.test
mysql-test/suite/ndb/r/ndb_restore_schema_tolerance.result
mysql-test/suite/ndb/t/ndb_restore_schema_tolerance.test
mysql-test/suite/rpl/r/rpl_skip_incident.result
mysql-test/suite/rpl/t/rpl_skip_incident-master.opt
mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
mysql-test/suite/rpl/t/rpl_skip_incident.test
mysql-test/suite/rpl_ndb/r/rpl_ndb_ignore_db.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_skip_gap_event.result
mysql-test/suite/rpl_ndb/t/rpl_ndb_ignore_db-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_ignore_db.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_skip_gap_event-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_skip_gap_event.test
storage/ndb/include/kernel/signaldata/DbspjErr.hpp
storage/ndb/include/kernel/signaldata/QueryTree.hpp
storage/ndb/src/kernel/blocks/dbspj/
storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp
storage/ndb/src/kernel/blocks/dbspj/DbspjInit.cpp
storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
storage/ndb/src/kernel/blocks/dbspj/DbspjProxy.cpp
storage/ndb/src/kernel/blocks/dbspj/DbspjProxy.hpp
renamed:
mysql-test/suite/ndb/r/ndb_blob_restore.result => mysql-test/suite/ndb/r/ndb_restore_schema_blobs.result
mysql-test/suite/ndb/r/ndb_restore.result => mysql-test/suite/ndb/r/ndb_restore_misc.result
mysql-test/suite/ndb/r/ndb_restore_compat.result => mysql-test/suite/ndb/r/ndb_restore_compat_downward.result
mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result => mysql-test/suite/ndb/r/ndb_restore_compat_endianness.result
mysql-test/suite/ndb/r/ndb_restore_lossy_charbinary_conv.result => mysql-test/suite/ndb/r/ndb_restore_conv_lossy_charbinary.result
mysql-test/suite/ndb/r/ndb_restore_lossy_integral_conv.result => mysql-test/suite/ndb/r/ndb_restore_conv_lossy_integral.result
mysql-test/suite/ndb/r/ndb_restore_options.result => mysql-test/suite/ndb/r/ndb_restore_schema_subsets.result
mysql-test/suite/ndb/r/ndb_restore_padding_preservation.result => mysql-test/suite/ndb/r/ndb_restore_conv_padding.result
mysql-test/suite/ndb/r/ndb_restore_partition.result => mysql-test/suite/ndb/r/ndb_restore_schema_partitions.result
mysql-test/suite/ndb/r/ndb_restore_promotion.result => mysql-test/suite/ndb/r/ndb_restore_conv_promotion.result
mysql-test/suite/ndb/r/ndb_restore_rewrite_db.result => mysql-test/suite/ndb/r/ndb_restore_schema_rewrites.result
mysql-test/suite/ndb/t/ndb_blob_restore.test => mysql-test/suite/ndb/t/ndb_restore_schema_blobs.test
mysql-test/suite/ndb/t/ndb_restore.test => mysql-test/suite/ndb/t/ndb_restore_misc.test
mysql-test/suite/ndb/t/ndb_restore_compat.test => mysql-test/suite/ndb/t/ndb_restore_compat_downward.test
mysql-test/suite/ndb/t/ndb_restore_compressed-master.opt => mysql-test/suite/ndb/t/ndb_restore_compat_compression-master.opt
mysql-test/suite/ndb/t/ndb_restore_compressed.test => mysql-test/suite/ndb/t/ndb_restore_compat_compression.test
mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test => mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test
mysql-test/suite/ndb/t/ndb_restore_lossy_charbinary_conv.test => mysql-test/suite/ndb/t/ndb_restore_conv_lossy_charbinary.test
mysql-test/suite/ndb/t/ndb_restore_lossy_integral_conv.test => mysql-test/suite/ndb/t/ndb_restore_conv_lossy_integral.test
mysql-test/suite/ndb/t/ndb_restore_options.test => mysql-test/suite/ndb/t/ndb_restore_schema_subsets.test
mysql-test/suite/ndb/t/ndb_restore_padding_preservation.test => mysql-test/suite/ndb/t/ndb_restore_conv_padding.test
mysql-test/suite/ndb/t/ndb_restore_partition.test => mysql-test/suite/ndb/t/ndb_restore_schema_partitions.test
mysql-test/suite/ndb/t/ndb_restore_promotion.test => mysql-test/suite/ndb/t/ndb_restore_conv_promotion.test
mysql-test/suite/ndb/t/ndb_restore_rewrite_db.test => mysql-test/suite/ndb/t/ndb_restore_schema_rewrites.test
modified:
VERSION
mysql-test/r/greedy_optimizer.result
mysql-test/r/join.result
mysql-test/r/status.result
mysql-test/r/subselect.result
mysql-test/suite/ndb/r/ndb_basic.result
mysql-test/suite/ndb/r/ndb_condition_pushdown.result
mysql-test/suite/ndb/r/ndb_index.result
mysql-test/suite/ndb/r/ndb_index_unique.result
mysql-test/suite/ndb/r/ndb_read_multi_range.result
mysql-test/suite/ndb/r/ndb_statistics.result
mysql-test/suite/ndb/r/ndbinfo_dump.result
mysql-test/suite/ndb/t/ndb_restore_print.test
mysql-test/suite/ndb/t/ndb_statistics.test
mysql-test/suite/ndb_binlog/r/ndb_binlog_ignore_db.result
mysql-test/suite/ndb_binlog/t/ndb_binlog_ignore_db-master.opt
mysql-test/suite/ndb_binlog/t/ndb_binlog_ignore_db.test
mysql-test/suite/rpl_ndb/r/rpl_ndb_gap_event.result
mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test
mysql-test/t/greedy_optimizer.test
sql/ha_ndbcluster.cc
sql/log.cc
sql/log_event.cc
sql/log_event.h
sql/rpl_injector.h
sql/sql_select.cc
storage/ndb/docs/doxygen/Doxyfile.mgmapi
storage/ndb/docs/doxygen/Doxyfile.ndbapi
storage/ndb/include/kernel/signaldata/ScanFrag.hpp
storage/ndb/include/kernel/signaldata/SignalData.hpp
storage/ndb/include/kernel/signaldata/TcIndx.hpp
storage/ndb/include/ndbapi/NdbTransaction.hpp
storage/ndb/include/util/NdbTypesUtil.hpp
storage/ndb/ndb_configure.m4
storage/ndb/src/common/debugger/BlockNames.cpp
storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
storage/ndb/src/common/debugger/signaldata/TcIndx.cpp
storage/ndb/src/kernel/CMakeLists.txt
storage/ndb/src/kernel/Makefile.am
storage/ndb/src/kernel/SimBlockList.cpp
storage/ndb/src/kernel/blocks/CMakeLists.txt
storage/ndb/src/kernel/blocks/Makefile.am
storage/ndb/src/kernel/blocks/backup/Backup.cpp
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dbinfo/Dbinfo.cpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/src/kernel/blocks/lgman.cpp
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
storage/ndb/src/kernel/vm/LongSignal.cpp
storage/ndb/src/kernel/vm/TransporterCallback.cpp
storage/ndb/src/kernel/vm/mt.cpp
storage/ndb/src/mgmsrv/ConfigManager.cpp
storage/ndb/src/mgmsrv/ConfigManager.hpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
storage/ndb/src/ndbapi/NdbTransaction.cpp
storage/ndb/src/ndbapi/Ndbif.cpp
storage/ndb/src/ndbapi/TransporterFacade.cpp
storage/ndb/src/ndbapi/TransporterFacade.hpp
storage/ndb/src/ndbapi/trp_client.cpp
storage/ndb/src/ndbapi/trp_client.hpp
storage/ndb/test/ndbapi/testDict.cpp
storage/ndb/test/ndbapi/testMgm.cpp
storage/ndb/test/ndbapi/testNdbApi.cpp
storage/ndb/test/ndbapi/testNodeRestart.cpp
storage/ndb/test/ndbapi/test_event.cpp
storage/ndb/tools/ndbinfo_sql.cpp
mysql-test/suite/ndb/r/ndb_restore_schema_subsets.result
mysql-test/suite/ndb/t/ndb_restore_schema_blobs.test
mysql-test/suite/ndb/t/ndb_restore_misc.test
mysql-test/suite/ndb/t/ndb_restore_compat_downward.test
mysql-test/suite/ndb/t/ndb_restore_compat_compression-master.opt
mysql-test/suite/ndb/t/ndb_restore_compat_compression.test
mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test
mysql-test/suite/ndb/t/ndb_restore_conv_lossy_charbinary.test
mysql-test/suite/ndb/t/ndb_restore_conv_lossy_integral.test
mysql-test/suite/ndb/t/ndb_restore_schema_subsets.test
mysql-test/suite/ndb/t/ndb_restore_conv_padding.test
mysql-test/suite/ndb/t/ndb_restore_schema_partitions.test
mysql-test/suite/ndb/t/ndb_restore_conv_promotion.test
mysql-test/suite/ndb/t/ndb_restore_schema_rewrites.test
=== added file 'mysql-test/suite/ndb/r/ndb_global_schema_lock_error.result'
--- a/mysql-test/suite/ndb/r/ndb_global_schema_lock_error.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_global_schema_lock_error.result 2011-03-24 09:06:36 +0000
@@ -0,0 +1,11 @@
+call mtr.add_suppression("Could not acquire global schema lock");
+Restarting all nodes "no start"
+Waiting for not started
+CREATE DATABASE test2;
+ERROR HY000: Got error 4009 'Failed to acquire global schema lock' from ndbcluster
+ALTER DATABASE test2 CHARACTER SET latin2;
+ERROR HY000: Got error 4009 'Failed to acquire global schema lock' from ndbcluster
+DROP DATABASE test2;
+ERROR HY000: Got error 4009 'Failed to acquire global schema lock' from ndbcluster
+Starting all nodes
+Waiting for started
=== added file 'mysql-test/suite/ndb/t/ndb_global_schema_lock_error.test'
--- a/mysql-test/suite/ndb/t/ndb_global_schema_lock_error.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_global_schema_lock_error.test 2011-03-24 09:06:36 +0000
@@ -0,0 +1,35 @@
+-- source include/have_ndb.inc
+
+# Test will produce this error in server log file -> ignore
+call mtr.add_suppression("Could not acquire global schema lock");
+
+#
+# Run all the commands which should take the global schema lock
+# against a mysqld "connected" to stopped NDB nodes
+#
+
+# Restart NDB nodes into "no start"
+--source ndb_restart_nostart.inc
+
+--error ER_GET_ERRMSG
+CREATE DATABASE test2;
+--error ER_GET_ERRMSG
+ALTER DATABASE test2 CHARACTER SET latin2;
+--error ER_GET_ERRMSG
+DROP DATABASE test2;
+
+# Start NDB nodes back up again
+--source ndb_restart_start.inc
+
+
+
+# NOTE! this is a workaround so that check-testcase after test
+# see the mysql.ndb_schema table(if not connected, 'find_files'
+# will hide the table)
+#
+# Wait until mysqld has connected properly to cluster
+--disable_result_log
+--disable_query_log
+source include/ndb_not_readonly.inc;
+--enable_query_log
+--enable_result_log
=== added file 'mysql-test/suite/ndb/t/ndb_mgm.inc'
--- a/mysql-test/suite/ndb/t/ndb_mgm.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_mgm.inc 2011-03-24 09:06:36 +0000
@@ -0,0 +1,3 @@
+let $_mgm_cmd=$NDB_MGM --no-defaults;
+let $_mgm_cmd=$_mgm_cmd --ndb-connectstring="$NDB_CONNECTSTRING";
+#echo mgm_cmd: $_mgm_cmd;
=== added file 'mysql-test/suite/ndb/t/ndb_restart_nostart.inc'
--- a/mysql-test/suite/ndb/t/ndb_restart_nostart.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restart_nostart.inc 2011-03-24 09:06:36 +0000
@@ -0,0 +1,6 @@
+--source ndb_mgm.inc
+
+--echo Restarting all nodes "no start"
+--exec $_mgm_cmd -e "ALL RESTART -n" > /dev/null
+
+--source ndb_wait_nostart.inc
=== added file 'mysql-test/suite/ndb/t/ndb_restart_start.inc'
--- a/mysql-test/suite/ndb/t/ndb_restart_start.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restart_start.inc 2011-03-24 09:06:36 +0000
@@ -0,0 +1,6 @@
+--source ndb_mgm.inc
+
+--echo Starting all nodes
+--exec $_mgm_cmd -e "ALL START" > /dev/null
+
+--source ndb_wait_started.inc
=== added file 'mysql-test/suite/ndb/t/ndb_wait_nostart.inc'
--- a/mysql-test/suite/ndb/t/ndb_wait_nostart.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_wait_nostart.inc 2011-03-24 09:06:36 +0000
@@ -0,0 +1,4 @@
+--source ndb_waiter.inc
+
+--echo Waiting for not started
+--exec $_waiter_cmd --not-started > /dev/null
=== added file 'mysql-test/suite/ndb/t/ndb_wait_started.inc'
--- a/mysql-test/suite/ndb/t/ndb_wait_started.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_wait_started.inc 2011-03-24 09:06:36 +0000
@@ -0,0 +1,4 @@
+--source ndb_waiter.inc
+
+--echo Waiting for started
+--exec $_waiter_cmd > /dev/null
=== added file 'mysql-test/suite/ndb/t/ndb_waiter.inc'
--- a/mysql-test/suite/ndb/t/ndb_waiter.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_waiter.inc 2011-03-24 09:06:36 +0000
@@ -0,0 +1,3 @@
+let $_waiter_cmd=$NDB_WAITER --no-defaults;
+let $_waiter_cmd=$_waiter_cmd --ndb-connectstring="$NDB_CONNECTSTRING";
+#echo waiter_cmd: $_waiter_cmd;
=== modified file 'sql/ndb_global_schema_lock.cc'
--- a/sql/ndb_global_schema_lock.cc 2011-03-09 13:09:55 +0000
+++ b/sql/ndb_global_schema_lock.cc 2011-03-24 09:06:36 +0000
@@ -433,3 +433,21 @@ int Ndb_global_schema_lock_guard::lock(b
return ndbcluster_global_schema_lock(m_thd, no_lock_queue,
report_cluster_disconnected);
}
+
+
+bool
+Ndb_global_schema_lock_guard::lock_raise_error(void)
+{
+ if (lock() != 0)
+ {
+ Thd_ndb *thd_ndb= thd_get_thd_ndb(m_thd);
+
+ my_error(ER_GET_ERRMSG, MYF(0),
+ thd_ndb->global_schema_lock_error,
+ "Failed to acquire global schema lock",
+ "ndbcluster");
+
+ return false; // Failed
+ }
+ return true; // OK
+}
=== modified file 'sql/ndb_global_schema_lock_guard.h'
--- a/sql/ndb_global_schema_lock_guard.h 2011-03-09 13:09:55 +0000
+++ b/sql/ndb_global_schema_lock_guard.h 2011-03-24 09:06:36 +0000
@@ -27,8 +27,12 @@ public:
~Ndb_global_schema_lock_guard();
int lock(bool no_lock_queue=false,
bool report_cluster_disconnected=true);
+
+ // Lock GSL, raise error in THD if failure occurs
+ bool lock_raise_error(void);
+
private:
- THD *m_thd;
+ THD* m_thd;
bool m_locked;
};
=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc 2011-03-14 15:13:48 +0000
+++ b/sql/sql_db.cc 2011-03-24 09:13:47 +0000
@@ -554,15 +554,16 @@ int mysql_create_db(THD *thd, char *db,
my_error(ER_DB_CREATE_EXISTS, MYF(0), db);
DBUG_RETURN(-1);
}
+
+#ifndef MCP_GLOBAL_SCHEMA_LOCK
+ Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
+ if (!global_schema_lock_guard.lock_raise_error())
+ DBUG_RETURN(-1); // Same as failed lock_schema_name, see below
+ #endif
if (lock_schema_name(thd, db))
DBUG_RETURN(-1);
-#ifndef MCP_GLOBAL_SCHEMA_LOCK
- Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
- global_schema_lock_guard.lock();
-#endif
-
/* Check directory */
path_len= build_table_filename(path, sizeof(path) - 1, db, "", "", 0);
path[path_len-1]= 0; // Remove last '/' from path
@@ -692,14 +693,15 @@ bool mysql_alter_db(THD *thd, const char
int error= 0;
DBUG_ENTER("mysql_alter_db");
- if (lock_schema_name(thd, db))
- DBUG_RETURN(TRUE);
-
#ifndef MCP_GLOBAL_SCHEMA_LOCK
Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
- global_schema_lock_guard.lock();
+ if (!global_schema_lock_guard.lock_raise_error())
+ DBUG_RETURN(TRUE); // Same as failed lock_schema_name, se below
#endif
+ if (lock_schema_name(thd, db))
+ DBUG_RETURN(TRUE);
+
/*
Recreate db options file: /dbpath/.db.opt
We pass MY_DB_OPT_FILE as "extension" to avoid
@@ -778,15 +780,15 @@ bool mysql_rm_db(THD *thd,char *db,bool
Drop_table_error_handler err_handler;
DBUG_ENTER("mysql_rm_db");
+#ifndef MCP_GLOBAL_SCHEMA_LOCK
+ Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
+ if (!global_schema_lock_guard.lock_raise_error())
+ DBUG_RETURN(true); // Same as failed lock_schema_name, see below
+ #endif
if (lock_schema_name(thd, db))
DBUG_RETURN(true);
-#ifndef MCP_GLOBAL_SCHEMA_LOCK
- Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
- global_schema_lock_guard.lock();
-#endif
-
length= build_table_filename(path, sizeof(path) - 1, db, "", "", 0);
strmov(path+length, MY_DB_OPT_FILE); // Append db option file name
del_dbopt(path); // Remove dboption hash entry
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.5-cluster branch (magnus.blaudd:3248 to 3249) | Magnus Blåudd | 24 Mar |