[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.17.10
+ Version 2.17.12
(C)opyright 2006,2007,2008,2009,2010,2011,2012,2013 by Bjoern Lemke
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/samples/chkdb/x.sql
^
|
@@ -1,14 +1,15 @@
drop if exists table t1;
-create table t1 ( a int not null, b int not null, c string(30) not null);
-create primary index on t1(a,b,c);
+create table t1 ( a int not null, b int not null);
+create primary index on t1(a,b);
-insert into t1 values ( 1, 1, 'ALPHA');
-insert into t1 values ( 1, 2, 'ALPHA');
-insert into t1 values ( 2, 1, 'BETA');
-insert into t1 values ( 2, 1, 'ALPGA');
-insert into t1 values ( 1, 3, 'ALPHA');
-insert into t1 values ( 2, 2, 'BETA');
-insert into t1 values ( 1, 4, 'BETA');
-insert into t1 values ( 1, 5, 'ALPHA');
+insert into t1 values ( 1, 1);
+insert into t1 values ( 1, 2);
+insert into t1 values ( 2, 1);
+insert into t1 values ( 2, 2);
+insert into t1 values ( 1, 3);
+insert into t1 values ( 2, 3);
+insert into t1 values ( 1, 4);
+insert into t1 values ( 1, 5);
-select * from t1 where a = 1 and c = 'ALPHA';
\ No newline at end of file
+-- plan select * from t1 where a = 1 and b != 2;
+select * from t1 where a = 1 and b != 2;
\ No newline at end of file
|
[-]
[+]
|
Added |
cego-2.17.12.tar.bz2/src/.#CegoAVLIndexCursor.cc
^
|
+(symlink to lemke@bigmac.local.59133)
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoAVLIndexCursor.cc
^
|
@@ -547,8 +547,7 @@
break;
}
case LESS_THAN:
- {
-
+ {
switch (comp)
{
case LESS_THAN:
|
[-]
[+]
|
Added |
cego-2.17.12.tar.bz2/src/CegoAVLIndexCursor.cc.new
^
|
@@ -0,0 +1,755 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// CegoAVLIndexCursor.cc
+// ------------------
+// Cego index cursor class implementation
+//
+// Design and Implementation by Bjoern Lemke
+//
+// (C)opyright 2000-2013 Bjoern Lemke
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// IMPLEMENTATION MODULE
+//
+// Class: CegoAVLIndexCursor
+//
+// Description: Index cursors are used for reading tables based on an available index
+// for the given attribute condition
+//
+// Status: QG-2.13
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// cego includes
+#include "CegoAVLIndexCursor.h"
+#include "CegoTupleState.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+CegoAVLIndexCursor::CegoAVLIndexCursor()
+{
+}
+
+CegoAVLIndexCursor::CegoAVLIndexCursor(CegoTableManager *pTM, int tabSetId, const Chain& indexName, CegoObject::ObjectType type, CegoAttrCond* pAttrCond, bool ignoreTouched, bool readUncommitted)
+{
+ _pTM = pTM;
+ _indexName = indexName;
+ _type = type;
+ _pAttrCond = pAttrCond;
+
+ _lockId = 0;
+ _rdpLockId = 0;
+ _dataLock = 0;
+
+ _tabSetId = tabSetId;
+ _ignoreTouched = ignoreTouched;
+ _readUncommitted = readUncommitted;
+ _cursorCached = false;
+}
+
+CegoAVLIndexCursor::~CegoAVLIndexCursor()
+{
+ abort();
+
+ if (_rdpLockId)
+ {
+ _pTM->releaseDataPtr(_rdpLockId, false);
+ _rdpLockId = 0;
+ }
+}
+
+bool CegoAVLIndexCursor::getFirst(ListT<CegoField>& fl, CegoDataPointer& dp)
+{
+
+ if ( fl.isEmpty() )
+ {
+ throw Exception(EXLOC, "Empty field list");
+ }
+
+ if ( _cursorCached == false )
+ {
+ CegoTableObject ioe;
+
+ _pTM->getObject(_tabSetId, _indexName, _type, ioe);
+
+ _idxSchema = ioe.getSchema();
+
+ Chain tabName = ioe.getTabName();
+
+ CegoObjectCursor* pC = _pTM->getObjectCursor(_tabSetId, tabName, _indexName, _type);
+
+ _cachedPointer = (char*)pC->getFirst(_cachedLen, _rdp);
+ pC->abort();
+ delete pC;
+
+ _rdpLockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _rdp, _cachedPointer, _cachedLen);
+
+ _cursorCached = true;
+
+ }
+
+ // get root entry
+ int len = _cachedLen;
+ char* p = _cachedPointer;
+
+ if ( p == 0 )
+ {
+ _eoc = true;
+ return false;
+ }
+
+ _ie.setPtr(p, len);
+
+ _idp = _ie.getRightBranch();
+
+ CegoDataPointer nil;
+ if (_idp == nil)
+ {
+ _eoc = true;
+ return false;
+ }
+
+ _eoc = false;
+
+ _rootPassed = false;
+
+ bool found = false;
+
+
+ // go to the beginning
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+ _idp = _ie.getLeftBranch();
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+ _ie.setPtr(p, len);
+ }
+
+ if (_pAttrCond)
+ {
+
+ if ( _pAttrCond->getPrimaryCompMode() == CegoAttrComp::BTWN )
+ _pAttrCond->setPrimaryComparison( MORE_EQUAL_THAN );
+
+ switch ( _pAttrCond->getPrimaryComparison() )
+ {
+ case NOT_EQUAL:
+ case LESS_THAN:
+ case LESS_EQUAL_THAN:
+
+ {
+ // go to the beginning
+
+ CegoComparison comp = compValue(_ie.getIdxPtr());
+
+ if ( comp == LESS_THAN
+ || ( comp == EQUAL && _pAttrCond->getPrimaryComparison() == LESS_EQUAL_THAN )
+ || ( comp != EQUAL && _pAttrCond->getPrimaryComparison() == NOT_EQUAL ) )
+ {
+ found = true;
+ }
+ else if ( _pAttrCond->getPrimaryComparison() == NOT_EQUAL )
+ {
+ return getNext(fl, dp);
+ }
+
+ break;
+ }
+ case MORE_THAN:
+ {
+
+ // go to the smallest leaf
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( ! found )
+ {
+
+ CegoDataPointer idp;
+
+ CegoComparison comp = compValue( _ie.getIdxPtr());
+
+ if ( comp == LESS_THAN || comp == EQUAL )
+ {
+ idp = _ie.getRightBranch();
+
+ if (_ie.getParent() == _rdp )
+ {
+ _rootPassed = true;
+ }
+
+ }
+ else if ( comp == MORE_THAN )
+ {
+ idp = _ie.getLeftBranch();
+
+ if ( idp == nil )
+ found = true;
+ }
+ else
+ {
+ return getNext(fl, dp);
+ }
+
+
+ if ( idp == nil && ! found )
+ {
+ return getNext(fl, dp);
+ }
+ else if ( ! found )
+ {
+ _idp = idp;
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, idp, p, len);
+ _ie.setPtr(p, len);
+ }
+ }
+ break;
+ }
+ case EQUAL:
+ case MORE_EQUAL_THAN:
+ {
+
+ // go to the smallest leaf
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( ! found )
+ {
+
+ CegoDataPointer idp = _idp;
+
+ CegoComparison comp = compValue(_ie.getIdxPtr());
+
+ if ( comp == LESS_THAN )
+ {
+ idp = _ie.getRightBranch();
+
+ if (_ie.getParent() == _rdp )
+ {
+ _rootPassed = true;
+ }
+ }
+ else if ( comp == EQUAL )
+ {
+ idp = _ie.getLeftBranch();
+
+ if ( idp == nil )
+ found = true;
+ }
+ else if ( comp == MORE_THAN )
+ {
+ idp = _ie.getLeftBranch();
+ }
+
+ if ( idp == nil && ! found )
+ {
+ return getNext(fl, dp);
+ }
+ else if ( ! found )
+ {
+ _idp = idp;
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, idp, p, len);
+ _ie.setPtr(p, len);
+
+ }
+ }
+ break;
+ }
+
+ }
+ }
+ else
+ {
+ found = true;
+ }
+
+ if (found )
+ {
+
+ char* p;
+ int len;
+
+ dp = _ie.getData();
+
+
+ if (_dataLock)
+ {
+ _pTM->releaseDataPtr(_dataLock, false);
+ _dataLock = 0;
+ }
+
+ _dataLock = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len);
+
+ // skipping tid
+
+ int tid;
+ int tastep;
+ CegoTupleState ts;
+
+ memcpy(&tid, p, sizeof(int));
+
+ char* ptastep = p + sizeof(int);
+ memcpy(&tastep, ptastep, sizeof(int));
+
+ char* pts = p + sizeof(int) + sizeof(int);
+ memcpy(&ts, pts, sizeof(CegoTupleState));
+
+ if (tid != 0)
+ {
+ if ( _ignoreTouched )
+ {
+ if ( ts == INSERTED
+ && tid == _pTM->getTID(_tabSetId)
+ && tastep < _pTM->getTAStep(_tabSetId) )
+ {
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ return getNext(fl,dp);
+ }
+ }
+ else
+ {
+
+ if ( ( _readUncommitted == true
+ && ts == INSERTED )
+ || ( _readUncommitted == false
+ && (( ts == INSERTED && tid == _pTM->getTID(_tabSetId))
+ || ( ts == DELETED && tid != _pTM->getTID(_tabSetId)))))
+ {
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ return getNext(fl,dp);
+ }
+ }
+ }
+ else
+ {
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CegoAVLIndexCursor::getNext(ListT<CegoField>& fl, CegoDataPointer& dp)
+{
+
+ if ( _eoc )
+ return false;
+
+ if ( fl.isEmpty() )
+ {
+ throw Exception(EXLOC, "Empty field list");
+ }
+
+ do {
+
+ CegoDataPointer nil;
+
+ char* p;
+ int len;
+
+ int tid;
+
+ bool rbFound=false;
+ bool nativeFound=false;
+
+ bool attrMatch = false;
+
+ if (_ie.getParent() == _rdp )
+ {
+ _rootPassed = true;
+ }
+
+ if (_ie.getRightBranch() != nil)
+ {
+
+ _idp = _ie.getRightBranch();
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+ _idp = _ie.getLeftBranch();
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+ _ie.setPtr(p, len);
+ }
+ }
+ else
+ {
+ // searching appropriate parent
+
+ if ( _ie.getParent() == _rdp && _rootPassed )
+ {
+ if (_lockId)
+ {
+ _pTM->releaseDataPtr(_lockId, false);
+ _lockId=0;
+ }
+ _eoc = true;
+ return false;
+ }
+
+ CegoDataPointer pdp = _ie.getParent();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, pdp, p, len);
+
+ _ie.setPtr(p, len);
+
+ bool entryFound = false;
+ while ( ! entryFound )
+ {
+
+ if (_ie.getLeftBranch() == _idp)
+ {
+ _idp = pdp;
+ entryFound = true;
+ }
+ else
+ {
+
+ if ( _ie.getParent() == _rdp )
+ {
+ if ( _rootPassed )
+ {
+ abort();
+ _eoc = true;
+ return false;
+ }
+ else
+ {
+
+ _idp = _ie.getRightBranch();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+
+ _idp = _ie.getLeftBranch();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+ }
+ entryFound = true;
+ }
+ }
+ else
+ {
+ _idp = pdp;
+
+ pdp = _ie.getParent();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, pdp, p, len);
+
+ _ie.setPtr(p, len);
+
+ }
+ }
+ }
+ }
+
+ if (_pAttrCond)
+ {
+
+ char *p = _ie.getIdxPtr();
+ CegoComparison comp;
+ comp = compValue(p);
+
+ if ( _pAttrCond->getPrimaryCompMode() == CegoAttrComp::BTWN )
+ {
+ _pAttrCond->setPrimaryComparison(LESS_EQUAL_THAN);
+ }
+
+ switch (_pAttrCond->getPrimaryComparison())
+ {
+
+ case EQUAL:
+ {
+ switch (comp)
+ {
+ case EQUAL:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case NOT_EQUAL:
+ {
+ switch (comp)
+ {
+ case LESS_THAN:
+ attrMatch=true;
+ break;
+ case MORE_THAN:
+ attrMatch=true;
+ break;
+ case EQUAL:
+ return getNext(fl, dp);
+ default:
+ break;
+ }
+ break;
+ }
+ case LESS_THAN:
+ {
+ switch (comp)
+ {
+ case LESS_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case MORE_THAN:
+ {
+ switch (comp)
+ {
+ case MORE_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case LESS_EQUAL_THAN:
+ {
+ switch (comp)
+ {
+ case EQUAL:
+ attrMatch=true;
+ break;
+ case LESS_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+
+ case MORE_EQUAL_THAN:
+ {
+ switch (comp)
+ {
+ case EQUAL:
+ attrMatch=true;
+ break;
+ case MORE_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ attrMatch = true;
+ }
+
+ if ( attrMatch )
+ {
+
+ char* p;
+ int len;
+
+ dp = _ie.getData();
+
+
+ if (_dataLock)
+ {
+ _pTM->releaseDataPtr(_dataLock, false);
+ _dataLock = 0;
+ }
+ _dataLock = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len);
+
+ // skipping tid
+
+ int tid;
+ int tastep;
+ CegoTupleState ts;
+ memcpy(&tid, p, sizeof(int));
+
+ char* ptastep = p + sizeof(int);
+ memcpy(&tastep, ptastep, sizeof(int));
+
+ char* pts = p + sizeof(int) + sizeof(int);
+ memcpy(&ts, pts, sizeof(CegoTupleState));
+
+ if (tid != 0)
+ {
+ if ( _ignoreTouched == true )
+ {
+ if ( ts == INSERTED
+ && tid == _pTM->getTID(_tabSetId)
+ && tastep < _pTM->getTAStep(_tabSetId) )
+ {
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ // ignore entry
+ }
+ }
+ else
+ {
+
+ if ( ( _readUncommitted == true
+ && ts == INSERTED )
+ || ( _readUncommitted == false
+ && (( ts == INSERTED && tid == _pTM->getTID(_tabSetId))
+ || ( ts == DELETED && tid != _pTM->getTID(_tabSetId)))))
+ {
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ // ignore entry
+ }
+ }
+ }
+ else
+ {
+
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ }
+ else
+ {
+ abort();
+ _eoc = true;
+ return false;
+ }
+ } while (1);
+}
+
+void CegoAVLIndexCursor::abort()
+{
+ if (_lockId)
+ {
+ _pTM->releaseDataPtr(_lockId, false);
+ _lockId = 0;
+ }
+
+ if (_dataLock)
+ {
+ _pTM->releaseDataPtr(_dataLock, false);
+ _dataLock = 0;
+ }
+
+
+}
+
+void CegoAVLIndexCursor::reset()
+{
+ abort();
+}
+
+CegoComparison CegoAVLIndexCursor::compValue(char* idxVal)
+{
+
+ CegoField* pF = _idxSchema.First();
+
+ while ( pF )
+ {
+
+ int flen;
+ memcpy(&flen, idxVal, sizeof(int));
+
+ idxVal += sizeof(int);
+
+ CegoFieldValue fv;
+ fv.setLength(flen);
+ fv.setValue(idxVal);
+ if ( flen > 0 )
+ fv.setType(pF->getType());
+
+ CegoAttrComp* pAC = _pAttrCond->getAttrCompSet().First();
+
+ while ( pAC )
+ {
+ if ( (Chain)pAC->getAttrName() == (Chain)pF->getAttrName() )
+ {
+ if ( fv < pAC->getFieldValue() )
+ {
+ return LESS_THAN;
+ }
+
+ if ( pAC->getCompMode() == CegoAttrComp::VAL
+ || pAC->getCompMode() == CegoAttrComp::ATTR )
+ {
+ if ( fv > pAC->getFieldValue() )
+ {
+ return MORE_THAN;
+ }
+ }
+ else if ( pAC->getCompMode() == CegoAttrComp::BTWN )
+ {
+ if ( fv > pAC->getFieldValue2() )
+ {
+ return MORE_THAN;
+ }
+ }
+ }
+ pAC = _pAttrCond->getAttrCompSet().Next();
+ }
+
+ idxVal += flen;
+
+ pF = _idxSchema.Next();
+
+ }
+
+ return EQUAL;
+
+}
+
|
[-]
[+]
|
Added |
cego-2.17.12.tar.bz2/src/CegoAVLIndexCursor.cc.save
^
|
@@ -0,0 +1,773 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// CegoAVLIndexCursor.cc
+// ------------------
+// Cego index cursor class implementation
+//
+// Design and Implementation by Bjoern Lemke
+//
+// (C)opyright 2000-2013 Bjoern Lemke
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// IMPLEMENTATION MODULE
+//
+// Class: CegoAVLIndexCursor
+//
+// Description: Index cursors are used for reading tables based on an available index
+// for the given attribute condition
+//
+// Status: QG-2.13
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// cego includes
+#include "CegoAVLIndexCursor.h"
+#include "CegoTupleState.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+CegoAVLIndexCursor::CegoAVLIndexCursor()
+{
+}
+
+CegoAVLIndexCursor::CegoAVLIndexCursor(CegoTableManager *pTM, int tabSetId, const Chain& indexName, CegoObject::ObjectType type, CegoAttrCond* pAttrCond, bool ignoreTouched, bool readUncommitted)
+{
+ _pTM = pTM;
+ _indexName = indexName;
+ _type = type;
+ _pAttrCond = pAttrCond;
+
+ _lockId = 0;
+ _rdpLockId = 0;
+ _dataLock = 0;
+
+ _tabSetId = tabSetId;
+ _ignoreTouched = ignoreTouched;
+ _readUncommitted = readUncommitted;
+ _cursorCached = false;
+}
+
+CegoAVLIndexCursor::~CegoAVLIndexCursor()
+{
+ abort();
+
+ if (_rdpLockId)
+ {
+ _pTM->releaseDataPtr(_rdpLockId, false);
+ _rdpLockId = 0;
+ }
+}
+
+bool CegoAVLIndexCursor::getFirst(ListT<CegoField>& fl, CegoDataPointer& dp)
+{
+
+ if ( fl.isEmpty() )
+ {
+ throw Exception(EXLOC, "Empty field list");
+ }
+
+ if ( _cursorCached == false )
+ {
+ CegoTableObject ioe;
+
+ _pTM->getObject(_tabSetId, _indexName, _type, ioe);
+
+ _idxSchema = ioe.getSchema();
+
+ Chain tabName = ioe.getTabName();
+
+ CegoObjectCursor* pC = _pTM->getObjectCursor(_tabSetId, tabName, _indexName, _type);
+
+ _cachedPointer = (char*)pC->getFirst(_cachedLen, _rdp);
+ pC->abort();
+ delete pC;
+
+ _rdpLockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _rdp, _cachedPointer, _cachedLen);
+
+ _cursorCached = true;
+
+ }
+
+ // get root entry
+ int len = _cachedLen;
+ char* p = _cachedPointer;
+
+ if ( p == 0 )
+ {
+ _eoc = true;
+ return false;
+ }
+
+ _ie.setPtr(p, len);
+
+ _idp = _ie.getRightBranch();
+
+ CegoDataPointer nil;
+ if (_idp == nil)
+ {
+ _eoc = true;
+ return false;
+ }
+
+ _eoc = false;
+
+ _rootPassed = false;
+
+ bool found = false;
+
+ if (_pAttrCond)
+ {
+
+ if ( _pAttrCond->getPrimaryCompMode() == CegoAttrComp::BTWN )
+ _pAttrCond->setPrimaryComparison( MORE_EQUAL_THAN );
+
+ switch ( _pAttrCond->getPrimaryComparison() )
+ {
+ case NOT_EQUAL:
+ case LESS_THAN:
+ case LESS_EQUAL_THAN:
+
+ {
+ // go to the beginning
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+
+ // Traversing to left
+ _idp = _ie.getLeftBranch();
+
+ _pTM->releaseDataPtr(_lockId, false);
+ _lockId = 0;
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+ }
+
+ CegoComparison comp = compValue(_ie.getIdxPtr());
+
+ if ( comp == LESS_THAN
+ || ( comp == EQUAL && _pAttrCond->getPrimaryComparison() == LESS_EQUAL_THAN )
+ || ( comp != EQUAL && _pAttrCond->getPrimaryComparison() == NOT_EQUAL ) )
+ {
+ found = true;
+ }
+ else if ( _pAttrCond->getPrimaryComparison() == NOT_EQUAL )
+ {
+ return getNext(fl, dp);
+ }
+
+ break;
+ }
+ case MORE_THAN:
+ {
+
+ // go to the smallest leaf
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( ! found )
+ {
+
+ CegoDataPointer idp;
+
+ CegoComparison comp = compValue( _ie.getIdxPtr());
+
+ if ( comp == LESS_THAN || comp == EQUAL )
+ {
+ idp = _ie.getRightBranch();
+
+ if (_ie.getParent() == _rdp )
+ {
+ _rootPassed = true;
+ }
+
+ }
+ else if ( comp == MORE_THAN )
+ {
+ idp = _ie.getLeftBranch();
+
+ if ( idp == nil )
+ found = true;
+ }
+ else
+ {
+ return getNext(fl, dp);
+ }
+
+
+ if ( idp == nil && ! found )
+ {
+ return getNext(fl, dp);
+ }
+ else if ( ! found )
+ {
+ _idp = idp;
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, idp, p, len);
+ _ie.setPtr(p, len);
+ }
+ }
+ break;
+ }
+ case EQUAL:
+ case MORE_EQUAL_THAN:
+ {
+
+ // go to the smallest leaf
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( ! found )
+ {
+
+ CegoDataPointer idp = _idp;
+
+ CegoComparison comp = compValue(_ie.getIdxPtr());
+
+ if ( comp == LESS_THAN )
+ {
+ idp = _ie.getRightBranch();
+
+ if (_ie.getParent() == _rdp )
+ {
+ _rootPassed = true;
+ }
+ }
+ else if ( comp == EQUAL )
+ {
+ idp = _ie.getLeftBranch();
+
+ if ( idp == nil )
+ found = true;
+ }
+ else if ( comp == MORE_THAN )
+ {
+ idp = _ie.getLeftBranch();
+ }
+
+ if ( idp == nil && ! found )
+ {
+ return getNext(fl, dp);
+ }
+ else if ( ! found )
+ {
+ _idp = idp;
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, idp, p, len);
+ _ie.setPtr(p, len);
+
+ }
+ }
+ break;
+ }
+
+ }
+ }
+ else
+ {
+ // go to the beginning
+
+ _lockId = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+ _idp = _ie.getLeftBranch();
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+ _ie.setPtr(p, len);
+ }
+
+ found = true;
+ }
+
+
+ if (found )
+ {
+
+ char* p;
+ int len;
+
+ dp = _ie.getData();
+
+
+ if (_dataLock)
+ {
+ _pTM->releaseDataPtr(_dataLock, false);
+ _dataLock = 0;
+ }
+
+ _dataLock = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len);
+
+ // skipping tid
+
+ int tid;
+ int tastep;
+ CegoTupleState ts;
+
+ memcpy(&tid, p, sizeof(int));
+
+ char* ptastep = p + sizeof(int);
+ memcpy(&tastep, ptastep, sizeof(int));
+
+ char* pts = p + sizeof(int) + sizeof(int);
+ memcpy(&ts, pts, sizeof(CegoTupleState));
+
+ if (tid != 0)
+ {
+ if ( _ignoreTouched )
+ {
+ if ( ts == INSERTED
+ && tid == _pTM->getTID(_tabSetId)
+ && tastep < _pTM->getTAStep(_tabSetId) )
+ {
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ return getNext(fl,dp);
+ }
+ }
+ else
+ {
+
+ if ( ( _readUncommitted == true
+ && ts == INSERTED )
+ || ( _readUncommitted == false
+ && (( ts == INSERTED && tid == _pTM->getTID(_tabSetId))
+ || ( ts == DELETED && tid != _pTM->getTID(_tabSetId)))))
+ {
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ return getNext(fl,dp);
+ }
+ }
+ }
+ else
+ {
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CegoAVLIndexCursor::getNext(ListT<CegoField>& fl, CegoDataPointer& dp)
+{
+
+ if ( _eoc )
+ return false;
+
+ if ( fl.isEmpty() )
+ {
+ throw Exception(EXLOC, "Empty field list");
+ }
+
+ do {
+
+ CegoDataPointer nil;
+
+ char* p;
+ int len;
+
+ int tid;
+
+ bool rbFound=false;
+ bool nativeFound=false;
+
+ bool attrMatch = false;
+
+ if (_ie.getParent() == _rdp )
+ {
+ _rootPassed = true;
+ }
+
+ if (_ie.getRightBranch() != nil)
+ {
+
+ _idp = _ie.getRightBranch();
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+ _idp = _ie.getLeftBranch();
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+ _ie.setPtr(p, len);
+ }
+ }
+ else
+ {
+ // searching appropriate parent
+
+ if ( _ie.getParent() == _rdp && _rootPassed )
+ {
+ if (_lockId)
+ {
+ _pTM->releaseDataPtr(_lockId, false);
+ _lockId=0;
+ }
+ _eoc = true;
+ return false;
+ }
+
+ CegoDataPointer pdp = _ie.getParent();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, pdp, p, len);
+
+ _ie.setPtr(p, len);
+
+ bool entryFound = false;
+ while ( ! entryFound )
+ {
+
+ if (_ie.getLeftBranch() == _idp)
+ {
+ _idp = pdp;
+ entryFound = true;
+ }
+ else
+ {
+
+ if ( _ie.getParent() == _rdp )
+ {
+ if ( _rootPassed )
+ {
+ abort();
+ _eoc = true;
+ return false;
+ }
+ else
+ {
+
+ _idp = _ie.getRightBranch();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+
+ while ( _ie.getLeftBranch() != nil)
+ {
+
+ _idp = _ie.getLeftBranch();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, _idp, p, len);
+
+ _ie.setPtr(p, len);
+ }
+ entryFound = true;
+ }
+ }
+ else
+ {
+ _idp = pdp;
+
+ pdp = _ie.getParent();
+
+ _lockId = _pTM->releaseAndClaimDataPtr(_lockId, false, _tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, pdp, p, len);
+
+ _ie.setPtr(p, len);
+
+ }
+ }
+ }
+ }
+
+ if (_pAttrCond)
+ {
+
+ char *p = _ie.getIdxPtr();
+ CegoComparison comp;
+ comp = compValue(p);
+
+ if ( _pAttrCond->getPrimaryCompMode() == CegoAttrComp::BTWN )
+ {
+ _pAttrCond->setPrimaryComparison(LESS_EQUAL_THAN);
+ }
+
+ switch (_pAttrCond->getPrimaryComparison())
+ {
+
+ case EQUAL:
+ {
+ switch (comp)
+ {
+ case EQUAL:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case NOT_EQUAL:
+ {
+ switch (comp)
+ {
+ case LESS_THAN:
+ attrMatch=true;
+ break;
+ case MORE_THAN:
+ attrMatch=true;
+ break;
+ case EQUAL:
+ return getNext(fl, dp);
+ default:
+ break;
+ }
+ break;
+ }
+ case LESS_THAN:
+ {
+ switch (comp)
+ {
+ case LESS_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case MORE_THAN:
+ {
+ switch (comp)
+ {
+ case MORE_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case LESS_EQUAL_THAN:
+ {
+ switch (comp)
+ {
+ case EQUAL:
+ attrMatch=true;
+ break;
+ case LESS_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+
+ case MORE_EQUAL_THAN:
+ {
+ switch (comp)
+ {
+ case EQUAL:
+ attrMatch=true;
+ break;
+ case MORE_THAN:
+ attrMatch=true;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ attrMatch = true;
+ }
+
+ if ( attrMatch )
+ {
+
+ char* p;
+ int len;
+
+ dp = _ie.getData();
+
+
+ if (_dataLock)
+ {
+ _pTM->releaseDataPtr(_dataLock, false);
+ _dataLock = 0;
+ }
+ _dataLock = _pTM->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len);
+
+ // skipping tid
+
+ int tid;
+ int tastep;
+ CegoTupleState ts;
+ memcpy(&tid, p, sizeof(int));
+
+ char* ptastep = p + sizeof(int);
+ memcpy(&tastep, ptastep, sizeof(int));
+
+ char* pts = p + sizeof(int) + sizeof(int);
+ memcpy(&ts, pts, sizeof(CegoTupleState));
+
+ if (tid != 0)
+ {
+ if ( _ignoreTouched == true )
+ {
+ if ( ts == INSERTED
+ && tid == _pTM->getTID(_tabSetId)
+ && tastep < _pTM->getTAStep(_tabSetId) )
+ {
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ // ignore entry
+ }
+ }
+ else
+ {
+
+ if ( ( _readUncommitted == true
+ && ts == INSERTED )
+ || ( _readUncommitted == false
+ && (( ts == INSERTED && tid == _pTM->getTID(_tabSetId))
+ || ( ts == DELETED && tid != _pTM->getTID(_tabSetId)))))
+ {
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ else
+ {
+ // ignore entry
+ }
+ }
+ }
+ else
+ {
+
+ CegoTupleState ts;
+ _qh.decodeFVL(fl, p, len, tid, tastep, ts);
+ return true;
+ }
+ }
+ else
+ {
+ abort();
+ _eoc = true;
+ return false;
+ }
+ } while (1);
+}
+
+void CegoAVLIndexCursor::abort()
+{
+ if (_lockId)
+ {
+ _pTM->releaseDataPtr(_lockId, false);
+ _lockId = 0;
+ }
+
+ if (_dataLock)
+ {
+ _pTM->releaseDataPtr(_dataLock, false);
+ _dataLock = 0;
+ }
+
+
+}
+
+void CegoAVLIndexCursor::reset()
+{
+ abort();
+}
+
+CegoComparison CegoAVLIndexCursor::compValue(char* idxVal)
+{
+
+ CegoField* pF = _idxSchema.First();
+
+ while ( pF )
+ {
+
+ int flen;
+ memcpy(&flen, idxVal, sizeof(int));
+
+ idxVal += sizeof(int);
+
+ CegoFieldValue fv;
+ fv.setLength(flen);
+ fv.setValue(idxVal);
+ if ( flen > 0 )
+ fv.setType(pF->getType());
+
+ CegoAttrComp* pAC = _pAttrCond->getAttrCompSet().First();
+
+ while ( pAC )
+ {
+ if ( (Chain)pAC->getAttrName() == (Chain)pF->getAttrName() )
+ {
+ if ( fv < pAC->getFieldValue() )
+ {
+ return LESS_THAN;
+ }
+
+ if ( pAC->getCompMode() == CegoAttrComp::VAL
+ || pAC->getCompMode() == CegoAttrComp::ATTR )
+ {
+ if ( fv > pAC->getFieldValue() )
+ {
+ return MORE_THAN;
+ }
+ }
+ else if ( pAC->getCompMode() == CegoAttrComp::BTWN )
+ {
+ if ( fv > pAC->getFieldValue2() )
+ {
+ return MORE_THAN;
+ }
+ }
+ }
+ pAC = _pAttrCond->getAttrCompSet().Next();
+ }
+
+ idxVal += flen;
+
+ pF = _idxSchema.Next();
+
+ }
+
+ return EQUAL;
+
+}
+
|
[-]
[+]
|
Added |
cego-2.17.12.tar.bz2/src/CegoAVLIndexCursor.h.save
^
|
@@ -0,0 +1,105 @@
+#ifndef _CEGOAVLINDEXCURSOR_H_INCLUDED_
+#define _CEGOAVLINDEXCURSOR_H_INCLUDED_
+///////////////////////////////////////////////////////////////////////////////
+//
+// CegoAVLIndexCursor.h
+// -----------------
+// Cego AVL index cursor class definition
+//
+// Design and Implementation by Bjoern Lemke
+//
+// (C)opyright 2000-2013 Bjoern Lemke
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// INTERFACE MODULE
+//
+// Class: CegoAVLIndexCursor
+//
+// Description: Traversing through index
+//
+// Status: QG-2.13
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// base includes
+#include <lfc/Chain.h>
+#include <lfc/ListT.h>
+
+// cego includes
+#include "CegoObject.h"
+#include "CegoField.h"
+#include "CegoAttrCond.h"
+#include "CegoDataPointer.h"
+#include "CegoTableManager.h"
+#include "CegoQueryHelper.h"
+#include "CegoAVLIndexEntry.h"
+
+class CegoAVLIndexCursor {
+
+public:
+
+ CegoAVLIndexCursor();
+ CegoAVLIndexCursor(CegoTableManager* pTM, int tabSetId, const Chain& indexName, CegoObject::ObjectType type, CegoAttrCond* pAttrCond, bool ignoreTouched, bool readUncommitted);
+ ~CegoAVLIndexCursor();
+
+ bool getFirst(ListT<CegoField>& fl, CegoDataPointer& dp);
+ bool getNext(ListT<CegoField>& fl, CegoDataPointer& dp);
+
+ void reset();
+ void abort();
+
+private:
+
+ CegoComparison compValue(char* idxVal);
+
+ CegoAttrCond* _pAttrCond;
+
+ CegoTableManager* _pTM;
+ CegoAVLIndexEntry _ie;
+ CegoDataPointer _rdp;
+ CegoDataPointer _idp;
+
+ Chain _indexName;
+ CegoObject::ObjectType _type;
+ bool _rootPassed;
+
+ unsigned long _rdpLockId;
+ unsigned long _lockId;
+ unsigned long _dataLock;
+
+ int _tabSetId;
+
+ bool _ignoreTouched;
+ bool _readUncommitted;
+
+ CegoQueryHelper _qh;
+
+ bool _cursorCached;
+ bool _eoc;
+
+ int _cachedLen;
+ char* _cachedPointer;
+
+ CegoDataType _dt;
+ ListT<CegoField> _idxSchema;
+};
+
+#endif
+
+
+
+
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoAttrCond.cc
^
|
@@ -87,13 +87,12 @@
return _attrCompSet;
}
-CegoAttrCond CegoAttrCond::getFilterCond(const ListT<CegoField>& fl, bool allowLeak) const
+CegoAttrCond CegoAttrCond::getFilterCond(const ListT<CegoField>& fl) const
{
CegoAttrCond ac;
- bool goOn=true;
CegoField *pF = fl.First();
- while ( pF && goOn)
+ while ( pF)
{
bool attrFound=false;
CegoAttrComp *pAC = _attrCompSet.First();
@@ -102,12 +101,43 @@
if ( pF->getAttrName() == pAC->getAttrName() )
{
ac.add(*pAC);
- attrFound=true;
}
pAC = _attrCompSet.Next();
}
- if ( attrFound || allowLeak)
+ pF = fl.Next();
+ }
+ return ac;
+}
+
+CegoAttrCond CegoAttrCond::getIndexCond(const ListT<CegoField>& fl) const
+{
+ CegoAttrCond ac;
+
+ bool isPrimary=true;
+ bool goOn=true;
+ CegoField *pF = fl.First();
+ while ( pF && goOn )
+ {
+ bool attrFound=false;
+ CegoAttrComp *pAC = _attrCompSet.First();
+ while ( pAC )
+ {
+
+ if ( pF->getAttrName() == pAC->getAttrName() )
+ {
+ if ( isPrimary || pAC->getComparison() == EQUAL )
+ {
+ ac.add(*pAC);
+ attrFound=true;
+ }
+ }
+ pAC = _attrCompSet.Next();
+ }
+
+ isPrimary = false;
+
+ if ( attrFound )
pF = fl.Next();
else
goOn=false;
@@ -116,6 +146,7 @@
return ac;
}
+
bool CegoAttrCond::setup(const ListT<CegoField>& fl)
{
CegoAttrComp *pAC = _attrCompSet.First();
@@ -213,8 +244,12 @@
{
int numFound=0;
+
+ bool isPrimary = true;
bool hasLeak=false;
CegoField *pF = schema.First();
+
+
while ( pF && hasLeak == false )
{
bool isFound=false;
@@ -224,7 +259,8 @@
if ( pComp->getAttrName() == pF->getAttrName()
&& ( pComp->getCompMode() == CegoAttrComp::VAL
|| pComp->getCompMode() == CegoAttrComp::ATTR
- || pComp->getCompMode() == CegoAttrComp::BTWN ) )
+ || pComp->getCompMode() == CegoAttrComp::BTWN )
+ && ( isPrimary || pComp->getComparison() == EQUAL ) )
{
numFound++;
@@ -236,7 +272,9 @@
pComp = _attrCompSet.Next();
}
}
-
+
+ isPrimary = false;
+
if ( isFound == true )
hasLeak=false;
else
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoAttrCond.h
^
|
@@ -61,7 +61,8 @@
bool setup(const ListT<CegoField>& fl);
bool setup(ListT<CegoField>* joinBuf, int offset, int size);
- CegoAttrCond getFilterCond(const ListT<CegoField>& fl, bool allowLeak) const;
+ CegoAttrCond getFilterCond(const ListT<CegoField>& fl) const;
+ CegoAttrCond getIndexCond(const ListT<CegoField>& fl) const;
IndexMatch checkIndex(const ListT<CegoField>& schema) const;
void setIdxSchema(ListT<CegoField>& schema);
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoBTreeCursor.cc
^
|
@@ -34,8 +34,8 @@
//
///////////////////////////////////////////////////////////////////////////////
-// #include <string.h>
-// #include <stdlib.h>
+#include <string.h>
+#include <stdlib.h>
// cego includes
#include "CegoBTreeCursor.h"
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoDefs.h
^
|
@@ -40,7 +40,7 @@
#endif
#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.17.10"
+#define CEGO_VERSION "2.17.12"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2013 by Bjoern Lemke. All rights reserved"
#define CGEXESHELLVARNAME "CGEXESHELL"
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoDistCursor.cc
^
|
@@ -1080,8 +1080,8 @@
outerSchema = pJO->getLeftObject()->getSchema();
innerSchema = pJO->getRightObject()->getSchema();
- _cursorCond = attrCond.getFilterCond(outerSchema, true);
- addInnerCond = attrCond.getFilterCond(innerSchema, true);
+ _cursorCond = attrCond.getFilterCond(outerSchema);
+ addInnerCond = attrCond.getFilterCond(innerSchema);
}
else if ( pJO->getJoinType() == CegoJoinObject::RIGHTOUTER )
@@ -1089,8 +1089,8 @@
innerSchema = pJO->getLeftObject()->getSchema();
outerSchema = pJO->getRightObject()->getSchema();
- _cursorCond = attrCond.getFilterCond(outerSchema, true);
- addInnerCond = attrCond.getFilterCond(innerSchema, true);
+ _cursorCond = attrCond.getFilterCond(outerSchema);
+ addInnerCond = attrCond.getFilterCond(innerSchema);
}
CegoAttrCond ac;
|
[-]
[+]
|
Changed |
cego-2.17.12.tar.bz2/src/CegoTableCursor.cc
^
|
@@ -83,7 +83,7 @@
}
}
-CegoAttrCond::IndexMatch CegoTableCursor::setup( const CegoAttrCond& attrCond)
+CegoAttrCond::IndexMatch CegoTableCursor::setup( const CegoAttrCond& attrCond )
{
if ( _idxSetup == false || attrCond.diff(_attrCond) == false )
@@ -120,7 +120,7 @@
if ( indexMatch == CegoAttrCond::FULL || indexMatch == CegoAttrCond::PART )
{
- CegoAttrCond checkCond = attrCond.getFilterCond(_pOE->getSchema(), false);
+ CegoAttrCond checkCond = attrCond.getIndexCond(_pOE->getSchema());
if ( checkCond.getStrength() > strength )
{
@@ -177,7 +177,7 @@
if ( indexMatch == CegoAttrCond::FULL || indexMatch == CegoAttrCond::PART )
{
- CegoAttrCond checkCond = attrCond.getFilterCond(_pBTO->getSchema(), false);
+ CegoAttrCond checkCond = attrCond.getIndexCond(_pBTO->getSchema());
if ( checkCond.getStrength() > strength )
{
|