From 10f9c48966d78e161904d3b9dd20ab6805a37071 Mon Sep 17 00:00:00 2001 From: prabatuty Date: Sat, 7 May 2011 18:14:34 +0000 Subject: [PATCH] trie fixes --- src/storage/DatabaseManagerImpl.cxx | 3 ++- src/storage/TrieIndex.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/storage/DatabaseManagerImpl.cxx b/src/storage/DatabaseManagerImpl.cxx index 79b97a59..5bb5751a 100644 --- a/src/storage/DatabaseManagerImpl.cxx +++ b/src/storage/DatabaseManagerImpl.cxx @@ -1485,7 +1485,8 @@ DbRetVal DatabaseManagerImpl::validateIndex(const char *tblName, } } CFIELD* fInfo = (CFIELD*)fptr[0]; - if (fInfo->type_ == typeFloat || fInfo->type_ == typeDouble || fInfo->type_ == typeTimeStamp) + if (!(fInfo->type_ == typeInt || fInfo->type_ == typeLong || fInfo->type_ == typeLongLong || fInfo->type == typeString +|| fInfo->type == typeVarchar)) { printError(ErrBadArg, "Trie Index cannot be created for float or double or timestamp type"); return ErrBadArg; diff --git a/src/storage/TrieIndex.cxx b/src/storage/TrieIndex.cxx index 555c76fe..ad88896f 100644 --- a/src/storage/TrieIndex.cxx +++ b/src/storage/TrieIndex.cxx @@ -35,7 +35,7 @@ char hashString(char value) void TrieIndex::computeHashValues(DataType type, void *key, char *in, int length) { - if (typeInt == type) { + if (typeInt == type ) { int val = *(int*)key; sprintf(in, "%d", val); int i=0; @@ -93,7 +93,7 @@ DbRetVal TrieIndex::insert(TableImpl *tbl, Transaction *tr, void *indexPtr, Inde Chunk *chunk = (Chunk*) iptr->chunkPtr_; ChunkIterator citer = CatalogTableINDEX::getIterator(indexPtr); TrieNode* start = (TrieNode*)citer.nextElement(); - if(start) displayAll(start); + //if(start) displayAll(start); int cnt=0; if (NULL == start) { //first value is inserted into the trie index -- 2.11.4.GIT