Changes of Revision 84
[-] | Changed | cego.changes |
1
2 ------------------------------------------------------------------- 3 +Mon Oct 21 13:02:40 UTC 2013 - cs@linux-administrator.com 4 + 5 +- Update to version 2.19.7 6 + 7 +------------------------------------------------------------------- 8 Fri Sep 6 19:31:26 UTC 2013 - cs@linux-administrator.com 9 10 - Update to version 2.19.6 11 |
||
[-] | Changed | cego.spec ^ |
8 1
2 Name: cego 3 -Version: 2.19.6 4 +Version: 2.19.7 5 Release: 1 6 Group: Productivity/Databases 7 Summary: Cego relational database 8 |
||
[+] | Changed | cego-2.19.7.tar.bz2/TODO ^ |
@@ -17,9 +17,6 @@ - BTree implementation o table correction -o Show information about used orderspace -!!! Duplicate index after crash recovery ( check with ipadb ) -==>> this is caused by missing couter adjustment after tableset restore - \ No newline at end of file + | ||
[+] | Changed | cego-2.19.7.tar.bz2/configure ^ |
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Cego 2.19.6. +# Generated by GNU Autoconf 2.69 for Cego 2.19.7. # # Report bugs to <lemke@lemke-it.com>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='Cego' PACKAGE_TARNAME='cego' -PACKAGE_VERSION='2.19.6' -PACKAGE_STRING='Cego 2.19.6' +PACKAGE_VERSION='2.19.7' +PACKAGE_STRING='Cego 2.19.7' PACKAGE_BUGREPORT='lemke@lemke-it.com' PACKAGE_URL='' @@ -1326,7 +1326,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Cego 2.19.6 to adapt to many kinds of systems. +\`configure' configures Cego 2.19.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1396,7 +1396,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Cego 2.19.6:";; + short | recursive ) echo "Configuration of Cego 2.19.7:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Cego configure 2.19.6 +Cego configure 2.19.7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2051,7 +2051,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Cego $as_me 2.19.6, which was +It was created by Cego $as_me 2.19.7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2914,7 +2914,7 @@ # Define the identity of the package. PACKAGE='cego' - VERSION='2.19.6' + VERSION='2.19.7' cat >>confdefs.h <<_ACEOF @@ -16608,7 +16608,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Cego $as_me 2.19.6, which was +This file was extended by Cego $as_me 2.19.7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16674,7 +16674,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Cego config.status 2.19.6 +Cego config.status 2.19.7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" | ||
[+] | Changed | cego-2.19.7.tar.bz2/configure.ac ^ |
@@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([Cego], [2.19.6], [lemke@lemke-it.com]) +AC_INIT([Cego], [2.19.7], [lemke@lemke-it.com]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) | ||
[+] | Added | cego-2.19.7.tar.bz2/samples/cgplustest/.deps ^ |
+(directory) | ||
[+] | Added | cego-2.19.7.tar.bz2/samples/cgplustest/.deps/CegoCPlusTest.Po ^ |
@@ -0,0 +1 @@ +# dummy | ||
[+] | Changed | cego-2.19.7.tar.bz2/samples/cgplustest/Makefile ^ |
@@ -48,8 +48,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = x86_64-apple-darwin12.4.0 -host_triplet = x86_64-apple-darwin12.4.0 +build_triplet = x86_64-apple-darwin12.5.0 +host_triplet = x86_64-apple-darwin12.5.0 bin_PROGRAMS = cgplustest$(EXEEXT) subdir = samples/cgplustest DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ @@ -136,13 +136,13 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.19.6/missing aclocal-1.13 +ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.19.7/missing aclocal-1.13 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 AR = ar -AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.19.6/missing autoconf -AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.19.6/missing autoheader -AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.19.6/missing automake-1.13 +AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.19.7/missing autoconf +AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.19.7/missing autoheader +AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.19.7/missing automake-1.13 AWK = awk CC = clang CCDEPMODE = depmode=gcc3 @@ -182,7 +182,7 @@ LIPO = lipo LN_S = ln -s LTLIBOBJS = -MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.19.6/missing makeinfo +MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.19.7/missing makeinfo MANIFEST_TOOL = : MKDIR_P = ../.././install-sh -c -d NM = /usr/bin/nm @@ -194,21 +194,21 @@ PACKAGE = cego PACKAGE_BUGREPORT = lemke@lemke-it.com PACKAGE_NAME = Cego -PACKAGE_STRING = Cego 2.19.6 +PACKAGE_STRING = Cego 2.19.7 PACKAGE_TARNAME = cego PACKAGE_URL = -PACKAGE_VERSION = 2.19.6 +PACKAGE_VERSION = 2.19.7 PATH_SEPARATOR = : RANLIB = ranlib SED = /usr/bin/sed SET_MAKE = SHELL = /bin/sh STRIP = strip -VERSION = 2.19.6 -abs_builddir = /Users/lemke/work/cego-2.19.6/samples/cgplustest -abs_srcdir = /Users/lemke/work/cego-2.19.6/samples/cgplustest -abs_top_builddir = /Users/lemke/work/cego-2.19.6 -abs_top_srcdir = /Users/lemke/work/cego-2.19.6 +VERSION = 2.19.7 +abs_builddir = /Users/lemke/work/cego-2.19.7/samples/cgplustest +abs_srcdir = /Users/lemke/work/cego-2.19.7/samples/cgplustest +abs_top_builddir = /Users/lemke/work/cego-2.19.7 +abs_top_srcdir = /Users/lemke/work/cego-2.19.7 ac_ct_AR = ar ac_ct_CC = clang ac_ct_CXX = @@ -219,10 +219,10 @@ am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin -build = x86_64-apple-darwin12.4.0 +build = x86_64-apple-darwin12.5.0 build_alias = build_cpu = x86_64 -build_os = darwin12.4.0 +build_os = darwin12.5.0 build_vendor = apple builddir = . datadir = ${datarootdir} @@ -230,15 +230,15 @@ docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = x86_64-apple-darwin12.4.0 +host = x86_64-apple-darwin12.5.0 host_alias = host_cpu = x86_64 -host_os = darwin12.4.0 +host_os = darwin12.5.0 host_vendor = apple htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /Users/lemke/work/cego-2.19.6/install-sh +install_sh = ${SHELL} /Users/lemke/work/cego-2.19.7/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale | ||
[+] | Added | cego-2.19.7.tar.bz2/samples/cgwraptest/.deps ^ |
+(directory) | ||
[+] | Added | cego-2.19.7.tar.bz2/samples/cgwraptest/.deps/cgwtest.Po ^ |
@@ -0,0 +1 @@ +# dummy | ||
[+] | Changed | cego-2.19.7.tar.bz2/samples/cgwraptest/Makefile ^ |
@@ -48,8 +48,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = x86_64-apple-darwin12.4.0 -host_triplet = x86_64-apple-darwin12.4.0 +build_triplet = x86_64-apple-darwin12.5.0 +host_triplet = x86_64-apple-darwin12.5.0 bin_PROGRAMS = cgwtest$(EXEEXT) subdir = samples/cgwraptest DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ @@ -136,13 +136,13 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.19.6/missing aclocal-1.13 +ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.19.7/missing aclocal-1.13 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 AR = ar -AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.19.6/missing autoconf -AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.19.6/missing autoheader -AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.19.6/missing automake-1.13 +AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.19.7/missing autoconf +AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.19.7/missing autoheader +AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.19.7/missing automake-1.13 AWK = awk CC = clang CCDEPMODE = depmode=gcc3 @@ -182,7 +182,7 @@ LIPO = lipo LN_S = ln -s LTLIBOBJS = -MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.19.6/missing makeinfo +MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.19.7/missing makeinfo MANIFEST_TOOL = : MKDIR_P = ../.././install-sh -c -d NM = /usr/bin/nm @@ -194,21 +194,21 @@ PACKAGE = cego PACKAGE_BUGREPORT = lemke@lemke-it.com PACKAGE_NAME = Cego -PACKAGE_STRING = Cego 2.19.6 +PACKAGE_STRING = Cego 2.19.7 PACKAGE_TARNAME = cego PACKAGE_URL = -PACKAGE_VERSION = 2.19.6 +PACKAGE_VERSION = 2.19.7 PATH_SEPARATOR = : RANLIB = ranlib SED = /usr/bin/sed SET_MAKE = SHELL = /bin/sh STRIP = strip -VERSION = 2.19.6 -abs_builddir = /Users/lemke/work/cego-2.19.6/samples/cgwraptest -abs_srcdir = /Users/lemke/work/cego-2.19.6/samples/cgwraptest -abs_top_builddir = /Users/lemke/work/cego-2.19.6 -abs_top_srcdir = /Users/lemke/work/cego-2.19.6 +VERSION = 2.19.7 +abs_builddir = /Users/lemke/work/cego-2.19.7/samples/cgwraptest +abs_srcdir = /Users/lemke/work/cego-2.19.7/samples/cgwraptest +abs_top_builddir = /Users/lemke/work/cego-2.19.7 +abs_top_srcdir = /Users/lemke/work/cego-2.19.7 ac_ct_AR = ar ac_ct_CC = clang ac_ct_CXX = @@ -219,10 +219,10 @@ am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin -build = x86_64-apple-darwin12.4.0 +build = x86_64-apple-darwin12.5.0 build_alias = build_cpu = x86_64 -build_os = darwin12.4.0 +build_os = darwin12.5.0 build_vendor = apple builddir = . datadir = ${datarootdir} @@ -230,15 +230,15 @@ docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = x86_64-apple-darwin12.4.0 +host = x86_64-apple-darwin12.5.0 host_alias = host_cpu = x86_64 -host_os = darwin12.4.0 +host_os = darwin12.5.0 host_vendor = apple htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /Users/lemke/work/cego-2.19.6/install-sh +install_sh = ${SHELL} /Users/lemke/work/cego-2.19.7/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale | ||
[+] | Changed | cego-2.19.7.tar.bz2/samples/chkdb/chkclt ^ |
@@ -1,2 +1,2 @@ #!/bin/bash -../../src/cgclt --server=localhost --port=2200 --tableset=TS1 --user=lemke/lemke --logfile=clt.log --protocol=serial $@ +../../src/cgclt --server=bigmac.local --port=2200 --tableset=TS1 --user=lemke/lemke --logfile=clt.log --protocol=serial $@ | ||
[+] | Changed | cego-2.19.7.tar.bz2/samples/chkdb/mkdb ^ |
@@ -21,7 +21,7 @@ # PAGESIZE=4096 # PAGESIZE=2048 # PAGESIZE=1024 -DBHOST=localhost +DBHOST=bigmac.local ADMPORT=2000 DBPORT=2200 LOGPORT=3000 | ||
[+] | Added | cego-2.19.7.tar.bz2/samples/chkdb/pid ^ |
@@ -0,0 +1 @@ +36022 \ No newline at end of file | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoBTreeCursor.cc ^ |
@@ -117,7 +117,7 @@ { CegoBufferPage bp; - + _pDBMng->bufferFix(bp, _tabSetId, _curFileId, _curPageId, CegoBufferPool::SYNC, _pTabMng->getLockHandler()); if ( bp.getType() == CegoBufferPage::BTREE_NODE ) @@ -178,9 +178,11 @@ while ( leafFound == false ) { + CegoBufferPage bp; + _pDBMng->bufferFix(bp, _tabSetId, _curFileId, _curPageId, CegoBufferPool::SYNC, _pTabMng->getLockHandler()); - + if ( bp.getType() == CegoBufferPage::BTREE_NODE ) { @@ -257,61 +259,89 @@ case MORE_THAN: { - // go to the most right - bool leafFound = false; + _curFileId = _rootFileId; _curPageId = _rootPageId; - - while ( ! found ) + while ( leafFound == false ) { - CegoBTreeValue startVal; - - while ( leafFound == false ) + CegoBufferPage bp; + _pDBMng->bufferFix(bp, _tabSetId, _curFileId, _curPageId, CegoBufferPool::SYNC, _pTabMng->getLockHandler()); + + if ( bp.getType() == CegoBufferPage::BTREE_NODE ) { - CegoBufferPage bp; - - _pDBMng->bufferFix(bp, _tabSetId, _curFileId, _curPageId, CegoBufferPool::SYNC, _pTabMng->getLockHandler()); - - - if ( bp.getType() == CegoBufferPage::BTREE_NODE ) + CegoBTreeNode traceNode; + traceNode.setType(CegoBTreeNode::NODE); + traceNode.setPtr(bp.getChunkEntry(), bp.getChunkLen()); + traceNode.setSchema(&_btreeSchema, _keyLen); + traceNode.setFileId(bp.getFileId()); + traceNode.setPageId(bp.getPageId()); + + traceNode.reset(); + + bool goOn = traceNode.nextChildPointer(_curFileId, _curPageId); + while ( goOn ) { - - CegoBTreeNode traceNode; - traceNode.setType(CegoBTreeNode::NODE); - traceNode.setPtr(bp.getChunkEntry(), bp.getChunkLen()); - traceNode.setSchema(&_btreeSchema, _keyLen); - traceNode.setFileId(bp.getFileId()); - traceNode.setPageId(bp.getPageId()); - - - traceNode.getChildPage(startVal, _curFileId, _curPageId); - + CegoBTreeValue iv; + if ( traceNode.rightChild(iv) ) + { + CegoComparison comp = compValue(iv); + + if ( comp == MORE_THAN ) + { + goOn = false; + } + else + { + goOn = traceNode.nextChildPointer(_curFileId, _curPageId); + } + } + else + { + goOn = false; + } + } + _parentPageStack.Push(bp); + } + else if ( bp.getType() == CegoBufferPage::BTREE_LEAF ) + { + + _curPage = bp; + _curLeaf.setType(CegoBTreeNode::LEAF); + _curLeaf.setPtr(_curPage.getChunkEntry(), _curPage.getChunkLen()); + _curLeaf.setFileId(_curPage.getFileId()); + _curLeaf.setPageId(_curPage.getPageId()); + _curLeaf.setSchema(&_btreeSchema, _keyLen); - } - else if ( bp.getType() == CegoBufferPage::BTREE_LEAF ) + leafFound=true; + + CegoBTreeValue iv; + + _curLeaf.reset(); + bool goOn = _curLeaf.nextValue(iv, dp); + while ( goOn ) { - - leafFound=true; - - CegoBTreeNode minLeaf; - minLeaf.setType(CegoBTreeNode::LEAF); - minLeaf.setPtr(bp.getChunkEntry(), bp.getChunkLen()); - minLeaf.setFileId(bp.getFileId()); - minLeaf.setPageId(bp.getPageId()); - minLeaf.setSchema(&_btreeSchema, _keyLen); - - // dp = minLeaf.getNextValue(startVal); - + CegoComparison comp = compValue(iv); + if ( comp == MORE_THAN ) + { + goOn = false; + if ( comp == MORE_THAN && _pAttrCond->getPrimaryComparison() == EQUAL ) + found = false; + else + found = true; + } + else + { + goOn = _curLeaf.nextValue(iv, dp); + } } } - - } + } break; - } + } } } else @@ -373,9 +403,7 @@ } } - // cout << "After search ..." << dp << endl; - - if (found ) + if ( found ) { char* p; @@ -467,6 +495,13 @@ bool moreValue = _curLeaf.nextValue(iv, dp); + if ( moreValue == false ) + { + _pDBMng->bufferUnfix(_curPage, true, _pTabMng->getLockHandler()); + _eoc = true; + return false; + } + while ( moreValue == false && _eoc == false ) { @@ -491,13 +526,13 @@ else { _eoc = true; + return false; } } do { - bool attrMatch = false; // get next available entry from leaf page @@ -545,8 +580,7 @@ break; } case LESS_THAN: - { - + { switch (comp) { case LESS_THAN: @@ -620,6 +654,7 @@ _pTabMng->releaseDataPtr(_dataLock, false); _dataLock = 0; } + _dataLock = _pTabMng->claimDataPtr(_tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len); // skipping tid @@ -690,6 +725,13 @@ void CegoBTreeCursor::abort() { + + if (_dataLock) + { + _pTabMng->releaseDataPtr(_dataLock, false); + _dataLock = 0; + } + // unfix node pages on stack CegoBufferPage bp; while ( _parentPageStack.Pop(bp) ) | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoBTreeManager.cc ^ |
@@ -118,8 +118,6 @@ int tid) { - // cout << "Inserting index " << iv.toChain(&_btreeSchema) << endl; - bool doAppend = true; StackT<CegoBufferPage> parentPageStack; @@ -184,7 +182,7 @@ propLeft.setNextFileId(bp.getNextFileId()); propLeft.setNextPageId(bp.getNextPageId()); - if ( propLeft.addValue(iv, dp, _btreeName, _btreeType == CegoObject::PBTREE || _btreeType == CegoObject::UBTREE) == false ) + if ( propLeft.addValue(iv, dp, _btreeName, _btreeType == CegoObject::PBTREE || _btreeType == CegoObject::UBTREE, _pObjMng, _tabSetId, tid) == false ) { // cout << "Creating new leaf page .." << endl; @@ -229,11 +227,11 @@ if ( iv.isHigher(ri, &_btreeSchema) ) { - propRight.addValue(iv, dp, _btreeName, _btreeType == CegoObject::PBTREE || _btreeType == CegoObject::UBTREE); + propRight.addValue(iv, dp, _btreeName, _btreeType == CegoObject::PBTREE || _btreeType == CegoObject::UBTREE, _pObjMng, _tabSetId, tid); } else { - propLeft.addValue(iv, dp, _btreeName, _btreeType == CegoObject::PBTREE || _btreeType == CegoObject::UBTREE); + propLeft.addValue(iv, dp, _btreeName, _btreeType == CegoObject::PBTREE || _btreeType == CegoObject::UBTREE, _pObjMng, _tabSetId, tid); } CegoBTreeValue propValue = propLeft.getMax(); | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoBTreeNode.cc ^ |
@@ -25,6 +25,7 @@ // cego includes #include "CegoBTreeNode.h" #include "CegoDataPointer.h" +#include "CegoTupleState.h" #include <string.h> #include <stdlib.h> @@ -319,7 +320,7 @@ /* add value - new version */ -bool CegoBTreeNode::addValue(const CegoBTreeValue& iv, const CegoDataPointer& dp, const Chain& btreeName, bool isUnique) +bool CegoBTreeNode::addValue(const CegoBTreeValue& iv, const CegoDataPointer& dp, const Chain& btreeName, bool isUnique, CegoObjectManager *pOM, int tabSetId, int tid) { // cout << "Adding value " << iv.toChain(_pSchema) << endl; @@ -366,9 +367,13 @@ CegoBTreeValue nv1; CegoBTreeValue nv2; - + + CegoDataPointer dp1; + CegoDataPointer dp2; nv1.setPtr((char*)((long)_pI + sizeof(int)) + i * getEntrySize()); + dp1.decode((char*)((long)_pI + sizeof(int)) + i * getEntrySize() + _keyLen); + CegoBTreeValue::Comparison valueComp1 = iv.comp(nv1, _pSchema); CegoBTreeValue::Comparison valueComp2; @@ -380,19 +385,33 @@ else { nv2.setPtr((char*)((long)_pI + sizeof(int)) + (i+1)*getEntrySize()); + dp2.decode((char*)((long)_pI + sizeof(int)) + (i+1)*getEntrySize() + _keyLen); + valueComp2 = iv.comp(nv2, _pSchema); } - - - + // cout << "VC1=" << valueComp1 << endl; // cout << "VC2=" << valueComp2 << endl; if ( isUnique && ( valueComp1 == CegoBTreeValue::EQUAL || valueComp2 == CegoBTreeValue::EQUAL )) { - Chain msg = Chain("Duplicate key on unique btree ") + btreeName; - throw Exception(EXLOC, msg); + if ( valueComp1 == CegoBTreeValue::EQUAL ) + { + if ( ! ( tid && checkForDeleted(pOM, dp1, tabSetId, tid) ) ) + { + Chain msg = Chain("Duplicate key on unique btree ") + btreeName; + throw Exception(EXLOC, msg); + } + } + if ( valueComp2 == CegoBTreeValue::EQUAL ) + { + if ( ! ( tid && checkForDeleted(pOM, dp2, tabSetId, tid) ) ) + { + Chain msg = Chain("Duplicate key on unique btree ") + btreeName; + throw Exception(EXLOC, msg); + } + } } if ( ( valueComp1 == CegoBTreeValue::MORE || valueComp1 == CegoBTreeValue::EQUAL ) @@ -669,7 +688,6 @@ else { - bool posFound=false; char* p = 0; int i=0; @@ -707,7 +725,6 @@ return true; - } } @@ -996,3 +1013,42 @@ } return s; } + +bool CegoBTreeNode::checkForDeleted(CegoObjectManager* pOM, const CegoDataPointer &dp, int tabSetId, int tid) +{ + + char* p; + int len; + + unsigned long dataLock; + dataLock = pOM->claimDataPtr(tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len); + + // skipping tid + int dataTid = *(int*)p; + int tastep; + CegoTupleState ts; + + char* ptastep = p + sizeof(int); + memcpy(&tastep, ptastep, sizeof(int)); + + char* pts = p + sizeof(int) + sizeof(int); + memcpy(&ts, pts, sizeof(CegoTupleState)); + + pOM->releaseDataPtr(dataLock, false); + + /* + cout << "Datapointer = " << dp << endl; + cout << "tid = " << tid << endl; + cout << "dataTid = " << dataTid << endl; + cout << "ts = " << ts << endl; + */ + + if (tid == dataTid && ( ts == DELETED || ts == OBSOLETE )) + { + return true; + } + else + { + return false; + } +} | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoBTreeNode.h ^ |
@@ -28,6 +28,7 @@ #include "CegoField.h" #include "CegoBTreeValue.h" #include "CegoDataPointer.h" +#include "CegoObjectManager.h" class CegoBTreeNode { @@ -67,7 +68,7 @@ void setSchema(ListT<CegoField>* pSchema, int keyLen); - bool addValue(const CegoBTreeValue& iv, const CegoDataPointer& dp, const Chain& btreeName, bool isUnique = false); + bool addValue(const CegoBTreeValue& iv, const CegoDataPointer& dp, const Chain& btreeName, bool isUnique, CegoObjectManager *pOM, int tabSetId, int tid); bool deleteValue(const CegoBTreeValue& iv, const CegoDataPointer& dp); bool addNode(const CegoBTreeValue& iv, const CegoBTreeNode& node); @@ -94,6 +95,8 @@ private: + bool checkForDeleted(CegoObjectManager* pOM, const CegoDataPointer &dp, int tabSetId, int tid); + void shiftEntries(int pos, int offset); int getEntrySize() const; | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoObjectCursor.cc ^ |
@@ -181,7 +181,7 @@ catch ( Exception e) { abort(); - throw Exception(EXLOC, Chain("Object cursor failed"), e); + throw e; } } @@ -292,7 +292,7 @@ catch ( Exception e) { abort(); - throw Exception(EXLOC, Chain("Object cursor failed"), e); + throw e; } } | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoSelect.cc ^ |
@@ -776,6 +776,7 @@ { if ( _checkUnion == false ) + { if ( nextAggTuple(jfl) ) { if ( _doCaching ) @@ -784,7 +785,8 @@ } return true; } - + } + if ( _pUnionSelect ) { _checkUnion = true; @@ -2578,7 +2580,6 @@ // the selection part. Either these are plain attributes, expressions or aggregation functions // the result is given in the outList parameter - void CegoSelect::evalSelection(ListT<CegoField>& ol) { | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoTableCursor.cc ^ |
@@ -458,11 +458,18 @@ } } +const CegoObject::ObjectType CegoTableCursor::getIndexType() const +{ + return _type; +} + const Chain& CegoTableCursor::getIndexName() const { return _idxName; } + + void CegoTableCursor::abort() { if (_pIC) | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoTableCursor.h ^ |
@@ -49,6 +49,8 @@ bool getFirst(ListT<CegoField>& fl, CegoDataPointer& dp); bool getNext(ListT<CegoField>& fl, CegoDataPointer& dp); + + const CegoObject::ObjectType getIndexType() const; const Chain& getIndexName() const; void getIdxSchema(ListT<CegoField>& idxSchema); | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoTableManager.cc ^ |
@@ -2329,8 +2329,13 @@ CegoAttrCond::IndexMatch indexMatch = pTC->setup(ac); Chain virginIndex; + CegoObject::ObjectType virginType; + if ( indexMatch == CegoAttrCond::FULL || indexMatch == CegoAttrCond::PART ) + { virginIndex = pTC->getIndexName(); + virginType = pTC->getIndexType(); + } #ifdef CGDEBUG _pDBMng->log(_modId, Logger::DEBUG, Chain("Virgin index is ") + virginIndex); @@ -2340,7 +2345,7 @@ CegoDataPointer dp; moreTuple = pTC->getFirst(fl, dp); - + while ( moreTuple && _isAborted == false ) { #ifdef CGDEBUG @@ -2362,9 +2367,13 @@ moreTuple = pTC->getNext(fl, dp); } } + +#ifdef CGDEBUG + _pDBMng->log(_modId, Logger::DEBUG, Chain("Commiting update ")); +#endif if ( virginIndex != Chain() ) - _pTM->commitUpdate(tabSetId, virginIndex, getTID(tabSetId), _doAppend); + _pTM->commitUpdate(tabSetId, virginIndex, virginType, getTID(tabSetId), _doAppend); } | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoTransactionManager.cc ^ |
@@ -39,6 +39,7 @@ #include "CegoTupleState.h" #include "CegoTableManager.h" #include "CegoAVLIndexManager.h" +#include "CegoBTreeManager.h" #define RBSEP "#" #define SYS_RB "rbcatlog" @@ -801,14 +802,14 @@ In this case, the ( virgin ) index still has to expand for the updated tuples */ -void CegoTransactionManager::commitUpdate(int tabSetId, const Chain& idxName, int tid, bool doAppend) +void CegoTransactionManager::commitUpdate(int tabSetId, const Chain& idxName, const CegoObject::ObjectType idxType, int tid, bool doAppend) { CegoObjectCursor *pOC = 0; unsigned long lockId = 0; CegoBufferPage bp; bool isFixed = false; - + try { @@ -817,91 +818,179 @@ if ( pUDE == 0 ) { // no update entry found. It seems, no - // modifying operations have been take place, so we can retrn immediately + // modifying operations have been take place, so we can return immediately return; // throw Exception(EXLOC, Chain("Cannot find transaction ") + Chain(tid)); } - Chain udTable = pUDE->getTableObject().getName(); - - CegoTableObject ioe; - _pTM->getObjectWithFix(tabSetId, idxName, CegoObject::INDEX, ioe, bp); - isFixed = true; - - pOC = _pTM->getObjectCursor(tabSetId, udTable, udTable, CegoObject::RBSEG); - - ListT<CegoField> schema = _updSchema; - - CegoDataPointer updp; - bool moreTuple = _pTM->getFirstTuple(pOC, schema, updp); - - while ( moreTuple) + if ( idxType == CegoObject::INDEX + || idxType == CegoObject::UINDEX + || idxType == CegoObject::PINDEX ) { + - int fileId, pageId, offset; + CegoTableObject ioe; + _pTM->getObjectWithFix(tabSetId, idxName, idxType, ioe, bp); + isFixed = true; - CegoField *pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_FILEID)); - if (pF) - fileId = *(int*)pF->getValue().getValue(); + pOC = _pTM->getObjectCursor(tabSetId, udTable, udTable, CegoObject::RBSEG); - pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_PAGEID)); - if (pF) - pageId = *(int*)pF->getValue().getValue(); - pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_OFFSET)); - if (pF) - offset = *(int*)pF->getValue().getValue(); + ListT<CegoField> schema = _updSchema; - CegoDataPointer dp(fileId, pageId, offset); + CegoDataPointer updp; + bool moreTuple = _pTM->getFirstTuple(pOC, schema, updp); - ListT<CegoField> fvl = ioe.getSchema(); + while ( moreTuple) + { + + int fileId, pageId, offset; + + CegoField *pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_FILEID)); + if (pF) + fileId = *(int*)pF->getValue().getValue(); + + pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_PAGEID)); + if (pF) + pageId = *(int*)pF->getValue().getValue(); + + pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_OFFSET)); + if (pF) + offset = *(int*)pF->getValue().getValue(); + + CegoDataPointer dp(fileId, pageId, offset); + + ListT<CegoField> fvl = ioe.getSchema(); + + char* p; + int len; + + CegoDataPointer sysEntry(bp.getFileId(), bp.getPageId(), bp.getEntryPos()); + + + lockId = _pTM->claimDataPtr(tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len); + + int tid; + int tastep; + CegoTupleState ts; + _qh.decodeFVL(fvl, p, len, tid, tastep, ts); + + char ip[TABMNG_MAXINDEXVALUE]; + int ilen = TABMNG_MAXINDEXVALUE; + int idxLen; + CegoDataPointer ritp; + + _pTM->extractIndexValue(fvl, ioe.getSchema(), ip, ilen, idxLen); + + CegoAVLIndexManager idxMng(_pTM); + idxMng.insertNativeIndexTable(ioe, sysEntry, dp, ip, idxLen, tid, doAppend, ritp); + + _pTM->releaseDataPtr(lockId); + lockId = 0; + + + moreTuple = _pTM->getNextTuple(pOC, schema, updp); + + } + + delete pOC; + pOC = 0; - char* p; - int len; + // now we can release the index root page + _pTM->getDBMng()->bufferUnfix(bp, true, _pTM->getLockHandler()); + isFixed = false; - CegoDataPointer sysEntry(bp.getFileId(), bp.getPageId(), bp.getEntryPos()); - + _pTM->removeObject(tabSetId, udTable, CegoObject::RBSEG); - lockId = _pTM->claimDataPtr(tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len); + // release the update commit object + _pTM->getDBMng()->bufferUnfix(pUDE->getBufferPage(), true, _pTM->getLockHandler()); + _udList.Remove(TAEntry(tid)); - int tid; - int tastep; - CegoTupleState ts; - _qh.decodeFVL(fvl, p, len, tid, tastep, ts); + } + else if ( idxType == CegoObject::BTREE + || idxType == CegoObject::UBTREE + || idxType == CegoObject::PBTREE ) + { - char ip[TABMNG_MAXINDEXVALUE]; - int ilen = TABMNG_MAXINDEXVALUE; - int idxLen; - CegoDataPointer ritp; - - _pTM->extractIndexValue(fvl, ioe.getSchema(), ip, ilen, idxLen); - - CegoAVLIndexManager idxMng(_pTM); - idxMng.insertNativeIndexTable(ioe, sysEntry, dp, ip, idxLen, tid, doAppend, ritp); - _pTM->releaseDataPtr(lockId); - lockId = 0; + CegoBTreeObject boe; + _pTM->getObjectWithFix(tabSetId, idxName, idxType, boe, bp); + isFixed = true; + + pOC = _pTM->getObjectCursor(tabSetId, udTable, udTable, CegoObject::RBSEG); + + + ListT<CegoField> schema = _updSchema; + + CegoDataPointer updp; + bool moreTuple = _pTM->getFirstTuple(pOC, schema, updp); + + while ( moreTuple) + { + + int fileId, pageId, offset; + + CegoField *pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_FILEID)); + if (pF) + fileId = *(int*)pF->getValue().getValue(); + + pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_PAGEID)); + if (pF) + pageId = *(int*)pF->getValue().getValue(); + + pF = schema.Find(CegoField(SYS_UPDTAB, SYS_UPDTAB_OFFSET)); + if (pF) + offset = *(int*)pF->getValue().getValue(); + + CegoDataPointer dp(fileId, pageId, offset); + + ListT<CegoField> fvl = boe.getSchema(); + + char* p; + int len; + + CegoDataPointer sysEntry(bp.getFileId(), bp.getPageId(), bp.getEntryPos()); + + lockId = _pTM->claimDataPtr(tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len); + + int tid; + int tastep; + CegoTupleState ts; + _qh.decodeFVL(fvl, p, len, tid, tastep, ts); + + CegoBTreeValue iv; + iv.valueFromSchema(fvl, boe.getSchema()); + + CegoBTreeManager btreeMng(_pTM, &boe); + btreeMng.insertBTree(dp, + iv, + tid); + _pTM->releaseDataPtr(lockId); + lockId = 0; + + + moreTuple = _pTM->getNextTuple(pOC, schema, updp); - moreTuple = _pTM->getNextTuple(pOC, schema, updp); + } + + delete pOC; + pOC = 0; + // now we can release the index root page + _pTM->getDBMng()->bufferUnfix(bp, true, _pTM->getLockHandler()); + isFixed = false; + + _pTM->removeObject(tabSetId, udTable, CegoObject::RBSEG); + + // release the update commit object + _pTM->getDBMng()->bufferUnfix(pUDE->getBufferPage(), true, _pTM->getLockHandler()); + _udList.Remove(TAEntry(tid)); + } - delete pOC; - pOC = 0; - - // now we can release the index root page - _pTM->getDBMng()->bufferUnfix(bp, true, _pTM->getLockHandler()); - isFixed = false; - - _pTM->removeObject(tabSetId, udTable, CegoObject::RBSEG); - - // release the update commit object - _pTM->getDBMng()->bufferUnfix(pUDE->getBufferPage(), true, _pTM->getLockHandler()); - _udList.Remove(TAEntry(tid)); - } catch ( Exception e ) { | ||
[+] | Changed | cego-2.19.7.tar.bz2/src/CegoTransactionManager.h ^ |
@@ -48,7 +48,7 @@ void reorgSystemSpace(int tabSetId); void recordUpdate(int tabSetId, int tid, const CegoDataPointer& dp ); - void commitUpdate(int tabSetId, const Chain& idxName, int tid, bool doAppend); + void commitUpdate(int tabSetId, const Chain& idxName, const CegoObject::ObjectType idxType, int tid, bool doAppend); void getRBDataPtr(int tabSetId, int tid, int fileId, int pageId, int offset, int& rbfileId, int& rbpageId, int& rboffset); |