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