Commit f9900675 authored by unknown's avatar unknown

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb

into mysql.com:/home/jonas/src/mysql-4.1-ndb

parents 4d552c39 0afb328e
...@@ -942,13 +942,14 @@ start_ndbcluster() ...@@ -942,13 +942,14 @@ start_ndbcluster()
NDBCLUSTER_OPTS="--small" NDBCLUSTER_OPTS="--small"
fi fi
./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\"" NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
else else
USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\"" NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
echo "Using ndbcluster at $USE_NDBCLUSTER" echo "Using ndbcluster at $NDB_CONNECTSTRING"
fi fi
USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$NDB_CONNECTSTRING\""
export NDB_CONNECTSTRING
fi fi
} }
stop_ndbcluster() stop_ndbcluster()
......
...@@ -397,4 +397,9 @@ select * from t1 order by a; ...@@ -397,4 +397,9 @@ select * from t1 order by a;
a b a b
1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
alter table t1 engine=myisam;
select * from t1 order by a;
a b
1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
drop table t1; drop table t1;
...@@ -309,6 +309,7 @@ select count(*) from t1; ...@@ -309,6 +309,7 @@ select count(*) from t1;
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
# bug #5349
set autocommit=1; set autocommit=1;
use test; use test;
CREATE TABLE t1 ( CREATE TABLE t1 (
...@@ -325,4 +326,8 @@ INSERT INTO t1 VALUES ...@@ -325,4 +326,8 @@ INSERT INTO t1 VALUES
select * from t1 order by a; select * from t1 order by a;
alter table t1 engine=ndb; alter table t1 engine=ndb;
select * from t1 order by a; select * from t1 order by a;
# bug #5872
alter table t1 engine=myisam;
select * from t1 order by a;
drop table t1; drop table t1;
...@@ -329,7 +329,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen) ...@@ -329,7 +329,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
}//if }//if
{ {
NdbConnection *trans= startTransactionLocal(aPriority, nodeId); NdbConnection *trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit",("start trans= 0x%x", trans)); DBUG_PRINT("exit",("start trans: 0x%x transid: 0x%llx",
trans, trans->getTransactionId()));
DBUG_RETURN(trans); DBUG_RETURN(trans);
} }
} else { } else {
...@@ -350,6 +351,8 @@ Ndb::hupp(NdbConnection* pBuddyTrans) ...@@ -350,6 +351,8 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
{ {
DBUG_ENTER("Ndb::hupp"); DBUG_ENTER("Ndb::hupp");
DBUG_PRINT("enter", ("trans: 0x%x",pBuddyTrans));
Uint32 aPriority = 0; Uint32 aPriority = 0;
if (pBuddyTrans == NULL){ if (pBuddyTrans == NULL){
DBUG_RETURN(startTransaction()); DBUG_RETURN(startTransaction());
...@@ -372,6 +375,8 @@ Ndb::hupp(NdbConnection* pBuddyTrans) ...@@ -372,6 +375,8 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
} }
pCon->setTransactionId(pBuddyTrans->getTransactionId()); pCon->setTransactionId(pBuddyTrans->getTransactionId());
pCon->setBuddyConPtr((Uint32)pBuddyTrans->getTC_ConnectPtr()); pCon->setBuddyConPtr((Uint32)pBuddyTrans->getTC_ConnectPtr());
DBUG_PRINT("exit", ("hupp trans: 0x%x transid: 0x%llx",
pCon, pCon ? pCon->getTransactionId() : 0));
DBUG_RETURN(pCon); DBUG_RETURN(pCon);
} else { } else {
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
...@@ -408,7 +413,10 @@ Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type) ...@@ -408,7 +413,10 @@ Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type)
fragmentId = getFragmentId(hashValue); fragmentId = getFragmentId(hashValue);
}//if }//if
Uint32 nodeId = guessPrimaryNode(fragmentId); Uint32 nodeId = guessPrimaryNode(fragmentId);
return startTransactionLocal(aPriority, nodeId); NdbConnection* trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx",
trans, trans ? trans->getTransactionId() : 0));
return trans;
} else { } else {
return NULL; return NULL;
}//if }//if
...@@ -455,7 +463,6 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) ...@@ -455,7 +463,6 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
abort(); abort();
} }
#endif #endif
DBUG_PRINT("exit", ("transid= %lld", tConnection->getTransactionId()));
DBUG_RETURN(tConnection); DBUG_RETURN(tConnection);
}//Ndb::startTransactionLocal() }//Ndb::startTransactionLocal()
...@@ -469,9 +476,6 @@ void ...@@ -469,9 +476,6 @@ void
Ndb::closeTransaction(NdbConnection* aConnection) Ndb::closeTransaction(NdbConnection* aConnection)
{ {
DBUG_ENTER("Ndb::closeTransaction"); DBUG_ENTER("Ndb::closeTransaction");
DBUG_PRINT("enter",("close trans= 0x%x, transid= %lld",
aConnection, aConnection->getTransactionId()));
NdbConnection* tCon; NdbConnection* tCon;
NdbConnection* tPreviousCon; NdbConnection* tPreviousCon;
...@@ -489,6 +493,12 @@ Ndb::closeTransaction(NdbConnection* aConnection) ...@@ -489,6 +493,12 @@ Ndb::closeTransaction(NdbConnection* aConnection)
tCon = theTransactionList; tCon = theTransactionList;
DBUG_PRINT("info",("close trans: 0x%x transid: 0x%llx",
aConnection, aConnection->getTransactionId()));
DBUG_PRINT("info",("magic number: 0x%x TCConPtr: 0x%x theMyRef: 0x%x 0x%x",
aConnection->theMagicNumber, aConnection->theTCConPtr,
aConnection->theMyRef, getReference()));
if (aConnection == tCon) { // Remove the active connection object if (aConnection == tCon) { // Remove the active connection object
theTransactionList = tCon->next(); // from the transaction list. theTransactionList = tCon->next(); // from the transaction list.
} else { } else {
......
...@@ -1691,6 +1691,8 @@ NdbDictInterface::execALTER_TABLE_REF(NdbApiSignal * signal, ...@@ -1691,6 +1691,8 @@ NdbDictInterface::execALTER_TABLE_REF(NdbApiSignal * signal,
int int
NdbDictionaryImpl::dropTable(const char * name) NdbDictionaryImpl::dropTable(const char * name)
{ {
DBUG_ENTER("NdbDictionaryImpl::dropTable");
DBUG_PRINT("enter",("name: %s", name));
NdbTableImpl * tab = getTable(name); NdbTableImpl * tab = getTable(name);
if(tab == 0){ if(tab == 0){
return -1; return -1;
...@@ -1701,15 +1703,16 @@ NdbDictionaryImpl::dropTable(const char * name) ...@@ -1701,15 +1703,16 @@ NdbDictionaryImpl::dropTable(const char * name)
if (ret == INCOMPATIBLE_VERSION) { if (ret == INCOMPATIBLE_VERSION) {
const char * internalTableName = m_ndb.internalizeTableName(name); const char * internalTableName = m_ndb.internalizeTableName(name);
DBUG_PRINT("info",("INCOMPATIBLE_VERSION internal_name: %s", internalTableName));
m_localHash.drop(internalTableName); m_localHash.drop(internalTableName);
m_globalHash->lock(); m_globalHash->lock();
m_globalHash->drop(tab); m_globalHash->drop(tab);
m_globalHash->unlock(); m_globalHash->unlock();
return dropTable(name); DBUG_RETURN(dropTable(name));
} }
return ret; DBUG_RETURN(ret);
} }
int int
...@@ -1763,6 +1766,7 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl) ...@@ -1763,6 +1766,7 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl)
int int
NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t) NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t)
{ {
DBUG_ENTER("NdbDictionaryImpl::dropBlobTables");
for (unsigned i = 0; i < t.m_columns.size(); i++) { for (unsigned i = 0; i < t.m_columns.size(); i++) {
NdbColumnImpl & c = *t.m_columns[i]; NdbColumnImpl & c = *t.m_columns[i];
if (! c.getBlobType() || c.getPartSize() == 0) if (! c.getBlobType() || c.getPartSize() == 0)
...@@ -1771,11 +1775,13 @@ NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t) ...@@ -1771,11 +1775,13 @@ NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t)
NdbBlob::getBlobTableName(btname, &t, &c); NdbBlob::getBlobTableName(btname, &t, &c);
if (dropTable(btname) != 0) { if (dropTable(btname) != 0) {
if (m_error.code != 709){ if (m_error.code != 709){
return -1; DBUG_PRINT("exit",("error %u - exiting",m_error.code));
DBUG_RETURN(-1);
} }
DBUG_PRINT("info",("error %u - continuing",m_error.code));
} }
} }
return 0; DBUG_RETURN(0);
} }
int int
......
...@@ -1195,18 +1195,21 @@ inline int ha_ndbcluster::next_result(byte *buf) ...@@ -1195,18 +1195,21 @@ inline int ha_ndbcluster::next_result(byte *buf)
be sent to NDB be sent to NDB
*/ */
DBUG_PRINT("info", ("ops_pending: %d", ops_pending)); DBUG_PRINT("info", ("ops_pending: %d", ops_pending));
if (current_thd->transaction.on) if (ops_pending)
{ {
if (ops_pending && (execute_no_commit(this,trans) != 0)) if (current_thd->transaction.on)
DBUG_RETURN(ndb_err(trans)); {
} if (execute_no_commit(this,trans) != 0)
else DBUG_RETURN(ndb_err(trans));
{ }
if (ops_pending && (execute_commit(this,trans) != 0)) else
DBUG_RETURN(ndb_err(trans)); {
trans->restart(); if (execute_commit(this,trans) != 0)
DBUG_RETURN(ndb_err(trans));
DBUG_ASSERT(trans->restart() == 0);
}
ops_pending= 0;
} }
ops_pending= 0;
contact_ndb= (check == 2); contact_ndb= (check == 2);
} }
...@@ -1641,7 +1644,7 @@ int ha_ndbcluster::write_row(byte *record) ...@@ -1641,7 +1644,7 @@ int ha_ndbcluster::write_row(byte *record)
no_uncommitted_rows_execute_failure(); no_uncommitted_rows_execute_failure();
DBUG_RETURN(ndb_err(trans)); DBUG_RETURN(ndb_err(trans));
} }
trans->restart(); DBUG_ASSERT(trans->restart() == 0);
} }
} }
if ((has_auto_increment) && (skip_auto_increment)) if ((has_auto_increment) && (skip_auto_increment))
...@@ -2278,7 +2281,7 @@ int ha_ndbcluster::rnd_init(bool scan) ...@@ -2278,7 +2281,7 @@ int ha_ndbcluster::rnd_init(bool scan)
{ {
if (!scan) if (!scan)
DBUG_RETURN(1); DBUG_RETURN(1);
cursor->restart(); DBUG_ASSERT(cursor->restart() == 0);
} }
index_init(table->primary_key); index_init(table->primary_key);
DBUG_RETURN(0); DBUG_RETURN(0);
...@@ -2435,7 +2438,7 @@ void ha_ndbcluster::info(uint flag) ...@@ -2435,7 +2438,7 @@ void ha_ndbcluster::info(uint flag)
DBUG_PRINT("info", ("HA_STATUS_CONST")); DBUG_PRINT("info", ("HA_STATUS_CONST"));
set_rec_per_key(); set_rec_per_key();
} }
if (flag & HA_STATUS_ERRKEY) if (flag & HA_STATUS_ERRKEY)
{ {
DBUG_PRINT("info", ("HA_STATUS_ERRKEY")); DBUG_PRINT("info", ("HA_STATUS_ERRKEY"));
errkey= dupkey; errkey= dupkey;
......
...@@ -1999,7 +1999,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) ...@@ -1999,7 +1999,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
} }
else if (tmp != not_found_field) else if (tmp != not_found_field)
{ {
ref= 0; // To prevent "delete *ref;" on ~Item_erf() of this item ref= 0; // To prevent "delete *ref;" on ~Item_ref() of this item
Item_field* fld; Item_field* fld;
if (!((*reference)= fld= new Item_field(tmp))) if (!((*reference)= fld= new Item_field(tmp)))
return 1; return 1;
......
...@@ -1264,8 +1264,6 @@ class select_subselect :public select_result ...@@ -1264,8 +1264,6 @@ class select_subselect :public select_result
bool send_fields(List<Item> &list, uint flag) { return 0; }; bool send_fields(List<Item> &list, uint flag) { return 0; };
bool send_data(List<Item> &items)=0; bool send_data(List<Item> &items)=0;
bool send_eof() { return 0; }; bool send_eof() { return 0; };
friend class Ttem_subselect;
}; };
/* Single value subselect interface class */ /* Single value subselect interface class */
......
...@@ -1140,7 +1140,7 @@ static const char *require_quotes(const char *name, uint name_length) ...@@ -1140,7 +1140,7 @@ static const char *require_quotes(const char *name, uint name_length)
for ( ; name < end ; name++) for ( ; name < end ; name++)
{ {
uchar chr= (uchar) *name; uchar chr= (uchar) *name;
length= my_mbcharlen(system_charset_info, chr); length= my_mbcharlen(system_charset_info, (uchar) chr);
if (length == 1 && !system_charset_info->ident_map[chr]) if (length == 1 && !system_charset_info->ident_map[chr])
return name; return name;
} }
...@@ -1169,7 +1169,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) ...@@ -1169,7 +1169,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
for (name_end= name+length ; name < name_end ; name+= length) for (name_end= name+length ; name < name_end ; name+= length)
{ {
char chr= *name; char chr= *name;
length= my_mbcharlen(system_charset_info, chr); length= my_mbcharlen(system_charset_info, (uchar) chr);
if (length == 1 && chr == quote_char) if (length == 1 && chr == quote_char)
packet->append(&quote_char, 1, system_charset_info); packet->append(&quote_char, 1, system_charset_info);
packet->append(name, length, packet->charset()); packet->append(name, length, packet->charset());
......
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