summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi
diff options
context:
space:
mode:
authorunknown <pekka@mysql.com>2005-02-20 15:55:39 +0100
committerunknown <pekka@mysql.com>2005-02-20 15:55:39 +0100
commit6fc95e50a9d974d9fa402162952c9f15d2730a9c (patch)
treee5c0f50f8a9d951beddbed5e47f2345bae1b25d1 /ndb/src/ndbapi
parent2200e35c8c17fee129cb63c2f6b4fa2266de7a86 (diff)
downloadmariadb-git-6fc95e50a9d974d9fa402162952c9f15d2730a9c.tar.gz
ndb - simple scan filter test (in testOIBasic)
ndb/src/ndbapi/NdbDictionary.cpp: print unusual array size ndb/src/ndbapi/NdbRecAttr.cpp: print hex chars as unsigned ndb/src/ndbapi/NdbOperationInt.cpp: ignore of NULL bound ndb/test/ndbapi/testOIBasic.cpp: add simple scan filter test (table scan on index bounds)
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp18
-rw-r--r--ndb/src/ndbapi/NdbOperationInt.cpp20
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp5
3 files changed, 33 insertions, 10 deletions
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index 664d568aee0..4cc47543cec 100644
--- a/ndb/src/ndbapi/NdbDictionary.cpp
+++ b/ndb/src/ndbapi/NdbDictionary.cpp
@@ -1011,6 +1011,24 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
out << "Type" << (Uint32)col.getType();
break;
}
+ // show unusual (non-MySQL) array size
+ if (col.getLength() != 1) {
+ switch (col.getType()) {
+ case NdbDictionary::Column::Char:
+ case NdbDictionary::Column::Varchar:
+ case NdbDictionary::Column::Binary:
+ case NdbDictionary::Column::Varbinary:
+ case NdbDictionary::Column::Blob:
+ case NdbDictionary::Column::Text:
+ case NdbDictionary::Column::Bit:
+ case NdbDictionary::Column::Longvarchar:
+ case NdbDictionary::Column::Longvarbinary:
+ break;
+ default:
+ out << " [" << col.getLength() << "]";
+ break;
+ }
+ }
if (col.getPrimaryKey())
out << " PRIMARY KEY";
else if (! col.getNullable())
diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp
index 0fa6ef3de62..5b98f090395 100644
--- a/ndb/src/ndbapi/NdbOperationInt.cpp
+++ b/ndb/src/ndbapi/NdbOperationInt.cpp
@@ -1026,15 +1026,19 @@ NdbOperation::branch_col(Uint32 type,
abort();
}
- Uint32 sizeInBytes = col->m_attrSize * col->m_arraySize;
- if (! col->getCharType()) {
- // prevent assert in NdbSqlUtil on length error
- if(len != 0 && len != sizeInBytes)
- {
- setErrorCodeAbort(4209);
- return -1;
+ if (val == NULL)
+ len = 0;
+ else {
+ if (! col->getCharType()) {
+ // prevent assert in NdbSqlUtil on length error
+ Uint32 sizeInBytes = col->m_attrSize * col->m_arraySize;
+ if (len != 0 && len != sizeInBytes)
+ {
+ setErrorCodeAbort(4209);
+ return -1;
+ }
+ len = sizeInBytes;
}
- len = sizeInBytes;
}
if (insertATTRINFO(Interpreter::BranchCol(c, 0, 0, false)) == -1)
diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp
index 86a777e79d2..5e5306fc33a 100644
--- a/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -139,8 +139,9 @@ NdbRecAttr::receive_data(const Uint32 * data, Uint32 sz){
static void
ndbrecattr_print_string(NdbOut& out, const char *type,
- const char *ref, unsigned sz)
+ const char *aref, unsigned sz)
{
+ const unsigned char* ref = (const unsigned char*)aref;
int i, len, printable= 1;
// trailing zeroes are not printed
for (i=sz-1; i >= 0; i--)
@@ -166,7 +167,7 @@ ndbrecattr_print_string(NdbOut& out, const char *type,
for (i= len+1; ref[i] != 0; i++)
out.print("%u]",len-i);
assert((int)sz > i);
- ndbrecattr_print_string(out,type,ref+i,sz-i);
+ ndbrecattr_print_string(out,type,aref+i,sz-i);
}
}