Commit 755874c8 authored by unknown's avatar unknown

ndb: small fixes (error codes, debug stuff)


ndb/test/ndbapi/testDeadlock.cpp:
  for broken compilers
sql/ha_ndbcluster.cc:
  Use DBUG_PRINT since DBUG_FILE cannot be filtered out
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  missing DBUG_RETURN
ndb/include/kernel/signaldata/TupFrag.hpp:
  fix some error codes
ndb/include/kernel/signaldata/TuxMaint.hpp:
  fix some error codes
ndb/include/ndbapi/NdbBlob.hpp:
  fix some error codes
ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  fix some error codes
ndb/src/ndbapi/ndberror.c:
  fix some error codes
parent ff51fe45
......@@ -104,9 +104,9 @@ public:
STATIC_CONST( SignalLength = 2 );
enum ErrorCode {
NoError = 0,
InvalidRequest = 800,
NoFreeFragment = 604,
NoFreeAttributes = 827
InvalidRequest = 903,
NoFreeFragment = 904,
NoFreeAttributes = 905
};
private:
Uint32 userPtr;
......@@ -186,9 +186,9 @@ public:
STATIC_CONST( SignalLength = 2 );
enum ErrorCode {
NoError = 0,
InvalidAttributeType = 742,
InvalidCharset = 743,
InvalidNodeSize = 832
InvalidAttributeType = 906,
InvalidCharset = 907,
InvalidNodeSize = 908
};
private:
Uint32 userPtr;
......
......@@ -36,8 +36,8 @@ public:
};
enum ErrorCode {
NoError = 0, // must be zero
SearchError = 895, // add + found or remove + not found
NoMemError = 827
SearchError = 901, // add + found or remove + not found
NoMemError = 902
};
STATIC_CONST( SignalLength = 8 );
private:
......
......@@ -202,7 +202,7 @@ public:
// "Error in blob head update forced rollback of transaction"
STATIC_CONST( ErrAbort = 4268 );
// "Unknown blob error"
STATIC_CONST( ErrUnknown = 4269 );
STATIC_CONST( ErrUnknown = 4270 );
/**
* Return info about all blobs in this operation.
*/
......
......@@ -1088,7 +1088,7 @@ void Dbacc::execACCFRAGREQ(Signal* signal)
// config mismatch - do not crash if release compiled
if (tabptr.i >= ctablesize) {
jam();
addFragRefuse(signal, 800);
addFragRefuse(signal, 640);
return;
}
#endif
......@@ -1837,7 +1837,7 @@ Dbacc::xfrmKeyData(Signal* signal)
tabptr.i = fragrecptr.p->myTableId;
ptrCheckGuard(tabptr, ctablesize, tabrec);
Uint32 dst[1024];
Uint32 dst[1024 * MAX_XFRM_MULTIPLY];
Uint32 dstSize = (sizeof(dst) >> 2);
Uint32* src = &signal->theData[7];
const Uint32 noOfKeyAttr = tabptr.p->noOfKeyAttr;
......
......@@ -1724,7 +1724,7 @@ NdbDictionaryImpl::dropTable(const char * name)
DBUG_PRINT("enter",("name: %s", name));
NdbTableImpl * tab = getTable(name);
if(tab == 0){
return -1;
DBUG_RETURN(-1);
}
int ret = dropTable(* tab);
// If table stored in cache is incompatible with the one in the kernel
......
......@@ -69,6 +69,7 @@ static const char* empty_string = "";
* 600 - ACC
* 700 - DICT
* 800 - TUP
* 900 - TUX
* 1200 - LQH
* 1300 - BACKUP
* 4000 - API
......@@ -176,10 +177,13 @@ ErrorBundle ErrorCodes[] = {
{ 623, IS, "623" },
{ 624, IS, "624" },
{ 625, IS, "Out of memory in Ndb Kernel, index part (increase IndexMemory)" },
{ 800, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" },
{ 640, IS, "Too many hash indexes (should not happen)" },
{ 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes or MaxNoOfTables)" },
{ 827, IS, "Out of memory in Ndb Kernel, data part (increase DataMemory)" },
{ 832, IS, "832" },
{ 902, IS, "Out of memory in Ndb Kernel, data part (increase DataMemory)" },
{ 903, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" },
{ 904, IS, "Out of fragment records (increase MaxNoOfOrderedIndexes)" },
{ 905, IS, "Out of attribute records (increase MaxNoOfAttributes)" },
/**
* TimeoutExpired
......@@ -205,8 +209,8 @@ ErrorBundle ErrorCodes[] = {
* Internal errors
*/
{ 892, IE, "Inconsistent hash index. The index needs to be dropped and recreated" },
{ 895, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" },
{ 896, IE, "Tuple corrupted - wrong checksum or column data in invalid format" },
{ 901, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" },
{ 202, IE, "202" },
{ 203, IE, "203" },
{ 207, IE, "207" },
......@@ -310,7 +314,6 @@ ErrorBundle ErrorCodes[] = {
{ 739, SE, "Unsupported primary key length" },
{ 740, SE, "Nullable primary key not supported" },
{ 741, SE, "Unsupported alter table" },
{ 742, SE, "Unsupported attribute type in index" },
{ 743, SE, "Unsupported character set in table or index" },
{ 744, SE, "Character string is invalid for given character set" },
{ 745, SE, "Distribution key not supported for char attribute (use binary attribute)" },
......@@ -319,6 +322,9 @@ ErrorBundle ErrorCodes[] = {
{ 284, SE, "Table not defined in transaction coordinator" },
{ 285, SE, "Unknown table error in transaction coordinator" },
{ 881, SE, "Unable to create table, out of data pages (increase DataMemory) " },
{ 906, SE, "Unsupported attribute type in index" },
{ 907, SE, "Unsupported character set in table or index" },
{ 908, IS, "Invalid ordered index tree node size" },
{ 1225, SE, "Table not defined in local query handler" },
{ 1226, SE, "Table is being dropped" },
{ 1228, SE, "Cannot use drop table for drop index" },
......@@ -482,8 +488,8 @@ ErrorBundle ErrorCodes[] = {
{ 4266, AE, "Invalid blob seek position" },
{ 4267, IE, "Corrupted blob value" },
{ 4268, IE, "Error in blob head update forced rollback of transaction" },
{ 4268, IE, "Unknown blob error" },
{ 4269, IE, "No connection to ndb management server" },
{ 4270, IE, "Unknown blob error" },
{ 4335, AE, "Only one autoincrement column allowed per table. Having a table without primary key uses an autoincremented hidden key, i.e. a table without a primary key can not have an autoincremented column" }
};
......
......@@ -464,7 +464,7 @@ wl1822_main(char scantx)
// run the steps
for (unsigned i = 0; i < wl1822_stepcount; i++) {
DBG("step " << i << " start");
for (int n = 0; n < thrcount; n++) {
for (n = 0; n < thrcount; n++) {
Thr& thr = *thrlist[n];
Runstep runstep = wl1822_step[i][n];
if (runstep != 0)
......
......@@ -2143,32 +2143,36 @@ void ha_ndbcluster::print_results()
DBUG_ENTER("print_results");
#ifndef DBUG_OFF
if (!_db_on_)
DBUG_VOID_RETURN;
for (uint f=0; f<table->fields;f++)
{
// Use DBUG_PRINT since DBUG_FILE cannot be filtered out
char buf[2000];
Field *field;
const NDBCOL *col;
NdbValue value;
NdbBlob *ndb_blob;
buf[0] = 0;
if (!(value= m_value[f]).ptr)
{
fprintf(DBUG_FILE, "Field %d was not read\n", f);
continue;
my_snprintf(buf, sizeof(buf), "not read");
goto print_value;
}
field= table->field[f];
DBUG_DUMP("field->ptr", (char*)field->ptr, field->pack_length());
col= tab->getColumn(f);
fprintf(DBUG_FILE, "%d: %s\t", f, col->getName());
NdbBlob *ndb_blob= NULL;
if (! (field->flags & BLOB_FLAG))
{
ndb_blob= NULL;
if (value.rec->isNULL())
{
fprintf(DBUG_FILE, "NULL\n");
continue;
my_snprintf(buf, sizeof(buf), "NULL");
goto print_value;
}
}
else
......@@ -2177,124 +2181,124 @@ void ha_ndbcluster::print_results()
bool isNull= TRUE;
ndb_blob->getNull(isNull);
if (isNull) {
fprintf(DBUG_FILE, "NULL\n");
continue;
my_snprintf(buf, sizeof(buf), "NULL");
goto print_value;
}
}
switch (col->getType()) {
case NdbDictionary::Column::Tinyint: {
char value= *field->ptr;
fprintf(DBUG_FILE, "Tinyint\t%d", value);
my_snprintf(buf, sizeof(buf), "Tinyint %d", value);
break;
}
case NdbDictionary::Column::Tinyunsigned: {
unsigned char value= *field->ptr;
fprintf(DBUG_FILE, "Tinyunsigned\t%u", value);
my_snprintf(buf, sizeof(buf), "Tinyunsigned %u", value);
break;
}
case NdbDictionary::Column::Smallint: {
short value= *field->ptr;
fprintf(DBUG_FILE, "Smallint\t%d", value);
my_snprintf(buf, sizeof(buf), "Smallint %d", value);
break;
}
case NdbDictionary::Column::Smallunsigned: {
unsigned short value= *field->ptr;
fprintf(DBUG_FILE, "Smallunsigned\t%u", value);
my_snprintf(buf, sizeof(buf), "Smallunsigned %u", value);
break;
}
case NdbDictionary::Column::Mediumint: {
byte value[3];
memcpy(value, field->ptr, 3);
fprintf(DBUG_FILE, "Mediumint\t%d,%d,%d", value[0], value[1], value[2]);
my_snprintf(buf, sizeof(buf), "Mediumint %d,%d,%d", value[0], value[1], value[2]);
break;
}
case NdbDictionary::Column::Mediumunsigned: {
byte value[3];
memcpy(value, field->ptr, 3);
fprintf(DBUG_FILE, "Mediumunsigned\t%u,%u,%u", value[0], value[1], value[2]);
my_snprintf(buf, sizeof(buf), "Mediumunsigned %u,%u,%u", value[0], value[1], value[2]);
break;
}
case NdbDictionary::Column::Int: {
fprintf(DBUG_FILE, "Int\t%lld", field->val_int());
my_snprintf(buf, sizeof(buf), "Int %d", value);
break;
}
case NdbDictionary::Column::Unsigned: {
Uint32 value= (Uint32) *field->ptr;
fprintf(DBUG_FILE, "Unsigned\t%u", value);
my_snprintf(buf, sizeof(buf), "Unsigned %u", value);
break;
}
case NdbDictionary::Column::Bigint: {
Int64 value= (Int64) *field->ptr;
fprintf(DBUG_FILE, "Bigint\t%lld", value);
my_snprintf(buf, sizeof(buf), "Bigint %lld", value);
break;
}
case NdbDictionary::Column::Bigunsigned: {
Uint64 value= (Uint64) *field->ptr;
fprintf(DBUG_FILE, "Bigunsigned\t%llu", value);
my_snprintf(buf, sizeof(buf), "Bigunsigned %llu", value);
break;
}
case NdbDictionary::Column::Float: {
float value= (float) *field->ptr;
fprintf(DBUG_FILE, "Float\t%f", value);
my_snprintf(buf, sizeof(buf), "Float %f", (double)value);
break;
}
case NdbDictionary::Column::Double: {
double value= (double) *field->ptr;
fprintf(DBUG_FILE, "Double\t%f", value);
my_snprintf(buf, sizeof(buf), "Double %f", value);
break;
}
case NdbDictionary::Column::Decimal: {
char *value= field->ptr;
fprintf(DBUG_FILE, "Decimal\t'%-*s'", field->pack_length(), value);
my_snprintf(buf, sizeof(buf), "Decimal '%-*s'", field->pack_length(), value);
break;
}
case NdbDictionary::Column::Char:{
const char *value= (char *) field->ptr;
fprintf(DBUG_FILE, "Char\t'%.*s'", field->pack_length(), value);
my_snprintf(buf, sizeof(buf), "Char '%.*s'", field->pack_length(), value);
break;
}
case NdbDictionary::Column::Varchar:
case NdbDictionary::Column::Binary:
case NdbDictionary::Column::Varbinary: {
const char *value= (char *) field->ptr;
fprintf(DBUG_FILE, "Var\t'%.*s'", field->pack_length(), value);
my_snprintf(buf, sizeof(buf), "Var '%.*s'", field->pack_length(), value);
break;
}
case NdbDictionary::Column::Bit: {
const char *value= (char *) field->ptr;
fprintf(DBUG_FILE, "Bit\t'%.*s'", field->pack_length(), value);
my_snprintf(buf, sizeof(buf), "Bit '%.*s'", field->pack_length(), value);
break;
}
case NdbDictionary::Column::Datetime: {
Uint64 value= (Uint64) *field->ptr;
fprintf(DBUG_FILE, "Datetime\t%llu", value);
my_snprintf(buf, sizeof(buf), "Datetime %llu", value);
break;
}
case NdbDictionary::Column::Timespec: {
Uint64 value= (Uint64) *field->ptr;
fprintf(DBUG_FILE, "Timespec\t%llu", value);
my_snprintf(buf, sizeof(buf), "Timespec %llu", value);
break;
}
case NdbDictionary::Column::Blob: {
Uint64 len= 0;
ndb_blob->getLength(len);
fprintf(DBUG_FILE, "Blob\t[len=%u]", (unsigned)len);
my_snprintf(buf, sizeof(buf), "Blob [len=%u]", (unsigned)len);
break;
}
case NdbDictionary::Column::Text: {
Uint64 len= 0;
ndb_blob->getLength(len);
fprintf(DBUG_FILE, "Text\t[len=%u]", (unsigned)len);
my_snprintf(buf, sizeof(buf), "Text [len=%u]", (unsigned)len);
break;
}
case NdbDictionary::Column::Undefined:
fprintf(DBUG_FILE, "Unknown type: %d", col->getType());
my_snprintf(buf, sizeof(buf), "Unknown type: %d", col->getType());
break;
}
fprintf(DBUG_FILE, "\n");
print_value:
DBUG_PRINT("value", ("%u,%s: %s", f, col->getName(), buf));
}
#endif
DBUG_VOID_RETURN;
......
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