[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.15.7
+ Version 2.15.8
(C)opyright 2006,2007,2008,2009,2010,2011,2012,2013 by Bjoern Lemke
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/gates/B.sql
^
|
@@ -37,7 +37,7 @@
insert into kids values ( 15, 'olga', 'girl', date('%d.%m.%Y %H:%M:%S', '14.12.2003 07:53:12'), 2);
insert into kids values ( 16, 'sveta', 'girl', date('%d.%m.%Y %H:%M:%S', '14.11.2004 07:53:12'), 2);
insert into kids values ( 17, 'maria', 'girl', date('%d.%m.%Y %H:%M:%S', '12.01.2002 07:53:12'), 2);
-insert into kids values ( 18, 'anna', 'girl', date('%d.%m.%Y %H:%M:%S', '01.02.2008 07:53:12'), 2);
+insert into kids values ( 18, 'alma', 'girl', date('%d.%m.%Y %H:%M:%S', '01.02.2008 07:53:12'), 2);
insert into kidtoys values ( 1, 'car');
@@ -234,6 +234,37 @@
end;
@
+@
+create procedure checkSelect007(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var fn string(10);
+
+ var b bool;
+
+ --
+ -- select kids who are girls and name contains 'nn'
+ --
+
+ cursor xCur as
+ select forename from kids k where gender = 'girl' and lower(forename) like '%nn%';
+
+ :b = fetch xCur into ( :fn );
+
+ close xCur;
+
+ if :fn = 'anna'
+ then
+ :res = 'ok';
+ end;
+
+ :msg = 'Girls with name containing nn lc or uc';
+
+ return :res;
+end;
+@
+
+
:r = call checkSelect001(:msg);
insert into checklog values ('B', :msg, :r);
:r = call checkSelect002(:msg);
@@ -246,7 +277,8 @@
insert into checklog values ('B', :msg, :r);
:r = call checkSelect006(:msg);
insert into checklog values ('B', :msg, :r);
-
+:r = call checkSelect007(:msg);
+insert into checklog values ('B', :msg, :r);
drop procedure checkSelect001;
@@ -255,6 +287,7 @@
drop procedure checkSelect004;
drop procedure checkSelect005;
drop procedure checkSelect006;
+drop procedure checkSelect007;
drop view kidview;
drop view kidtoyview;
|
[-]
[+]
|
Added |
cego-2.15.8.tar.bz2/gates/B.sql~
^
|
@@ -0,0 +1,265 @@
+--
+-- ### Gate B
+--
+--
+
+
+create table kids ( primary kid int not null, forename string(30), gender string(10), birthday datetime, gid int);
+create table kidtoys ( primary tid int not null, toyname string(30));
+
+create table toy2kid ( primary tid int not null, primary kid int not null);
+
+create table kidgroup ( primary gid int not null, groupname string(20));
+
+create view kidview as select k.forename as forename, kg.groupname as groupname from kids k, kidgroup kg where k.gid = kg.gid;
+
+create view kidtoyview as select k.forename as forename, kt.toyname as toyname from kids k, kidtoys kt, toy2kid t2k
+ where k.kid = t2k.kid and t2k.tid = kt.tid;
+
+
+insert into kidgroup values ( 1, 'LittleGeeks');
+insert into kidgroup values ( 2, 'FunnyBunny');
+
+insert into kids values ( 1, 'hugo' , 'boy', date('%d.%m.%Y %H:%M:%S', '12.01.2001 07:53:12'), 1);
+insert into kids values ( 2, 'john', 'boy', date('%d.%m.%Y %H:%M:%S', '01.07.2002 07:53:12'), 1);
+insert into kids values ( 3, 'kuno', 'boy', date('%d.%m.%Y %H:%M:%S', '19.03.2003 07:53:12'), 1);
+insert into kids values ( 4, 'peter', 'boy', date('%d.%m.%Y %H:%M:%S', '23.05.2001 07:53:12'), 1);
+insert into kids values ( 5, 'karl', 'boy', date('%d.%m.%Y %H:%M:%S', '25.07.2005 07:53:12'), 2);
+insert into kids values ( 6, 'dieter', 'boy', date('%d.%m.%Y %H:%M:%S', '09.08.2003 07:53:12'), 2);
+insert into kids values ( 7, 'iwan', 'boy', date('%d.%m.%Y %H:%M:%S', '12.03.2002 07:53:12'), 2);
+insert into kids values ( 8, 'eugen', 'boy', date('%d.%m.%Y %H:%M:%S', '11.05.2001 07:53:12'), 2);
+insert into kids values ( 9, 'norbert', 'boy', date('%d.%m.%Y %H:%M:%S', '14.08.2002 07:53:12'), 2);
+insert into kids values ( 10, 'rudi', 'boy', date('%d.%m.%Y %H:%M:%S', '04.07.2005 07:53:12'), 2);
+insert into kids values ( 11, 'detlev', 'boy', date('%d.%m.%Y %H:%M:%S', '02.01.2007 07:53:12'), 2);
+insert into kids values ( 12, 'frank', 'boy', date('%d.%m.%Y %H:%M:%S', '12.02.2005 07:53:12'), 2);
+insert into kids values ( 13, 'anna', 'girl', date('%d.%m.%Y %H:%M:%S', '14.02.2003 07:53:12'), 1);
+insert into kids values ( 14, 'berta', 'girl', date('%d.%m.%Y %H:%M:%S', '14.08.2002 07:53:12'), 1);
+insert into kids values ( 15, 'olga', 'girl', date('%d.%m.%Y %H:%M:%S', '14.12.2003 07:53:12'), 2);
+insert into kids values ( 16, 'sveta', 'girl', date('%d.%m.%Y %H:%M:%S', '14.11.2004 07:53:12'), 2);
+insert into kids values ( 17, 'maria', 'girl', date('%d.%m.%Y %H:%M:%S', '12.01.2002 07:53:12'), 2);
+insert into kids values ( 18, 'anna', 'girl', date('%d.%m.%Y %H:%M:%S', '01.02.2008 07:53:12'), 2);
+
+
+insert into kidtoys values ( 1, 'car');
+insert into kidtoys values ( 2, 'train');
+insert into kidtoys values ( 3, 'brick');
+insert into kidtoys values ( 4, 'skateboard');
+insert into kidtoys values ( 5, 'ball');
+
+
+insert into toy2kid values ( 1, 1);
+insert into toy2kid values ( 1, 3);
+insert into toy2kid values ( 2, 6);
+insert into toy2kid values ( 2, 12);
+insert into toy2kid values ( 2, 7);
+insert into toy2kid values ( 3, 11);
+insert into toy2kid values ( 3, 10);
+insert into toy2kid values ( 3, 1);
+insert into toy2kid values ( 4, 10);
+insert into toy2kid values ( 5, 9);
+
+insert into toy2kid values ( 1, 13);
+insert into toy2kid values ( 2, 13);
+insert into toy2kid values ( 3, 13);
+insert into toy2kid values ( 4, 13);
+insert into toy2kid values ( 5, 13);
+
+@
+create procedure checkSelect001(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var i int;
+
+ cursor xCur as select count(*) from kids where kid > 5;
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 13
+ then
+ :res = 'ok';
+ end;
+ end;
+ close xCur;
+
+ :msg = 'Number of kids where kid > 5';
+
+ return :res;
+end;
+@
+
+@
+create procedure checkSelect002(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var i int;
+
+ cursor xCur as select count(*) from kids where kid >= 5;
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 14
+ then
+ :res = 'ok';
+ end;
+ end;
+ close xCur;
+
+ :msg = 'Number of kids where kid >= 5';
+
+ return :res;
+end;
+@
+
+
+@
+create procedure checkSelect003(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var f string(10);
+
+ cursor xCur as
+ select forename from kids where forename in ( select forename from kidview where groupname = 'LittleGeeks' )
+ and gender = 'boy' or ( date2str(birthday, '%Y') < '2001' and date2str(birthday, '%m') = '07' );
+
+ if fetch xCur into ( :f ) = true
+ then
+ if :f = 'john'
+ then
+ :res = 'ok';
+ end;
+ end;
+ close xCur;
+
+ :msg = 'Kid with special birtday';
+
+ return :res;
+end;
+@
+
+
+@
+create procedure checkSelect004(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var g1 string(10);
+ var g2 string(10);
+ var i1 int;
+ var i2 int;
+
+ var b bool;
+
+ --
+ -- select kids grouped by gender
+ --
+
+ cursor xCur as
+ select gender, count(*) from kids group by gender order by gender;
+ :b = fetch xCur into ( :g1, :i1 );
+ :b = fetch xCur into ( :g2, :i2 );
+ close xCur;
+
+ if :g1 = 'boy' and :i1 = 12 and :g2 = 'girl' and :i2 = 6
+ then
+ :res = 'ok';
+ end;
+
+ :msg = 'Grouped kids order by gender';
+
+ return :res;
+end;
+@
+
+
+@
+create procedure checkSelect005(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var g1 string(10);
+ var g2 string(10);
+ var i1 int;
+ var i2 int;
+
+ var b bool;
+
+ --
+ -- select kids grouped by gender
+ --
+
+ cursor xCur as
+ select gender, count(*) from kids group by gender order by count(*) asc;
+ :b = fetch xCur into ( :g1, :i1 );
+ :b = fetch xCur into ( :g2, :i2 );
+ close xCur;
+
+ if :g2 = 'boy' and :i2 = 12 and :g1 = 'girl' and :i1 = 6
+ then
+ :res = 'ok';
+ end;
+
+ :msg = 'Grouped kids order by count(*)';
+
+ return :res;
+end;
+@
+
+
+@
+create procedure checkSelect006(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var fn string(10);
+
+ var b bool;
+
+ --
+ -- select kids who have all toys ( allquantor test )
+ --
+
+ cursor xCur as
+ select forename from kids k where not exists
+ ( select * from kidtoys kt where not exists
+ ( select * from toy2kid t2k where k.kid = t2k.kid and t2k.tid = kt.tid ));
+
+
+ :b = fetch xCur into ( :fn );
+
+ close xCur;
+
+ if :fn = 'anna'
+ then
+ :res = 'ok';
+ end;
+
+ :msg = 'Kids with all toys';
+
+ return :res;
+end;
+@
+
+:r = call checkSelect001(:msg);
+insert into checklog values ('B', :msg, :r);
+:r = call checkSelect002(:msg);
+insert into checklog values ('B', :msg, :r);
+:r = call checkSelect003(:msg);
+insert into checklog values ('B', :msg, :r);
+:r = call checkSelect004(:msg);
+insert into checklog values ('B', :msg, :r);
+:r = call checkSelect005(:msg);
+insert into checklog values ('B', :msg, :r);
+:r = call checkSelect006(:msg);
+insert into checklog values ('B', :msg, :r);
+
+
+
+drop procedure checkSelect001;
+drop procedure checkSelect002;
+drop procedure checkSelect003;
+drop procedure checkSelect004;
+drop procedure checkSelect005;
+drop procedure checkSelect006;
+
+drop view kidview;
+drop view kidtoyview;
+drop table kids;
+drop table kidtoys;
+drop table kidgroup;
+drop table toy2kid;
+
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/gates/cegodb.xml
^
|
@@ -2,7 +2,7 @@
<!DOCTYPE CEGO_DB_SPEC>
<DATABASE NAME="cegodb" PAGESIZE="16384" ADMINPORT="2000" LOGPORT="3000" DATAPORT="2200" PIDFILE="./db/pid" MAXFID="32" MAXTSID="2" NUMRECSEMA="281" NUMSYSPAGESEMA="53" NUMDATAPAGESEMA="281" NUMIDXPAGESEMA="281" NUMRBPAGESEMA="281" NUMDATAFILESEMA="53" NUMBUFFERPOOLSEMA="31" CSMODE="ON">
 <MODULE NAME="ALL" LEVEL="DEBUG"></MODULE>
<USER NAME="cgadm" PASSWD="f9d1bb5de113b12009fd4b1672a23cfe" TRACE="OFF" ROLE="admin"></USER>
- <TABLESET NAME="TS1" TSROOT="./db" PRIMARY="dude.local" SECONDARY="dude.local" MEDIATOR="dude.local" RUNSTATE="OFFLINE" SYNCSTATE="SYNCHED" TSTICKET="./db/tsticket.xml" TSID="2" TMPFID="31" SYSSIZE="100" TMPSIZE="100" SORTAREASIZE="10000000" LSN="987" TID="103"> <LOGFILE NAME="./db/TS1redo0.log" SIZE="1000000" STATUS="FREE"></LOGFILE>
+ <TABLESET NAME="TS1" TSROOT="./db" PRIMARY="dude.local" SECONDARY="dude.local" MEDIATOR="dude.local" RUNSTATE="OFFLINE" SYNCSTATE="SYNCHED" TSTICKET="./db/tsticket.xml" TSID="2" TMPFID="31" SYSSIZE="100" TMPSIZE="100" SORTAREASIZE="10000000" LSN="990" TID="103"> <LOGFILE NAME="./db/TS1redo0.log" SIZE="1000000" STATUS="FREE"></LOGFILE>
<LOGFILE NAME="./db/TS1redo1.log" SIZE="1000000" STATUS="FREE"></LOGFILE>
<LOGFILE NAME="./db/TS1redo2.log" SIZE="1000000" STATUS="ACTIVE"></LOGFILE>
<DATAFILE TYPE="APP" FILEID="32" NAME="./db/data01.dbf" SIZE="1000"></DATAFILE>
|
[-]
[+]
|
Added |
cego-2.15.8.tar.bz2/gates/gatecheck~
^
|
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+./mkdb
+../src/cego --mode=batch --batchfile=pre.sql --dbxml=cegodb.xml --user=lemke/lemke --poolsize=1000 --tableset=TS1 > check.log 2> error.log
+# ../src/cego --mode=batch --batchfile=A.sql --dbxml=cegodb.xml --user=lemke/lemke --poolsize=1000 --tableset=TS1 > check.log 2> error.log
+../src/cego --mode=batch --batchfile=B.sql --dbxml=cegodb.xml --user=lemke/lemke --poolsize=1000 --tableset=TS1 > check.log 2> error.log
+../src/cego --mode=batch --batchfile=C.sql --dbxml=cegodb.xml --user=lemke/lemke --poolsize=1000 --tableset=TS1 > check.log 2> error.log
+../src/cego --mode=batch --batchfile=post.sql --dbxml=cegodb.xml --user=lemke/lemke --poolsize=1000 --tableset=TS1
+
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/samples/chkdb/chkblow
^
|
@@ -1,2 +1,2 @@
#!/bin/bash
-../../src/cgblow --mode=insert --server=localhost --port=2200 --iset=i:10000,s:10 --table=t1 --tableset=TS1 --user=lemke/lemke --append --interval=1000 --count=5000000 --protocol=serial $@
+../../src/cgblow --mode=insert --server=localhost --port=2200 --iset=i:10000,s:10 --table=t1 --tableset=TS1 --user=lemke/lemke --append --interval=1000 --count=500000 --protocol=serial $@
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/samples/chkdb/chkup
^
|
@@ -5,9 +5,9 @@
if [ $# -eq 0 ]
then
- ../../src/cego --mode=daemon --forceload --numdbthread=30 --dbxml=./db/chkdb.xml --poolsize=1000 --protocol=serial
+ ../../src/cego --mode=daemon --forceload --numdbthread=30 --dbxml=./db/chkdb.xml --poolsize=3000 --protocol=serial
else
- ../../src/cego --mode=daemon --forceload --numdbthread=30 --dbxml=./db/chkdb.xml --poolsize=1000 --tableset=$1 --protocol=serial
+ ../../src/cego --mode=daemon --forceload --numdbthread=30 --dbxml=./db/chkdb.xml --poolsize=3000 --tableset=$1 --protocol=serial
fi
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/samples/chkdb/pid
^
|
@@ -1 +1 @@
-4341
\ No newline at end of file
+83818
\ No newline at end of file
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/src/CegoDataPointer.cc
^
|
@@ -40,16 +40,29 @@
CegoDataPointer::CegoDataPointer()
{
+ _idArray[0] = 0;
+ _idArray[1] = 0;
+ _idArray[2] = 0;
+
+ /*
_fileId = 0;
_pageId = 0;
_offset = 0;
+ */
}
CegoDataPointer::CegoDataPointer(int fileId, int pageId, int offset)
{
+
+ _idArray[0] = fileId;
+ _idArray[1] = pageId;
+ _idArray[2] = offset;
+
+ /*
_fileId = fileId;
_pageId = pageId;
_offset = offset;
+ */
}
CegoDataPointer::~CegoDataPointer()
@@ -58,32 +71,38 @@
void CegoDataPointer::setFileId(int fileId)
{
- _fileId = fileId;
+ _idArray[0] = fileId;
+ // _fileId = fileId;
}
int CegoDataPointer::getFileId() const
{
- return _fileId;
+ return _idArray[0];
+ // return _fileId;
}
void CegoDataPointer::setPageId(int pageId)
{
- _pageId = pageId;
+ _idArray[1] = pageId;
+ // _pageId = pageId;
}
int CegoDataPointer::getPageId() const
{
- return _pageId;
+ return _idArray[1];
+ // return _pageId;
}
void CegoDataPointer::setOffset(int offset)
{
- _offset = offset;
+ _idArray[2] = offset;
+ // _offset = offset;
}
int CegoDataPointer::getOffset() const
{
- return _offset;
+ return _idArray[2];
+ // return _offset;
}
int CegoDataPointer::getEncodingLength() const
@@ -95,38 +114,52 @@
{
void* ip = p;
+ memcpy(ip, _idArray, 3 * sizeof(int));
+
+ /*
memcpy(ip, &_fileId, sizeof(int));
memcpy((void*)((long)ip + sizeof(int)) , &_pageId, sizeof(int));
memcpy((void*)((long)ip + 2 * sizeof(int)), &_offset, sizeof(int));
+ */
}
void CegoDataPointer::decode(void* p)
{
void* ip = p;
+ memcpy(_idArray, ip, 3 * sizeof(int));
+
+ /*
memcpy(&_fileId, ip, sizeof(int));
memcpy(&_pageId,(void*)((long)ip + sizeof(int)), sizeof(int));
memcpy(&_offset,(void*) ((long) ip + 2 * sizeof(int)), sizeof(int));
+ */
}
CegoDataPointer& CegoDataPointer::operator = ( const CegoDataPointer& d)
{
+ memcpy(_idArray, d._idArray, 3 * sizeof(int));
+ /*
_fileId = d._fileId;
_pageId = d._pageId;
_offset = d._offset;
+ */
return (*this);
}
bool CegoDataPointer::operator == ( const CegoDataPointer& d) const
{
- if (_fileId == d._fileId && _pageId == d._pageId && _offset == d._offset)
+
+ if (_idArray[0] == d._idArray[0] && _idArray[1] == d._idArray[1] && _idArray[2] == d._idArray[2])
+ // if (_fileId == d._fileId && _pageId == d._pageId && _offset == d._offset)
return true;
return false;
}
bool CegoDataPointer::operator != ( const CegoDataPointer& d) const
{
- if (_fileId != d._fileId || _pageId != d._pageId || _offset != d._offset)
+ if (_idArray[0] != d._idArray[0] || _idArray[1] != d._idArray[1] || _idArray[2] != d._idArray[2])
+ // if (_fileId != d._fileId || _pageId != d._pageId || _offset != d._offset)
return true;
return false;
}
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/src/CegoDataPointer.h
^
|
@@ -71,10 +71,14 @@
friend ostream& operator << (ostream& s, const CegoDataPointer& dp);
private:
-
+
+ int _idArray[3];
+
+ /*
int _fileId;
int _pageId;
int _offset;
+ */
};
#endif
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/src/CegoDefs.h
^
|
@@ -39,8 +39,8 @@
#include <windows.h>
#endif
-#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.15.7"
+#define CEGO_PRODUCT "cego"
+#define CEGO_VERSION "2.15.8"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2013 by Bjoern Lemke. All rights reserved"
#define CGEXESHELLVARNAME "CGEXESHELL"
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/src/CegoIndexManager.cc
^
|
@@ -1466,11 +1466,13 @@
{
return GT;
}
-
- p1 += flen1;
- p2 += flen2;
-
+
pF = schema.Next();
+ if ( pF )
+ {
+ p1 += flen1;
+ p2 += flen2;
+ }
}
return EQU;
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/src/CegoQueryHelper.cc
^
|
@@ -6,7 +6,7 @@
//
// Design and Implementation by Bjoern Lemke
//
-// (C)opyright 2000-2010 Bjoern Lemke
+// (C)opyright 2000-2012 Bjoern Lemke
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -496,7 +496,10 @@
{
ac.add(CegoAttrComp(pAttrDesc->getAttrName(), pP->getPattern(), false));
}
- return COMPLETE;
+ else
+ {
+ return PARTIAL;
+ }
}
else if (pP->getMode() == CegoPredDesc::ISNOTLIKE)
{
@@ -506,7 +509,10 @@
{
ac.add(CegoAttrComp(pAttrDesc->getAttrName(), pP->getPattern(), true));
}
- return COMPLETE;
+ else
+ {
+ return PARTIAL;
+ }
}
else
{
|
[-]
[+]
|
Changed |
cego-2.15.8.tar.bz2/src/CegoSelect.cc
^
|
@@ -1314,6 +1314,11 @@
if ( doSetup )
{
+
+#ifdef CGDEBUG
+ _pLogger->log(_modId, Logger::DEBUG, Chain("Setting attrcond = ") + _attrCond[_joinLevel].toChain());
+#endif
+
_pTC[_joinLevel]->distSetup(_attrCond[_joinLevel]);
}
else
@@ -1875,8 +1880,10 @@
if ( m == CegoQueryHelper::COMPLETE )
predChecked = true;
- // _pLogger->log(_modId, Logger::DEBUG, Chain("Using attr cond for ") + _joinList[i]->getTabName());
-
+#ifdef CGDEBUG
+ _pLogger->log(_modId, Logger::DEBUG, Chain("Detecting valid attr cond [ ") + ac.toChain() + Chain(" ]"));
+#endif
+
notFound = false;
_attrCond[i] = ac;
_attrCondFlag[i] = true;
|