[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/Makefile.in
^
|
@@ -19,6 +19,7 @@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
# Common prefix for installation directories
PREFIX = @prefix@
@@ -37,9 +38,12 @@
( cd src; make all )
( cd samples/cgwtest; make all )
( cd samples/cgplustest; make all )
-
+
install:
( cd src; make install )
+ $(INSTALL_SCRIPT) tools/cgmkdb $(BINPREFIX)
+ $(INSTALL_SCRIPT) tools/cgbackup $(BINPREFIX)
+ $(INSTALL_SCRIPT) tools/cgrecover $(BINPREFIX)
basecheck:
( cd samples/chkdb; ./checkSQL; ./expImpCheck 10000)
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.10.7
+ Version 2.10.10
(C)opyright 2006,2007,2008,2009,2010,2011 by Bjoern Lemke
@@ -14,7 +14,7 @@
-----------
To build Cego, you need the following library packages available from www.lemke-it.com:
- lfc-1.1.38.tar.gz
+ lfc-1.1.40.tar.gz
lfcxml-1.0.25.tar.gz
Furthermore, you need the GNU readline library available via http://tiswww.case.edu/php/chet/readline/rltop.html
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/gates/C.sql
^
|
@@ -6,6 +6,7 @@
create table t1 ( primary a int not null, b string(30) );
create table t2 ( primary c int not null, d string(30));
+create view v1 as select a from t1;
insert into t1 values ( 1, 'hugo');
insert into t1 values ( 2, 'hugo');
@@ -152,18 +153,64 @@
var res string(10) = 'error';
var i int;
- cursor xCur as select count(*) from t1 right outer join t2 on t1.a = t2.c where c = 10;
+ cursor xCur as select count(*) from t1 right outer join t2 on t1.a = t2.c;
if fetch xCur into ( :i ) = true
then
- if :i = 1
+ if :i = 10
then
:res = 'ok';
end;
end;
close xCur;
- :msg = 'Left join check with condition';
+ :msg = 'Right join check with condition';
+
+ return :res;
+end;
+@
+
+@
+create procedure checkSelect007(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var i int;
+
+ cursor xCur as select count(*) from t1 where a between 3 and 5;
+
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 3
+ then
+ :res = 'ok';
+ end;
+ end;
+ close xCur;
+
+ :msg = 'Between query check';
+
+ return :res;
+end;
+@
+
+@
+create procedure checkSelect008(msg out string(20)) return string(10)
+begin
+ var res string(10) = 'error';
+ var i int;
+
+ cursor xCur as select count(*) from v1 where a between 3 and 5;
+
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 3
+ then
+ :res = 'ok';
+ end;
+ end;
+ close xCur;
+
+ :msg = 'Between query check on view';
return :res;
end;
@@ -180,13 +227,22 @@
insert into checklog values ('C', :msg, :r);
:r = call checkSelect005(:msg);
insert into checklog values ('C', :msg, :r);
+:r = call checkSelect006(:msg);
+insert into checklog values ('C', :msg, :r);
+:r = call checkSelect007(:msg);
+insert into checklog values ('C', :msg, :r);
+:r = call checkSelect008(:msg);
+insert into checklog values ('C', :msg, :r);
drop procedure checkSelect001;
drop procedure checkSelect002;
drop procedure checkSelect003;
drop procedure checkSelect004;
drop procedure checkSelect005;
+drop procedure checkSelect006;
+drop procedure checkSelect007;
+drop procedure checkSelect008;
drop table t1;
drop table t2;
-
+drop view v1;
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/gates/C.sql~
^
|
@@ -1,68 +1,34 @@
--
--- ### Gate B
+-- ### Gate C
--
--
-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 t1 ( primary a int not null, b string(30) );
+create table t2 ( primary c int not null, d 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);
+insert into t1 values ( 1, 'hugo');
+insert into t1 values ( 2, 'hugo');
+insert into t1 values ( 3, 'walter');
+insert into t1 values ( 4, 'bert');
+insert into t1 values ( 5, 'bert');
+insert into t1 values ( 6, 'bert');
+insert into t1 values ( 7, 'bert');
+insert into t1 values ( 8, 'bert');
+insert into t1 values ( 9, 'bert');
+insert into t1 values ( 10, 'bert');
+
+
+insert into t2 values ( 1, 'hugo');
+insert into t2 values ( 2, 'hugo');
+insert into t2 values ( 3, 'walter');
+insert into t2 values ( 4, 'bert');
+insert into t2 values ( 5, 'bert');
+insert into t2 values ( 16, 'bert');
+insert into t2 values ( 17, 'bert');
+insert into t2 values ( 18, 'bert');
+insert into t2 values ( 19, 'bert');
+insert into t2 values ( 20, 'bert');
@
create procedure checkSelect001(msg out string(20)) return string(10)
@@ -70,17 +36,17 @@
var res string(10) = 'error';
var i int;
- cursor xCur as select count(*) from kids where kid > 5;
+ cursor xCur as select count(*) from t1 inner join t2 on t1.a = t2.c;
if fetch xCur into ( :i ) = true
then
- if :i = 13
+ if :i = 5
then
:res = 'ok';
end;
end;
close xCur;
- :msg = 'Number of kids where kid > 5';
+ :msg = 'Inner join check';
return :res;
end;
@@ -92,17 +58,17 @@
var res string(10) = 'error';
var i int;
- cursor xCur as select count(*) from kids where kid >= 5;
+ cursor xCur as select count(*) from t1 left outer join t2 on t1.a = t2.c;
if fetch xCur into ( :i ) = true
then
- if :i = 14
+ if :i = 10
then
:res = 'ok';
end;
end;
close xCur;
- :msg = 'Number of kids where kid >= 5';
+ :msg = 'Left outer join check';
return :res;
end;
@@ -113,22 +79,20 @@
create procedure checkSelect003(msg out string(20)) return string(10)
begin
var res string(10) = 'error';
- var f string(10);
+ var i int;
- 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' );
+ cursor xCur as select count(*) from t1 left outer join t2 on t1.a = t2.c;
- if fetch xCur into ( :f ) = true
+ if fetch xCur into ( :i ) = true
then
- if :f = 'john'
+ if :i = 10
then
:res = 'ok';
end;
end;
close xCur;
- :msg = 'Kid with special birtday';
+ :msg = 'Right outer join check';
return :res;
end;
@@ -139,29 +103,20 @@
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;
+ var i int;
- if :g1 = 'boy' and :i1 = 12 and :g2 = 'girl' and :i2 = 6
- then
- :res = 'ok';
+ cursor xCur as select count(*) from t1 inner join t2 on t1.a = t2.c where a = 5 or a = 1;
+
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 2
+ then
+ :res = 'ok';
+ end;
end;
+ close xCur;
- :msg = 'Grouped kids order by gender';
+ :msg = 'Inner join check with condition';
return :res;
end;
@@ -172,94 +127,66 @@
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;
+ var i int;
- if :g2 = 'boy' and :i2 = 12 and :g1 = 'girl' and :i1 = 6
- then
- :res = 'ok';
+ cursor xCur as select count(*) from t1 left outer join t2 on t1.a = t2.c where a = 10;
+
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 1
+ then
+ :res = 'ok';
+ end;
end;
+ close xCur;
- :msg = 'Grouped kids order by count(*)';
+ :msg = 'Left join check with condition';
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 ));
-
+ var i int;
- :b = fetch xCur into ( :fn );
+ cursor xCur as select count(*) from t1 right outer join t2 on t1.a = t2.c where c = 10;
+ if fetch xCur into ( :i ) = true
+ then
+ if :i = 1
+ then
+ :res = 'ok';
+ end;
+ end;
close xCur;
- if :fn = 'anna'
- then
- :res = 'ok';
- end;
+ :msg = 'Left join check with condition';
- :msg = 'Kids with all toys';
-
return :res;
end;
@
+
:r = call checkSelect001(:msg);
-insert into checklog values ('B', :msg, :r);
+insert into checklog values ('C', :msg, :r);
:r = call checkSelect002(:msg);
-insert into checklog values ('B', :msg, :r);
+insert into checklog values ('C', :msg, :r);
:r = call checkSelect003(:msg);
-insert into checklog values ('B', :msg, :r);
+insert into checklog values ('C', :msg, :r);
:r = call checkSelect004(:msg);
-insert into checklog values ('B', :msg, :r);
+insert into checklog values ('C', :msg, :r);
:r = call checkSelect005(:msg);
-insert into checklog values ('B', :msg, :r);
-:r = call checkSelect006(:msg);
-insert into checklog values ('B', :msg, :r);
-
-
+insert into checklog values ('C', :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;
+drop table t1;
+drop table t2;
|
[-]
[+]
|
Changed |
cego-2.10.10.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"></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="230"> <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="240"> <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.10.10.tar.bz2/samples/chkdb/check030.sql
^
|
@@ -0,0 +1,35 @@
+--
+-- ### Cast checks
+--
+--
+--
+
+drop if exists table t_castcheck;
+
+
+create table t_castcheck ( a int, b fixed(2), c decimal(2), d string(10));
+
+insert into t_castcheck values ( 20, (fixed)22.23, (decimal)44.99, '3.45' );
+
+select * from t_castcheck;
+
+select a + b from t_castcheck;
+select b + a from t_castcheck;
+select b - a from t_castcheck;
+select a * b from t_castcheck;
+select b * a from t_castcheck;
+
+select b + c from t_castcheck;
+select c + b from t_castcheck;
+select c - b from t_castcheck;
+select c * b from t_castcheck;
+select b * c from t_castcheck;
+
+select b + d from t_castcheck;
+select d + b from t_castcheck;
+select b * d from t_castcheck;
+select d * b from t_castcheck;
+
+
+
+
|
[-]
[+]
|
Added |
cego-2.10.10.tar.bz2/samples/chkdb/x.sql
^
|
@@ -0,0 +1,53 @@
+create table t1 ( primary a int not null, b string(30) );
+create table t2 ( primary c int not null, d string(30));
+create view v1 as select a from t1;
+
+insert into t1 values ( 1, 'hugo');
+insert into t1 values ( 2, 'hugo');
+insert into t1 values ( 3, 'walter');
+insert into t1 values ( 4, 'bert');
+insert into t1 values ( 5, 'bert');
+insert into t1 values ( 6, 'bert');
+insert into t1 values ( 7, 'bert');
+insert into t1 values ( 8, 'bert');
+insert into t1 values ( 9, 'bert');
+insert into t1 values ( 10, 'bert');
+
+
+insert into t2 values ( 1, 'hugo');
+insert into t2 values ( 2, 'hugo');
+insert into t2 values ( 3, 'walter');
+insert into t2 values ( 4, 'bert');
+insert into t2 values ( 5, 'bert');
+insert into t2 values ( 16, 'bert');
+insert into t2 values ( 17, 'bert');
+insert into t2 values ( 18, 'bert');
+insert into t2 values ( 19, 'bert');
+insert into t2 values ( 20, 'bert');
+
+select * from t1 right outer join t2 on t1.a = t2.c;
+
+xxxx;
+
+drop if exists table t1;
+drop if exists view v1;
+create table t1 ( a int, b datetime );
+
+create index i1 on t1 (b);
+
+insert into t1 values ( 1, date('%d.%m.%Y %H:%M:%S','01.07.2011 12:00:00'));
+insert into t1 values ( 2, date('%d.%m.%Y %H:%M:%S','02.07.2011 12:00:00'));
+insert into t1 values ( 3, date('%d.%m.%Y %H:%M:%S','03.07.2011 12:00:00'));
+insert into t1 values ( 4, date('%d.%m.%Y %H:%M:%S','04.07.2011 12:00:00'));
+insert into t1 values ( 42, date('%d.%m.%Y %H:%M:%S','05.07.2011 12:00:00'));
+insert into t1 values ( 5, date('%d.%m.%Y %H:%M:%S','01.08.2011 12:00:00'));
+insert into t1 values ( 6, date('%d.%m.%Y %H:%M:%S','05.08.2011 12:00:00'));
+
+create view v1 as select a, b from t1;
+
+select a, b from v1 where b between
+date('%d.%m.%Y %H:%M:%S','01.07.2011 12:00:00')
+and
+date('%d.%m.%Y %H:%M:%S','05.07.2011 12:00:00');
+
+
|
[-]
[+]
|
Added |
cego-2.10.10.tar.bz2/samples/chkdb/x.sql~
^
|
@@ -0,0 +1,22 @@
+drop if exists table t1;
+drop if exists view v1;
+create table t1 ( a int, b datetime );
+
+create index i1 on t1 (b);
+
+insert into t1 values ( 1, date('%d.%m.%Y %H:%M:%S','01.07.2011 12:00:00'));
+insert into t1 values ( 2, date('%d.%m.%Y %H:%M:%S','02.07.2011 12:00:00'));
+insert into t1 values ( 3, date('%d.%m.%Y %H:%M:%S','03.07.2011 12:00:00'));
+insert into t1 values ( 4, date('%d.%m.%Y %H:%M:%S','04.07.2011 12:00:00'));
+insert into t1 values ( 42, date('%d.%m.%Y %H:%M:%S','05.07.2011 12:00:00'));
+insert into t1 values ( 5, date('%d.%m.%Y %H:%M:%S','01.08.2011 12:00:00'));
+insert into t1 values ( 6, date('%d.%m.%Y %H:%M:%S','05.08.2011 12:00:00'));
+
+create view v1 as select a, b from t1;
+
+select a, b from v1 where b between
+date('%d.%m.%Y %H:%M:%S','01.07.2011 12:00:00')
+and
+date('%d.%m.%Y %H:%M:%S','05.07.2011 12:00:00');
+
+
|
[-]
[+]
|
Added |
cego-2.10.10.tar.bz2/samples/rc/README.FreeBSD
^
|
@@ -0,0 +1,22 @@
+How to make cego rc set up for FreeBSD
+--------------------------------------
+
+1. Compile and install the required cego software.
+ It should be installed in /usr/local
+ ( you might use the precompiled packages available from freshports )
+
+2. Create a db using the cgmkdb script in the tools directory
+ You should use /usr/local/cego as the default root path
+
+ $ cd /usr/local/cego
+ $ cgmkdb mydb
+
+3. Copy the cego rc script from this directory to /usr/local/etc/rc.d
+
+4. Add the following entries to /etc/rc.conf
+
+ # cego
+ cego_enable="YES"
+ cego_profiles="mydb"
+ cego_mydb_tablespc="mydb"
+
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/samples/rc/cego
^
|
@@ -1,6 +1,6 @@
-#!/usr/local/bin/bash
+#!/bin/sh
#
-# $FreeBSD$
+# $FreeBSD: ports/databases/cego/files/cego.in,v 1.2 2011/05/15 02:49:04 dougb Exp $
#
# PROVIDE: cego
@@ -13,6 +13,7 @@
# Set it to "YES" to enable cego
# cego_profiles (str): Set to "" by default.
# Define your profiles here.
+# cego_tablespc (str): Set it to the tablespace
# cego_flags (str): Set to "" by default.
# Extra flags passed to start command.
@@ -22,92 +23,88 @@
rcvar=`set_rcvar`
command="/usr/local/bin/cego"
-user="cego"
-defcegoconf="/usr/local/etc/cego/conf"
-defcegoroot="/serv/cego"
+
+: ${cego_enable="NO"}
+: ${cego_conf="/usr/local/cego"}
+: ${cego_root="/usr/local/cego"}
+: ${cego_user="%%USER%%"}
+
flags="--mode=daemon"
_pidprefix="/var/run/cego"
pidfile="${_pidprefix}.pid"
-[ -z "$cego_enable" ] && cego_enable="NO"
-[ -z "$cego_tablespc" ] && cego_enable="NO"
+command_arg="--mode=daemon"
+_pidprefix="/var/run/cego"
+
+flags="--mode=daemon"
load_rc_config $name
if [ -n "$2" ]; then
- profile="$2"
- if [ "x${cego_profiles}" != "x" ]; then
- pidfile="${_pidprefix}.${profile}.pid"
+ profile="$2"
+ if [ "x${cego_profiles}" != "x" ]; then
+ pidfile="${_pidprefix}.${profile}.pid"
echo profile is $profile
- eval cginst=`echo $profile | awk -F : '{ print $1 }'`
- eval cgts=`echo $profile | awk -F : '{ print $2 }'`
- if [ "x${cgts}" = "x" ]; then
- echo "You must define a tableset for db instance ${profile}"
- exit 1
+ eval cego_tablespc="\${cego_${profile}_tablespc:-}"
+ if [ "x${cego_tablespc}" = "x" ]; then
+ err 1 "You must define a tableset for db instance cego_${profile}_tablespc"
fi
- eval cegoconf="\${cegoconf:-${defcegoconf}}"
- eval cegoroot="\${cegoroot:-${defcegoroot}}"
-
- required_files="${configfile}"
- eval cego_enable="\${cego_${cginst}_enable:-${cego_enable}}"
- command_args="--dbxml=${cegoconf}/${cginst}.xml --tableset=${cgts} --lockfile=${cegoroot}/${cginst}.lck --logfile=${cegoroot}/${cginst}.log --pidfile=${cegoroot}/${cginst}.pid"
- echo "Setting command_args $command_args"
- else
- echo "$0: extra argument ignored"
- fi
+ eval cego_conf="\${cego_${profile}_conf:-${cego_conf}}"
+ eval cego_root="\${cego_${profile}_root:-${cego_root}}"
+
+ required_files="${cego_conf}/${profile}.xml"
+ eval cego_enable="\${cego_${profile}_enable:-${cego_enable}}"
+ command_args="--dbxml=${required_files} --tableset=${cego_tablespc} --lockfile=${cego_root}/${profile}.lck --logfile=${cego_root}/${profile}.log"
+ echo "Setting command_args $command_args"
+ else
+ warn "$0: extra argument ignored"
+ fi
else
- if [ "x${cego_profiles}" != "x" -a "x$1" != "x" ]; then
- for profile in ${cego_profiles}; do
- eval _enable="\${cego_${profile}_enable}"
- case "x${_enable:-${cego_enable}}" in
- x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
- continue
- ;;
- x[Yy][Ee][Ss])
- ;;
- *)
- if test -z "$_enable"; then
- _var=cego_enable
- else
- _var=cego_"${profile}"_enable
- fi
- echo "Bad value" \
- "'${_enable:-${cego_enable}}'" \
- "for ${_var}. " \
- "Profile ${profile} skipped."
- continue
- ;;
- esac
- echo "===> cego profile: ${profile}"
- /etc/rc.d/cego $1 ${profile}
- retcode="$?"
- if [ "0${retcode}" -ne 0 ]; then
- failed="${profile} (${retcode}) ${failed:-}"
- else
- success="${profile} ${success:-}"
- fi
- done
- exit 0
- fi
+ if [ "x${cego_profiles}" != "x" -a "x$1" != "x" ]; then
+ for profile in ${cego_profiles}; do
+ eval _enable="\${cego_${profile}_enable}"
+ case "x${_enable:-${cego_enable}}" in
+ x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
+ continue
+ ;;
+ x[Yy][Ee][Ss])
+ ;;
+ *)
+ if test -z "$_enable"; then
+ _var=cego_enable
+ else
+ _var=cego_"${profile}"_enable
+ fi
+ warn "Bad value" \
+ "'${_enable:-${cego_enable}}'" \
+ "for ${_var}. " \
+ "Profile ${profile} skipped."
+ continue
+ ;;
+ esac
+ echo "===> cego profile: ${profile}"
+ /usr/local/etc/rc.d/cego $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+ fi
fi
+
cego_requirepidfile()
{
if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
- echo "${name} not running? (check $pidfile)."
- exit 1
+ err 1 "${name} not running? (check $pidfile)."
fi
}
-cego_stop() {
- cego_requirepidfile
-
- echo "stopping cego instance $1"
- kill -1 $1
-}
-
run_rc_command "$1"
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoAction.cc
^
|
@@ -4651,7 +4651,7 @@
CegoExpr *pExpr3;
_exprStack.Pop(pExpr3);
- CegoPredDesc* pP = new CegoPredDesc(pExpr2, pExpr3, pExpr1);
+ CegoPredDesc* pP = new CegoPredDesc(pExpr3, pExpr2, pExpr1);
_predDescStack.Push(pP);
}
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoAttrComp.cc
^
|
@@ -124,7 +124,7 @@
{
_isSetup=false;
CegoField* pF = fl.First();
- while (pF && _isSetup == false)
+ while ( pF && _isSetup == false )
{
if ( ( _attrDesc.getTableName() == pF->getTableName() || _attrDesc.getTableName()== pF->getTableAlias() )
&& _attrDesc.getAttrName() == pF->getAttrName() )
@@ -151,8 +151,7 @@
&& _attrDesc.getAttrName() == pF->getAttrName() )
{
_isSetup = true;
-
-
+
_fv = pF->getValue();
}
pF = joinBuf[i].Next();
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoAttrCond.cc
^
|
@@ -162,14 +162,13 @@
new CegoExpr(new CegoTerm(new CegoFactor( pAC->getFieldValue()))),
pAC->getComparison());
}
- else if ( pAC->getCompMode() == CegoAttrComp::BTWN )
+ else if ( pAC->getCompMode() == CegoAttrComp::BTWN )
{
pP = new CegoPredDesc(pExpr,
new CegoExpr(new CegoTerm(new CegoFactor( pAC->getFieldValue()))),
new CegoExpr(new CegoTerm(new CegoFactor( pAC->getFieldValue2()))));
}
-
conjunctionList.Insert(pP);
pAC = _attrCompSet.Next();
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoBufferPool.cc
^
|
@@ -187,7 +187,7 @@
while ( ! isFixed && numTries < _maxFixTries )
{
- pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE, BP_LOCKTIMEOUT, BP_NUMTRIES);
+ pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE);
BufferHead bh;
memcpy(&bh, bufPtr, sizeof(BufferHead));
@@ -242,7 +242,7 @@
try
{
- pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE, BP_LOCKTIMEOUT, BP_NUMTRIES);
+ pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE);
}
catch ( Exception e )
{
@@ -322,7 +322,7 @@
try
{
- pLockHandle->lockBufferPool(minHashId, CegoLockHandler::WRITE, BP_LOCKTIMEOUT, BP_NUMTRIES);
+ pLockHandle->lockBufferPool(minHashId, CegoLockHandler::WRITE);
}
catch ( Exception e )
{
@@ -492,7 +492,7 @@
BufferHead bh;
- pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE, BP_LOCKTIMEOUT, BP_NUMTRIES);
+ pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE);
memcpy(&bh, bufPtr, sizeof(BufferHead));
@@ -541,7 +541,7 @@
int hashId = ( (bp.getFileId()+1) * (bp.getPageId()+1) ) % _numPages;
- pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE, BP_LOCKTIMEOUT, BP_NUMTRIES);
+ pLockHandle->lockBufferPool(hashId, CegoLockHandler::WRITE);
try
{
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoDefs.h
^
|
@@ -40,7 +40,7 @@
#endif
#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.10.7"
+#define CEGO_VERSION "2.10.10"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2011 by Bjoern Lemke. All rights reserved"
/*******************************/
@@ -148,37 +148,23 @@
/* lock delay resolution */
#define LCKMNG_DELRES 1000
+#define LCKMNG_NUMLOCKTRIES 3
+
/* FileHandler lock timeout in msec */
#define FH_LOCKTIMEOUT 10000
-#define FH_NUMTRIES 3
-
/* BufferPool lock timeout in msec */
/* this was increased becasue for large bufferpool configurations, timeouts may
occur during checkpoint writes */
#define BP_LOCKTIMEOUT 300000
-#define BP_NUMTRIES 3
-
-/* Data Page lock timeout in msec */
-#define DP_LOCKTIMEOUT 2000
-#define DP_NUMTRIES 3
-
-/* System Page lock timeout in msec */
-#define SP_LOCKTIMEOUT 2000
-#define SP_NUMTRIES 3
-
-/* Record lock timeout in msec */
-#define RC_LOCKTIMEOUT 2000
-#define RC_NUMTRIES 3
-
+/* Page lock timeout in msec */
+#define PG_LOCKTIMEOUT 10000
/* XMLSpace lock timeout in msec */
#define XS_LOCKTIMEOUT 10000
-/* TableManager TS lock timeout in msec */
+/* Transaction manager lock timeout in msec */
#define TS_LOCKTIMEOUT 10000
/* Database Manager lock timeout in msec */
#define DBM_LOCKTIMEOUT 10000
-/* number of retries after lock timeout */
-#define LCKMNG_NUMLOCKTRIES 3
#define RECLOCKGROUP "RECLOCK"
#define RBRECLOCKGROUP "RBRECLOCK"
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoDistCursor.cc
^
|
@@ -52,7 +52,7 @@
_isLocal = true;
_moreTuple = false;
-
+
_pSelect = 0;
_pSH = 0;
_pGTM = pGTM;
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoFieldValue.cc
^
|
@@ -361,6 +361,45 @@
_type = FIXED_TYPE;
return true;
}
+ else if ( _type == FLOAT_TYPE && t == FIXED_TYPE)
+ {
+ float f;
+ memcpy(&f, _pV, sizeof(float));
+ free(_pV);
+
+ Chain flval( f );
+ // cout << "flval = " << flval << endl;
+ _len = flval.length();
+ _pV = malloc(_len);
+ _type = FIXED_TYPE;
+ memcpy(_pV, (char*)flval, _len);
+ return true;
+ }
+ else if ( _type == VARCHAR_TYPE && t == FIXED_TYPE)
+ {
+ // we construct big decimal to check format
+ BigDecimal d = BigDecimal( Chain((char*)_pV) );
+ _type = FIXED_TYPE;
+ return true;
+ }
+ else if ( _type == INT_TYPE && t == FIXED_TYPE)
+ {
+
+ int intVal;
+ memcpy(&intVal, _pV, sizeof(int));
+ free(_pV);
+
+ Chain bival(intVal);
+ bival += Chain(".0");
+
+ _len = bival.length();
+ _pV = malloc(_len);
+ _type = FIXED_TYPE;
+ memcpy(_pV, (char*)bival, _len);
+ return true;
+
+ }
+
return false;
}
@@ -413,13 +452,17 @@
if (_type != fv._type )
{
CegoFieldValue fv2 = fv;
- if ( fv2.castTo(_type) == false )
- {
- Chain msg = Chain("Mismatched datatypes ") + CEGO_TYPE_MAP[_type]
- + Chain(" and ") + CEGO_TYPE_MAP[fv._type];
- throw Exception(EXLOC , msg);
- }
- return isEqual(fv2);
+ if ( fv2.castTo(_type) == true )
+ return isEqual(fv2);
+ fv2 = *this;
+ if ( fv2.castTo(fv.getType()) == true )
+ return fv2.isEqual(fv);
+
+ Chain msg = Chain("Mismatched datatypes ") + CEGO_TYPE_MAP[_type]
+ + Chain(" and ") + CEGO_TYPE_MAP[fv._type];
+ throw Exception(EXLOC , msg);
+
+
}
if (_pV == 0 || fv._pV == 0)
{
@@ -446,10 +489,15 @@
if (_type != fv._type )
{
CegoFieldValue fv2 = fv;
- if ( fv2.castTo(_type) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv2.castTo(_type) == true )
+ return ! isEqual(fv2);
+
+ fv2 = *this;
+ if ( fv2.castTo(fv.getType()) == false )
+ return ! fv2.isEqual(fv);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
- return ! isEqual(fv2);
}
if (_pV == 0 || fv._pV == 0)
{
@@ -473,12 +521,16 @@
if (_type != fv._type )
{
CegoFieldValue fv2 = fv;
- if ( fv2.castTo(_type) == false )
- {
- Chain msg = Chain("Mismatched Datatypes ") + CEGO_TYPE_MAP[_type] + Chain(" != ") + CEGO_TYPE_MAP[fv._type];
- throw Exception(EXLOC , msg);
- }
- return isLess(fv2);
+ if ( fv2.castTo(_type) == true )
+ return isLess(fv2);
+
+ fv2 = *this;
+ if ( fv2.castTo(fv.getType()) == true )
+ return fv2.isLess(fv);
+
+ Chain msg = Chain("Mismatched Datatypes ") + CEGO_TYPE_MAP[_type] + Chain(" != ") + CEGO_TYPE_MAP[fv._type];
+ throw Exception(EXLOC , msg);
+
}
if (_pV == 0 || fv._pV == 0)
{
@@ -504,9 +556,14 @@
if (_type != fv._type )
{
CegoFieldValue fv2 = fv;
- if ( fv2.castTo(_type) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
- return isMore(fv2);
+ if ( fv2.castTo(_type) == true )
+ return isMore(fv2);
+ fv2 = *this;
+ if ( fv2.castTo(fv.getType()) == true )
+ return fv2.isMore(fv);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
+
}
if (_pV == 0 || fv._pV == 0)
{
@@ -532,10 +589,15 @@
if (_type != fv._type )
{
CegoFieldValue fv2 = fv;
- if ( fv2.castTo(_type) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv2.castTo(_type) == true )
+ return isLessEqual(fv2);
+
+ fv2 = *this;
+ if ( fv2.castTo(fv.getType()) == true )
+ return fv2.isLessEqual(fv);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
- return isLessEqual(fv2);
}
if (_pV == 0 || fv._pV == 0)
{
@@ -560,10 +622,15 @@
if (_type != fv._type )
{
CegoFieldValue fv2 = fv;
- if ( fv2.castTo(_type) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv2.castTo(_type) == true )
+ return isMoreEqual(fv2);
+
+ fv2 = *this;
+ if ( fv2.castTo(fv.getType()) == true )
+ return fv2.isMoreEqual(fv);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
- return isMoreEqual(fv2);
}
if (_pV == 0 || fv._pV == 0)
{
@@ -1101,17 +1168,28 @@
CegoFieldValue operator + ( const CegoFieldValue& fv1, const CegoFieldValue& fv2 )
{
- if (fv1._type == NULL_TYPE || fv2._type == NULL_TYPE)
+ if ( fv1._type == NULL_TYPE )
{
- throw Exception(EXLOC , "Cannot operate on null value");
+ return fv2;
+ // throw Exception(EXLOC , "Cannot operate on null value");
}
+ if ( fv2._type == NULL_TYPE )
+ {
+ return fv1;
+ }
+
if (fv1._type != fv2._type)
{
CegoFieldValue fv3 = fv2;
- if ( fv3.castTo(fv1.getType()) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
-
- return fv1.add(fv3);
+ if ( fv3.castTo(fv1.getType()) == true )
+ return fv1.add(fv3);
+
+ fv3 = fv1;
+ if ( fv3.castTo(fv2.getType()) == true )
+ return fv2.add(fv3);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
+
}
if (fv1._pV == 0 || fv2._pV == 0)
{
@@ -1225,17 +1303,29 @@
CegoFieldValue operator - ( const CegoFieldValue& fv1, const CegoFieldValue& fv2 )
{
- if ( fv1._type == NULL_TYPE || fv2._type == NULL_TYPE)
+
+ if ( fv2._type == NULL_TYPE )
{
- throw Exception(EXLOC , "Cannot operate on null value");
+ return fv1;
+ }
+
+ if ( fv1._type == NULL_TYPE )
+ {
+ return fv2.negate();
}
+
if (fv1._type != fv2._type)
{
CegoFieldValue fv3 = fv2;
- if ( fv3.castTo(fv1.getType()) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv3.castTo(fv1.getType()) == true )
+ return fv1.sub(fv3);
+
+ fv3 = fv1;
+ if ( fv3.castTo(fv2.getType()) == true )
+ return fv3.sub(fv2);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
- return fv1.sub(fv3);
}
if (fv1._pV == 0 || fv2._pV == 0)
{
@@ -1360,10 +1450,16 @@
if (fv1._type != fv2._type)
{
CegoFieldValue fv3 = fv2;
- if ( fv3.castTo(fv1.getType()) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv3.castTo(fv1.getType()) == true )
+ return fv1.mul(fv3);
+
+ fv3 = fv1;
+ if ( fv3.castTo(fv2.getType()) == true )
+ return fv2.mul(fv3);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
+
- return fv1.mul(fv3);
}
if (fv1._pV == 0 || fv2._pV == 0)
{
@@ -1477,10 +1573,16 @@
if (fv1._type != fv2._type)
{
CegoFieldValue fv3 = fv2;
- if ( fv3.castTo(fv1.getType()) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv3.castTo(fv1.getType()) == true )
+ return fv1.div(fv3);
+
+ fv3 = fv1;
+ if ( fv3.castTo(fv2.getType()) == true )
+ return fv3.div(fv2);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
+
- return fv1.div(fv3);
}
if (fv1._pV == 0 || fv2._pV == 0)
{
@@ -1561,8 +1663,11 @@
BigDecimal d1 = BigDecimal( Chain((char*)(_pV)) );
BigDecimal d2 = BigDecimal( Chain((char*)(fv2._pV)) );
+ // cout << "div : " << d1 << " / " << d2 << endl;
+
BigDecimal d3 = d1.div(d2);
+ // cout << "res = " << d3 << endl;
CegoFieldValue fv3(_type, d3.toChain());
return fv3;
@@ -1639,10 +1744,15 @@
if (fv1._type != fv2._type)
{
CegoFieldValue fv3 = fv2;
- if ( fv3.castTo(fv1.getType()) == false )
- throw Exception(EXLOC , "Mismatched Datatypes");
+ if ( fv3.castTo(fv1.getType()) == true )
+ return fv1.concat(fv3);
+
+ fv3 = fv1;
+ if ( fv3.castTo(fv2.getType()) == true )
+ return fv3.concat(fv2);
+
+ throw Exception(EXLOC , "Incompatible Datatypes");
- return fv1.concat(fv3);
}
if (fv1._pV == 0 || fv2._pV == 0)
{
@@ -1685,6 +1795,90 @@
throw Exception(EXLOC, "Unknown Type");
}
}
+
+
+CegoFieldValue CegoFieldValue::negate() const
+{
+ switch (_type)
+ {
+ case INT_TYPE:
+ {
+ int i;
+ memcpy(&i, _pV, sizeof(int));
+ int* pI = new int;
+ *pI = (-1) * i;
+ CegoFieldValue fv3(_type, pI, sizeof(int), true);
+ return fv3;
+ }
+ case LONG_TYPE:
+ {
+ long l;
+ memcpy(&l, _pV, sizeof(long));
+ long* pL = new long;
+ *pL = (-1) * l;
+ CegoFieldValue fv3(_type, pL, sizeof(long), true);
+ return fv3;
+ }
+ case BIGINT_TYPE:
+ {
+ BigInteger bi = BigInteger( Chain((char*)(_pV)) );
+ bi.negate();
+ CegoFieldValue fv3(_type, bi.toChain());
+ return fv3;
+ }
+ case DECIMAL_TYPE:
+ case FIXED_TYPE:
+ {
+ BigDecimal bd = BigDecimal( Chain((char*)(_pV)) );
+ bd.negate();
+ CegoFieldValue fv3(_type, bd.toChain());
+ return fv3;
+ }
+ case FLOAT_TYPE:
+ {
+ float f;
+ memcpy(&f, _pV, sizeof(float));
+ float* pF = new float;
+ *pF = (-1.0) * f;
+ CegoFieldValue fv3(_type, pF, sizeof(float), true);
+ return fv3;
+ }
+ case DOUBLE_TYPE:
+ {
+ double d;
+ memcpy(&d, _pV, sizeof(double));
+ double* pD = new double;
+ *pD = (-1.0) * d;
+ CegoFieldValue fv3(_type, pD, sizeof(double), true);
+ return fv3;
+ }
+ case SMALLINT_TYPE:
+ {
+ short s;
+ memcpy(&s,_pV, sizeof(short));
+ short* pS = new short;
+ *pS = (-1) * s;
+ CegoFieldValue fv3(_type, pS, sizeof(short), true);
+ return fv3;
+ }
+ case TINYINT_TYPE:
+ {
+ char c = *(char*)(_pV);
+ char* pC = new char;
+ *pC = (-1) * c;
+ CegoFieldValue fv3(_type, pC, sizeof(char), true);
+ return fv3;
+ }
+ case VARCHAR_TYPE:
+ case BOOL_TYPE:
+ case DATETIME_TYPE:
+ {
+ throw Exception(EXLOC, "Cannot negate date type");
+ }
+ default:
+ throw Exception(EXLOC, "Unknown Type");
+ }
+}
void CegoFieldValue::setLocalCopy(bool isLocal)
{
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoFieldValue.h
^
|
@@ -107,6 +107,7 @@
CegoFieldValue mul( const CegoFieldValue& fv2 ) const;
CegoFieldValue div( const CegoFieldValue& fv2 ) const;
CegoFieldValue concat( const CegoFieldValue& fv2 ) const;
+ CegoFieldValue negate() const;
CegoDataType _type;
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoFileHandler.cc
^
|
@@ -159,7 +159,7 @@
throw Exception(EXLOC, "Cannot read fbm", e);
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
@@ -200,7 +200,7 @@
throw Exception(EXLOC, "Cannot write fbm", e);
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
@@ -337,7 +337,7 @@
void CegoFileHandler::regDataFile(int tabSetId, const Chain& path, int fileId, CegoLockHandler *pLockHandle)
{
- pLockHandle->lockDataFile(fileId, CegoLockHandler::READ, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::READ);
if ( _isReg[fileId] )
{
@@ -422,7 +422,7 @@
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
@@ -466,7 +466,7 @@
throw Exception(EXLOC, "Cannot read page", e);
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
@@ -512,7 +512,7 @@
throw Exception(EXLOC, "Cannot claim page", e);
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
@@ -566,7 +566,7 @@
File* pF;
pF = getHandle(fid);
- pLockHandle->lockDataFile(fid, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fid, CegoLockHandler::WRITE);
try
{
@@ -693,7 +693,7 @@
File* pF;
pF = getHandle(fileId);
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
if ( _buMask[fileId] )
{
@@ -778,7 +778,7 @@
throw Exception(EXLOC, "Cannot get num used pages", e);
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
@@ -850,7 +850,7 @@
throw Exception(EXLOC, "Cannot check for claimed status", e);
}
- pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE, FH_LOCKTIMEOUT, FH_NUMTRIES);
+ pLockHandle->lockDataFile(fileId, CegoLockHandler::WRITE);
try
{
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoFunction.cc
^
|
@@ -1129,6 +1129,11 @@
funcString = Chain("nextcount");
break;
}
+ case CegoFunction::SETCOUNT:
+ {
+ funcString = Chain("setcount");
+ break;
+ }
case CegoFunction::USERDEFINED:
{
funcString = _funcName;
@@ -1283,6 +1288,11 @@
pFunctionElement->setAttribute( XML_FUNCTYPE_ATTR, XML_NEXTCOUNTFUNC_VALUE);
break;
}
+ case CegoFunction::SETCOUNT:
+ {
+ pFunctionElement->setAttribute( XML_FUNCTYPE_ATTR, XML_SETCOUNTFUNC_VALUE);
+ break;
+ }
case CegoFunction::USERDEFINED:
{
pFunctionElement->setAttribute( XML_FUNCTYPE_ATTR, XML_USERDEFINEDFUNC_VALUE);
@@ -1413,6 +1423,10 @@
{
_type = CegoFunction::NEXTCOUNT;
}
+ else if ( functionTypeString == Chain(XML_SETCOUNTFUNC_VALUE) )
+ {
+ _type = CegoFunction::SETCOUNT;
+ }
else if ( functionTypeString == Chain(XML_USERDEFINEDFUNC_VALUE) )
{
_type = CegoFunction::USERDEFINED;
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoLockHandler.cc
^
|
@@ -51,16 +51,6 @@
static ThreadLock** _lockArray;
-/*
-static ThreadLock _countRecLock;
-static ThreadLock _countRBRecLock;
-static ThreadLock _countSysRecLock;
-static ThreadLock _countSysPageLock;
-static ThreadLock _countDataPageLock;
-static ThreadLock _countIdxPageLock;
-static ThreadLock _countRBPageLock;
-*/
-
bool __lockStatOn = true;
CegoLockHandler::CegoLockHandler(CegoDatabaseManager* pDBMng)
@@ -77,6 +67,11 @@
_numDataFileSema = pDBMng->getNumDataFileSema();
_numBufferPoolSema = pDBMng->getNumBufferPoolSema();
+ _pageLockTimeout = pDBMng->getPageLockTimeout();
+ _fileLockTimeout = pDBMng->getFileLockTimeout();
+ _poolLockTimeout = pDBMng->getPoolLockTimeout();
+ _numLockTries = pDBMng->getNumLockTries();
+
_pDBMng = pDBMng;
_modId = pDBMng->getModId("CegoLockHandler");
@@ -168,17 +163,6 @@
_lockArray[i]->init(LCKMNG_LOCKWAITDELAY, __lockStatOn);
}
- /*
- _countRecLock.init(LCKMNG_LOCKWAITDELAY);
- _countRBRecLock.init(LCKMNG_LOCKWAITDELAY);
- _countSysRecLock.init(LCKMNG_LOCKWAITDELAY);
- _countSysPageLock.init(LCKMNG_LOCKWAITDELAY);
- _countSysPageLock.init(LCKMNG_LOCKWAITDELAY);
- _countDataPageLock.init(LCKMNG_LOCKWAITDELAY);
- _countIdxPageLock.init(LCKMNG_LOCKWAITDELAY);
- _countRBPageLock.init(LCKMNG_LOCKWAITDELAY);
- */
-
int low = 0;
int high = _numRecSema;
int semId;
@@ -353,12 +337,14 @@
}
}
-unsigned long CegoLockHandler::lockRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode)
{
int semId = ( dp.getFileId() * dp.getPageId() + dp.getOffset()) % _numRecSema;
- // _countRecLock.writeLock();
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
+
int i=0;
while ( _recordLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -366,13 +352,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countRecLock.unlock();
throw Exception(EXLOC, "Number of record locks exceeded");
}
_recordLock[i].lockId=_nextLockId;
_nextLockId++;
- // _countRecLock.unlock();
-
_recordLock[i].semId=semId;
if ( _lockCount[semId] == 0 )
@@ -451,13 +434,15 @@
}
}
-unsigned long CegoLockHandler::lockRBRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockRBRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode)
{
int semId = _numRecSema
+ ( dp.getFileId() * dp.getPageId() + dp.getOffset()) % _numRBRecSema;
- // _countRBRecLock.writeLock();
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
+
int i=0;
while ( _rbRecordLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -465,12 +450,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countRBRecLock.unlock();
throw Exception(EXLOC, "Number of rb record locks exceeded");
}
_rbRecordLock[i].lockId=_nextLockId;
_nextLockId++;
- // _countRBRecLock.unlock();
_rbRecordLock[i].semId=semId;
@@ -553,14 +536,16 @@
-unsigned long CegoLockHandler::lockSysRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockSysRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode)
{
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
+
int semId = _numRecSema
+ _numRBRecSema
+ ( dp.getFileId() * dp.getPageId() + dp.getOffset()) % _numSysRecSema;
- // _countSysRecLock.writeLock();
int i=0;
while ( _sysRecordLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -568,12 +553,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countSysRecLock.unlock();
throw Exception(EXLOC, "Number of sys record locks exceeded");
}
_sysRecordLock[i].lockId=_nextLockId;
_nextLockId++;
- // _countSysRecLock.unlock();
_sysRecordLock[i].semId=semId;
if ( _lockCount[semId] == 0 )
@@ -651,7 +634,7 @@
}
}
-unsigned long CegoLockHandler::lockSysPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockSysPage(int fileId, int pageId, enum LockMode lockMode)
{
int semId = _numRecSema
@@ -659,7 +642,9 @@
+ _numSysRecSema
+ ( fileId * ( pageId + 1 ) ) % _numSysPageSema;
- // _countSysPageLock.writeLock();
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
+
int i=0;
while ( _sysPageLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -667,12 +652,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countSysPageLock.unlock();
throw Exception(EXLOC, "Number of sys page locks exceeded");
}
_sysPageLock[i].lockId = _nextLockId;
_nextLockId++;
- // _countSysPageLock.unlock();
if ( _lockCount[semId] == 0 )
{
@@ -748,17 +731,18 @@
}
}
-unsigned long CegoLockHandler::lockData(CegoObject::ObjectType type, int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockData(CegoObject::ObjectType type, int fileId, int pageId, enum LockMode lockMode)
{
+
if ( type == CegoObject::INDEX || type == CegoObject::UINDEX || type == CegoObject::PINDEX )
{
- return lockIndexPage(fileId, pageId, lockMode, timeout, numTries);
+ return lockIndexPage(fileId, pageId, lockMode);
}
else if ( type == CegoObject::RBSEG )
{
- return lockRBPage(fileId, pageId, lockMode, timeout, numTries);
+ return lockRBPage(fileId, pageId, lockMode);
}
- return lockDataPage(fileId, pageId, lockMode, timeout, numTries);
+ return lockDataPage(fileId, pageId, lockMode);
}
@@ -775,7 +759,7 @@
return unlockDataPage(lockId);
}
-unsigned long CegoLockHandler::lockDataPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockDataPage(int fileId, int pageId, enum LockMode lockMode)
{
int semId = _numRecSema
@@ -783,8 +767,10 @@
+ _numSysRecSema
+ _numSysPageSema
+ ( fileId * ( pageId + 1 ) ) % _numDataPageSema;
+
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
- // _countDataPageLock.writeLock();
int i=0;
while ( _dataPageLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -792,12 +778,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countDataPageLock.unlock();
throw Exception(EXLOC, Chain("Number of data page locks exceeded"));
}
_dataPageLock[i].lockId = _nextLockId;
_nextLockId++;
- // _countDataPageLock.unlock();
if ( _lockCount[semId] == 0 )
{
@@ -873,7 +857,7 @@
}
}
-unsigned long CegoLockHandler::lockIndexPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockIndexPage(int fileId, int pageId, enum LockMode lockMode)
{
int semId = _numRecSema
@@ -883,7 +867,9 @@
+ _numDataPageSema
+ ( fileId * ( pageId + 1 ) ) % _numIdxPageSema;
- // _countIdxPageLock.writeLock();
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
+
int i=0;
while ( _idxPageLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -891,12 +877,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countIdxPageLock.unlock();
throw Exception(EXLOC, "Number of index page locks exceeded");
}
_idxPageLock[i].lockId = _nextLockId;
_nextLockId++;
- // _countIdxPageLock.unlock();
if ( _lockCount[semId] == 0 )
{
@@ -972,7 +956,7 @@
}
}
-unsigned long CegoLockHandler::lockRBPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries)
+unsigned long CegoLockHandler::lockRBPage(int fileId, int pageId, enum LockMode lockMode)
{
int semId = _numRecSema
@@ -983,7 +967,9 @@
+ _numIdxPageSema
+ ( fileId * ( pageId + 1 ) ) % _numRBPageSema;
- // _countRBPageLock.writeLock();
+ int timeout = _pageLockTimeout;
+ int numTries = _numLockTries;
+
int i=0;
while ( _rbPageLock[i].lockId != 0 && i < LCKMNG_NUMLOCKS)
{
@@ -991,12 +977,10 @@
}
if (i == LCKMNG_NUMLOCKS)
{
- // _countRBPageLock.unlock();
throw Exception(EXLOC, "Number of rb page locks exceeded");
}
_rbPageLock[i].lockId = _nextLockId;
_nextLockId++;
- // _countRBPageLock.unlock();
if ( _lockCount[semId] == 0 )
{
@@ -1073,7 +1057,7 @@
}
}
-void CegoLockHandler::lockDataFile(int fileId, enum LockMode lockMode, int timeout, int numTries)
+void CegoLockHandler::lockDataFile(int fileId, enum LockMode lockMode)
{
int semId = _numRecSema
@@ -1085,6 +1069,9 @@
+ _numRBPageSema
+ fileId % _numDataFileSema;
+ int timeout = _fileLockTimeout;
+ int numTries = _numLockTries;
+
if ( _lockCount[semId] == 0 )
{
@@ -1146,7 +1133,7 @@
}
}
-void CegoLockHandler::lockBufferPool(int hashId, enum LockMode lockMode, int timeout, int numTries)
+void CegoLockHandler::lockBufferPool(int hashId, enum LockMode lockMode)
{
int semId = _numRecSema
@@ -1159,6 +1146,9 @@
+ _numDataFileSema
+ hashId % _numBufferPoolSema;
+ int timeout = _poolLockTimeout;
+ int numTries = _numLockTries;
+
if ( _lockCount[semId] == 0 )
{
while ( numTries > 0 )
@@ -1222,7 +1212,7 @@
{
for ( int i=0; i<_numBufferPoolSema; i++ )
- lockBufferPool(i, WRITE, BP_LOCKTIMEOUT, BP_NUMTRIES);
+ lockBufferPool(i, WRITE);
}
void CegoLockHandler::unlockBufferPool()
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoLockHandler.h
^
|
@@ -60,25 +60,25 @@
CegoBufferPage getPage(unsigned long lockId);
- unsigned long lockRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode);
void unlockRecord(unsigned long id);
- unsigned long lockRBRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockRBRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode);
void unlockRBRecord(unsigned long id);
- unsigned long lockSysRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockSysRecord(const CegoBufferPage &bp, const CegoDataPointer& dp, enum LockMode lockMode);
void unlockSysRecord(unsigned long id);
- unsigned long lockSysPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockSysPage(int fileId, int pageId, enum LockMode lockMode);
void unlockSysPage(unsigned long id);
- unsigned long lockData(CegoObject::ObjectType type, int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockData(CegoObject::ObjectType type, int fileId, int pageId, enum LockMode lockMode);
void unlockData(CegoObject::ObjectType type, unsigned long id);
- void lockDataFile(int fileId, enum LockMode lockMode, int timeout, int numTries);
+ void lockDataFile(int fileId, enum LockMode lockMode);
void unlockDataFile(int fileId);
- void lockBufferPool(int hashId, enum LockMode lockMode, int timeout, int numTries);
+ void lockBufferPool(int hashId, enum LockMode lockMode);
void unlockBufferPool(int hashId);
void lockBufferPool();
@@ -89,13 +89,13 @@
private:
- unsigned long lockDataPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockDataPage(int fileId, int pageId, enum LockMode lockMode);
void unlockDataPage(unsigned long id);
- unsigned long lockIndexPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockIndexPage(int fileId, int pageId, enum LockMode lockMode);
void unlockIndexPage(unsigned long id);
- unsigned long lockRBPage(int fileId, int pageId, enum LockMode lockMode, int timeout, int numTries);
+ unsigned long lockRBPage(int fileId, int pageId, enum LockMode lockMode);
void unlockRBPage(unsigned long id);
unsigned long _nextLockId;
@@ -134,6 +134,11 @@
int _numSema;
+ int _pageLockTimeout;
+ int _fileLockTimeout;
+ int _poolLockTimeout;
+ int _numLockTries;
+
CegoDatabaseManager *_pDBMng;
unsigned long _modId;
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoObjectCursor.cc
^
|
@@ -90,7 +90,7 @@
try
{
- _lockId = _pLockHandle->lockData(_type, _fileId, _pageId, CegoLockHandler::READ, DP_LOCKTIMEOUT, DP_NUMTRIES);
+ _lockId = _pLockHandle->lockData(_type, _fileId, _pageId, CegoLockHandler::READ);
}
catch ( Exception e)
{
@@ -116,9 +116,9 @@
_recLock = 0;
if ( _type == CegoObject::RBSEG )
- _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ);
else
- _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ);
return p;
}
@@ -143,7 +143,7 @@
try
{
- _lockId = _pLockHandle->lockData(_type, _fileId, _pageId, CegoLockHandler::READ, DP_LOCKTIMEOUT, DP_NUMTRIES);
+ _lockId = _pLockHandle->lockData(_type, _fileId, _pageId, CegoLockHandler::READ);
}
catch ( Exception e)
{
@@ -172,9 +172,9 @@
_recLock = 0;
if ( _type == CegoObject::RBSEG )
- _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ);
else
- _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ);
return p;
}
@@ -231,9 +231,9 @@
dp.setOffset(_bp.getEntryPos());
if ( _type == CegoObject::RBSEG )
- _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ);
else
- _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ);
return p;
}
@@ -259,7 +259,7 @@
try
{
- _lockId = _pLockHandle->lockData(_type, _fileId, _pageId, CegoLockHandler::READ, DP_LOCKTIMEOUT, DP_NUMTRIES);
+ _lockId = _pLockHandle->lockData(_type, _fileId, _pageId, CegoLockHandler::READ);
}
catch ( Exception e )
{
@@ -284,9 +284,9 @@
dp.setOffset(_bp.getEntryPos());
if ( _type == CegoObject::RBSEG )
- _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRBRecord(_bp, dp, CegoLockHandler::READ);
else
- _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _recLock = _pLockHandle->lockRecord(_bp, dp, CegoLockHandler::READ);
return p;
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoObjectManager.cc
^
|
@@ -110,7 +110,7 @@
{
char *buf;
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
buf = (char*)bp.newEntry(tableObject.getEntrySize());
@@ -209,7 +209,7 @@
{
char *buf;
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
buf = (char*)bp.newEntry(keyObject.getEntrySize());
@@ -289,7 +289,7 @@
{
char *buf;
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
buf = (char*)bp.newEntry(checkObject.getEntrySize());
@@ -372,7 +372,7 @@
{
char *buf;
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
buf = (char*)bp.newEntry(viewObject.getEntrySize());
@@ -455,7 +455,7 @@
{
char *buf;
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
buf = (char*)bp.newEntry(procObject.getEntrySize());
@@ -558,7 +558,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
while ( pE )
@@ -702,7 +702,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -850,7 +850,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -997,7 +997,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -1052,7 +1052,7 @@
{
char *buf;
- altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE);
buf = (char*)altPage.newEntry(objEntry.getEntrySize());
@@ -1167,7 +1167,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -1203,7 +1203,7 @@
{
char *buf;
- altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE);
buf = (char*)altPage.newEntry(objEntry.getEntrySize());
@@ -1318,7 +1318,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -1354,7 +1354,7 @@
{
char *buf;
- altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE);
buf = (char*)altPage.newEntry(objEntry.getEntrySize());
@@ -1460,7 +1460,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -1497,7 +1497,7 @@
{
char *buf;
- altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE);
buf = (char*)altPage.newEntry(procEntry.getEntrySize());
@@ -1608,7 +1608,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -1646,7 +1646,7 @@
{
char *buf;
- altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE);
buf = (char*)altPage.newEntry(viewEntry.getEntrySize());
@@ -1754,7 +1754,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::WRITE);
char* pE = (char*)bp.getFirstEntry();
@@ -1793,7 +1793,7 @@
{
char *buf;
- altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ altLockId = _pLockHandle->lockSysPage(altFileId, altPageId, CegoLockHandler::WRITE);
buf = (char*)altPage.newEntry(checkEntry.getEntrySize());
@@ -1910,7 +1910,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
while (pE)
@@ -1994,8 +1994,8 @@
while ( ! lastPage )
{
- _pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ _pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
@@ -2129,8 +2129,7 @@
{
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
-
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
@@ -2257,8 +2256,8 @@
while ( ! lastPage && ! found )
{
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
-
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
@@ -2379,7 +2378,7 @@
{
_pDBMng->bufferFix(bp, oe.getTabSetId(), fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
@@ -2396,7 +2395,7 @@
CegoDataPointer recDP(fileId, pageId, bp.getEntryPos());
- recLock = _pLockHandle->lockSysRecord(bp, recDP, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ recLock = _pLockHandle->lockSysRecord(bp, recDP, CegoLockHandler::WRITE);
// resolve required
oe.decode(pE);
@@ -2498,7 +2497,7 @@
try
{
- recLock = _pLockHandle->lockSysRecord(zerobp, sysEntry, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ recLock = _pLockHandle->lockSysRecord(zerobp, sysEntry, CegoLockHandler::WRITE);
CegoDataPointer dp;
@@ -2562,7 +2561,7 @@
char* pE = (char*)bp.getPagePtr() + dp.getOffset();
- lockId = _pLockHandle->lockData(type, dp.getFileId(), dp.getPageId(), CegoLockHandler::WRITE, DP_LOCKTIMEOUT, DP_NUMTRIES);
+ lockId = _pLockHandle->lockData(type, dp.getFileId(), dp.getPageId(), CegoLockHandler::WRITE);
bp.freeEntry(pE);
_pLockHandle->unlockData(type, lockId);
@@ -2633,7 +2632,7 @@
{
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, CegoBufferPool::PERSISTENT, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
@@ -2731,7 +2730,7 @@
unsigned long lockId=0;
- lockId = _pLockHandle->lockRecord(bp, dp, lockMode, RC_LOCKTIMEOUT, RC_NUMTRIES);
+ lockId = _pLockHandle->lockRecord(bp, dp, lockMode);
return lockId;
}
catch ( Exception e )
@@ -2767,7 +2766,7 @@
try
{
- lockId = _pLockHandle->lockRecord(bp, dp, lockMode, RC_LOCKTIMEOUT, RC_NUMTRIES);
+ lockId = _pLockHandle->lockRecord(bp, dp, lockMode);
}
catch ( Exception e )
@@ -3025,7 +3024,7 @@
while ( ! inserted )
{
- lockId = _pLockHandle->lockData(type, fileId, pageId, CegoLockHandler::WRITE, DP_LOCKTIMEOUT, DP_NUMTRIES);
+ lockId = _pLockHandle->lockData(type, fileId, pageId, CegoLockHandler::WRITE);
char *pE = (char*)bp.newEntry(dataSize);
@@ -3187,7 +3186,7 @@
_pDBMng->bufferFix(bp, tabSetId, fileId, pageId, lockMode, _pLockHandle);
- lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ lockId = _pLockHandle->lockSysPage(fileId, pageId, CegoLockHandler::READ);
char* pE = (char*)bp.getFirstEntry();
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoQueryHelper.cc
^
|
@@ -178,7 +178,10 @@
pP->getExpr1()->setBlock(pBlock);
pP->getExpr2()->setBlock(pBlock);
pP->getExpr3()->setBlock(pBlock);
-
+
+
+ // cout << " Eval " << pP->getExpr1()->evalFieldValue() << " is btwn " << pP->getExpr2()->evalFieldValue() << " and " << pP->getExpr3()->evalFieldValue() << endl;
+
retVal = evalBetween(pP->getExpr1()->evalFieldValue(), pP->getExpr2()->evalFieldValue(), pP->getExpr3()->evalFieldValue());
break;
}
@@ -445,22 +448,22 @@
ListT<CegoAttrDesc*> attrRefList2 = pP->getExpr2()->getAttrRefList();
ListT<CegoAttrDesc*> attrRefList3 = pP->getExpr3()->getAttrRefList();
- if ( attrRefList1.Size() == 0 && pAttrDesc2 && attrRefList3.Size() == 0 )
+ if ( pAttrDesc1 && attrRefList2.Size() && attrRefList3.Size() == 0 )
{
CegoField* pF = schema.First();
while (pF)
{
- if ((pAttrDesc2->getTableName() == (Chain)pF->getTableName() ||
- pAttrDesc2->getTableName() == (Chain)pF->getTableAlias() ||
- pAttrDesc2->getTableName() == Chain())
- && pAttrDesc2->getAttrName() == (Chain)pF->getAttrName())
+ if ((pAttrDesc1->getTableName() == (Chain)pF->getTableName() ||
+ pAttrDesc1->getTableName() == (Chain)pF->getTableAlias() ||
+ pAttrDesc1->getTableName() == Chain())
+ && pAttrDesc1->getAttrName() == (Chain)pF->getAttrName())
{
- pP->getExpr1()->setBlock(pBlock);
+ pP->getExpr2()->setBlock(pBlock);
pP->getExpr3()->setBlock(pBlock);
ac.add(CegoAttrComp(pF->getAttrName(),
- pP->getExpr1()->evalFieldValue(),
+ pP->getExpr2()->evalFieldValue(),
pP->getExpr3()->evalFieldValue()));
}
pF = schema.Next();
@@ -642,7 +645,7 @@
bool CegoQueryHelper::evalBetween(const CegoFieldValue& f1, const CegoFieldValue& f2, const CegoFieldValue& f3)
{
- if ( f1 <= f2 && f2 <= f3 )
+ if ( f2 <= f1 && f1 <= f3 )
return true;
return false;
}
@@ -704,6 +707,11 @@
fv = CegoFieldValue(FIXED_TYPE, Chain("0.0"));
break;
}
+ case NULL_TYPE:
+ {
+ // nothing to to
+ break;
+ }
default:
{
Chain msg = Chain("Aggregation not supported on datatype <") + CEGO_TYPE_MAP[ (int) fv.getType()] + Chain(">");
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoSelect.cc
^
|
@@ -701,7 +701,8 @@
if ( _pUnionSelect )
{
_checkUnion = true;
-
+
+ jfl.Empty();
if ( _pUnionSelect->nextTuple(jfl) )
{
if ( _doCaching )
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoTableManager.cc
^
|
@@ -3296,7 +3296,7 @@
CegoDataPointer dp = insertData(ioe, (char*)base.getPtr(), base.getLen(), true);
CegoBufferPage zp;
- unsigned long recLock = _pLockHandle->lockRecord(zp, dp, CegoLockHandler::WRITE, SP_LOCKTIMEOUT, SP_NUMTRIES);
+ unsigned long recLock = _pLockHandle->lockRecord(zp, dp, CegoLockHandler::WRITE);
// building up index
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoXMLSpace.cc
^
|
@@ -396,6 +396,46 @@
return maxFixTries;
}
+int CegoXMLSpace::getPageLockTimeout()
+{
+ P();
+ int lockTimeout = _pDoc->getRootElement()->getAttributeValue(XML_PAGELOCKTIMEOUT_ATTR).asInteger();
+ V();
+ if ( lockTimeout == 0 )
+ lockTimeout = PG_LOCKTIMEOUT;
+ return lockTimeout;
+}
+
+int CegoXMLSpace::getFileLockTimeout()
+{
+ P();
+ int lockTimeout = _pDoc->getRootElement()->getAttributeValue(XML_FILELOCKTIMEOUT_ATTR).asInteger();
+ V();
+ if ( lockTimeout == 0 )
+ lockTimeout = FH_LOCKTIMEOUT;
+ return lockTimeout;
+}
+
+int CegoXMLSpace::getPoolLockTimeout()
+{
+ P();
+ int lockTimeout = _pDoc->getRootElement()->getAttributeValue(XML_POOLLOCKTIMEOUT_ATTR).asInteger();
+ V();
+ if ( lockTimeout == 0 )
+ lockTimeout = BP_LOCKTIMEOUT;
+ return lockTimeout;
+}
+
+int CegoXMLSpace::getNumLockTries()
+{
+ P();
+ int numLockTries = _pDoc->getRootElement()->getAttributeValue(XML_NUMLOCKTRIES_ATTR).asInteger();
+ V();
+ if ( numLockTries == 0 )
+ numLockTries = LCKMNG_NUMLOCKTRIES;
+ return numLockTries;
+}
+
bool CegoXMLSpace::isCaseSensitiveMode()
{
P();
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoXMLSpace.h
^
|
@@ -80,6 +80,11 @@
int getNumBufferPoolSema();
int getMaxFixTries();
+ int getPageLockTimeout();
+ int getFileLockTimeout();
+ int getPoolLockTimeout();
+ int getNumLockTries();
+
bool isCaseSensitiveMode();
bool isQuoteEscapeMode();
|
[-]
[+]
|
Changed |
cego-2.10.10.tar.bz2/src/CegoXMLdef.h
^
|
@@ -307,6 +307,7 @@
#define XML_FILEID_ATTR "FILEID"
#define XML_FILESIZE_ATTR "FILESIZE"
#define XML_FILENAME_ATTR "FILENAME"
+#define XML_FILELOCKTIMEOUT_ATTR "FILELOCKTIMEOUT"
#define XML_FIXSTAT_ATTR "FIXSTAT"
#define XML_FORCELOAD_ATTR "FORCELOAD"
#define XML_FORMAT_ATTR "FORMAT"
@@ -340,6 +341,7 @@
#define XML_LOGMNGPROG_ATTR "LOGMNGPROG"
#define XML_LSN_ATTR "LSN"
#define XML_NEXTLSN_ATTR "NEXTLSN"
+#define XML_NUMLOCKTRIES_ATTR "NUMLOCKTRIES"
#define XML_SORTAREASIZE_ATTR "SORTAREASIZE"
#define XML_MAXFIXCOUNT_ATTR "MAXFIXCOUNT"
#define XML_MVAL_ATTR "MVAL"
@@ -368,6 +370,8 @@
#define XML_NUMQUERY_ATTR "NUMQUERY"
#define XML_OPENUNDO_ATTR "OPENUNDO"
#define XML_OPENUPD_ATTR "OPENUPD"
+#define XML_PAGELOCKTIMEOUT_ATTR "PAGELOCKTIMEOUT"
+#define XML_POOLLOCKTIMEOUT_ATTR "POOLLOCKTIMEOUT"
#define XML_READDELAY_ATTR "READDELAY"
#define XML_ROLE_ATTR "ROLE"
#define XML_WRITEDELAY_ATTR "WRITEDELAY"
@@ -605,6 +609,7 @@
#define XML_BITORFUNC_VALUE "BITORFUNC"
#define XML_BITXORFUNC_VALUE "BITXORFUNC"
#define XML_NEXTCOUNTFUNC_VALUE "NEXTCOUNT"
+#define XML_SETCOUNTFUNC_VALUE "SETCOUNT"
#define XML_USERDEFINEDFUNC_VALUE "USERDEFINEDFUNC"
|
[-]
[+]
|
Added |
cego-2.10.10.tar.bz2/tools/cgmkdb
^
|
@@ -0,0 +1,151 @@
+#!/bin/bash
+#
+# mkcgdb
+# ------
+# Utility script to build up a cego database with one tableset
+#
+# (C)opyright 2010 by Bjoern Lemke
+#
+# The database and tableset parameters defined below
+# should be edited and customized to appropriate values
+#
+#
+
+DEFCEGOROOT=/usr/local/cego
+
+printUsage()
+{
+ echo "Usage : $0 <dbname> [ <root path> ]"
+}
+
+if [ $# -lt 1 ] || [ $# -gt 2 ]
+then
+ printUsage
+ exit 1
+fi
+
+# path to the database root path, where the database should be created
+DBNAME=$1
+CEGOROOT=$2
+
+if [ -z "$CEGOROOT" ]
+then
+ CEGOROOT=$DEFCEGOROOT
+fi
+
+if [ ! -d $CEGOROOT ]
+then
+ echo "Root directory $CEGOROOT must exist"
+ exit 1
+fi
+
+DBROOT=$CEGOROOT/$DBNAME
+
+if [ -d $DBROOT ]
+then
+ echo "Root directory $DBROOT/$DBNAME already exists"
+ echo "Must be removed manually to create database"
+ exit 1
+fi
+
+echo "Creating database in directory $DBROOT ..."
+
+# path to the cego executable
+CEGO=cego
+# name of the database xml file
+DBXML=${DBROOT}/${DBNAME}.xml
+# several database parameters
+PAGESIZE=16384
+ADMPORT=2000
+DBPORT=2200
+LOGPORT=3000
+PIDFILE=${DBROOT}/pid
+ADMINUSER=cgadm
+ADMINPWD=cgadm
+LOGFILE=${DBROOT}/cego.log
+
+# DEBUGLEVEL=DEBUG
+DEBUGLEVEL=NOTICE
+
+# tableset defs
+TS=tsdef
+TSROOT=${DBROOT}/data
+TSTICKET=${TSROOT}/tsticket.xml
+SYSSIZE=100
+TMPSIZE=3000
+LOGFILESIZE=1000000
+LOGFILENUM=3
+SORTAREASIZE=10000000
+APPFILE=${TSROOT}/${TS}data01.dbf
+APPSIZE=5000
+DBUSER=cego
+DBPWD=cego
+
+##########################
+### end of customizing ###
+##########################
+
+# rm -rf ${TSROOT}
+
+mkdir ${DBROOT}
+mkdir ${TSROOT}
+
+echo "Creating xml ..."
+cat > $DBXML <<EOF
+<?xml version="1.0" ?>
+<!DOCTYPE CEGO_DB_SPEC>
+<DATABASE NAME="$DBNAME" PAGESIZE="$PAGESIZE"
+ADMINPORT="$ADMPORT" LOGPORT="$LOGPORT" DATAPORT="$DBPORT"
+PIDFILE="$PIDFILE" MAXFID="1" MAXTSID="1"
+NUMRECSEMA="1000" NUMSYSPAGESEMA="43" NUMDATAPAGESEMA="43"
+NUMIDXPAGESEMA="43" NUMRBPAGESEMA="43" NUMDATAFILESEMA="11"
+NUMBUFFERPOOLSEMA="11" MAXFIXTRIES="30"
+CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
+<MODULE NAME="ALL" LEVEL="$DEBUGLEVEL"></MODULE>
+</DATABASE>
+EOF
+
+# <MODULE NAME="CegoTableManager" LEVEL="NOTICE"></MODULE>
+# <MODULE NAME="CegoAdminThreadPool" LEVEL="NOTICE"></MODULE>
+# <MODULE NAME="CegoSelect" LEVEL="NOTICE"></MODULE>
+
+/bin/echo -n "Creating admin user ..."
+${CEGO} --mode=setadminuser --dbxml=${DBXML} --user=${ADMINUSER}/${ADMINPWD} --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+/bin/echo -n "Defining tableset $TS1..."
+${CEGO} --mode=define --tableset=${TS} -dbxml=${DBXML} --tsdef=tsroot:${TSROOT},tsticket:${TSTICKET},syssize:${SYSSIZE},tmpsize:${TMPSIZE},logfilesize:${LOGFILESIZE},logfilenum:${LOGFILENUM},appfile:${APPFILE},appsize:${APPSIZE},sortareasize=${SORTAREASIZE} --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+/bin/echo -n "Creating database user for $TS1 ..."
+${CEGO} --mode=setdbuser --tableset=${TS} --dbxml=${DBXML} --user=${DBUSER}/${DBPWD} --role=ALL --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+/bin/echo -n "Creating tableset $TS1..."
+${CEGO} --mode=create --dbxml=${DBXML} --tableset=${TS} --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
|
[-]
[+]
|
Added |
cego-2.10.10.tar.bz2/tools/cgmkdb~
^
|
@@ -0,0 +1,143 @@
+#!/bin/bash
+#
+# mkcgdb
+# ------
+# Utility script to build up a cego database with one tableset
+#
+# (C)opyright 2010 by Bjoern Lemke
+#
+# The database and tableset parameters defined below
+# should be edited and customized to appropriate values
+#
+#
+
+printUsage()
+{
+ echo "Usage : $0 <dbname> [ <root path> ]"
+}
+
+if [ $# -lt 1 ] || [ $# -gt 2 ]
+then
+ printUsage
+ exit 1
+fi
+
+# path to the database root path, where the database should be created
+DBNAME=$1
+DBROOT=$2
+
+if [ -z "$DBROOT" ]
+then
+ DBROOT=./$DBNAME
+else
+ DBROOT=$DBROOT/$DBNAME
+fi
+
+if [ -d $DBROOT ]
+then
+ echo "Root directory $DBROOT already exists"
+ echo "Must be removed manually to create database"
+ exit 1
+fi
+
+echo "Creating database in directory $DBROOT ..."
+
+# path to the cego executable
+CEGO=cego
+# name of the database xml file
+DBXML=${DBROOT}/${DBNAME}.xml
+# several database parameters
+PAGESIZE=16384
+ADMPORT=2000
+DBPORT=2200
+LOGPORT=3000
+PIDFILE=${DBROOT}/pid
+ADMINUSER=cgadm
+ADMINPWD=cgadm
+LOGFILE=${DBROOT}/cego.log
+
+# DEBUGLEVEL=DEBUG
+DEBUGLEVEL=NOTICE
+
+# tableset defs
+TS=tsdef
+TSROOT=${DBROOT}/data
+TSTICKET=${TSROOT}/tsticket.xml
+SYSSIZE=100
+TMPSIZE=3000
+LOGFILESIZE=1000000
+LOGFILENUM=3
+SORTAREASIZE=10000000
+APPFILE=${TSROOT}/${TS}data01.dbf
+APPSIZE=5000
+DBUSER=cego
+DBPWD=cego
+
+##########################
+### end of customizing ###
+##########################
+
+# rm -rf ${TSROOT}
+
+mkdir ${DBROOT}
+mkdir ${TSROOT}
+
+echo "Creating xml ..."
+cat > $DBXML <<EOF
+<?xml version="1.0" ?>
+<!DOCTYPE CEGO_DB_SPEC>
+<DATABASE NAME="$DBNAME" PAGESIZE="$PAGESIZE"
+ADMINPORT="$ADMPORT" LOGPORT="$LOGPORT" DATAPORT="$DBPORT"
+PIDFILE="$PIDFILE" MAXFID="1" MAXTSID="1"
+NUMRECSEMA="1000" NUMSYSPAGESEMA="43" NUMDATAPAGESEMA="43"
+NUMIDXPAGESEMA="43" NUMRBPAGESEMA="43" NUMDATAFILESEMA="11"
+NUMBUFFERPOOLSEMA="11" MAXFIXTRIES="30"
+CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
+<MODULE NAME="ALL" LEVEL="$DEBUGLEVEL"></MODULE>
+</DATABASE>
+EOF
+
+# <MODULE NAME="CegoTableManager" LEVEL="NOTICE"></MODULE>
+# <MODULE NAME="CegoAdminThreadPool" LEVEL="NOTICE"></MODULE>
+# <MODULE NAME="CegoSelect" LEVEL="NOTICE"></MODULE>
+
+/bin/echo -n "Creating admin user ..."
+${CEGO} --mode=setadminuser --dbxml=${DBXML} --user=${ADMINUSER}/${ADMINPWD} --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+/bin/echo -n "Defining tableset $TS1..."
+${CEGO} --mode=define --tableset=${TS} -dbxml=${DBXML} --tsdef=tsroot:${TSROOT},tsticket:${TSTICKET},syssize:${SYSSIZE},tmpsize:${TMPSIZE},logfilesize:${LOGFILESIZE},logfilenum:${LOGFILENUM},appfile:${APPFILE},appsize:${APPSIZE},sortareasize=${SORTAREASIZE} --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+/bin/echo -n "Creating database user for $TS1 ..."
+${CEGO} --mode=setdbuser --tableset=${TS} --dbxml=${DBXML} --user=${DBUSER}/${DBPWD} --role=ALL --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+/bin/echo -n "Creating tableset $TS1..."
+${CEGO} --mode=create --dbxml=${DBXML} --tableset=${TS} --logfile=${LOGFILE}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
|
[-]
[+]
|
Deleted |
cego-2.10.7.tar.bz2/TODO~
^
|
@@ -1,7 +0,0 @@
-In CegoAction, make the following distribution ready
-- show systemspace
-- check index
-- create, list set, drop counter
-Manage append mode also for distributed queries
-Idea : With session request append mode is set up
-
|
[-]
[+]
|
Deleted |
cego-2.10.7.tar.bz2/samples/rc/cegod
^
|
@@ -1,96 +0,0 @@
-#!/usr/sh
-#
-# Start/stop cego daemon
-#
-
-. /etc/rc.subr(2)
-
-name="cegod"
-rcvar=`set_rcvar`
-start_cmd="${name}_start"
-stop_cmd="${name}_stop"
-
-load_rc_config $name
-
-# are we called with a profile ?
-if [ -n "$2" ]; then
- profile="$2"
- if [ "x${named_profiles}" != "x" ]; then
- eval named_enable="\${named_${profile}_enable:-${named_enable}}"
- eval chrootdir="/serv/dns/${profile}/"
- eval flags=\"-t ${chrootdir} -c conf -u bind\"
- pidfile="$chrootdir$pidfile"
- required_files="${chrootdir}${configfile}"
- else
- echo "$0: extra argument ignored"
- fi
-else
- # we are called without a profile, but probably as a profile
- if [ "x${named_profiles}" != "x" -a "x$1" != "x" ]; then
- for profile in ${named_profiles}; do
- eval _enable="\${named_${profile}_enable}"
- case "x${_enable:-${named_enable}}" in
- x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
- continue
- ;;
- x[Yy][Ee][Ss])
- ;;
- *)
- if test -z "$_enable"; then
- _var=named_enable
- else
- _var=named_"${profile}"_enable
- fi
- echo "Bad value" \
- "'${_enable:-${named_enable}}'" \
- "for ${_var}. " \
- "Profile ${profile} skipped."
- continue
- ;;
- esac
- echo "===> named profile: ${profile}"
- # echo " ${flags}"
- /client/rc.d/named $1 ${profile}
- retcode="$?"
- if [ "0${retcode}" -ne 0 ]; then
- failed="${profile} (${retcode}) ${failed:-}"
- else
- success="${profile} ${success:-}"
- fi
- done
- exit 0
- else
- # setup the default cases
- pidfile="$chrootdir$pidfile"
- fi
-fi
-
-cegod_start()
-{
- echo "Starting cego daemon .."
- $CEGO --mode=daemon --dbxml=$CGXML --logfile=$CGLOG --tableset=$TS &
- rc=$?
-}
-
-cegod_stop()
-{
- echo "Stopping cego daemon .."
- PID=`cat /usr/local/cegodb/pid`
- /usr/bin/kill -s INT $PID
-}
-
-
-
-run_rc_command "$1"
-
-
-# location of the cego program
-CEGO=/usr/local/bin/cego
-# location of the cego configuration file
-CGXML=/usr/local/cegodb/cegodb.xml
-# location of the cego log file
-CGLOG=/usr/local/cegodb/cego.log
-# name of the tableset, which should be started up
-TS=TS1
-
-rc=0
|
[-]
[+]
|
Deleted |
cego-2.10.7.tar.bz2/samples/rc/rc.cego
^
|
@@ -1,110 +0,0 @@
-#!/usr/local/bin/bash
-#
-# $FreeBSD$
-#
-
-# PROVIDE: cego
-# REQUIRE: LOGIN cleanvar
-# KEYWORD: shutdown
-
-#
-# Add the following lines to /etc/rc.conf to enable cego:
-# cego_enable (bool): Set to "NO" by default.
-# Set it to "YES" to enable cego
-# cego_profiles (str): Set to "" by default.
-# Define your profiles here.
-# cego_flags (str): Set to "" by default.
-# Extra flags passed to start command.
-
-. /etc/rc.subr
-
-name="cego"
-rcvar=`set_rcvar`
-
-command="/usr/local/bin/cego"
-user="cego"
-defcegoconf="/usr/local/etc/cego/conf"
-defcegoroot="/serv/cego"
-flags="--mode=daemon --dbxml=${cego_configfile}"
-_pidprefix="/var/run/cego"
-pidfile="${_pidprefix}.pid"
-
-[ -z "$cego_enable" ] && cego_enable="NO"
-[ -z "$cego_tablespc" ] && cego_enable="NO"
-
-load_rc_config $name
-
-if [ -n "$2" ]; then
- profile="$2"
- if [ "x${cego_profiles}" != "x" ]; then
- pidfile="${_pidprefix}.${profile}.pid"
-
- eval cginst=`echo $profile | awk -F : '{ print $1 }'`
- eval cgts=`echo $profile | awk -F : '{ print $2 }'`
-
- if [ "x${cgts}" = "x" ]; then
- echo "You must define a tableset for db instance ${profile}"
- exit 1
- fi
-
- eval cegoconf="\${cegoconf:-${defcegoconf}}"
- eval cegoroot="\${cegoroot:-${defcegoroot}}"
-
- required_files="${configfile}"
- eval cego_enable="\${cego_${cginst}_enable:-${cego_enable}}"
- cego_flags="--mode=daemon --dbxml=${cegoconf}/${cginst}.xml --tableset=${cgts} --lockfile=${cegoroot}/${cginst}.lck --logfile=${cegoroot}/${cginst}.log"
- else
- echo "$0: extra argument ignored"
- fi
-else
- if [ "x${cego_profiles}" != "x" -a "x$1" != "x" ]; then
- for profile in ${cego_profiles}; do
- eval _enable="\${cego_${profile}_enable}"
- case "x${_enable:-${cego_enable}}" in
- x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
- continue
- ;;
- x[Yy][Ee][Ss])
- ;;
- *)
- if test -z "$_enable"; then
- _var=cego_enable
- else
- _var=cego_"${profile}"_enable
- fi
- echo "Bad value" \
- "'${_enable:-${cego_enable}}'" \
- "for ${_var}. " \
- "Profile ${profile} skipped."
- continue
- ;;
- esac
- echo "===> cego profile: ${profile}"
- /usr/local/etc/rc.d/cego $1 ${profile}
- retcode="$?"
- if [ "0${retcode}" -ne 0 ]; then
- failed="${profile} (${retcode}) ${failed:-}"
- else
- success="${profile} ${success:-}"
- fi
- done
- exit 0
- fi
-fi
-
-cego_requirepidfile()
-{
- if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
- echo "${name} not running? (check $pidfile)."
- exit 1
- fi
-}
-
-cego_stop() {
- cego_requirepidfile
-
- echo "stopping cego instance $1"
- kill -1 $1
-}
-
-run_rc_command "$1"
|
[-]
[+]
|
Deleted |
cego-2.10.7.tar.bz2/tools/mkcgdb
^
|
@@ -1,115 +0,0 @@
-#!/bin/bash
-#
-# mkcgdb
-# ------
-# Utility script to build up a cego database with one tableset
-#
-# (C)opyright 2010 by Bjoern Lemke
-#
-# The database and tableset parameters defined below
-# should be edited and customized to appropriate values
-#
-#
-
-# path to the cego executable
-CEGO=cego
-# path to the database root path, where the database should be created
-DBROOT=./db
-# name of the database xml file
-DBXML=${DBROOT}/mydb.xml
-# name of the database
-DBNAME=mydb
-# several database parameters
-PAGESIZE=16384
-ADMPORT=2000
-DBPORT=2200
-LOGPORT=3000
-PIDFILE=${DBROOT}/pid
-ADMINUSER=cgadm
-ADMINPWD=cgadm
-LOGFILE=${DBROOT}/cego.log
-
-# DEBUGLEVEL=DEBUG
-DEBUGLEVEL=NOTICE
-
-# tableset defs
-TS=myts
-TSROOT=${DBROOT}/myts
-TSTICKET=${TSROOT}/tsticket.xml
-SYSSIZE=100
-TMPSIZE=3000
-LOGFILESIZE=1000000
-LOGFILENUM=3
-SORTAREASIZE=10000000
-APPFILE=${TSROOT}/${TS}data01.dbf
-APPSIZE=5000
-DBUSER=lemke
-DBPWD=lemke
-
-##########################
-### end of customizing ###
-##########################
-
-rm -rf ${DBROOT}
-
-mkdir ${DBROOT}
-mkdir ${TSROOT}
-
-echo "Creating xml ..."
-cat > $DBXML <<EOF
-<?xml version="1.0" ?>
-<!DOCTYPE CEGO_DB_SPEC>
-<DATABASE NAME="$DBNAME" PAGESIZE="$PAGESIZE" ADMINPORT="$ADMPORT" LOGPORT="$LOGPORT" DATAPORT="$DBPORT"
-PIDFILE="$PIDFILE" MAXFID="1" MAXTSID="1"
-NUMRECSEMA="1000" NUMSYSPAGESEMA="43" NUMDATAPAGESEMA="43"
-NUMIDXPAGESEMA="43" NUMRBPAGESEMA="43" NUMDATAFILESEMA="11" NUMBUFFERPOOLSEMA="11"
-MAXFIXTRIES="30"
- CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
-<MODULE NAME="ALL" LEVEL="$DEBUGLEVEL"></MODULE>
-</DATABASE>
-EOF
-
-# <MODULE NAME="CegoTableManager" LEVEL="NOTICE"></MODULE>
-# <MODULE NAME="CegoAdminThreadPool" LEVEL="NOTICE"></MODULE>
-# <MODULE NAME="CegoSelect" LEVEL="NOTICE"></MODULE>
-
-/bin/echo -n "Creating admin user ..."
-${CEGO} --mode=setadminuser --dbxml=${DBXML} --user=${ADMINUSER}/${ADMINPWD} --logfile=${LOGFILE}
-if [ $? -eq 0 ]
-then
- echo "... operation ok"
-else
- echo "... operation failed"
- exit 1
-fi
-
-/bin/echo -n "Defining tableset $TS1..."
-${CEGO} --mode=define --tableset=${TS} -dbxml=${DBXML} --tsdef=tsroot:${TSROOT},tsticket:${TSTICKET},syssize:${SYSSIZE},tmpsize:${TMPSIZE},logfilesize:${LOGFILESIZE},logfilenum:${LOGFILENUM},appfile:${APPFILE},appsize:${APPSIZE},sortareasize=${SORTAREASIZE} --logfile=${LOGFILE}
-if [ $? -eq 0 ]
-then
- echo "... operation ok"
-else
- echo "... operation failed"
- exit 1
-fi
-
-/bin/echo -n "Creating database user for $TS1 ..."
-${CEGO} --mode=setdbuser --tableset=${TS} --dbxml=${DBXML} --user=${DBUSER}/${DBPWD} --role=ALL --logfile=${LOGFILE}
-if [ $? -eq 0 ]
-then
- echo "... operation ok"
-else
- echo "... operation failed"
- exit 1
-fi
-
-/bin/echo -n "Creating tableset $TS1..."
-${CEGO} --mode=create --dbxml=${DBXML} --tableset=${TS} --logfile=${LOGFILE}
-if [ $? -eq 0 ]
-then
- echo "... operation ok"
-else
- echo "... operation failed"
- exit 1
-fi
-
|