Merge mysql.com:/home/jonas/src/mysql-4.1

into mysql.com:/home/jonas/src/wl1744


ndb/src/ndbapi/ndberror.c:
  Auto merged
This commit is contained in:
unknown 2004-11-11 22:02:17 +01:00
commit 26c5503415
48 changed files with 195 additions and 141 deletions

View file

@ -20,6 +20,10 @@
#include <basestring_vsnprintf.h>
#include <my_config.h>
/*
#define SNPRINTF_RETURN_TRUNC
*/
int
basestring_snprintf(char *str, size_t size, const char *format, ...)
{
@ -47,13 +51,27 @@ static char basestring_vsnprintf_buf[16*1024];
int
basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap)
{
int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap);
if (size == 0)
{
#ifdef SNPRINTF_RETURN_TRUNC
if (ret == size-1 || ret == -1) {
ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
sizeof(basestring_vsnprintf_buf),
format, ap);
}
return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
sizeof(basestring_vsnprintf_buf),
format, ap);
#else
char buf[1];
return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap);
#endif
return ret;
}
{
int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap);
#ifdef SNPRINTF_RETURN_TRUNC
if (ret == size-1 || ret == -1)
{
ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
sizeof(basestring_vsnprintf_buf),
format, ap);
}
#endif
return ret;
}
}

View file

@ -200,6 +200,7 @@ extern "C" {
int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle h)
{
delete (Ndb_mgmclient*)h;
return 0;
}
}
/*

View file

@ -125,7 +125,8 @@ ErrorBundle ErrorCodes[] = {
{ 217, TR, "217" },
{ 218, TR, "218" },
{ 219, TR, "219" },
{ 233, TR, "Out of operation records in transaction coordinator" },
{ 233, TR,
"Out of operation records in transaction coordinator (increase MaxNoOfConcurrentOperations)" },
{ 275, TR, "275" },
{ 279, TR, "Out of transaction markers in transaction coordinator" },
{ 414, TR, "414" },
@ -138,7 +139,7 @@ ErrorBundle ErrorCodes[] = {
{ 830, TR, "Out of add fragment operation records" },
{ 873, TR, "Out of attrinfo records for scan in tuple manager" },
{ 1217, TR, "1217" },
{ 1219, TR, "Out of operation records in local data manager" },
{ 1219, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" },
{ 1220, TR, "1220" },
{ 1222, TR, "Out of transaction markers in LQH" },
{ 4021, TR, "Out of Send Buffer space in NDB API" },
@ -150,9 +151,10 @@ ErrorBundle ErrorCodes[] = {
*/
{ 623, IS, "623" },
{ 624, IS, "624" },
{ 625, IS, "Out of memory in Ndb Kernel, index part" },
{ 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes)" },
{ 827, IS, "Out of memory in Ndb Kernel, data part" },
{ 625, IS, "Out of memory in Ndb Kernel, index part (increase IndexMemory)" },
{ 800, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" },
{ 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" },
/**
@ -169,10 +171,10 @@ ErrorBundle ErrorCodes[] = {
* OverloadError
*/
{ 410, OL, "Out of log file space temporarily" },
{ 677, OL, "Index UNDO buffers overloaded" },
{ 891, OL, "Data UNDO buffers overloaded" },
{ 1221, OL, "REDO log buffers overloaded" },
{ 4006, OL, "Connect failure - out of connection objects" },
{ 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" },
{ 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" },
{ 1221, OL, "REDO log buffers overloaded (increase RedoBuffer)" },
{ 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" },
@ -242,9 +244,9 @@ ErrorBundle ErrorCodes[] = {
{ 884, AE, "Stack overflow in interpreter" },
{ 885, AE, "Stack underflow in interpreter" },
{ 886, AE, "More than 65535 instructions executed in interpreter" },
{ 4256, AE, "Must call Ndb::init() before this function" },
{ 4256, AE, "Must call Ndb::init() before this function" },
{ 880, AE, "Tried to read too much - too many getValue calls" },
{ 4257, AE, "Tried to read too much - too many getValue calls" },
{ 4257, AE, "Tried to read too much - too many getValue calls" },
/**
* Scan application errors
@ -289,7 +291,7 @@ ErrorBundle ErrorCodes[] = {
{ 283, SE, "Table is being dropped" },
{ 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" },
{ 881, SE, "Unable to create table, out of data pages (increase DataMemory) " },
{ 1225, SE, "Table not defined in local query handler" },
{ 1226, SE, "Table is being dropped" },
{ 1228, SE, "Cannot use drop table for drop index" },
@ -345,17 +347,11 @@ ErrorBundle ErrorCodes[] = {
{ 4327, AE, "Distribution Group with 1 byte attribute is not allowed" },
{ 4328, AE, "Disk memory attributes not yet supported" },
{ 4329, AE, "Variable stored attributes not yet supported" },
{ 4330, AE, "Table names limited to 127 bytes" },
{ 4331, AE, "Attribute names limited to 31 bytes" },
{ 4332, AE, "Maximum 2000 attributes in a table" },
{ 4333, AE, "Maximum 4092 bytes long keys allowed" },
{ 4334, AE, "Attribute properties length limited to 127 bytes" },
{ 4400, AE, "Status Error in NdbSchemaCon" },
{ 4401, AE, "Only one schema operation per schema transaction" },
{ 4402, AE, "No schema operation defined before calling execute" },
{ 4500, AE, "Cannot handle more than 2048 tables in NdbApi" },
{ 4501, AE, "Insert in hash table failed when getting table information from Ndb" },
{ 4502, AE, "GetValue not allowed in Update operation" },
{ 4503, AE, "GetValue not allowed in Insert operation" },

View file

@ -32,19 +32,21 @@ int test_snprintf(const char * fmt, int buf_sz, int result)
if(ret < 0)
{
printf("BaseString::snprint returns %d\n", ret);
printf("BaseString::snprint returns %d with size=%d and strlen(fmt)=%d\n",
ret, buf_sz, strlen(fmt));
return -1;
}
if(ret+1 == buf_sz)
{
printf("BaseString::snprint truncates\n");
printf("BaseString::snprint truncates returns %d with size=%d and strlen(fmt)=%d\n",
ret, buf_sz, strlen(fmt));
return -1;
}
if(ret != result)
{
printf("BaseString::snprint returns incorrect value: %d != %d\n",
printf("BaseString::snprint returns incorrect value: returned=%d != expected=%d\n",
ret, result);
return -1;
}
@ -54,7 +56,7 @@ int test_snprintf(const char * fmt, int buf_sz, int result)
if(buf[ret] != fmt[ret])
{
printf("BaseString::snprint Incorrect value in output buffer: "
"%d %d %d %d %d\n",
"size=%d returned=expected=%d at pos=%d result=%d != expected=%d\n",
buf_sz, result, ret, buf[ret], fmt[ret]);
return -1;
}

View file

@ -86,7 +86,7 @@ int main(int argc, char** argv){
if (_hostName == NULL){
LocalConfig lcfg;
if(!lcfg.init())
if(!lcfg.init(opt_connect_str, 0))
{
lcfg.printError();
lcfg.printUsage();