diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-09-20 17:17:32 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-09-20 17:17:32 +0300 |
commit | 353739fdef95fb1765dbbadf14ce1a9849a36137 (patch) | |
tree | 4b2b7364d1e622b3b02db3fb9d0c898fb9293a87 /sql/ha_ndbcluster.cc | |
parent | 9fee5866beed47b55c5196acfa1a03503a13a2d7 (diff) | |
parent | f4444c0016c68feb3f300c4b30b886cd407f5824 (diff) | |
download | mariadb-git-353739fdef95fb1765dbbadf14ce1a9849a36137.tar.gz |
merge of mysql-5.5 into mysql-5.5-wl1054
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9d394d740a8..bc0f2258a0a 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -680,7 +680,7 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans) bzero((char*) &table_list,sizeof(table_list)); table_list.db= m_dbname; table_list.alias= table_list.table_name= m_tabname; - close_cached_tables(thd, &table_list, FALSE, FALSE); + close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT); break; } default: @@ -5702,7 +5702,7 @@ int ha_ndbcluster::create(const char *name, m_table->getObjectVersion(), (is_truncate) ? SOT_TRUNCATE_TABLE : SOT_CREATE_TABLE, - 0, 0, 1); + 0, 0); break; } } @@ -6143,7 +6143,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) old_dbname, m_tabname, ndb_table_id, ndb_table_version, SOT_RENAME_TABLE, - m_dbname, new_tabname, 1); + m_dbname, new_tabname); } // If we are moving tables between databases, we need to recreate @@ -6337,7 +6337,7 @@ retry_temporary_error1: thd->query(), thd->query_length(), share->db, share->table_name, ndb_table_id, ndb_table_version, - SOT_DROP_TABLE, 0, 0, 1); + SOT_DROP_TABLE, 0, 0); } else if (table_dropped && share && share->op) /* ndbcluster_log_schema_op will do a force GCP */ @@ -7019,7 +7019,6 @@ int ndbcluster_drop_database_impl(const char *path) while ((tabname=it++)) { tablename_to_filename(tabname, tmp, FN_REFLEN - (tmp - full_path)-1); - mysql_mutex_lock(&LOCK_open); if (ha_ndbcluster::delete_table(0, ndb, full_path, dbname, tabname)) { const NdbError err= dict->getNdbError(); @@ -7029,7 +7028,6 @@ int ndbcluster_drop_database_impl(const char *path) ret= ndb_to_mysql_error(&err); } } - mysql_mutex_unlock(&LOCK_open); } DBUG_RETURN(ret); } @@ -7056,7 +7054,7 @@ static void ndbcluster_drop_database(handlerton *hton, char *path) ha_ndbcluster::set_dbname(path, db); ndbcluster_log_schema_op(thd, 0, thd->query(), thd->query_length(), - db, "", 0, 0, SOT_DROP_DB, 0, 0, 0); + db, "", 0, 0, SOT_DROP_DB, 0, 0); #endif DBUG_VOID_RETURN; } @@ -7181,7 +7179,6 @@ int ndbcluster_find_all_files(THD *thd) my_free(data); my_free(pack_data); - mysql_mutex_lock(&LOCK_open); if (discover) { /* ToDo 4.1 database needs to be created if missing */ @@ -7199,7 +7196,6 @@ int ndbcluster_find_all_files(THD *thd) TRUE); } #endif - mysql_mutex_unlock(&LOCK_open); } } while (unhandled && retries); @@ -7292,19 +7288,16 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, file_name->str, reg_ext, 0); if (my_access(name, F_OK)) { - mysql_mutex_lock(&LOCK_open); DBUG_PRINT("info", ("Table %s listed and need discovery", file_name->str)); if (ndb_create_table_from_engine(thd, db, file_name->str)) { - mysql_mutex_unlock(&LOCK_open); push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TABLE_EXISTS_ERROR, "Discover of table %s.%s failed", db, file_name->str); continue; } - mysql_mutex_unlock(&LOCK_open); } DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name->str)); file_on_disk= TRUE; @@ -7361,10 +7354,8 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, file_name_str= (char*)my_hash_element(&ok_tables, i); end= end1 + tablename_to_filename(file_name_str, end1, sizeof(name) - (end1 - name)); - mysql_mutex_lock(&LOCK_open); ndbcluster_create_binlog_setup(ndb, name, end-name, db, file_name_str, TRUE); - mysql_mutex_unlock(&LOCK_open); } } #endif @@ -7426,7 +7417,6 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, } /* Lock mutex before creating .FRM files. */ - mysql_mutex_lock(&LOCK_open); /* Create new files. */ List_iterator_fast<char> it2(create_list); while ((file_name_str=it2++)) @@ -7441,8 +7431,6 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, } } - mysql_mutex_unlock(&LOCK_open); - my_hash_free(&ok_tables); my_hash_free(&ndb_tables); @@ -8452,8 +8440,7 @@ int handle_trailing_share(NDB_SHARE *share) bzero((char*) &table_list,sizeof(table_list)); table_list.db= share->db; table_list.alias= table_list.table_name= share->table_name; - mysql_mutex_assert_owner(&LOCK_open); - close_cached_tables(thd, &table_list, TRUE, FALSE); + close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT); mysql_mutex_lock(&ndbcluster_mutex); /* ndb_share reference temporary free */ @@ -10612,13 +10599,13 @@ int ndbcluster_alter_tablespace(handlerton *hton, thd->query(), thd->query_length(), "", alter_info->tablespace_name, 0, 0, - SOT_TABLESPACE, 0, 0, 0); + SOT_TABLESPACE, 0, 0); else ndbcluster_log_schema_op(thd, 0, thd->query(), thd->query_length(), "", alter_info->logfile_group_name, 0, 0, - SOT_LOGFILE_GROUP, 0, 0, 0); + SOT_LOGFILE_GROUP, 0, 0); #endif DBUG_RETURN(FALSE); |