Merge dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/mysql-5.1-new-ndb

into  dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/mysql-5.1-new-ndb-bj.merge
parents 3d166e45 d7d0d68b
...@@ -141,6 +141,11 @@ DROP TABLE test.backup_info; ...@@ -141,6 +141,11 @@ DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
ForceVarPart: 0 ForceVarPart: 0
ForceVarPart: 1 ForceVarPart: 1
select * from information_schema.columns where table_name = "t1_c";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1_c capgoaledatta 1 NULL NO mediumint NULL NULL 7 0 NULL NULL mediumint(5) unsigned PRI auto_increment select,insert,update,references
NULL test t1_c goaledatta 2 NO char 2 2 NULL NULL latin1 latin1_swedish_ci char(2) PRI select,insert,update,references
NULL test t1_c maturegarbagefa 3 NO varchar 32 32 NULL NULL latin1 latin1_swedish_ci varchar(32) PRI select,insert,update,references
select count(*) from t1; select count(*) from t1;
count(*) count(*)
5 5
......
...@@ -180,6 +180,11 @@ drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c; ...@@ -180,6 +180,11 @@ drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
# Bug #30667
# ndb table discovery does not work correcly with information schema
# - prior to bug fix this would yeild no output and a warning
select * from information_schema.columns where table_name = "t1_c";
# random output order?? # random output order??
#show tables; #show tables;
......
...@@ -6953,9 +6953,26 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, ...@@ -6953,9 +6953,26 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
while ((file_name=it++)) while ((file_name=it++))
{ {
bool file_on_disk= FALSE; bool file_on_disk= FALSE;
DBUG_PRINT("info", ("%s", file_name)); DBUG_PRINT("info", ("%s", file_name));
if (hash_search(&ndb_tables, file_name, strlen(file_name))) if (hash_search(&ndb_tables, file_name, strlen(file_name)))
{ {
build_table_filename(name, sizeof(name), db, file_name, reg_ext, 0);
if (my_access(name, F_OK))
{
pthread_mutex_lock(&LOCK_open);
DBUG_PRINT("info", ("Table %s listed and need discovery",
file_name));
if (ndb_create_table_from_engine(thd, db, file_name))
{
pthread_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);
continue;
}
pthread_mutex_unlock(&LOCK_open);
}
DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name)); DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
file_on_disk= TRUE; file_on_disk= TRUE;
} }
......
...@@ -99,6 +99,7 @@ AsyncFile::AsyncFile(SimulatedBlock& fs) : ...@@ -99,6 +99,7 @@ AsyncFile::AsyncFile(SimulatedBlock& fs) :
{ {
m_page_ptr.setNull(); m_page_ptr.setNull();
m_current_request= m_last_request= 0; m_current_request= m_last_request= 0;
m_open_flags = 0;
} }
void void
...@@ -328,6 +329,7 @@ void AsyncFile::openReq(Request* request) ...@@ -328,6 +329,7 @@ void AsyncFile::openReq(Request* request)
{ {
m_auto_sync_freq = 0; m_auto_sync_freq = 0;
m_write_wo_sync = 0; m_write_wo_sync = 0;
m_open_flags = request->par.open.flags;
// for open.flags, see signal FSOPENREQ // for open.flags, see signal FSOPENREQ
#ifdef NDB_WIN32 #ifdef NDB_WIN32
...@@ -954,7 +956,12 @@ AsyncFile::writevReq( Request * request) ...@@ -954,7 +956,12 @@ AsyncFile::writevReq( Request * request)
void void
AsyncFile::closeReq(Request * request) AsyncFile::closeReq(Request * request)
{ {
syncReq(request); if (m_open_flags & (
FsOpenReq::OM_WRITEONLY |
FsOpenReq::OM_READWRITE |
FsOpenReq::OM_APPEND )) {
syncReq(request);
}
#ifdef NDB_WIN32 #ifdef NDB_WIN32
if(!CloseHandle(hFile)) { if(!CloseHandle(hFile)) {
request->error = GetLastError(); request->error = GetLastError();
......
...@@ -224,6 +224,8 @@ private: ...@@ -224,6 +224,8 @@ private:
#else #else
int theFd; int theFd;
#endif #endif
Uint32 m_open_flags; // OM_ flags from request to open file
MemoryChannel<Request> *theReportTo; MemoryChannel<Request> *theReportTo;
MemoryChannel<Request>* theMemoryChannelPtr; MemoryChannel<Request>* theMemoryChannelPtr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment