[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.20.8.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.20.7.
+# Generated by GNU Autoconf 2.69 for Cego 2.20.8.
#
# Report bugs to <lemke@lemke-it.com>.
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='Cego'
PACKAGE_TARNAME='cego'
-PACKAGE_VERSION='2.20.7'
-PACKAGE_STRING='Cego 2.20.7'
+PACKAGE_VERSION='2.20.8'
+PACKAGE_STRING='Cego 2.20.8'
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.20.7 to adapt to many kinds of systems.
+\`configure' configures Cego 2.20.8 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.20.7:";;
+ short | recursive ) echo "Configuration of Cego 2.20.8:";;
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.20.7
+Cego configure 2.20.8
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.20.7, which was
+It was created by Cego $as_me 2.20.8, 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.20.7'
+ VERSION='2.20.8'
cat >>confdefs.h <<_ACEOF
@@ -16776,7 +16776,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.20.7, which was
+This file was extended by Cego $as_me 2.20.8, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16842,7 +16842,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.20.7
+Cego config.status 2.20.8
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
|
[-]
[+]
|
Changed |
cego-2.20.8.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.20.7], [lemke@lemke-it.com])
+AC_INIT([Cego], [2.20.8], [lemke@lemke-it.com])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/samples/cgplustest/Makefile
^
|
@@ -164,13 +164,13 @@
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.20.7/missing aclocal-1.14
+ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.20.8/missing aclocal-1.14
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AR = ar
-AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.20.7/missing autoconf
-AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.20.7/missing autoheader
-AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.20.7/missing automake-1.14
+AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.20.8/missing autoconf
+AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.20.8/missing autoheader
+AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.20.8/missing automake-1.14
AWK = awk
CC = gcc
CCDEPMODE = depmode=gcc3
@@ -180,7 +180,7 @@
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
-CXXFLAGS = -g -O2
+CXXFLAGS = -DCGDEBUG
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
@@ -210,7 +210,7 @@
LIPO = lipo
LN_S = ln -s
LTLIBOBJS =
-MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.20.7/missing makeinfo
+MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.20.8/missing makeinfo
MANIFEST_TOOL = :
MKDIR_P = ../.././install-sh -c -d
NM = /usr/bin/nm
@@ -222,21 +222,21 @@
PACKAGE = cego
PACKAGE_BUGREPORT = lemke@lemke-it.com
PACKAGE_NAME = Cego
-PACKAGE_STRING = Cego 2.20.7
+PACKAGE_STRING = Cego 2.20.8
PACKAGE_TARNAME = cego
PACKAGE_URL =
-PACKAGE_VERSION = 2.20.7
+PACKAGE_VERSION = 2.20.8
PATH_SEPARATOR = :
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
-VERSION = 2.20.7
-abs_builddir = /Users/lemke/work/cego-2.20.7/samples/cgplustest
-abs_srcdir = /Users/lemke/work/cego-2.20.7/samples/cgplustest
-abs_top_builddir = /Users/lemke/work/cego-2.20.7
-abs_top_srcdir = /Users/lemke/work/cego-2.20.7
+VERSION = 2.20.8
+abs_builddir = /Users/lemke/work/cego-2.20.8/samples/cgplustest
+abs_srcdir = /Users/lemke/work/cego-2.20.8/samples/cgplustest
+abs_top_builddir = /Users/lemke/work/cego-2.20.8
+abs_top_srcdir = /Users/lemke/work/cego-2.20.8
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
@@ -266,7 +266,7 @@
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
-install_sh = ${SHELL} /Users/lemke/work/cego-2.20.7/install-sh
+install_sh = ${SHELL} /Users/lemke/work/cego-2.20.8/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/samples/cgwraptest/Makefile
^
|
@@ -164,13 +164,13 @@
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.20.7/missing aclocal-1.14
+ACLOCAL = ${SHELL} /Users/lemke/work/cego-2.20.8/missing aclocal-1.14
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AR = ar
-AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.20.7/missing autoconf
-AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.20.7/missing autoheader
-AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.20.7/missing automake-1.14
+AUTOCONF = ${SHELL} /Users/lemke/work/cego-2.20.8/missing autoconf
+AUTOHEADER = ${SHELL} /Users/lemke/work/cego-2.20.8/missing autoheader
+AUTOMAKE = ${SHELL} /Users/lemke/work/cego-2.20.8/missing automake-1.14
AWK = awk
CC = gcc
CCDEPMODE = depmode=gcc3
@@ -180,7 +180,7 @@
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
-CXXFLAGS = -g -O2
+CXXFLAGS = -DCGDEBUG
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
@@ -210,7 +210,7 @@
LIPO = lipo
LN_S = ln -s
LTLIBOBJS =
-MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.20.7/missing makeinfo
+MAKEINFO = ${SHELL} /Users/lemke/work/cego-2.20.8/missing makeinfo
MANIFEST_TOOL = :
MKDIR_P = ../.././install-sh -c -d
NM = /usr/bin/nm
@@ -222,21 +222,21 @@
PACKAGE = cego
PACKAGE_BUGREPORT = lemke@lemke-it.com
PACKAGE_NAME = Cego
-PACKAGE_STRING = Cego 2.20.7
+PACKAGE_STRING = Cego 2.20.8
PACKAGE_TARNAME = cego
PACKAGE_URL =
-PACKAGE_VERSION = 2.20.7
+PACKAGE_VERSION = 2.20.8
PATH_SEPARATOR = :
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
-VERSION = 2.20.7
-abs_builddir = /Users/lemke/work/cego-2.20.7/samples/cgwraptest
-abs_srcdir = /Users/lemke/work/cego-2.20.7/samples/cgwraptest
-abs_top_builddir = /Users/lemke/work/cego-2.20.7
-abs_top_srcdir = /Users/lemke/work/cego-2.20.7
+VERSION = 2.20.8
+abs_builddir = /Users/lemke/work/cego-2.20.8/samples/cgwraptest
+abs_srcdir = /Users/lemke/work/cego-2.20.8/samples/cgwraptest
+abs_top_builddir = /Users/lemke/work/cego-2.20.8
+abs_top_srcdir = /Users/lemke/work/cego-2.20.8
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
@@ -266,7 +266,7 @@
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
-install_sh = ${SHELL} /Users/lemke/work/cego-2.20.7/install-sh
+install_sh = ${SHELL} /Users/lemke/work/cego-2.20.8/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
|
[-]
[+]
|
Added |
cego-2.20.8.tar.bz2/samples/chkdb/debfail.sql
^
|
@@ -0,0 +1,117 @@
+drop if exists table t1;
+create table t1( a int, b string(30));
+insert into t1 values(20, 'XXX');
+insert into t1 values(2, 'XXX');
+insert into t1 values(32, 'XXX');
+insert into t1 values(32, 'XXX');
+insert into t1 values(32, 'XXX');
+insert into t1 values(45, 'XXX');
+insert into t1 values(27, 'XXX');
+insert into t1 values(82, 'fdsfsdfsdXXX');
+insert into t1 values(423, 'XXX');
+insert into t1 values(890, 'fsdfsdfsdfsjXXX');
+insert into t1 values(412, 'XXX');
+insert into t1 values(412, 'XXX');
+insert into t1 values(412, 'XXfdsfsdfsdfsdaX');
+insert into t1 values(42, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(32, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(32, 'XXX');
+insert into t1 values(33, 'XXXfsdfsfsfs');
+insert into t1 values(32, 'XXXddddddddddfsfsdf');
+insert into t1 values(33, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(32, 'Xbalalllalasfsdfsfsdf');
+insert into t1 values(32, 'XXgugugugugufsdfsfsdf');
+insert into t1 values(32, 'XXrrrrrsfsdfsfsdf');
+insert into t1 values(32, 'XXppppsfsdfsfsdf');
+insert into t1 values(32, 'XXllllllsdfsfsdf');
+insert into t1 values(32, 'XXssssssfsdfsfsdf');
+insert into t1 values(32, 'XXwwwwwfsdfsfsdf');
+insert into t1 values(32, 'XXaaaaaaasdfsfsdf');
+insert into t1 values(32, 'XXX');
+insert into t1 values(45, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXXxxxxxxxxxx');
+insert into t1 values(3, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XX6666666666fds');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(45, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(890, 'XXX');
+insert into t1 values(412, 'XXX');
+insert into t1 values(45, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(890, 'XXX');
+insert into t1 values(412, 'XXX');
+insert into t1 values(412, 'XXX');
+insert into t1 values(412, 'XXX');
+insert into t1 values(42, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(45, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(45, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(812, 'XXX');
+insert into t1 values(52, 'XXX');
+insert into t1 values(3, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(30, 'XXX');
+insert into t1 values(33, 'XXX');
+insert into t1 values(45, 'XXX');
+select count(*) from t1;
+
+select * from t1 where a = 32;
+create btree b1 on t1(a);
+select * from t1 where a = 32;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoAction.cc
^
|
@@ -802,8 +802,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
- _pTabMng->getDistObjectByTableList(_tableSet, tableName, idxList, btreeList, keyList, checkList, true);
+ _pTabMng->getDistObjectByTableList(_tableSet, tableName, idxList, btreeList, keyList, checkList, numInvalid);
CegoTableObject oe;
ListT< ListT < CegoFieldValue > > fa;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoAggregation.cc
^
|
@@ -32,9 +32,9 @@
_pExpr = 0;
}
-CegoAggregation::CegoAggregation(char* buf, CegoDistManager *pGTM)
+CegoAggregation::CegoAggregation(char* buf, CegoDistManager *pGTM, int tabSetId)
{
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoAggregation::CegoAggregation(Element* pAE, CegoDistManager *pGTM)
@@ -158,7 +158,7 @@
}
}
-void CegoAggregation::decode(char *buf, CegoDistManager *pGTM)
+void CegoAggregation::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
if ( _pExpr )
@@ -178,7 +178,7 @@
if ( c == 1 )
{
- _pExpr = new CegoExpr(pBuf, pGTM);
+ _pExpr = new CegoExpr(pBuf, pGTM, tabSetId);
}
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoAggregation.h
^
|
@@ -36,7 +36,7 @@
enum AggType { MIN, MAX, AVG, SUM, COUNT };
CegoAggregation();
- CegoAggregation(char* buf, CegoDistManager *pGTM);
+ CegoAggregation(char* buf, CegoDistManager *pGTM, int tabSetId);
CegoAggregation(Element* pAE, CegoDistManager *pGTM);
CegoAggregation(AggType type, CegoExpr* pExpr, bool isDistinct = false);
~CegoAggregation();
@@ -63,7 +63,7 @@
ListT<CegoAttrDesc*> getAttrRefList() const;
void encode(char *buf);
- void decode(char *buf, CegoDistManager *pGTM);
+ void decode(char *buf, CegoDistManager *pGTM, int tabSetId);
int getEncodingLength() const;
Element* toElement() const;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoBTreeNode.cc
^
|
@@ -624,14 +624,14 @@
char* srcPtr = (char*)((long)_pI + sizeof(int) + pos * getEntrySize());
char* destPtr = (char*)((long)_pI + sizeof(int) + ( pos + offset) * getEntrySize());
int shiftSize = ( numEntries() - pos ) * getEntrySize();
- memcpy(destPtr, srcPtr, shiftSize);
+ memmove(destPtr, srcPtr, shiftSize);
}
else if ( _nt == NODE )
{
char* srcPtr = (char*)((long)_pI + sizeof(int) + 2 * sizeof(int) + pos * getEntrySize());
char* destPtr = (char*)((long)_pI + sizeof(int) + 2 * sizeof(int) + ( pos + offset ) * getEntrySize());
int shiftSize = ( numEntries() - pos ) * getEntrySize();
- memcpy(destPtr, srcPtr, shiftSize);
+ memmove(destPtr, srcPtr, shiftSize);
}
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoCheckObject.cc
^
|
@@ -125,7 +125,9 @@
_tabName = Chain(bufPtr);
bufPtr=bufPtr + _tabName.length();
- _pPredDesc = new CegoPredDesc(bufPtr, 0);
+ // TODO
+ // No support for check objects which have to access table manager
+ _pPredDesc = new CegoPredDesc(bufPtr, 0, 0);
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoCondDesc.cc
^
|
@@ -24,12 +24,12 @@
#include <string.h>
#include <stdlib.h>
-CegoCondDesc::CegoCondDesc(char *buf, CegoDistManager *pGTM)
+CegoCondDesc::CegoCondDesc(char *buf, CegoDistManager *pGTM, int tabSetId)
{
_pLeft=0;
_pRight=0;
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoCondDesc::CegoCondDesc(Element *pCondElement, CegoDistManager *pGTM)
@@ -156,7 +156,7 @@
}
}
-void CegoCondDesc::decode(char *buf, CegoDistManager *pGTM)
+void CegoCondDesc::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
if ( _pLeft )
@@ -174,15 +174,15 @@
case CegoCondDesc::AND:
case CegoCondDesc::OR:
{
- _pLeft = new CegoPredDesc(pP, pGTM);
+ _pLeft = new CegoPredDesc(pP, pGTM, tabSetId);
pP = pP + _pLeft->getEncodingLength();
- _pRight = new CegoPredDesc(pP, pGTM);
+ _pRight = new CegoPredDesc(pP, pGTM, tabSetId);
pP = pP + _pRight->getEncodingLength();
break;
}
case CegoCondDesc::PRED:
{
- _pLeft = new CegoPredDesc(pP, pGTM);
+ _pLeft = new CegoPredDesc(pP, pGTM, tabSetId);
pP = pP + _pLeft->getEncodingLength();
break;
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoCondDesc.h
^
|
@@ -28,7 +28,7 @@
enum CondType { AND, OR, PRED };
- CegoCondDesc(char *buf, CegoDistManager *pGTM);
+ CegoCondDesc(char *buf, CegoDistManager *pGTM, int tabSetId);
CegoCondDesc(Element *pCondElement, CegoDistManager *pGTM);
CegoCondDesc(CondType ct);
~CegoCondDesc();
@@ -47,7 +47,7 @@
void setBlock(CegoProcBlock* pBlock);
void encode(char *buf);
- void decode(char *buf, CegoDistManager *pGTM);
+ void decode(char *buf, CegoDistManager *pGTM, int tabSetId);
int getEncodingLength() const;
ListT<CegoAttrDesc*> getAttrRefList() const;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoDatabaseManager.cc
^
|
@@ -507,7 +507,7 @@
if ( pOR == 0 )
{
V();
- Chain msg = Chain("Cannot access object ") + objName;
+ Chain msg = Chain("Cannot access object <") + objName + Chain(">");
throw Exception(EXLOC, msg);
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoDbThread.cc
^
|
@@ -828,8 +828,10 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
- _pTabMng->getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, false);
+ _pTabMng->setIgnoreInvalid(false);
+ _pTabMng->getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
pSH->sendObjByTableList(idxList, keyList, checkList);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoDistCursor.cc
^
|
@@ -41,8 +41,9 @@
_pSelect = 0;
_pSH = 0;
_pGTM = pGTM;
- _tableName = pCO->getTabName();
+ _tableName = pCO->getTabName();
+
_tableAlias = pCO->getName();
_tabSetId = pCO->getTabSetId();
@@ -331,6 +332,7 @@
bool CegoDistCursor::nextTuple(ListT<CegoField>* flArray, int pos, int size)
{
+
while ( getTuple(flArray, pos, size) )
{
if ( _doEval == true )
@@ -483,6 +485,7 @@
}
else if ( _pCO->getType() == CegoObject::TABLE )
{
+
if ( _isLocal )
{
@@ -494,6 +497,7 @@
}
else
_moreTuple = _pTC->getNext(flArray[offset], dp);
+
return _moreTuple;
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoDistManager.cc
^
|
@@ -114,9 +114,7 @@
startTableSet(tableSet, secondary, cleanIt);
try
- {
- registerObjects(tableSet);
-
+ {
bool isAutoCorrect = _pDBMng->getAutoCorrect(tableSet);
if ( isAutoCorrect )
@@ -138,8 +136,10 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- getObjectListByTable(tabSetId, *pTableName, idxList, btreeList, keyList, checkList, true);
+ int numInvalid;
+
+ setIgnoreInvalid(false);
+ getObjectListByTable(tabSetId, *pTableName, idxList, btreeList, keyList, checkList, numInvalid);
// correct indexes
CegoTableObject *pIdx = idxList.First();
@@ -158,6 +158,25 @@
pIdx = idxList.Next();
}
+
+ // correct btrees
+ CegoBTreeObject *pBTree = btreeList.First();
+ while ( pBTree )
+ {
+
+ if ( pBTree->isValid() == false )
+ {
+
+ dropBTree(tabSetId, pBTree->getName());
+ createBTree(tabSetId, pBTree->getName(), pBTree->getTabName(), pBTree->getSchema(), pBTree->getType());
+
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("BTree ") + pBTree->getName() + Chain(" was corrected"));
+
+ }
+
+ pBTree = btreeList.Next();
+ }
+
pTableName = tabList.Next();
}
@@ -181,6 +200,7 @@
Chain *pTableName = tabList.First();
while ( pTableName )
{
+
#ifdef CGDEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Adding table ") + *pTableName + Chain(" to tableset ") + tableSet);
#endif
@@ -217,6 +237,7 @@
Chain *pProcName = procList.First();
while ( pProcName )
{
+
#ifdef CGDEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Adding procedure ") + *pProcName + Chain(" to tableset ") + tableSet);
#endif
@@ -309,6 +330,8 @@
else
{
+ registerObjects(tableSet);
+
_pDBMng->setActiveLogFile(tableSet);
// get checkpoint lsn
@@ -337,6 +360,8 @@
long lsn;
int ts = 0;
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Starting recovery ... "));
+ setIgnoreInvalid(true);
CegoRecoveryManager recoveryMng(this, CegoRecoveryManager::LOCAL);
recoveryMng.recoverCurrentTransactionLog(tabSetId, 0, lsn, ts);
@@ -345,11 +370,17 @@
throw Exception(EXLOC, Chain("Incomplete recovery"));
}
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Recovery finished"));
+
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Closing open transactions ... "));
finishOpenTransaction(tabSetId);
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Transactions closed"));
+
+ setIgnoreInvalid(false);
// set lsn to last lsn in log
maxlsn = writeCheckPoint(tableSet, true, false);
-
+
}
else
{
@@ -1717,7 +1748,7 @@
ListT<CegoTableObject>& idxList,
ListT<CegoBTreeObject>& btreeList,
ListT<CegoKeyObject>& keyList,
- ListT<CegoCheckObject>& checkList, bool ignoreInvalid)
+ ListT<CegoCheckObject>& checkList, int& numInvalid)
{
#ifdef CGDEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Getting global object list by table ") + tabName + Chain(" in tableset ") + tableSet);
@@ -1730,7 +1761,7 @@
if ( hostName.toUpper() == h.getName().toUpper() )
{
- getObjectListByTable(tabSetId, tabName, idxList, btreeList, keyList, checkList, ignoreInvalid);
+ getObjectListByTable(tabSetId, tabName, idxList, btreeList, keyList, checkList, numInvalid);
}
else
{
@@ -1807,6 +1838,7 @@
}
}
+/*
CegoAttrCond::IndexMatch CegoDistManager::distIndexExists(int tabSetId, const Chain& tableName, CegoAttrCond& ac)
{
ListT<CegoTableObject> idxList;
@@ -1820,7 +1852,7 @@
if ( hostName.toUpper() == h.getName().toUpper() )
{
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, false);
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList);
CegoAttrCond::IndexMatch idxMatch = CegoAttrCond::INAPP;
@@ -1908,6 +1940,8 @@
}
}
+*/
+
CegoLockHandler* CegoDistManager::getLockHandle()
{
return _pLockHandle;
@@ -1994,8 +2028,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, true);
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
CegoTableObject oe;
getObject(tabSetId, tableName, CegoObject::TABLE, oe);
@@ -2178,8 +2213,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, true);
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
/*
CegoTableObject oe;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoDistManager.h
^
|
@@ -92,9 +92,9 @@
void getDistObjectList(const Chain& tableSet, CegoObject::ObjectType type, ListT<Chain> &objList);
void getLocalObjectList(int tabSetId, CegoObject::ObjectType type, ListT<Chain> &objList);
- void getDistObjectByTableList(const Chain& tableSet, const Chain& tabName, ListT<CegoTableObject> &idxList, ListT<CegoBTreeObject> &btreeList, ListT<CegoKeyObject>& keyList, ListT<CegoCheckObject>& checkList, bool ignoreInvalid);
+ void getDistObjectByTableList(const Chain& tableSet, const Chain& tabName, ListT<CegoTableObject> &idxList, ListT<CegoBTreeObject> &btreeList, ListT<CegoKeyObject>& keyList, ListT<CegoCheckObject>& checkList, int &numInvalid);
- CegoAttrCond::IndexMatch distIndexExists(int tabSetId, const Chain& tableName, CegoAttrCond& ac);
+ // CegoAttrCond::IndexMatch distIndexExists(int tabSetId, const Chain& tableName, CegoAttrCond& ac);
int getDistPageCount(const Chain& tableSet, const Chain& tabName, CegoObject::ObjectType type);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoExpr.cc
^
|
@@ -25,11 +25,11 @@
#include <string.h>
#include <stdlib.h>
-CegoExpr::CegoExpr(char* buf, CegoDistManager *pGTM)
+CegoExpr::CegoExpr(char* buf, CegoDistManager *pGTM, int tabSetId)
{
_pTerm=0;
_pExpr=0;
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoExpr::CegoExpr()
@@ -473,7 +473,7 @@
}
}
-void CegoExpr::decode(char *buf, CegoDistManager *pGTM)
+void CegoExpr::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
char* pE = (char*)buf;
@@ -487,16 +487,16 @@
case CegoExpr::SUB:
case CegoExpr::CONCAT:
{
- _pExpr = new CegoExpr(pE, pGTM);
+ _pExpr = new CegoExpr(pE, pGTM, tabSetId);
pE = pE + _pExpr->getEncodingLength();
- _pTerm = new CegoTerm(pE, pGTM);
+ _pTerm = new CegoTerm(pE, pGTM, tabSetId);
pE = pE + _pTerm->getEncodingLength();
break;
}
case CegoExpr::TERM:
{
_pExpr=0;
- _pTerm = new CegoTerm(pE, pGTM);
+ _pTerm = new CegoTerm(pE, pGTM, tabSetId);
pE = pE + _pTerm->getEncodingLength();
break;
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoExpr.h
^
|
@@ -33,7 +33,7 @@
enum ExpType { ADD, SUB, TERM, CONCAT };
CegoExpr();
- CegoExpr(char* buf, CegoDistManager *pGTM);
+ CegoExpr(char* buf, CegoDistManager *pGTM, int tabSetId);
CegoExpr(Element* pExpElement, CegoDistManager *pGTM);
CegoExpr(CegoExpr *pExpr, CegoTerm *pTerm, ExpType expType);
CegoExpr(CegoTerm *pTerm);
@@ -79,7 +79,7 @@
friend ostream& operator << (ostream& s, const CegoExpr& e);
void encode(char *buf);
- void decode(char *buf, CegoDistManager *pGTM);
+ void decode(char *buf, CegoDistManager *pGTM, int tabSetId);
int getEncodingLength() const;
void getPlanList(ListT<Element*>& planList);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoFactor.cc
^
|
@@ -31,7 +31,7 @@
#include <string.h>
#include <stdlib.h>
-CegoFactor::CegoFactor(char* buf, CegoDistManager *pGTM)
+CegoFactor::CegoFactor(char* buf, CegoDistManager *pGTM, int tabSetId)
{
_pAttrDesc = 0;
_pExpr = 0;
@@ -45,7 +45,7 @@
_flaCached = false;
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoFactor::CegoFactor(Element* pFactorElement, CegoDistManager *pGTM)
@@ -1191,7 +1191,7 @@
}
}
-void CegoFactor::decode(char *buf, CegoDistManager* pGTM)
+void CegoFactor::decode(char *buf, CegoDistManager* pGTM, int tabSetId)
{
char* pE = (char*)buf;
@@ -1221,7 +1221,7 @@
}
case CegoFactor::EXPR:
{
- _pExpr = new CegoExpr(pE, pGTM);
+ _pExpr = new CegoExpr(pE, pGTM, tabSetId);
pE = pE + _pExpr->getEncodingLength();
break;
}
@@ -1237,19 +1237,19 @@
}
case CegoFactor::AGGREGATION:
{
- _pAggr = new CegoAggregation(pE, pGTM);
+ _pAggr = new CegoAggregation(pE, pGTM, tabSetId);
pE = pE + _pAggr->getEncodingLength();
break;
}
case CegoFactor::FUNCTION:
{
- _pFunction = new CegoFunction(pE, pGTM);
+ _pFunction = new CegoFunction(pE, pGTM, tabSetId);
pE = pE + _pFunction->getEncodingLength();
break;
}
case CegoFactor::QUERY:
{
- _pSelect = new CegoSelect(pE, pGTM);
+ _pSelect = new CegoSelect(pE, pGTM, tabSetId);
pE = pE + _pSelect->getEncodingLength();
break;
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoFactor.h
^
|
@@ -45,7 +45,7 @@
enum FacType { CONSTVAL, VAR, EXPR, FETCH, ATTR, FUNCTION, QUERY, AGGREGATION, CASECOND };
- CegoFactor(char* buf, CegoDistManager *pGTM);
+ CegoFactor(char* buf, CegoDistManager *pGTM, int tabSetId);
CegoFactor(Element* pFactorElement, CegoDistManager *pGTM);
CegoFactor(const CegoFactor& pf);
@@ -101,7 +101,7 @@
void fromElement(Element *pFactorElement, CegoDistManager* pGTM);
void encode(char *buf);
- void decode(char *buf, CegoDistManager* pGTM);
+ void decode(char *buf, CegoDistManager* pGTM, int tabSetId);
int getEncodingLength() const;
ListT<CegoAggregation*> getAggregationList();
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoFunction.cc
^
|
@@ -30,10 +30,6 @@
#include <string.h>
#include <stdlib.h>
-CegoFunction::CegoFunction(char* buf, CegoDistManager *pGTM)
-{
- decode(buf, pGTM);
-}
CegoFunction::CegoFunction(CegoFunction::FunctionType type)
{
@@ -48,6 +44,13 @@
_type = type;
}
+CegoFunction::CegoFunction(char* buf, CegoDistManager *pTabMng, int tabSetId)
+{
+ _pTabMng = pTabMng;
+ _tabSetId = tabSetId;
+ decode(buf, pTabMng, tabSetId);
+}
+
CegoFunction::CegoFunction(CegoDistManager* pTabMng, int tabSetId, CegoFunction::FunctionType type)
{
_pTabMng = pTabMng;
@@ -1091,56 +1094,64 @@
}
case CegoFunction::USERDEFINED:
{
-
+
CegoFieldValue retVal;
+
+ _pTabMng->getDBMng()->useObject(_tabSetId, _funcName, CegoObject::PROCEDURE, CegoDatabaseManager::SHARED, _pTabMng->getThreadId());
try
{
- _pTabMng->getDBMng()->useObject(_tabSetId, _funcName, CegoObject::PROCEDURE, CegoDatabaseManager::SHARED, _pTabMng->getThreadId());
-
CegoProcedure* pProc = _pTabMng->getProcedure(_tabSetId, _funcName);
-
- pProc->setMasterBlock(_pBlock);
-
- ListT<CegoProcVar> argList;
- pProc->getArgList(argList);
-
- CegoProcVar *pVar = argList.First();
- CegoExpr **pExpr = _exprList.First();
- while ( pVar && pExpr )
+
+ if ( pProc )
{
+
+ pProc->setMasterBlock(_pBlock);
- (*pExpr)->setBlock(_pBlock);
+ ListT<CegoProcVar> argList;
+ pProc->getArgList(argList);
- if ( pVar->getVarType() == CegoProcVar::OUTVAR )
+ CegoProcVar *pVar = argList.First();
+ CegoExpr **pExpr = _exprList.First();
+ while ( pVar && pExpr )
{
- Chain outVar;
- (*pExpr)->checkVar(outVar);
- CegoProcVar *pCheckVar = _pBlock->getVarList().Find(CegoProcVar(outVar));
- if ( pCheckVar == 0 )
+ (*pExpr)->setBlock(_pBlock);
+
+ if ( pVar->getVarType() == CegoProcVar::OUTVAR )
{
- CegoFieldValue nullVal;
- _pBlock->getVarList().Insert(CegoProcVar(outVar, CegoProcVar::BLOCKVAR, NULL_TYPE, 0, nullVal));
- }
+ Chain outVar;
+ (*pExpr)->checkVar(outVar);
+
+ CegoProcVar *pCheckVar = _pBlock->getVarList().Find(CegoProcVar(outVar));
+ if ( pCheckVar == 0 )
+ {
+ CegoFieldValue nullVal;
+ _pBlock->getVarList().Insert(CegoProcVar(outVar, CegoProcVar::BLOCKVAR, NULL_TYPE, 0, nullVal));
+ }
+ }
+ pExpr = _exprList.Next();
+ pVar = argList.Next();
}
- pExpr = _exprList.Next();
- pVar = argList.Next();
- }
-
-
- pProc->execute(_exprList);
- retVal = pProc->getRetVal();
+ pProc->execute(_exprList);
+
+ retVal = pProc->getRetVal();
+ }
+ else
+ {
+ Chain msg= Chain("Function ") + _funcName + Chain(" not loaded");
+ throw Exception(EXLOC, msg);
+ }
}
catch ( Exception e )
{
_pTabMng->getDBMng()->unuseObject(_tabSetId, _funcName, CegoObject::PROCEDURE, CegoDatabaseManager::SHARED);
throw e;
}
-
+
_pTabMng->getDBMng()->unuseObject(_tabSetId, _funcName, CegoObject::PROCEDURE, CegoDatabaseManager::SHARED);
return retVal;
@@ -1664,6 +1675,15 @@
memcpy( pE, &_type, sizeof(CegoFunction::FunctionType));
pE = pE + sizeof(CegoFunction::FunctionType);
+ if ( _type == CegoFunction::USERDEFINED )
+ {
+ int len = _funcName.length() - 1;
+ memcpy(pE, &len, sizeof(int));
+ pE = pE + sizeof(int);
+ memcpy(pE, (char*)_funcName, len);
+ pE = pE + len;
+ }
+
int numExpr = _exprList.Size();
memcpy( pE, &numExpr, sizeof(int));
@@ -1676,17 +1696,24 @@
pE = pE + (*pExpr)->getEncodingLength();
pExpr = _exprList.Next();
}
-
-
}
-void CegoFunction::decode(char *buf, CegoDistManager* pGTM)
+void CegoFunction::decode(char *buf, CegoDistManager* pGTM, int tabSetId)
{
char* pE = (char*)buf;
memcpy( &_type, pE, sizeof(CegoFunction::FunctionType));
pE = pE + sizeof(CegoFunction::FunctionType);
+ if ( _type == CegoFunction::USERDEFINED )
+ {
+ int len;
+ memcpy( &len, pE, sizeof(int));
+ pE = pE + sizeof(int);
+ _funcName = Chain((char*)pE, len);
+ pE = pE + len;
+ }
+
int numExpr;
memcpy( &numExpr, pE, sizeof(int));
pE = pE + sizeof(int);
@@ -1694,7 +1721,7 @@
int i=0;
while ( i < numExpr )
{
- CegoExpr *pExpr = new CegoExpr(pE, pGTM);
+ CegoExpr *pExpr = new CegoExpr(pE, pGTM, tabSetId);
pE = pE + pExpr->getEncodingLength();
_exprList.Insert(pExpr);
i++;
@@ -1708,6 +1735,11 @@
int len = 0;
len += sizeof(CegoFunction::FunctionType);
+ if ( _type == CegoFunction::USERDEFINED )
+ {
+ len += sizeof(int); // size of user funcname
+ len += _funcName.length() - 1;
+ }
len += sizeof(int); // numExpr
CegoExpr** pExpr = _exprList.First();
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoFunction.h
^
|
@@ -69,10 +69,12 @@
SETCOUNT,
USERDEFINED };
- CegoFunction(char* buf, CegoDistManager *pGTM);
+
+
CegoFunction(FunctionType funcType);
CegoFunction(FunctionType funcType, ListT<CegoExpr*>& exprList);
+ CegoFunction(char* buf, CegoDistManager *pTabMng, int tabSetId);
CegoFunction(CegoDistManager* pTabMng, int tabSetId, CegoFunction::FunctionType type);
CegoFunction(CegoDistManager* pTabMng, int tabSetId, const Chain& funcName, ListT<CegoExpr*>& exprList);
@@ -109,7 +111,7 @@
void fromElement(Element *pFunctionElement, CegoDistManager *pGTM);
void encode(char *buf);
- void decode(char *buf, CegoDistManager* pGTM);
+ void decode(char *buf, CegoDistManager* pGTM, int tabSetId);
int getEncodingLength() const;
CegoFunction* clone(bool isAttrRef = false);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoHavingDesc.cc
^
|
@@ -31,11 +31,11 @@
_comp = comp;
}
-CegoHavingDesc::CegoHavingDesc(char* buf, CegoDistManager *pGTM)
+CegoHavingDesc::CegoHavingDesc(char* buf, CegoDistManager *pGTM, int tabSetId)
{
_pAggExpr = 0;
_pExpr = 0;
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoHavingDesc::CegoHavingDesc(Element* pHE, CegoDistManager *pGTM)
@@ -80,7 +80,7 @@
pBuf = pBuf + _pExpr->getEncodingLength();
}
-void CegoHavingDesc::decode(char *buf, CegoDistManager *pGTM)
+void CegoHavingDesc::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
if ( _pAggExpr )
delete _pAggExpr;
@@ -89,10 +89,10 @@
char* pBuf = (char*)buf;
- _pAggExpr = new CegoExpr(pBuf, pGTM);
+ _pAggExpr = new CegoExpr(pBuf, pGTM, tabSetId);
pBuf = pBuf + _pAggExpr->getEncodingLength();
- _pExpr = new CegoExpr(pBuf, pGTM);
+ _pExpr = new CegoExpr(pBuf, pGTM, tabSetId);
pBuf = pBuf + _pExpr->getEncodingLength();
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoHavingDesc.h
^
|
@@ -33,7 +33,7 @@
public:
- CegoHavingDesc(char* buf, CegoDistManager *pGTM);
+ CegoHavingDesc(char* buf, CegoDistManager *pGTM, int tabSetId);
CegoHavingDesc(Element* pHE, CegoDistManager *pGTM);
CegoHavingDesc(CegoExpr* pAggExpr, CegoExpr* pExpr, const CegoComparison& comp);
@@ -46,7 +46,7 @@
ListT<CegoAttrDesc*> getAttrRefList() const;
void encode(char *buf);
- void decode(char *buf, CegoDistManager *pGTM);
+ void decode(char *buf, CegoDistManager *pGTM, int tabSetId);
int getEncodingLength() const;
Element* toElement() const;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoImpInStream.cc
^
|
@@ -219,8 +219,9 @@
_sysEntry = CegoDataPointer(_bp.getFileId(), _bp.getPageId(), _bp.getEntryPos());
// _pDBMng->bufferUnfix(_bp, false, _pGTM->getLockHandle());
-
- _pGTM->getObjectListByTable(_oe.getTabSetId(), _oe.getName(), _idxList, _btreeList, _keyList, _checkList, false);
+
+ int numInvalid;
+ _pGTM->getObjectListByTable(_oe.getTabSetId(), _oe.getName(), _idxList, _btreeList, _keyList, _checkList, numInvalid);
_isFirst = false;
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoJDBCInfo.cc
^
|
@@ -249,8 +249,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, true);
+ int numInvalid;
+
+ _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, numInvalid);
ListT<CegoField> schema;
schema.Insert( CegoField("JDBC", "JDBC", "TABLE_CAT", VARCHAR_TYPE, MAX_OBJNAME_LEN));
@@ -347,8 +348,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, true);
+ int numInvalid;
+
+ _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, numInvalid);
ListT<CegoField> schema;
schema.Insert( CegoField("JDBC", "JDBC", "PKTABLE_CAT", VARCHAR_TYPE, MAX_OBJNAME_LEN));
@@ -441,8 +443,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, true);
+ int numInvalid;
+
+ _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, numInvalid);
ListT<CegoField> schema;
@@ -536,8 +539,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, true);
+ int numInvalid;
+
+ _pTabMng->getDistObjectByTableList(*pTS, *pTable, idxList, btreeList, keyList, checkList, numInvalid);
ListT<CegoField> schema;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoJoinObject.cc
^
|
@@ -182,8 +182,9 @@
_pLeftObject->decode(bufPtr);
bufPtr += _pLeftObject->getEntrySize();
+ // TODO
// no support for subselects in Join objects ( pGTM required as argument )
- _pPred = new CegoPredDesc(bufPtr, 0);
+ _pPred = new CegoPredDesc(bufPtr, 0, 0);
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoLogReader.cc
^
|
@@ -300,7 +300,7 @@
CegoQueryHelper qh;
Chain tableAlias;
- qh.decodeDelRec(tableAlias, pPred, lr.getData(), lr.getDataLen(), 0);
+ qh.decodeDelRec(tableAlias, pPred, lr.getData(), lr.getDataLen(), 0, 0);
cout << " TableAlias=" << tableAlias << endl;
@@ -332,7 +332,7 @@
pPred,
updList,
exprList,
- lr.getData(), lr.getDataLen(), 0);
+ lr.getData(), lr.getDataLen(), 0, 0);
cout << "TableAlias=" << tableAlias << endl;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoObjectManager.cc
^
|
@@ -34,6 +34,7 @@
{
_pDBMng = pDBMng;
_pLockHandle = new CegoLockHandler(pDBMng);
+ _ignoreInvalid = true;
_modId = _pDBMng->getModId("CegoObjectManager");
}
@@ -1040,6 +1041,7 @@
void CegoObjectManager::invalidateObject(int tabSetId, const Chain& objName, CegoObject::ObjectType type)
{
+
unsigned long lockId = 0;
CegoBufferPage bp;
@@ -1086,10 +1088,16 @@
int size;
obj.decodeBase(pE, size);
- bool typeMatch = ( type == CegoObject::INDEX
- && ( obj.getType() == CegoObject::INDEX
- || obj.getType() == CegoObject::PINDEX
- || obj.getType() == CegoObject::UINDEX ));
+ bool typeMatch =
+ ( type == CegoObject::INDEX
+ && ( obj.getType() == CegoObject::INDEX
+ || obj.getType() == CegoObject::PINDEX
+ || obj.getType() == CegoObject::UINDEX )) ||
+ ( type == CegoObject::BTREE
+ && ( obj.getType() == CegoObject::BTREE
+ || obj.getType() == CegoObject::PBTREE
+ || obj.getType() == CegoObject::UBTREE ));
+
if ( ! typeMatch )
typeMatch = obj.getType() == type;
@@ -1131,6 +1139,33 @@
return;
}
+ case CegoObject::BTREE:
+ case CegoObject::PBTREE:
+ case CegoObject::UBTREE:
+ {
+
+ CegoBTreeObject bto;
+ bto.decode(pE);
+
+ fileId = bto.getDataFileId();
+ pageId = bto.getDataPageId();
+
+ CegoBTreeManager btreeMng(this, &bto);
+ int freedPages = btreeMng.freeBTree();
+
+ bto.setDataFileId(0);
+ bto.setDataPageId(0);
+
+ bto.encode(pE);
+
+ _pLockHandle->unlockSysPage(lockId);
+ lockId = 0;
+
+ _pDBMng->bufferUnfix(bp, true, _pLockHandle);
+
+ return;
+
+ }
default:
break;
}
@@ -2406,11 +2441,16 @@
}
+void CegoObjectManager::setIgnoreInvalid(bool ignoreInvalid)
+{
+ _ignoreInvalid = ignoreInvalid;
+}
+
void CegoObjectManager::getObjectListByTable(int tabSetId, const Chain& tabName,
ListT<CegoTableObject>& idxList,
ListT<CegoBTreeObject>& btreeList,
ListT<CegoKeyObject>& keyList,
- ListT<CegoCheckObject>& checkList, bool ignoreInvalid)
+ ListT<CegoCheckObject>& checkList, int& numInvalid)
{
keyList.Empty();
@@ -2420,6 +2460,8 @@
unsigned long lockId = 0;
CegoBufferPage bp;
+ numInvalid = 0;
+
try
{
int maxPos = TABMNG_HASHSIZE;
@@ -2476,13 +2518,18 @@
if ( (Chain)io.getTabName() == (Chain)tabName)
{
- idxList.Insert(io);
-
- // for invalidation
- if ( io.getDataFileId() == 0 && io.getDataPageId() == 0 && ignoreInvalid == false )
+
+ if ( io.getDataFileId() == 0 && io.getDataPageId() == 0 )
{
- Chain msg = Chain("Invalid index ") + io.getName() + Chain(" detected");
- throw Exception(EXLOC, msg);
+ if ( _ignoreInvalid == false )
+ {
+ numInvalid++;
+ idxList.Insert(io);
+ }
+ }
+ else
+ {
+ idxList.Insert(io);
}
}
}
@@ -2495,9 +2542,18 @@
if ( (Chain)bto.getTabName() == (Chain)tabName)
{
- // for invalidation
- if ( ! ( bto.getDataFileId() == 0 && bto.getDataPageId() == 0 && ignoreInvalid ) )
+ if ( bto.getDataFileId() == 0 && bto.getDataPageId() == 0 )
+ {
+ if ( _ignoreInvalid == false )
+ {
+ numInvalid++;
+ btreeList.Insert(bto);
+ }
+ }
+ else
+ {
btreeList.Insert(bto);
+ }
}
}
}
@@ -2599,7 +2655,7 @@
|| obj.getType() == CegoObject::UBTREE ));
if ( ! typeMatch )
typeMatch = obj.getType() == type;
-
+
if ((Chain)obj.getName() == (Chain)objectName && typeMatch ) // && type != CegoObject::FKEY)
{
oe.decode(pE);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoObjectManager.h
^
|
@@ -50,11 +50,13 @@
bool objectExists(int tabSetId, const Chain& objectName, CegoObject::ObjectType type);
void getObjectList(int tabSetId, CegoObject::ObjectType type, ListT<Chain>& objList);
+
+ void setIgnoreInvalid(bool ignoreInvalid);
void getObjectListByTable(int tabSetId, const Chain& tabName,
ListT<CegoTableObject>& idxList,
ListT<CegoBTreeObject>& btreeList,
ListT<CegoKeyObject>& keyList,
- ListT<CegoCheckObject>& checkList, bool ignoreInvalid);
+ ListT<CegoCheckObject>& checkList, int& numInvalid);
void getObject(int tabSetId, const Chain& objectName, CegoObject::ObjectType type, CegoDecodableObject& oe);
void getObjectWithFix(int tabSetId, const Chain& objectName, CegoObject::ObjectType type, CegoDecodableObject& oe, CegoBufferPage &bp);
@@ -122,6 +124,7 @@
CegoDataPointer insertPageData(int tabSetId, CegoObject::ObjectType type, int fileId, int pageId, char* data, int datasize, bool& isNewPage, bool allowWrite, bool doAppend);
+ bool _ignoreInvalid;
unsigned long _modId;
};
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoPredDesc.cc
^
|
@@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h>
-CegoPredDesc::CegoPredDesc(char* buf, CegoDistManager *pGTM)
+CegoPredDesc::CegoPredDesc(char* buf, CegoDistManager *pGTM, int tabSetId)
{
_pExpr1 = 0;
_pExpr2 = 0;
@@ -36,7 +36,7 @@
_pNotPred = 0;
_isChecked = false;
_pSelect = 0;
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoPredDesc::CegoPredDesc(Element* pPredElement, CegoDistManager *pGTM)
@@ -561,7 +561,7 @@
}
}
-void CegoPredDesc::decode(char *buf, CegoDistManager *pGTM)
+void CegoPredDesc::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
char* pP = (char*)buf;
@@ -580,13 +580,13 @@
{
case CegoPredDesc::CONDITION:
{
- _pC = new CegoCondDesc(pP, pGTM);
+ _pC = new CegoCondDesc(pP, pGTM, tabSetId);
pP = pP + _pC->getEncodingLength();
break;
}
case CegoPredDesc::NOTPRED:
{
- _pNotPred = new CegoPredDesc(pP, pGTM);
+ _pNotPred = new CegoPredDesc(pP, pGTM, tabSetId);
pP = pP + _pNotPred->getEncodingLength();
break;
}
@@ -596,10 +596,10 @@
memcpy( &_comp, pP, sizeof(CegoComparison));
pP = pP + sizeof(CegoComparison);
- _pExpr1 = new CegoExpr(pP, pGTM);
+ _pExpr1 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr1->getEncodingLength();
- _pExpr2 = new CegoExpr(pP, pGTM);
+ _pExpr2 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr2->getEncodingLength();
break;
@@ -607,13 +607,13 @@
case CegoPredDesc::BETWEEN:
{
- _pExpr1 = new CegoExpr(pP, pGTM);
+ _pExpr1 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr1->getEncodingLength();
- _pExpr2 = new CegoExpr(pP, pGTM);
+ _pExpr2 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr2->getEncodingLength();
- _pExpr3 = new CegoExpr(pP, pGTM);
+ _pExpr3 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr3->getEncodingLength();
break;
@@ -621,13 +621,13 @@
case CegoPredDesc::NULLCOMP:
case CegoPredDesc::NOTNULLCOMP:
{
- _pExpr1 = new CegoExpr(pP, pGTM);
+ _pExpr1 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr1->getEncodingLength();
break;
}
case CegoPredDesc::EXISTSCOMP:
{
- _pSelect = new CegoSelect(pP, pGTM);
+ _pSelect = new CegoSelect(pP, pGTM, tabSetId);
pP = pP + _pSelect->getEncodingLength();
break;
}
@@ -635,10 +635,10 @@
case CegoPredDesc::NOTINSUB:
{
- _pExpr1 = new CegoExpr(pP, pGTM);
+ _pExpr1 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr1->getEncodingLength();
- _pSelect = new CegoSelect(pP, pGTM);
+ _pSelect = new CegoSelect(pP, pGTM, tabSetId);
pP = pP + _pSelect->getEncodingLength();
break;
@@ -646,7 +646,7 @@
case CegoPredDesc::ISLIKE:
case CegoPredDesc::ISNOTLIKE:
{
- _pExpr1 = new CegoExpr(pP, pGTM);
+ _pExpr1 = new CegoExpr(pP, pGTM, tabSetId);
pP = pP + _pExpr1->getEncodingLength();
char len;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoPredDesc.h
^
|
@@ -42,7 +42,7 @@
enum CompMode { EXPRCOMP, EXISTSCOMP, ISLIKE, ISNOTLIKE, INSUB, NOTINSUB, NULLCOMP, NOTNULLCOMP, CONDITION, NOTPRED, BETWEEN };
- CegoPredDesc(char* buf, CegoDistManager *pGTM);
+ CegoPredDesc(char* buf, CegoDistManager *pGTM, int tabSetId);
CegoPredDesc(Element* pPredElement, CegoDistManager *pGTM);
CegoPredDesc(const CegoPredDesc& p);
CegoPredDesc(CegoExpr *pExpr1, CegoExpr *pExpr2, const CegoComparison& comp);
@@ -100,7 +100,7 @@
CegoPredDesc& operator = ( const CegoPredDesc& p);
void encode(char *buf);
- void decode(char *buf, CegoDistManager *pGTM);
+ void decode(char *buf, CegoDistManager *pGTM, int tabSetId);
int getEncodingLength() const;
SetT<Chain> getTableRefSet() const;
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoQueryHelper.cc
^
|
@@ -1529,7 +1529,7 @@
ListT<CegoField>& updList,
ListT<CegoExpr*>& exprList,
char* pBuf, int buflen,
- CegoDistManager *pGTM)
+ CegoDistManager *pGTM, int tabSetId)
{
int aliasLen;
@@ -1545,7 +1545,7 @@
if ( c == 1 )
{
- pPred = new CegoPredDesc(pBuf, pGTM);
+ pPred = new CegoPredDesc(pBuf, pGTM, tabSetId);
pBuf += pPred->getEncodingLength();
}
else
@@ -1568,7 +1568,7 @@
int pos = 0;
while ( pos < expBufLen )
{
- CegoExpr *pExpr = new CegoExpr(pBuf, pGTM);
+ CegoExpr *pExpr = new CegoExpr(pBuf, pGTM, tabSetId);
int len = pExpr->getEncodingLength();
pos += len;
@@ -1636,7 +1636,7 @@
void CegoQueryHelper::decodeDelRec(Chain& tableAlias,
CegoPredDesc* &pPred,
char* pBuf, int buflen,
- CegoDistManager *pGTM)
+ CegoDistManager *pGTM, int tabSetId)
{
int aliasLen;
memcpy(&aliasLen, pBuf, sizeof(int));
@@ -1651,7 +1651,7 @@
if ( c == 1 )
{
- pPred = new CegoPredDesc(pBuf, pGTM);
+ pPred = new CegoPredDesc(pBuf, pGTM, tabSetId);
pBuf += pPred->getEncodingLength();
}
else
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoQueryHelper.h
^
|
@@ -87,7 +87,7 @@
ListT<CegoField>& updList,
ListT<CegoExpr*>& exprList,
char* pBuf, int buflen,
- CegoDistManager* pGTM);
+ CegoDistManager* pGTM, int tabSetId);
void encodeUpdRec(const Chain& tableAlias,
CegoPredDesc* pPred,
@@ -99,7 +99,7 @@
void decodeDelRec(Chain& tableAlias,
CegoPredDesc* &pPred,
char* pBuf, int buflen,
- CegoDistManager *pGTM);
+ CegoDistManager *pGTM, int tabSetId);
void encodeDelRec(const Chain& tableAlias,
CegoPredDesc* pPred,
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoRecoveryManager.cc
^
|
@@ -622,9 +622,7 @@
ts=logRec.getTS();
int tid=logRec.getTID();
-#ifdef CGDEBUG
- _pDBMng->log(_modId, Logger::DEBUG, Chain("Recovering lsn ") + Chain(logRec.getLSN()) + Chain(" ..."));
-#endif
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Recovering lsn ") + Chain(logRec.getLSN()) + Chain(" ..."));
// here comes the recovery
@@ -632,7 +630,7 @@
{
case CegoLogRecord::LOGREC_CREATE:
-
+ {
switch ( logRec.getObjType() )
{
@@ -678,6 +676,7 @@
break;
}
break;
+ }
case CegoLogRecord::LOGREC_DROP:
{
_pGTM->removeObject(tabSetId, logRec.getObjName(), logRec.getObjType());
@@ -721,7 +720,7 @@
if ( invalidateSet.Find(logRec.getObjName()) == 0 )
{
- _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
_pGTM->invalidateIndexForTable(tabSetId, logRec.getObjName());
invalidateSet.Insert(logRec.getObjName());
}
@@ -764,11 +763,10 @@
}
bool lastPage = true;
- bool ignoreInvalid = true;
CegoDataPointer dp;
_pGTM->setTID(tabSetId, tid);
- _pGTM->insertDataTable(oe, fvl, dp, lastPage, ignoreInvalid);
+ _pGTM->insertDataTable(oe, fvl, dp, lastPage);
break;
}
@@ -779,7 +777,7 @@
CegoQueryHelper qh;
Chain tableAlias;
- qh.decodeDelRec(tableAlias, pPred, logRec.getData(), logRec.getDataLen(), _pGTM);
+ qh.decodeDelRec(tableAlias, pPred, logRec.getData(), logRec.getDataLen(), _pGTM, tabSetId);
_delRecList.Insert(DeleteRecord(tid, tableAlias, pPred));
@@ -798,13 +796,13 @@
if ( invalidateSet.Find(logRec.getObjName()) == 0 )
{
- _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
_pGTM->invalidateIndexForTable(tabSetId, logRec.getObjName());
invalidateSet.Insert(logRec.getObjName());
}
_pGTM->setTID(tabSetId, tid);
- _pGTM->deleteDataTable(oe, delRecord->getPred(), 0, true);
+ _pGTM->deleteDataTable(oe, delRecord->getPred(), 0);
delRecord->clean();
_delRecList.Remove(DeleteRecord(tid));
@@ -827,7 +825,7 @@
CegoPredDesc *pPred = 0;
CegoQueryHelper qh;
Chain tableAlias;
- qh.decodeUpdRec(tableAlias, pPred, updList, exprList, logRec.getData(), logRec.getDataLen(), _pGTM);
+ qh.decodeUpdRec(tableAlias, pPred, updList, exprList, logRec.getData(), logRec.getDataLen(), _pGTM, tabSetId);
_updRecList.Insert(UpdateRecord(tid, tableAlias, pPred, updList, exprList));
@@ -853,7 +851,7 @@
updRecord->getTable(),
updRecord->getPred(),
updRecord->getUpdateList(),
- updRecord->getExprList(), 0, true);
+ updRecord->getExprList(), 0);
updRecord->clean();
_updRecList.Remove(UpdateRecord(tid));
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoSelect.cc
^
|
@@ -33,9 +33,57 @@
#include <string.h>
#include <stdlib.h>
-CegoSelect::CegoSelect(char* buf, CegoDistManager* pGTM)
+CegoSelect::CegoSelect(char* buf, CegoDistManager* pGTM, int tabSetId)
{
- decode(buf, pGTM);
+ _pPred = 0;
+ _pHaving = 0;
+ _pNativeOrderList = 0;
+ _pOrderList = 0;
+ _pGroupList = 0;
+ _pNativeOrderOptList = 0;
+ _pOrderOptList = 0;
+ _pOrderSpace = 0;
+ _pGroupSpace = 0;
+ _pGTM = pGTM;
+ _pLogger = _pGTM->getDBMng();
+
+ _modId = 0;
+
+ int i=0;
+ while ( i < TABMNG_MAXJOINLEVEL )
+ {
+ _pTC[i]=0;
+ _attrCondFlag[i] = false;
+ _firstTuple[i]=true;
+ _attrPred[i]=0;
+ i++;
+ }
+
+ _pBlock = 0;
+ _pUnionSelect = 0;
+
+ _checkUnion = false;
+ _selectMode = PLAIN;
+ _nextAid=0;
+ _aggregationCount=0;
+
+ _pOrderCursor=0;
+ _pGroupCursor=0;
+
+ _isDistinct = false;
+ _pParentJoinBuf = 0;
+ _isPrepared = false;
+ _rowLimit = 0;
+ _doCaching = false;
+ _isCached = false;
+ _extRefCount = 0;
+
+ _cacheEnabled = true;
+
+ _tabSetId = tabSetId;
+
+ decode(buf, pGTM, tabSetId);
+
}
CegoSelect::CegoSelect(Element* pSelectElement, CegoDistManager* pGTM)
@@ -49,7 +97,10 @@
_pOrderOptList = 0;
_pOrderSpace = 0;
_pGroupSpace = 0;
- _pGTM = 0;
+
+ _pGTM = pGTM;
+ _pLogger = _pGTM->getDBMng();
+
_pLogger = 0;
_modId = 0;
@@ -342,13 +393,16 @@
if ( _isPrepared )
{
+
#ifdef CGDEBUG
_pLogger->log(_modId, Logger::DEBUG, Chain("Building join conditions ..."));
#endif
+
buildJoinConditions();
return;
}
-
+
+
#ifdef CGDEBUG
_pLogger->log(_modId, Logger::DEBUG, Chain("Evaluating references ..."));
#endif
@@ -440,7 +494,8 @@
if ( _pUnionSelect )
{
_pUnionSelect->prepare();
- }
+ }
+
}
// the reset method performas a reset on the query without making any join evaluation
@@ -1262,6 +1317,7 @@
bool moreTuple=false;
+
if ( _firstTuple[_joinLevel] )
{
if ( _pTC[_joinLevel] == 0 )
@@ -1272,6 +1328,8 @@
+ _joinList[_joinLevel]->getTabName() + Chain(" on join level ") + Chain(_joinLevel));
#endif
+
+
_pTC[_joinLevel] =
new CegoDistCursor(_pGTM,_joinList[_joinLevel]);
@@ -1282,12 +1340,16 @@
{
// _pLogger->log(_modId, Logger::DEBUG, Chain("Resetting cursor for ")
// + _joinList[_joinLevel]->getTabName());
+
+
_pTC[_joinLevel]->reset();
+
}
if ( _attrCondFlag[_joinLevel] == true )
{
+
#ifdef CGDEBUG
_pLogger->log(_modId, Logger::DEBUG, Chain("Setting attrcond = ") + _attrCond[_joinLevel].toChain());
#endif
@@ -1351,6 +1413,7 @@
else
{
+
/*
cout << "NextTuple : Size=" << _joinSize << " NumCO= " << _joinList[_joinLevel]->getSubCOList().Size() << endl;
for ( int i=_joinSize; i<_joinList[_joinLevel]->getSubCOList().Size(); i++)
@@ -1358,8 +1421,10 @@
cout << "SchemaSize=" << _joinBuf[i].Size() << endl;
}
*/
+
moreTuple = _pTC[_joinLevel]->nextTuple(_joinBuf, _joinSize, _joinList[_joinLevel]->getSubCOList().Size());
+
}
@@ -1872,6 +1937,7 @@
if ( i >= TABMNG_MAXJOINLEVEL )
throw Exception(EXLOC, "Join levels exceeded");
+
if ( ! _conjunctionList.isEmpty() )
{
@@ -1893,60 +1959,15 @@
{
CegoAttrCond ac;
-
+
#ifdef CGDEBUG
_pLogger->log(_modId, Logger::DEBUG, Chain("Getting attribute cond for ") + (*pPred)->toChain());
#endif
+
CegoQueryHelper::AttrCondMatch m = queryHelper.checkAttrCond(ac, *pPred, _joinList[i]->getSchema(), &availJoinFields, 1, _pBlock);
if ( m != CegoQueryHelper::INAPP )
{
- // _pLogger->log(_modId, Logger::DEBUG, Chain("Detecting valid attr cond ") + ac.toChain());
-
- // before we can use the attrCond as index cursor condition, we have to
- // check out if the object is a view or if an appropriate index exists
-
- /*
- CegoAttrCond::IndexMatch idxMatch = CegoAttrCond::INAPP;
-
- if ( _joinList[i]->getType() == CegoObject::JOIN )
- {
- // useAttrCond = true;
- // predChecked = true;
- }
- else if ( _pGTM->distObjectExists( _joinList[i]->getTabName(),
- _joinList[i]->getTabSetId(),
- CegoObject::VIEW ) )
- {
- // useAttrCond = true;
- // predChecked = true;
- }
- else
- {
-
- idxMatch = _pGTM->distIndexExists( _joinList[i]->getTabSetId(),
- _joinList[i]->getTabName(),
- ac );
-
- if ( idxMatch == CegoAttrCond::INAPP )
- {
- useAttrCond = true;
- predChecked = true;
- }
- else if ( idxMatch == CegoAttrCond::PART )
- {
- useAttrCond = true;
- predChecked = true;
- }
- else if ( idxMatch == CegoAttrCond::FULL )
- {
- useAttrCond = true;
- predChecked = true;
- }
-
- }
- */
-
bool predChecked = false;
@@ -1984,6 +2005,7 @@
}
}
+
}
void CegoSelect::buildJoinRefs()
@@ -2839,7 +2861,7 @@
}
-void CegoSelect::decode(char *buf, CegoDistManager *pGTM)
+void CegoSelect::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
char* pBuf = (char*)buf;
@@ -2851,7 +2873,7 @@
int i = 0;
while ( i < size )
{
- CegoExpr *pExpr = new CegoExpr(pBuf, pGTM);
+ CegoExpr *pExpr = new CegoExpr(pBuf, pGTM, tabSetId);
int len = pExpr->getEncodingLength();
pBuf += len;
@@ -2904,7 +2926,7 @@
if ( size > 0 )
{
- _pPred = new CegoPredDesc(pBuf, pGTM);
+ _pPred = new CegoPredDesc(pBuf, pGTM, tabSetId);
pBuf += _pPred->getEncodingLength();
}
else
@@ -2938,7 +2960,7 @@
if ( size > 0 )
{
- _pHaving = new CegoHavingDesc(buf, pGTM);
+ _pHaving = new CegoHavingDesc(buf, pGTM, tabSetId);
pBuf += _pHaving->getEncodingLength();
}
else
@@ -2962,7 +2984,7 @@
int i = 0;
while ( i < size )
{
- CegoExpr *pExpr = new CegoExpr(pBuf, pGTM);
+ CegoExpr *pExpr = new CegoExpr(pBuf, pGTM, tabSetId);
int len = pExpr->getEncodingLength();
pBuf += len;
@@ -2982,7 +3004,7 @@
if ( size > 0 )
{
- _pUnionSelect = new CegoSelect(pBuf, pGTM);
+ _pUnionSelect = new CegoSelect(pBuf, pGTM, tabSetId);
}
else
{
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoSelect.h
^
|
@@ -51,7 +51,7 @@
public:
- CegoSelect(char* buf, CegoDistManager* pGTM);
+ CegoSelect(char* buf, CegoDistManager* pGTM, int tabSetId);
CegoSelect(Element* pSelectElement, CegoDistManager* pGTM);
CegoSelect(ListT<CegoContentObject*>& coList,
ListT<CegoExpr*>& exprList,
@@ -104,7 +104,7 @@
ListT<CegoField> getFieldList() const;
void encode(char *buf);
- void decode(char *buf, CegoDistManager* pGTM);
+ void decode(char *buf, CegoDistManager* pGTM, int tabSetId);
int getEncodingLength() const;
void setViewCond(const CegoAttrCond& attrCond);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoTableCursor.cc
^
|
@@ -73,6 +73,7 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
if ( _idxSetup == false || attrCond.diff(_attrCond) == false )
{
@@ -81,8 +82,9 @@
#endif
_idxSetup = true;
-
- _pTM->getObjectListByTable(_tabSetId, _tableName, idxList, btreeList, keyList, checkList, false);
+
+ // we can ignore invalid index objects here, since we just read from the table
+ _pTM->getObjectListByTable(_tabSetId, _tableName, idxList, btreeList, keyList, checkList, numInvalid);
CegoTableObject *pIOE = idxList.First();
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoTableManager.cc
^
|
@@ -1451,9 +1451,15 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, true);
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
+ if ( numInvalid > 0 )
+ {
+ throw Exception(EXLOC, Chain("Invalid index detected"));
+ }
+
CegoTableObject *pIO = idxList.First();
while ( pIO )
{
@@ -1684,8 +1690,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, true);
+ int numInvalid;
+
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
CegoTableObject *pIdx = idxList.First();
while ( pIdx )
@@ -1693,9 +1700,17 @@
invalidateObject(tabSetId, pIdx->getName(), pIdx->getType());
pIdx = idxList.Next();
}
+
+ CegoBTreeObject *pBTree = btreeList.First();
+ while ( pBTree )
+ {
+ invalidateObject(tabSetId, pBTree->getName(), pBTree->getType());
+ pBTree = btreeList.Next();
+ }
+
}
-void CegoTableManager::insertDataTable(CegoTableObject& oe, ListT<CegoField>& fvl, CegoDataPointer& dp, bool doLogging, bool ignoreInvalid)
+void CegoTableManager::insertDataTable(CegoTableObject& oe, ListT<CegoField>& fvl, CegoDataPointer& dp, bool doLogging)
{
// nextTAStep
if ( getTID(oe.getTabSetId()) != 0 )
@@ -1705,8 +1720,13 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- getObjectListByTable(oe.getTabSetId(), oe.getName(), idxList, btreeList, keyList, checkList, ignoreInvalid);
+ int numInvalid;
+
+ getObjectListByTable(oe.getTabSetId(), oe.getName(), idxList, btreeList, keyList, checkList, numInvalid);
+ if ( numInvalid > 0 )
+ {
+ throw Exception(EXLOC, Chain("Invalid index detected"));
+ }
CegoDataPointer sysEntry;
Chain virginIndex;
@@ -2174,7 +2194,7 @@
}
}
-long CegoTableManager::updateDataTable(int tabSetId, const Chain& tableName, const Chain& tableAlias, CegoPredDesc* pPred, const ListT<CegoField>& updList, ListT<CegoExpr*>& exprList, CegoProcBlock* pBlock, bool ignoreInvalid)
+long CegoTableManager::updateDataTable(int tabSetId, const Chain& tableName, const Chain& tableAlias, CegoPredDesc* pPred, const ListT<CegoField>& updList, ListT<CegoExpr*>& exprList, CegoProcBlock* pBlock)
{
long updCount = 0;
@@ -2208,6 +2228,7 @@
if ( buflen > 0 )
free ( pBuf );
+
try
{
@@ -2217,8 +2238,14 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
+
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, ignoreInvalid);
+ if ( numInvalid > 0 )
+ {
+ throw Exception(EXLOC, Chain("Invalid index detected"));
+ }
if (pPred == 0)
{
@@ -2281,6 +2308,7 @@
else
{
+
ListT<CegoField> fl = oe.getSchema();
if ( tableName != tableAlias )
{
@@ -2440,6 +2468,7 @@
_pDBMng->log(_modId, Logger::DEBUG, Chain("Updating tuple..."));
#endif
updateTuple(oe, sysEntry, dp, fl, updList, exprList, idxList, btreeList, keyList, checkList, virginIndex, pBlock);
+
moreTuple = pTC->getNext(fl, dp);
}
else
@@ -2509,11 +2538,11 @@
const Chain& virginIndex,
CegoProcBlock* pBlock)
{
-
+
#ifdef CGDEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Updating tuple for ") + oe.getTabName());
#endif
-
+
CegoField* pFV = nfvl.First();
CegoExpr** pExpr = exprList.First();
@@ -2524,11 +2553,11 @@
(*pExpr)->setFieldListArray(&fl, 1);
(*pExpr)->clearAttrCache();
-
+
CegoFieldValue fv = (*pExpr)->evalFieldValue();
_qh.prepareFieldValue(pFV, fv, pos);
-
+
pFV->setValue(fv);
pFV = nfvl.Next();
pExpr = exprList.Next();
@@ -2557,6 +2586,7 @@
_pDBMng->log(_modId, Logger::DEBUG, Chain("Checking integrity ... "));
#endif
+
checkIntegrity( oe.getTabSetId(), oe.getTabName(), dp, fl, updSchema);
#ifdef CGDEBUG
@@ -2564,9 +2594,9 @@
#endif
CegoDataPointer ndp;
-
+
deleteDataTable(oe.getTabSetId(), oe.getTabName(), oe.getType(), dp, fl, idxList, btreeList, keyList, false);
- insertDataTable(oe, updSchema, idxList, btreeList, keyList, checkList, sysEntry, virginIndex, ndp, false);
+ insertDataTable(oe, updSchema, idxList, btreeList, keyList, checkList, sysEntry, virginIndex, ndp, true);
if ( virginIndex != Chain() )
_pTM->recordUpdate(oe.getTabSetId(), getTID(oe.getTabSetId()), ndp);
@@ -2582,8 +2612,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, false);
+ int numInvalid;
+
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
if ( ! keyList.isEmpty() )
{
@@ -2754,8 +2785,9 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, false);
+ int numInvalid;
+
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
if ( ! idxList.isEmpty() )
{
@@ -3068,7 +3100,7 @@
}
-long CegoTableManager::deleteDataTable(CegoTableObject& oe, CegoPredDesc* pPred, CegoProcBlock* pBlock, bool ignoreInvalid)
+long CegoTableManager::deleteDataTable(CegoTableObject& oe, CegoPredDesc* pPred, CegoProcBlock* pBlock)
{
long delCount = 0;
@@ -3082,8 +3114,14 @@
ListT<CegoBTreeObject> btreeList;
ListT<CegoKeyObject> keyList;
ListT<CegoCheckObject> checkList;
-
- getObjectListByTable(oe.getTabSetId(), oe.getTabName(), idxList, btreeList, keyList, checkList, ignoreInvalid);
+ int numInvalid;
+
+ getObjectListByTable(oe.getTabSetId(), oe.getTabName(), idxList, btreeList, keyList, checkList, numInvalid);
+
+ if ( numInvalid > 0 )
+ {
+ throw Exception(EXLOC, Chain("Invalid index detected"));
+ }
// make log entry first
@@ -3462,8 +3500,10 @@
+ Chain(",") + Chain(type) + Chain(")"));
#endif
-
- getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, false);
+
+ int numInvalid;
+
+ getObjectListByTable(tabSetId, tableName, idxList, btreeList, keyList, checkList, numInvalid);
CegoTableObject *pIO = idxList.First();
while ( pIO )
@@ -4216,9 +4256,14 @@
ListT<CegoBTreeObject> checkBTreeList;
ListT<CegoKeyObject> checkKeyList;
ListT<CegoCheckObject> checkList;
+ int numInvalid;
+
+ getObjectListByTable(tabSetId, refTable, checkIdxList, checkBTreeList, checkKeyList, checkList, numInvalid);
+ if ( numInvalid > 0 )
+ {
+ throw Exception(EXLOC, Chain("Cannot create foreign key on table with invalid index"));
+ }
- getObjectListByTable(tabSetId, refTable, checkIdxList, checkBTreeList, checkKeyList, checkList, false);
-
CegoTableObject *pIO = checkIdxList.First();
bool idxFound = false;
while ( pIO && idxFound == false)
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoTableManager.h
^
|
@@ -110,7 +110,7 @@
void insertDataTable(CegoTableObject& oe,
ListT<CegoField>& fvl,
CegoDataPointer& dp,
- bool doLogging, bool ignoreInvalid = false);
+ bool doLogging);
void insertDataTable(CegoTableObject& oe, ListT<CegoField>& fvl,
@@ -123,7 +123,7 @@
CegoDataPointer& dp,
bool doLogging);
- long deleteDataTable(CegoTableObject& oe, CegoPredDesc* pPred = 0 , CegoProcBlock* pBlock = 0, bool ignoreInvalid = false);
+ long deleteDataTable(CegoTableObject& oe, CegoPredDesc* pPred = 0 , CegoProcBlock* pBlock = 0);
void deleteDataTable(int tabSetId,
const Chain& tableName,
@@ -142,8 +142,7 @@
CegoPredDesc* pPred,
const ListT<CegoField>& updSchema,
ListT<CegoExpr*>& exprList,
- CegoProcBlock* pBlock,
- bool ignoreInvalid = false);
+ CegoProcBlock* pBlock);
void dropTable(int tabSetId,
const Chain& tableName,
@@ -179,7 +178,7 @@
void createIndexTable(int tabSetId, const Chain& indexName, const Chain& tabName, ListT<CegoField>& schema, CegoObject::ObjectType type);
- void createBTree(int tabSetId, const Chain& indexName, const Chain& tableName, ListT<CegoField>& schema, CegoObject::ObjectType type);
+ void createBTree(int tabSetId, const Chain& btreeName, const Chain& tableName, ListT<CegoField>& schema, CegoObject::ObjectType type);
void createAVLIndexTable(int tabSetId, const Chain& indexName, const Chain& tableName, ListT<CegoField>& schema, CegoObject::ObjectType type);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoTerm.cc
^
|
@@ -30,12 +30,12 @@
_pFactor=0;
}
-CegoTerm::CegoTerm(char* buf, CegoDistManager *pGTM)
+CegoTerm::CegoTerm(char* buf, CegoDistManager *pGTM, int tabSetId)
{
_pTerm = 0;
_pFactor = 0;
- decode(buf, pGTM);
+ decode(buf, pGTM, tabSetId);
}
CegoTerm::CegoTerm(Element* pTermElement, CegoDistManager *pGTM)
@@ -308,7 +308,7 @@
}
}
-void CegoTerm::decode(char *buf, CegoDistManager *pGTM)
+void CegoTerm::decode(char *buf, CegoDistManager *pGTM, int tabSetId)
{
char* pE = (char*)buf;
@@ -321,16 +321,16 @@
case CegoTerm::MUL:
case CegoTerm::DIV:
{
- _pTerm = new CegoTerm(pE, pGTM);
+ _pTerm = new CegoTerm(pE, pGTM, tabSetId);
pE = pE + _pTerm->getEncodingLength();
- _pFactor = new CegoFactor(pE, pGTM);
+ _pFactor = new CegoFactor(pE, pGTM, tabSetId);
pE = pE + _pFactor->getEncodingLength();
break;
}
case CegoTerm::FACTOR:
{
_pTerm=0;
- _pFactor = new CegoFactor(pE, pGTM);
+ _pFactor = new CegoFactor(pE, pGTM, tabSetId);
pE = pE + _pFactor->getEncodingLength();
break;
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoTerm.h
^
|
@@ -34,7 +34,7 @@
enum TermType { MUL, DIV, FACTOR };
CegoTerm();
- CegoTerm(char* buf, CegoDistManager *pGTM);
+ CegoTerm(char* buf, CegoDistManager *pGTM, int tabSetId);
CegoTerm(Element* pTermElement, CegoDistManager *pGTM);
CegoTerm(CegoTerm *pTerm, CegoFactor *pFac, TermType termType);
CegoTerm(CegoFactor *pFactor);
@@ -77,7 +77,7 @@
friend ostream& operator << (ostream& s, const CegoTerm& e);
void encode(char *buf);
- void decode(char *buf, CegoDistManager *pGTM);
+ void decode(char *buf, CegoDistManager *pGTM, int tabSetId);
int getEncodingLength() const;
void getPlanList(ListT<Element*>& planList);
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoTransactionManager.cc
^
|
@@ -369,7 +369,8 @@
ListT<CegoBTreeObject> cachedBTreeList;
ListT<CegoKeyObject> cachedKeyList;
ListT<CegoCheckObject> cachedCheckList;
-
+ int numInvalid;
+
while (moreTuple)
{
@@ -417,7 +418,7 @@
cachedBTreeList.Empty();
cachedKeyList.Empty();
cachedCheckList.Empty();
- _pTM->getObjectListByTable(tabSetId, cachedTable, cachedIdxList, cachedBTreeList, cachedKeyList, cachedCheckList, false);
+ _pTM->getObjectListByTable(tabSetId, cachedTable, cachedIdxList, cachedBTreeList, cachedKeyList, cachedCheckList, numInvalid);
}
@@ -585,7 +586,8 @@
ListT<CegoBTreeObject> cachedBTreeList;
ListT<CegoKeyObject> cachedKeyList;
ListT<CegoCheckObject> cachedCheckList;
-
+ int numInvalid;
+
while (moreTuple)
{
@@ -632,7 +634,7 @@
cachedBTreeList.Empty();
cachedKeyList.Empty();
cachedCheckList.Empty();
- _pTM->getObjectListByTable(tabSetId, cachedTable, cachedIdxList, cachedBTreeList, cachedKeyList, cachedCheckList, true);
+ _pTM->getObjectListByTable(tabSetId, cachedTable, cachedIdxList, cachedBTreeList, cachedKeyList, cachedCheckList, numInvalid);
}
|
[-]
[+]
|
Changed |
cego-2.20.8.tar.bz2/src/CegoXPorter.cc
^
|
@@ -484,7 +484,6 @@
if ( tableSet != pRoot->getAttributeValue(XML_NAME_ATTR) )
{
-
throw Exception(EXLOC, "Tableset mismatch");
}
@@ -1846,8 +1845,9 @@
throw Exception(EXLOC, "pdBuf exceeded");
}
pInFile->readByte((char*)_pdBuffer, pdlen);
-
- CegoPredDesc *pPredDesc = new CegoPredDesc(_pdBuffer, _pGTM);
+
+ int tabSetId = _pDBMng->getTabSetId(tableSet);
+ CegoPredDesc *pPredDesc = new CegoPredDesc(_pdBuffer, _pGTM, tabSetId);
_pDBMng->log(_modId, Logger::NOTICE, Chain("Creating check ") + checkName + Chain("..."));
_pGTM->createDistCheck(tableSet, checkName, tableName, pPredDesc);
@@ -2042,7 +2042,8 @@
_sysEntry = CegoDataPointer(bp.getFileId(), bp.getPageId(), bp.getEntryPos());
_pDBMng->bufferUnfix(bp, false, _pGTM->getLockHandle());
- _pGTM->getObjectListByTable(_oe.getTabSetId(), _oe.getName(), _idxList, _btreeList, _keyList, _checkList, false);
+ int numInvalid;
+ _pGTM->getObjectListByTable(_oe.getTabSetId(), _oe.getName(), _idxList, _btreeList, _keyList, _checkList, numInvalid);
_isFirst = false;
}
|