[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Deleted |
cego-2.11.4.tar.bz2/src/cgwtest.c
^
|
@@ -1,540 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// cgwtest.c
-// ---------
-// Cego C wrapper test program
-//
-// Design and Implementation by Bjoern Lemke
-//
-// (C)opyright 2009 Bjoern Lemke
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "cgwrap.h"
-
-void connect_test();
-void create_test();
-void drop_test();
-void prepstmt1_test();
-void prepstmt2_test();
-void fetch_test();
-void inout_test();
-void blob_test();
-
-
-char host[] = "localhost";
-char tableset[] = "TS1";
-char user[] = "lemke";
-char passwd[] = "lemke";
-char cgwlog[] = "cgwrap.log";
-
-char proccreatestmt[] = "create procedure checkInOut ( inVal in string(30), outVal out string(30) ) return int \
-begin \
- insert into t1 values ( 1000, :inVal ); \
- :outVal = 'Out-Out'; \
- return 42; \
-end;";
-char tabcreatestmt[] = "create table t1 ( a int, b string(30));";
-char procdropstmt[] = "drop procedure checkInOut;";
-char tabdropstmt[] = "drop table t1;";
-
-
-int main(int argc, char** argv)
-{
-
- if ( argc > 1 )
- {
- if ( strcmp (argv[1], "connect") == 0)
- {
- connect_test();
- }
- else if ( strcmp (argv[1], "create") == 0)
- {
- create_test();
- }
- else if ( strcmp (argv[1], "drop") == 0)
- {
- drop_test();
- }
- else if ( strcmp (argv[1], "prepstmt1") == 0)
- {
- prepstmt1_test();
- }
- else if ( strcmp (argv[1], "prepstmt2") == 0)
- {
- prepstmt2_test();
- }
- else if ( strcmp (argv[1], "fetch") == 0)
- {
- fetch_test();
- }
- else if ( strcmp (argv[1], "inout") == 0)
- {
- inout_test();
- }
- else if ( strcmp (argv[1], "blob") == 0)
- {
- blob_test();
- }
- }
-
-}
-
-void connect_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- cego_modlog("ALL", CG_LOG_DEBUG);
-
- printf("Connect ok\n");
-
- cego_disconnect(cgdb);
-}
-
-void create_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- cego_modlog("ALL", CG_LOG_DEBUG);
-
-
- printf("Executing query ...\n");
- if ( cego_query (cgdb, tabcreatestmt, 0) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
- printf("Query ok\n");
-
- if ( cego_query (cgdb, proccreatestmt, 0) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
- printf("Query ok\n");
-
-
- cego_disconnect(cgdb);
-}
-
-void drop_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- cego_modlog("ALL", CG_LOG_DEBUG);
-
- printf("Executing query ...\n");
- if ( cego_query (cgdb, tabdropstmt, 0) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
- printf("Query ok\n");
-
- if ( cego_query (cgdb, procdropstmt, 0) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
- printf("Query ok\n");
-
-
- cego_disconnect(cgdb);
-}
-
-
-void prepstmt1_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("Prepare stmt ...\n");
- CGStmt *pStmt;
- pStmt = cego_prepare("insert into t1 values ( ? , ? );");
-
- int *pI = (int*)malloc(sizeof(int));
- *pI = 42;
- CGVal *pV1 = (CGVal*)malloc(sizeof(CGVal));
- pV1->type = CG_INT;
- pV1->len = sizeof(int);
- pV1->val = pI;
-
- char *s = (char*)malloc(20);
- strcpy(s, "This is a X");
- CGVal *pV2 = (CGVal*) malloc(sizeof(CGVal));
-
- pV2->type = CG_VARCHAR;
- pV2->len = strlen(s);
- pV2->val = s;
-
- printf("Bind stmt ...\n");
- cego_bind_in(pStmt, pV1, 1);
- cego_bind_in(pStmt, pV2, 2);
-
- printf("Execute stmt ...\n");
- if ( cego_execute(cgdb, pStmt, 0) != 0)
- {
- printf("Error : %s\n", cgerrmsg);
- }
- printf("Prepared Stmt ok\n");
-
- cego_free_stmt(pStmt);
-
- cego_disconnect(cgdb);
-}
-
-
-void prepstmt2_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("Prepare stmt ...\n");
- CGStmt *pStmt;
- pStmt = cego_prepare("select a, b from t1;");
-
-
- printf("Creating fetch handle ...\n");
- CGFetch* cgfetch = cego_allocate_fetch();
-
- printf("Making query ...\n");
- if ( cego_execute(cgdb, pStmt, cgfetch) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("Size=%d\n", cego_num_col(cgfetch));
-
- CGVal cgval[2];
- cgval[0].val=0;
- cgval[1].val=0;
-
- int colnum;
- colnum = cego_fetch (cgfetch, cgval, 2);
- cego_abort(cgfetch);
- cego_disconnect(cgdb);
-
-
- while ( ( colnum = cego_fetch (cgfetch, cgval, 2)) > 0 )
- {
-
- int i=0;
- while ( i < colnum )
- {
- printf("Col %d\n", i);
- if ( cgval[i].type == CG_VARCHAR )
- printf("%s ", cgval[i].val);
- else if ( cgval[i].type == CG_INT )
- printf("%d ", *(int*)cgval[i].val);
- i++;
- }
- printf("\n");
-
- cego_abort(cgfetch);
- break;
- }
-
- printf("Fetch ok\n");
- cego_free_fetch(cgfetch);
-
- printf("Prepared Stmt ok\n");
-
- cego_disconnect(cgdb);
-}
-
-
-void fetch_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("Creating fetch handle ...\n");
- CGFetch* cgfetch = cego_allocate_fetch();
-
- printf("Making query ...\n");
- if ( cego_query(cgdb, "select a, b from t1;", cgfetch) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("Size=%d\n", cego_num_col(cgfetch));
-
- CGVal cgval[2];
- cgval[0].val=0;
- cgval[1].val=0;
-
- int colnum;
- while ( ( colnum = cego_fetch (cgfetch, cgval, 2)) > 0 )
- {
-
- int i=0;
- while ( i < colnum )
- {
- printf("Col %d, Name %s\n", i, cego_getcol(cgfetch, i));
- if ( cgval[i].type == CG_VARCHAR )
- printf("%s ", cgval[i].val);
- else if ( cgval[i].type == CG_INT )
- printf("%d ", *(int*)cgval[i].val);
- i++;
- }
- printf("\n");
- }
-
- printf("Fetch ok\n");
-
- cego_free_fetch(cgfetch);
- cego_disconnect(cgdb);
-}
-
-
-void inout_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("Prepare stmt ...\n");
- CGStmt *pStmt;
- pStmt = cego_prepare("? = call checkInOut( ? , ? );");
-
- CGVal v1;
- v1.val = 0;
-
- char s[20] = "This is XXXX";
- CGVal v2;
-
- v2.type = CG_VARCHAR;
- v2.len = strlen(s);
- v2.val = s;
-
- CGVal v3;
- v3.val = 0;
-
- printf("Bind stmt ...\n");
- cego_bind_out(pStmt, &v1, 1);
- cego_bind_in(pStmt, &v2, 2);
- cego_bind_out(pStmt, &v3, 3);
-
- printf("Execute stmt ...\n");
- if ( cego_execute(cgdb, pStmt, 0) != 0)
- {
- printf("Error : %s\n", cgerrmsg);
- }
-
- printf("P1 = %d\n", *(int*)v1.val);
- printf("P2 = %s\n", v2.val);
- printf("P3 = %s\n", v3.val);
-
- printf("InOut ok\n");
-
- cego_disconnect(cgdb);
-}
-
-void blob_test()
-{
-
- CGDB *cgdb;
-
- printf("Connecting ...\n");
-
- if ( (cgdb = cego_connect(host, 2200, tableset, user, passwd, cgwlog)) == NULL )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
-
- CGStmt *pStmt;
- pStmt = cego_prepare("create table blobtab ( a blob );");
- printf("Execute stmt ...\n");
- if ( cego_execute(cgdb, pStmt, 0) != 0)
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
- cego_free_stmt(pStmt);
-
- // create blob ( putblob )
-
- CGBlob b;
- int blobSize = 100;
- b.buf = malloc(blobSize);
- int i;
- for ( i = 0 ; i < blobSize ; i++ )
- b.buf[i]='X';
-
- b.len = 100;
- b.fileId = 0;
- b.pageId = 0;
-
- cego_putblob (cgdb, &b);
- printf("Created blob with ref : [%d,%d]\n", b.fileId, b.pageId);
-
- // insert into blobtab
-
- pStmt = cego_prepare("insert into blobtab values ( ? );");
-
- CGVal v1;
- v1.type = CG_BLOB;
- v1.len = 2 * sizeof(int);
- v1.val = malloc ( 2 * sizeof(int));
-
- memcpy ( v1.val, &b.fileId, sizeof(int));
- memcpy ( (int*)((long)v1.val + sizeof(int)), &b.pageId, sizeof(int));
-
- printf("Bind stmt ...\n");
- cego_bind_in(pStmt, &v1, 1);
-
- printf("Execute stmt ...\n");
- if ( cego_execute(cgdb, pStmt, 0) != 0)
- {
- printf("Error : %s\n", cgerrmsg);
- }
- printf("Prepared Stmt ok\n");
-
- // blob retrievel
-
- // select from blobtab
-
- printf("Creating fetch handle ...\n");
- CGFetch* cgfetch = cego_allocate_fetch();
-
- printf("Creating fetch handle ...\n");
- if ( cego_query(cgdb, "select a from blobtab;", cgfetch) != 0 )
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
-
- printf("NumCol=%d\n", cego_num_col(cgfetch));
-
- CGVal cgval[2];
-
- int fileId;
- int pageId;
-
- int colnum;
- while ( ( colnum = cego_fetch (cgfetch, cgval, 2)) > 0 )
- {
- int i=0;
- while ( i < colnum )
- {
- if ( cgval[i].type == CG_BLOB )
- {
-
- memcpy ( &fileId, (int*)cgval[i].val, sizeof (int));
- memcpy ( &pageId, (int*)( (long)cgval[i].val + sizeof(int)), sizeof (int));
-
- }
- i++;
- }
- printf("\n");
- }
-
- printf("Fetch ok\n");
- cego_free_fetch(cgfetch);
-
- printf("Retrieving blob : [%d,%d]\n", fileId, pageId);
-
- CGBlob b2;
- b2.len = 0;
- b2.buf = 0;
-
- b2.fileId = fileId;
- b2.pageId = pageId;
-
- cego_getblob (cgdb, &b2);
-
- printf("Retrieved blob of size : %d\n", b2.len);
-
- pStmt = cego_prepare("drop table blobtab;");
- printf("Execute stmt ...\n");
- if ( cego_execute(cgdb, pStmt, 0) != 0)
- {
- printf("Error : %s\n", cgerrmsg);
- exit(1);
- }
- cego_free_stmt(pStmt);
-
- cego_disconnect(cgdb);
-}
-
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.11.4
+ Version 2.11.7
(C)opyright 2006,2007,2008,2009,2010,2011 by Bjoern Lemke
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/TODO
^
|
@@ -11,6 +11,16 @@
( idea : before commit or rollback, rename rb-file to commitTID or rollbackTID,
so if an exception occurs during commit or rollback, it can be decided to commit or rollback
the transaction again )
-
+
+- crash recovery improvement
+ The update and delete log record must be created at the beginning of the transaction.
+ At the end of the TA, an UPDATE_COMMIT / DELETE_COMMIT entry is also written to the log.
+ During recovery, the UPDATE log record first is stored to an update record ( new class CegoUpdateRecord )
+ with all required information. If the UPDATE_COMMIT log entry appears, the update transaction is performanced
+ by the recovery manager. This avoids inconsistent system states in case of checkpointing during the
+ update recovery procedure ( Problem: Update TA is started and RBSEG object is created. Now a checkpoint occurs
+ and after this, the update record is written to the log. Now the system crashes.
+ In this case, the RBSEG object already exist but the recovery manager performs the complete update TA.
+ The RBSEG is created again, which results in an error.
- user management with new role concept should be adapted for distributed mode
|
[-]
[+]
|
Changed |
cego-2.11.7.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" 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="240"> <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="252"> <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.11.7.tar.bz2/samples/chkdb/check031.sql
^
|
@@ -0,0 +1,50 @@
+--
+-- ### Advanced procedure checks
+--
+--
+--
+
+drop if exists table t1;
+create table t1 ( a int, b string(30));
+
+drop if exists counter aid;
+create counter aid;
+set counter aid to 0;
+
+drop if exists procedure newEntry;
+
+@
+create procedure newEntry ( b in string(30) ) return int
+begin
+ var a int;
+ :a = nextcount(aid);
+ insert into t1 values ( :a, :b );
+ return :a;
+end;
+@
+
+drop if exists procedure cleanEntry;
+@
+create procedure cleanEntry ()
+begin
+ delete from t1;
+ setcount(aid, 0);
+end;
+@
+
+
+call newEntry('Erwin');
+call newEntry('Matha');
+call newEntry('Hugo');
+
+select * from t1;
+
+call cleanEntry();
+
+select * from t1;
+
+call newEntry('Erwin');
+select * from t1;
+
+show procedure newEntry;
+show procedure cleanEntry;
|
[-]
[+]
|
Added |
cego-2.11.7.tar.bz2/samples/chkdb/chkload
^
|
@@ -0,0 +1,187 @@
+#!/bin/sh
+
+PIDFILE=/tmp/cegoload.pid
+LOCKFILE=/tmp/cegoload.lock
+INITBATCH=/tmp/cegoload.sql
+NUMLOOP=100
+NUMOP=1000
+
+###############
+# database defs
+###############
+
+TS=TS1
+TSROOT=./db
+TSTICKET=$TSROOT/${TS}ticket.xml
+SYSSIZE=100
+TMPSIZE=3000
+LOGFILESIZE=1000000
+LOGFILENUM=3
+APPFILE=$TSROOT/${TS}data01.dbf
+APPSIZE=3000
+SORTAREASIZE=10000000
+DBUSER=lemke
+DBPWD=lemke
+
+DBXML=$TSROOT/chkdb.xml
+DBNAME=chkdb
+PAGESIZE=16384
+ADMPORT=2000
+DBPORT=2200
+LOGPORT=3000
+PIDFILE=$TSROOT/pid
+ADMINUSER=cgadm
+ADMINPWD=cgadm
+
+#DEBUGLEVEL=DEBUG
+DEBUGLEVEL=NOTICE
+
+### end of customizing ###
+
+rm -rf $TSROOT
+mkdir $TSROOT
+rm -f $DBXML
+rm -f $LOCKFILE
+
+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="2141" NUMSYSPAGESEMA="41" NUMDATAPAGESEMA="41"
+NUMIDXPAGESEMA="41" NUMRBPAGESEMA="2141" 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>
+
+echo "Creating admin user ...\c"
+../../src/cego --mode=adduser --dbxml=${DBXML} --user=${ADMINUSER}/${ADMINPWD} --role=admin
+
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating role ...\c"
+../../src/cego --mode=addrole --dbxml=${DBXML} --role=ALL
+
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating role ...\c"
+../../src/cego --mode=addperm --dbxml=${DBXML} --permid=${TS}_P --role=ALL --tableset=$TS --filter="ALL" --perm="ALL"
+
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Defining tableset $TS...\c"
+../../src/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}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating database user for $TS ...\c"
+../../src/cego --mode=adduser --dbxml=${DBXML} --user=${DBUSER}/${DBPWD} --role=ALL
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating tableset $TS...\c"
+../../src/cego --mode=create --dbxml=${DBXML} --tableset=${TS}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "create table t1 ( a int, b string(100));" > $INITBATCH
+echo "create table t2 ( a int, b string(100));" >> $INITBATCH
+echo "create table t3 ( a int, b string(100));" >> $INITBATCH
+
+echo "create index i1 on t1(a);" >> $INITBATCH
+echo "create index i2 on t2(b);" >> $INITBATCH
+echo "create index i3 on t3(b);" >> $INITBATCH
+
+echo "@" >> $INITBATCH
+echo "create procedure p1 ( a in int, b in string(100))" >> $INITBATCH
+echo "begin" >> $INITBATCH
+echo " insert into t1 values ( :a, :b );" >> $INITBATCH
+echo "end;" >> $INITBATCH
+echo "@" >> $INITBATCH
+
+# cat $INITBATCH
+
+../../src/cego --mode=batch --dbxml=${DBXML} --user=$DBUSER/$DBPWD --poolsize=1000 --batchfile=$INITBATCH --tableset=$TS
+
+rm -rf $LOCKFILE
+
+echo "Starting daemon ..."
+
+nohup ../../src/cego --mode=daemon --forceload --nolockstat --pidfile=$PIDFILE --numdbthread=30 --dbxml=${DBXML} --poolsize=3000 --tableset=$TS --lockfile=$LOCKFILE &
+
+echo "Waiting 3 sec for startup .."
+
+sleep 3
+
+echo "Enable trace for $DBUSER .."
+../../src/cgadm --server=localhost --port=2000 --user=cgadm/cgadm -cmd="trace on user $DBUSER"
+
+i=0
+while [ $i -lt $NUMLOOP ]
+do
+
+ echo "Loop $i"
+ echo "======="
+
+ for t in t1 t2 t3
+ do
+ echo "Arbitrary op for $t ..."
+ ../../src/cgblow --mode=arbitrary --server=localhost --port=$DBPORT --iset=i:10000,s:3 --uset=a:i:10 --ucond=b:s:3 --dcond=a:i:100 --table=$t --tableset=TS1 --user=$DBUSER/$DBPWD --interval=$NUMOP --count=$NUMOP --proc=p1 --pset=i:100,s:3 &
+
+
+ done
+ i=`expr $i + 1`
+
+ echo "Waiting for sub processes .."
+ wait $!
+ echo "Finished"
+
+ sleep 1
+done
+
+echo "Stopping daemon ..."
+kill -INT `cat $PIDFILE`
+
+wait `cat $PIDFILE`
+echo "... daemon stopped"
+
|
[-]
[+]
|
Added |
cego-2.11.7.tar.bz2/samples/chkdb/chkload~
^
|
@@ -0,0 +1,188 @@
+#!/bin/sh
+
+PIDFILE=/tmp/cegoload.pid
+LOCKFILE=/tmp/cegoload.lock
+INITBATCH=/tmp/cegoload.sql
+NUMLOOP=100
+NUMOP=1000
+
+###############
+# database defs
+###############
+
+TS=TS1
+TSROOT=./loaddb
+TSTICKET=$TSROOT/${TS}ticket.xml
+SYSSIZE=100
+TMPSIZE=3000
+LOGFILESIZE=1000000
+LOGFILENUM=3
+APPFILE=$TSROOT/${TS}data01.dbf
+APPSIZE=3000
+SORTAREASIZE=10000000
+DBUSER=lemke
+DBPWD=lemke
+
+DBXML=$TSROOT/chkdb.xml
+DBNAME=chkdb
+PAGESIZE=16384
+ADMPORT=2000
+DBPORT=2200
+LOGPORT=3000
+PIDFILE=$TSROOT/pid
+ADMINUSER=cgadm
+ADMINPWD=cgadm
+
+#DEBUGLEVEL=DEBUG
+DEBUGLEVEL=NOTICE
+
+### end of customizing ###
+
+rm -rf $TSROOT
+mkdir $TSROOT
+rm -f $DBXML
+rm -f $LOCKFILE
+
+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="2141" NUMSYSPAGESEMA="41" NUMDATAPAGESEMA="41"
+NUMIDXPAGESEMA="41" NUMRBPAGESEMA="2141" 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>
+
+echo "Creating admin user ...\c"
+../../src/cego --mode=adduser --dbxml=${DBXML} --user=${ADMINUSER}/${ADMINPWD} --role=admin
+
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating role ...\c"
+../../src/cego --mode=addrole --dbxml=${DBXML} --role=ALL
+
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating role ...\c"
+../../src/cego --mode=addperm --dbxml=${DBXML} --permid=${TS}_P --role=ALL --tableset=$TS --filter="ALL" --perm="ALL"
+
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Defining tableset $TS...\c"
+../../src/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}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating database user for $TS ...\c"
+../../src/cego --mode=adduser --dbxml=${DBXML} --user=${DBUSER}/${DBPWD} --role=ALL
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "Creating tableset $TS...\c"
+../../src/cego --mode=create --dbxml=${DBXML} --tableset=${TS}
+if [ $? -eq 0 ]
+then
+ echo "... operation ok"
+else
+ echo "... operation failed"
+ exit 1
+fi
+
+echo "create table t1 ( a int, b string(100));" > $INITBATCH
+echo "create table t2 ( a int, b string(100));" >> $INITBATCH
+echo "create table t3 ( a int, b string(100));" >> $INITBATCH
+
+echo "create index i1 on t1(a);" >> $INITBATCH
+echo "create index i2 on t2(b);" >> $INITBATCH
+echo "create index i3 on t3(b);" >> $INITBATCH
+
+echo "@" >> $INITBATCH
+echo "create procedure p1 ( a in int, b in string(100))" >> $INITBATCH
+echo "begin" >> $INITBATCH
+echo " insert into t1 values ( :a, :b );" >> $INITBATCH
+echo "end;" >> $INITBATCH
+echo "@" >> $INITBATCH
+
+# cat $INITBATCH
+
+../../src/cego --mode=batch --dbxml=${DBXML} --user=$DBUSER/$DBPWD --poolsize=1000 --batchfile=$INITBATCH --tableset=$TS
+
+rm -rf $LOCKFILE
+
+echo "Starting daemon ..."
+
+nohup ../../src/cego --mode=daemon --forceload --nolockstat --pidfile=$PIDFILE --numdbthread=30 --dbxml=${DBXML} --poolsize=3000 --tableset=$TS --lockfile=$LOCKFILE &
+
+echo "Waiting 3 sec for startup .."
+
+sleep 3
+
+echo "Enable trace for $DBUSER .."
+../../src/cgadm --server=localhost --port=2000 --user=cgadm/cgadm -cmd="trace on user $DBUSER"
+
+i=0
+while [ $i -lt $NUMLOOP ]
+do
+
+ echo "Loop $i"
+ echo "======="
+
+ for t in t1 t2 t3
+ do
+ echo "Arbitrary op for $t ..."
+ ../../src/cgblow --mode=arbitrary --server=localhost --port=$DBPORT --iset=i:10000,s:3 --uset=a:i:10 --ucond=b:s:3 --dcond=a:i:100 --table=$t --tableset=TS1 --user=$DBUSER/$DBPWD --interval=$NUMOP --count=$NUMOP --proc=p1 --pset=i:100,s:3 &
+
+
+ done
+ i=`expr $i + 1`
+
+ echo "Waiting for sub processes .."
+ wait $!
+ echo "Finished"
+
+ sleep 1
+
+done
+
+echo "Stopping daemon ..."
+kill -INT `cat $PIDFILE`
+
+wait `cat $PIDFILE`
+echo "... daemon stopped"
+
|
[-]
[+]
|
Added |
cego-2.11.7.tar.bz2/samples/chkdb/chkrecover
^
|
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+TS=TS1
+PIDFILE=/tmp/cego.pid
+LOCKFILE=/tmp/cego.lock
+INITBATCH=/tmp/b.sql
+
+rm -rf $LOCKFILE
+./mkdb $TS
+
+echo "create table t1 ( a int, b string(100));" > $INITBATCH
+echo "create table t2 ( a int, b string(100));" >> $INITBATCH
+echo "create table t3 ( a int, b string(100));" >> $INITBATCH
+
+../../src/cego --mode=batch --dbxml=./db/chkdb.xml --user=lemke/lemke --poolsize=1000 --batchfile=$INITBATCH --tableset=$TS
+
+dodel=no
+
+while true
+do
+
+ rm -rf $LOCKFILE
+
+ echo "Starting daemon ..."
+
+ nohup ../../src/cego --mode=daemon --forceload --nolockstat --pidfile=$PIDFILE --numdbthread=30 --dbxml=./db/chkdb.xml --poolsize=3000 --tableset=$TS --lockfile=$LOCKFILE &
+
+
+ echo "Waiting 30 sec for recovery .."
+ sleep 30
+
+ for t in t1 t2 t3
+ do
+
+ if [ $dodel = "no" ]
+ then
+ echo "Inserting into $t ..."
+ ../../src/cgblow --mode=insert --server=localhost --port=2200 --attrformat=i:10000,s:3 --table=$t --tableset=TS1 --user=lemke/lemke --append --interval=1000 --count=20000 --dotransaction &
+ else
+
+ echo "Deleting from $t ..."
+ ../../src/cgblow --mode=delete --server=localhost --port=2200 --condformat=a:i:1000 --table=$t --tableset=TS1 --user=lemke/lemke --append --interval=100 --count=3000 --dotransaction &
+ fi
+
+ done
+
+ if [ $dodel = "no" ]
+ then
+ dodel=yes
+ else
+ dodel=no
+ fi
+
+ sleep 15
+
+ echo "Crashing daemon .."
+ kill -9 `cat $PIDFILE`
+ sleep 2
+
+done
\ No newline at end of file
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/samples/chkdb/chkup
^
|
@@ -6,5 +6,5 @@
exit 1
fi
-../../src/cego --mode=daemon --forceload --nolockstat --numdbthread=30 --dbxml=chkdb.xml --poolsize=3000 --tableset=$1
+../../src/cego --mode=daemon --forceload --nolockstat --numdbthread=30 --dbxml=./db/chkdb.xml --poolsize=3000 --tableset=$1
|
[-]
[+]
|
Added |
cego-2.11.7.tar.bz2/samples/chkdb/db/chkdb.xml
^
|
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<!DOCTYPE CEGO_DB_SPEC>
+<DATABASE NAME="chkdb" PAGESIZE="16384" ADMINPORT="2000" LOGPORT="3000" DATAPORT="2200" PIDFILE="./db/pid" MAXFID="32" MAXTSID="2" NUMRECSEMA="2141" NUMSYSPAGESEMA="41" NUMDATAPAGESEMA="41" NUMIDXPAGESEMA="41" NUMRBPAGESEMA="2141" NUMDATAFILESEMA="11" NUMBUFFERPOOLSEMA="11" MAXFIXTRIES="30" CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
 <MODULE NAME="ALL" LEVEL="NOTICE"></MODULE>
+ <USER NAME="cgadm" PASSWD="f9d1bb5de113b12009fd4b1672a23cfe" ROLE="admin"></USER>
+ <ROLE NAME="ALL"> <PERM TABLESET="TS1" FILTER="ALL" PERM="ALL" PERMID="TS1_P"></PERM>
+</ROLE>
+ <TABLESET NAME="TS1" TSROOT="./db" PRIMARY="dude.local" SECONDARY="dude.local" MEDIATOR="dude.local" RUNSTATE="OFFLINE" SYNCSTATE="SYNCHED" TSTICKET="./db/TS1ticket.xml" TSID="2" TMPFID="31" SYSSIZE="100" TMPSIZE="3000" SORTAREASIZE="10000000" LSN="1255" TID="132"> <LOGFILE NAME="./db/TS1redo0.log" SIZE="1000000" STATUS="ACTIVE"></LOGFILE>
+ <LOGFILE NAME="./db/TS1redo1.log" SIZE="1000000" STATUS="FREE"></LOGFILE>
+ <LOGFILE NAME="./db/TS1redo2.log" SIZE="1000000" STATUS="FREE"></LOGFILE>
+ <DATAFILE TYPE="APP" FILEID="32" NAME="./db/TS1data01.dbf" SIZE="3000"></DATAFILE>
+</TABLESET>
+ <USER NAME="lemke" PASSWD="20eb196673144f5c299ef3d0d7a58bd9" ROLE="ALL" TRACE="ON" NUMREQUEST="66" NUMQUERY="792"></USER>
+ <NODE HOSTNAME="dude.local" STATUS="ONLINE"></NODE>
+</DATABASE>
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/samples/chkdb/expImpCheck
^
|
@@ -52,7 +52,7 @@
echo "########### XML Export #########"
echo "Exporting database as XML ...\c"
-USEDTIME=`time -p ../../src/cego --mode=xmlexport --tableset=TS1 --dbxml=chkdb.xml --expfile=db/ts1.xml 2>&1 | grep real | sed 's/real//'`
+USEDTIME=`time -p ../../src/cego --mode=xmlexport --tableset=TS1 --dbxml=db/chkdb.xml --expfile=db/ts1.xml 2>&1 | grep real | sed 's/real//'`
if [ $? -eq 0 ]
then
echo " operation ok"
@@ -69,7 +69,7 @@
rm -rf arch/*.dbf
echo "Recreating database ...\c"
-../../src/cego --mode=create --dbxml=chkdb.xml --tableset=TS1
+../../src/cego --mode=create --dbxml=db/chkdb.xml --tableset=TS1
if [ $? -eq 0 ]
then
echo " operation ok"
@@ -79,7 +79,7 @@
fi
echo "Importing database from XML ...\c"
-USEDTIME=`time -p ../../src/cego --mode=xmlimport --tableset=TS1 --dbxml=chkdb.xml --impfile=db/ts1.xml 2>&1 | grep real | sed 's/real//'`
+USEDTIME=`time -p ../../src/cego --mode=xmlimport --tableset=TS1 --dbxml=db/chkdb.xml --impfile=db/ts1.xml 2>&1 | grep real | sed 's/real//'`
if [ $? -eq 0 ]
then
echo " operation ok"
@@ -92,7 +92,7 @@
echo "########### Bin Export #########"
echo "Exporting database as binary ...\c"
-USEDTIME=`time -p ../../src/cego --mode=binexport --tableset=TS1 --dbxml=chkdb.xml --expfile=db/ts1.bin 2>&1 | grep real | sed 's/real//'`
+USEDTIME=`time -p ../../src/cego --mode=binexport --tableset=TS1 --dbxml=db/chkdb.xml --expfile=db/ts1.bin 2>&1 | grep real | sed 's/real//'`
if [ $? -eq 0 ]
then
echo " operation ok"
@@ -110,7 +110,7 @@
echo "Recreating database ...\c"
-../../src/cego --mode=create --dbxml=chkdb.xml --tableset=TS1
+../../src/cego --mode=create --dbxml=db/chkdb.xml --tableset=TS1
if [ $? -eq 0 ]
then
echo " operation ok"
@@ -120,7 +120,7 @@
fi
echo "Importing database from binary ...\c"
-USEDTIME=`time -p ../../src/cego --mode=binimport --tableset=TS1 --dbxml=chkdb.xml --impfile=db/ts1.bin 2>&1 | grep real | sed 's/real//'`
+USEDTIME=`time -p ../../src/cego --mode=binimport --tableset=TS1 --dbxml=db/chkdb.xml --impfile=db/ts1.bin 2>&1 | grep real | sed 's/real//'`
if [ $? -eq 0 ]
then
echo " operation ok"
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/samples/chkdb/mkdb
^
|
@@ -11,7 +11,7 @@
###############
# database defs
###############
-DBXML=chkdb.xml
+DBXML=./db/chkdb.xml
DBNAME=chkdb
PAGESIZE=16384
ADMPORT=2000
@@ -21,8 +21,8 @@
ADMINUSER=cgadm
ADMINPWD=cgadm
-DEBUGLEVEL=DEBUG
-# DEBUGLEVEL=NOTICE
+#DEBUGLEVEL=DEBUG
+DEBUGLEVEL=NOTICE
### end of customizing ###
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/samples/chkdb/runCheck
^
|
@@ -33,16 +33,16 @@
then
NAME=`cat $3 | grep "###" | sed 's/--//'`
echo "Batch execute $3$NAME\c"
- ../../src/cego --mode=batch --dbxml=chkdb.xml --user=lemke/lemke --poolsize=1000 --batchfile=$3 --tableset=$TS > check.log 2> error.log
+ ../../src/cego --mode=batch --dbxml=./db/chkdb.xml --user=lemke/lemke --poolsize=1000 --batchfile=$3 --tableset=$TS > ./db/check.log 2> ./db/error.log
retCode=$?
elif [ $2 = "remote" ]
then
echo "Client execute $3 ...\c"
- ../../src/cgclt -server=${DBHOST} --port={DBPORT} --user=${DBUSER}/${DBPWD} ---tableset=$TS --batchfile=$3 > check.log 2> error.log
+ ../../src/cgclt -server=${DBHOST} --port={DBPORT} --user=${DBUSER}/${DBPWD} ---tableset=$TS --batchfile=$3 > ./db/check.log 2> ./db/error.log
retCode=$?
elif [ $2 = "direct" ]
then
- ../../src/cego --mode=batch --dbxml=chkdb.xml --user=lemke/lemke --poolsize=1000 --batchfile=$3 --tableset=$TS
+ ../../src/cego --mode=batch --dbxml=./db/chkdb.xml --user=lemke/lemke --poolsize=1000 --batchfile=$3 --tableset=$TS
exit $?
else
printUsage
@@ -52,8 +52,8 @@
if [ $QMODE = "N" ]
then
echo ""
- cat check.log
- cat error.log
+ cat ./db/check.log
+ cat ./db/error.log
else
if [ $retCode -eq 0 ]
@@ -62,14 +62,10 @@
else
echo "... operation failed for following reason"
echo "--------------------------------------"
- cat error.log
+ cat ./db/error.log
echo "--------------------------------------"
exit 1
fi
fi
-rm -rf check.log
-rm -rf error.log
-
-
-
-
+rm -rf ./db/check.log
+rm -rf ./db/error.log
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAction.cc
^
|
@@ -85,6 +85,7 @@
_pOrderingList = 0;
_pOrderingOptList = 0;
+ _procContext = false;
_queryCacheEnabled = true;
_modId = pTabMng->getDBMng()->getModId("CegoAction");
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdm.cc
^
|
@@ -2036,186 +2036,184 @@
}
void CegoAdm::loadParser0()
{
- _actionMap[317][SEMICOLON] = ActionEntry(REDUCE, 75);
- _actionMap[312][SEMICOLON] = ActionEntry(REDUCE, 72);
- _actionMap[313][NOLOGGING] = ActionEntry(SHIFT, 294);
- _actionMap[313][SEMICOLON] = ActionEntry(REDUCE, 83);
- _jumpMap[313][LogOpt] = 317;
- _actionMap[314][SEMICOLON] = ActionEntry(REDUCE, 77);
- _actionMap[315][SEMICOLON] = ActionEntry(REDUCE, 51);
- _actionMap[316][SEMICOLON] = ActionEntry(REDUCE, 37);
- _actionMap[289][STRINGVAL] = ActionEntry(SHIFT, 312);
- _actionMap[290][SEMICOLON] = ActionEntry(REDUCE, 74);
- _actionMap[291][STRINGVAL] = ActionEntry(SHIFT, 313);
- _actionMap[292][NOLOGGING] = ActionEntry(SHIFT, 294);
- _actionMap[292][SEMICOLON] = ActionEntry(REDUCE, 83);
- _jumpMap[292][LogOpt] = 314;
- _actionMap[293][SEMICOLON] = ActionEntry(REDUCE, 76);
- _actionMap[294][SEMICOLON] = ActionEntry(REDUCE, 82);
- _actionMap[295][SEMICOLON] = ActionEntry(REDUCE, 62);
- _actionMap[296][IDENTIFIER] = ActionEntry(SHIFT, 315);
- _actionMap[297][KSEP] = ActionEntry(REDUCE, 52);
- _actionMap[297][TO] = ActionEntry(REDUCE, 52);
- _actionMap[298][KSEP] = ActionEntry(REDUCE, 55);
- _actionMap[298][TO] = ActionEntry(REDUCE, 55);
- _actionMap[299][KSEP] = ActionEntry(REDUCE, 56);
- _actionMap[299][TO] = ActionEntry(REDUCE, 56);
- _actionMap[300][KSEP] = ActionEntry(REDUCE, 54);
- _actionMap[300][TO] = ActionEntry(REDUCE, 54);
- _actionMap[301][IDENTIFIER] = ActionEntry(SHIFT, 316);
- _actionMap[302][SEMICOLON] = ActionEntry(REDUCE, 102);
- _actionMap[302][PRIMARY] = ActionEntry(REDUCE, 102);
- _actionMap[302][SECONDARY] = ActionEntry(REDUCE, 102);
- _actionMap[302][SYSSIZE] = ActionEntry(REDUCE, 102);
- _actionMap[302][TMPSIZE] = ActionEntry(REDUCE, 102);
- _actionMap[302][LOGSIZE] = ActionEntry(REDUCE, 102);
- _actionMap[302][LOGNUM] = ActionEntry(REDUCE, 102);
- _actionMap[302][SORTAREASIZE] = ActionEntry(REDUCE, 102);
- _actionMap[302][TSROOT] = ActionEntry(REDUCE, 102);
- _actionMap[302][TSTICKET] = ActionEntry(REDUCE, 102);
- _actionMap[303][SEMICOLON] = ActionEntry(REDUCE, 99);
- _actionMap[303][PRIMARY] = ActionEntry(REDUCE, 99);
- _actionMap[303][SECONDARY] = ActionEntry(REDUCE, 99);
- _actionMap[303][SYSSIZE] = ActionEntry(REDUCE, 99);
- _actionMap[303][TMPSIZE] = ActionEntry(REDUCE, 99);
- _actionMap[303][LOGSIZE] = ActionEntry(REDUCE, 99);
- _actionMap[303][LOGNUM] = ActionEntry(REDUCE, 99);
- _actionMap[303][SORTAREASIZE] = ActionEntry(REDUCE, 99);
- _actionMap[303][TSROOT] = ActionEntry(REDUCE, 99);
- _actionMap[303][TSTICKET] = ActionEntry(REDUCE, 99);
- _actionMap[304][SEMICOLON] = ActionEntry(REDUCE, 98);
- _actionMap[304][PRIMARY] = ActionEntry(REDUCE, 98);
- _actionMap[304][SECONDARY] = ActionEntry(REDUCE, 98);
+ _actionMap[313][SEMICOLON] = ActionEntry(REDUCE, 75);
+ _actionMap[308][SEMICOLON] = ActionEntry(REDUCE, 72);
+ _actionMap[309][NOLOGGING] = ActionEntry(SHIFT, 290);
+ _actionMap[309][SEMICOLON] = ActionEntry(REDUCE, 83);
+ _jumpMap[309][LogOpt] = 313;
+ _actionMap[310][SEMICOLON] = ActionEntry(REDUCE, 77);
+ _actionMap[311][SEMICOLON] = ActionEntry(REDUCE, 51);
+ _actionMap[312][SEMICOLON] = ActionEntry(REDUCE, 37);
+ _actionMap[285][STRINGVAL] = ActionEntry(SHIFT, 308);
+ _actionMap[286][SEMICOLON] = ActionEntry(REDUCE, 74);
+ _actionMap[287][STRINGVAL] = ActionEntry(SHIFT, 309);
+ _actionMap[288][NOLOGGING] = ActionEntry(SHIFT, 290);
+ _actionMap[288][SEMICOLON] = ActionEntry(REDUCE, 83);
+ _jumpMap[288][LogOpt] = 310;
+ _actionMap[289][SEMICOLON] = ActionEntry(REDUCE, 76);
+ _actionMap[290][SEMICOLON] = ActionEntry(REDUCE, 82);
+ _actionMap[291][SEMICOLON] = ActionEntry(REDUCE, 62);
+ _actionMap[292][IDENTIFIER] = ActionEntry(SHIFT, 311);
+ _actionMap[293][KSEP] = ActionEntry(REDUCE, 52);
+ _actionMap[293][TO] = ActionEntry(REDUCE, 52);
+ _actionMap[294][KSEP] = ActionEntry(REDUCE, 55);
+ _actionMap[294][TO] = ActionEntry(REDUCE, 55);
+ _actionMap[295][KSEP] = ActionEntry(REDUCE, 56);
+ _actionMap[295][TO] = ActionEntry(REDUCE, 56);
+ _actionMap[296][KSEP] = ActionEntry(REDUCE, 54);
+ _actionMap[296][TO] = ActionEntry(REDUCE, 54);
+ _actionMap[297][IDENTIFIER] = ActionEntry(SHIFT, 312);
+ _actionMap[298][SEMICOLON] = ActionEntry(REDUCE, 102);
+ _actionMap[298][PRIMARY] = ActionEntry(REDUCE, 102);
+ _actionMap[298][SECONDARY] = ActionEntry(REDUCE, 102);
+ _actionMap[298][SYSSIZE] = ActionEntry(REDUCE, 102);
+ _actionMap[298][TMPSIZE] = ActionEntry(REDUCE, 102);
+ _actionMap[298][LOGSIZE] = ActionEntry(REDUCE, 102);
+ _actionMap[298][LOGNUM] = ActionEntry(REDUCE, 102);
+ _actionMap[298][SORTAREASIZE] = ActionEntry(REDUCE, 102);
+ _actionMap[298][TSROOT] = ActionEntry(REDUCE, 102);
+ _actionMap[298][TSTICKET] = ActionEntry(REDUCE, 102);
+ _actionMap[299][SEMICOLON] = ActionEntry(REDUCE, 99);
+ _actionMap[299][PRIMARY] = ActionEntry(REDUCE, 99);
+ _actionMap[299][SECONDARY] = ActionEntry(REDUCE, 99);
+ _actionMap[299][SYSSIZE] = ActionEntry(REDUCE, 99);
+ _actionMap[299][TMPSIZE] = ActionEntry(REDUCE, 99);
+ _actionMap[299][LOGSIZE] = ActionEntry(REDUCE, 99);
+ _actionMap[299][LOGNUM] = ActionEntry(REDUCE, 99);
+ _actionMap[299][SORTAREASIZE] = ActionEntry(REDUCE, 99);
+ _actionMap[299][TSROOT] = ActionEntry(REDUCE, 99);
+ _actionMap[299][TSTICKET] = ActionEntry(REDUCE, 99);
+ _actionMap[300][SEMICOLON] = ActionEntry(REDUCE, 98);
+ _actionMap[300][PRIMARY] = ActionEntry(REDUCE, 98);
+ _actionMap[300][SECONDARY] = ActionEntry(REDUCE, 98);
}
void CegoAdm::loadParser1()
{
- _actionMap[304][SYSSIZE] = ActionEntry(REDUCE, 98);
- _actionMap[304][TMPSIZE] = ActionEntry(REDUCE, 98);
- _actionMap[304][LOGSIZE] = ActionEntry(REDUCE, 98);
- _actionMap[304][LOGNUM] = ActionEntry(REDUCE, 98);
- _actionMap[304][SORTAREASIZE] = ActionEntry(REDUCE, 98);
- _actionMap[304][TSROOT] = ActionEntry(REDUCE, 98);
- _actionMap[304][TSTICKET] = ActionEntry(REDUCE, 98);
- _actionMap[305][SEMICOLON] = ActionEntry(REDUCE, 94);
- _actionMap[305][PRIMARY] = ActionEntry(REDUCE, 94);
- _actionMap[305][SECONDARY] = ActionEntry(REDUCE, 94);
- _actionMap[305][SYSSIZE] = ActionEntry(REDUCE, 94);
- _actionMap[305][TMPSIZE] = ActionEntry(REDUCE, 94);
- _actionMap[305][LOGSIZE] = ActionEntry(REDUCE, 94);
- _actionMap[305][LOGNUM] = ActionEntry(REDUCE, 94);
- _actionMap[305][SORTAREASIZE] = ActionEntry(REDUCE, 94);
- _actionMap[305][TSROOT] = ActionEntry(REDUCE, 94);
- _actionMap[305][TSTICKET] = ActionEntry(REDUCE, 94);
- _actionMap[306][SEMICOLON] = ActionEntry(REDUCE, 95);
- _actionMap[306][PRIMARY] = ActionEntry(REDUCE, 95);
- _actionMap[306][SECONDARY] = ActionEntry(REDUCE, 95);
- _actionMap[306][SYSSIZE] = ActionEntry(REDUCE, 95);
- _actionMap[306][TMPSIZE] = ActionEntry(REDUCE, 95);
- _actionMap[306][LOGSIZE] = ActionEntry(REDUCE, 95);
- _actionMap[306][LOGNUM] = ActionEntry(REDUCE, 95);
- _actionMap[306][SORTAREASIZE] = ActionEntry(REDUCE, 95);
- _actionMap[306][TSROOT] = ActionEntry(REDUCE, 95);
- _actionMap[306][TSTICKET] = ActionEntry(REDUCE, 95);
- _actionMap[307][SEMICOLON] = ActionEntry(REDUCE, 100);
- _actionMap[307][PRIMARY] = ActionEntry(REDUCE, 100);
- _actionMap[307][SECONDARY] = ActionEntry(REDUCE, 100);
- _actionMap[307][SYSSIZE] = ActionEntry(REDUCE, 100);
- _actionMap[307][TMPSIZE] = ActionEntry(REDUCE, 100);
- _actionMap[307][LOGSIZE] = ActionEntry(REDUCE, 100);
- _actionMap[307][LOGNUM] = ActionEntry(REDUCE, 100);
- _actionMap[307][SORTAREASIZE] = ActionEntry(REDUCE, 100);
- _actionMap[307][TSROOT] = ActionEntry(REDUCE, 100);
- _actionMap[307][TSTICKET] = ActionEntry(REDUCE, 100);
- _actionMap[308][SEMICOLON] = ActionEntry(REDUCE, 96);
- _actionMap[308][PRIMARY] = ActionEntry(REDUCE, 96);
- _actionMap[308][SECONDARY] = ActionEntry(REDUCE, 96);
- _actionMap[308][SYSSIZE] = ActionEntry(REDUCE, 96);
- _actionMap[308][TMPSIZE] = ActionEntry(REDUCE, 96);
- _actionMap[308][LOGSIZE] = ActionEntry(REDUCE, 96);
- _actionMap[308][LOGNUM] = ActionEntry(REDUCE, 96);
- _actionMap[308][SORTAREASIZE] = ActionEntry(REDUCE, 96);
- _actionMap[308][TSROOT] = ActionEntry(REDUCE, 96);
- _actionMap[308][TSTICKET] = ActionEntry(REDUCE, 96);
- _actionMap[309][SEMICOLON] = ActionEntry(REDUCE, 97);
- _actionMap[309][PRIMARY] = ActionEntry(REDUCE, 97);
- _actionMap[309][SECONDARY] = ActionEntry(REDUCE, 97);
+ _actionMap[300][SYSSIZE] = ActionEntry(REDUCE, 98);
+ _actionMap[300][TMPSIZE] = ActionEntry(REDUCE, 98);
+ _actionMap[300][LOGSIZE] = ActionEntry(REDUCE, 98);
+ _actionMap[300][LOGNUM] = ActionEntry(REDUCE, 98);
+ _actionMap[300][SORTAREASIZE] = ActionEntry(REDUCE, 98);
+ _actionMap[300][TSROOT] = ActionEntry(REDUCE, 98);
+ _actionMap[300][TSTICKET] = ActionEntry(REDUCE, 98);
+ _actionMap[301][SEMICOLON] = ActionEntry(REDUCE, 94);
+ _actionMap[301][PRIMARY] = ActionEntry(REDUCE, 94);
+ _actionMap[301][SECONDARY] = ActionEntry(REDUCE, 94);
+ _actionMap[301][SYSSIZE] = ActionEntry(REDUCE, 94);
+ _actionMap[301][TMPSIZE] = ActionEntry(REDUCE, 94);
+ _actionMap[301][LOGSIZE] = ActionEntry(REDUCE, 94);
+ _actionMap[301][LOGNUM] = ActionEntry(REDUCE, 94);
+ _actionMap[301][SORTAREASIZE] = ActionEntry(REDUCE, 94);
+ _actionMap[301][TSROOT] = ActionEntry(REDUCE, 94);
+ _actionMap[301][TSTICKET] = ActionEntry(REDUCE, 94);
+ _actionMap[302][SEMICOLON] = ActionEntry(REDUCE, 95);
+ _actionMap[302][PRIMARY] = ActionEntry(REDUCE, 95);
+ _actionMap[302][SECONDARY] = ActionEntry(REDUCE, 95);
+ _actionMap[302][SYSSIZE] = ActionEntry(REDUCE, 95);
+ _actionMap[302][TMPSIZE] = ActionEntry(REDUCE, 95);
+ _actionMap[302][LOGSIZE] = ActionEntry(REDUCE, 95);
+ _actionMap[302][LOGNUM] = ActionEntry(REDUCE, 95);
+ _actionMap[302][SORTAREASIZE] = ActionEntry(REDUCE, 95);
+ _actionMap[302][TSROOT] = ActionEntry(REDUCE, 95);
+ _actionMap[302][TSTICKET] = ActionEntry(REDUCE, 95);
+ _actionMap[303][SEMICOLON] = ActionEntry(REDUCE, 100);
+ _actionMap[303][PRIMARY] = ActionEntry(REDUCE, 100);
+ _actionMap[303][SECONDARY] = ActionEntry(REDUCE, 100);
+ _actionMap[303][SYSSIZE] = ActionEntry(REDUCE, 100);
+ _actionMap[303][TMPSIZE] = ActionEntry(REDUCE, 100);
+ _actionMap[303][LOGSIZE] = ActionEntry(REDUCE, 100);
+ _actionMap[303][LOGNUM] = ActionEntry(REDUCE, 100);
+ _actionMap[303][SORTAREASIZE] = ActionEntry(REDUCE, 100);
+ _actionMap[303][TSROOT] = ActionEntry(REDUCE, 100);
+ _actionMap[303][TSTICKET] = ActionEntry(REDUCE, 100);
+ _actionMap[304][SEMICOLON] = ActionEntry(REDUCE, 96);
+ _actionMap[304][PRIMARY] = ActionEntry(REDUCE, 96);
+ _actionMap[304][SECONDARY] = ActionEntry(REDUCE, 96);
+ _actionMap[304][SYSSIZE] = ActionEntry(REDUCE, 96);
+ _actionMap[304][TMPSIZE] = ActionEntry(REDUCE, 96);
+ _actionMap[304][LOGSIZE] = ActionEntry(REDUCE, 96);
+ _actionMap[304][LOGNUM] = ActionEntry(REDUCE, 96);
+ _actionMap[304][SORTAREASIZE] = ActionEntry(REDUCE, 96);
+ _actionMap[304][TSROOT] = ActionEntry(REDUCE, 96);
+ _actionMap[304][TSTICKET] = ActionEntry(REDUCE, 96);
+ _actionMap[305][SEMICOLON] = ActionEntry(REDUCE, 97);
+ _actionMap[305][PRIMARY] = ActionEntry(REDUCE, 97);
+ _actionMap[305][SECONDARY] = ActionEntry(REDUCE, 97);
}
void CegoAdm::loadParser2()
{
- _actionMap[309][SYSSIZE] = ActionEntry(REDUCE, 97);
- _actionMap[309][TMPSIZE] = ActionEntry(REDUCE, 97);
- _actionMap[309][LOGSIZE] = ActionEntry(REDUCE, 97);
- _actionMap[309][LOGNUM] = ActionEntry(REDUCE, 97);
- _actionMap[309][SORTAREASIZE] = ActionEntry(REDUCE, 97);
- _actionMap[309][TSROOT] = ActionEntry(REDUCE, 97);
- _actionMap[309][TSTICKET] = ActionEntry(REDUCE, 97);
- _actionMap[310][SEMICOLON] = ActionEntry(REDUCE, 101);
- _actionMap[310][PRIMARY] = ActionEntry(REDUCE, 101);
- _actionMap[310][SECONDARY] = ActionEntry(REDUCE, 101);
- _actionMap[310][SYSSIZE] = ActionEntry(REDUCE, 101);
- _actionMap[310][TMPSIZE] = ActionEntry(REDUCE, 101);
- _actionMap[310][LOGSIZE] = ActionEntry(REDUCE, 101);
- _actionMap[310][LOGNUM] = ActionEntry(REDUCE, 101);
- _actionMap[310][SORTAREASIZE] = ActionEntry(REDUCE, 101);
- _actionMap[310][TSROOT] = ActionEntry(REDUCE, 101);
- _actionMap[310][TSTICKET] = ActionEntry(REDUCE, 101);
- _actionMap[311][SEMICOLON] = ActionEntry(REDUCE, 80);
- _actionMap[257][TO] = ActionEntry(SHIFT, 289);
- _actionMap[258][STRINGVAL] = ActionEntry(SHIFT, 290);
- _actionMap[259][SEMICOLON] = ActionEntry(REDUCE, 73);
- _actionMap[260][FROM] = ActionEntry(SHIFT, 291);
- _actionMap[261][STRINGVAL] = ActionEntry(SHIFT, 292);
- _actionMap[262][NOLOGGING] = ActionEntry(SHIFT, 294);
- _actionMap[262][SEMICOLON] = ActionEntry(REDUCE, 83);
- _jumpMap[262][LogOpt] = 293;
- _actionMap[263][IDENTIFIER] = ActionEntry(SHIFT, 295);
- _actionMap[264][ROLE] = ActionEntry(SHIFT, 296);
- _actionMap[265][TABLESET] = ActionEntry(SHIFT, 223);
- _actionMap[265][FILTER] = ActionEntry(SHIFT, 221);
- _actionMap[265][RIGHT] = ActionEntry(SHIFT, 222);
- _jumpMap[265][PermEntry] = 297;
- _actionMap[266][STRINGVAL] = ActionEntry(SHIFT, 298);
- _actionMap[267][IDENTIFIER] = ActionEntry(SHIFT, 299);
- _actionMap[268][IDENTIFIER] = ActionEntry(SHIFT, 300);
- _actionMap[269][SEMICOLON] = ActionEntry(REDUCE, 41);
- _actionMap[270][TO] = ActionEntry(SHIFT, 301);
- _actionMap[271][STRINGVAL] = ActionEntry(SHIFT, 302);
- _actionMap[272][INTVAL] = ActionEntry(SHIFT, 303);
- _actionMap[273][INTVAL] = ActionEntry(SHIFT, 304);
- _actionMap[274][STRINGVAL] = ActionEntry(SHIFT, 305);
- _actionMap[275][STRINGVAL] = ActionEntry(SHIFT, 306);
- _actionMap[276][INTVAL] = ActionEntry(SHIFT, 307);
- _actionMap[277][INTVAL] = ActionEntry(SHIFT, 308);
- _actionMap[278][INTVAL] = ActionEntry(SHIFT, 309);
- _actionMap[279][STRINGVAL] = ActionEntry(SHIFT, 310);
- _actionMap[280][SEMICOLON] = ActionEntry(REDUCE, 78);
- _actionMap[281][SEMICOLON] = ActionEntry(REDUCE, 44);
- _actionMap[282][SEMICOLON] = ActionEntry(REDUCE, 34);
- _actionMap[283][SEMICOLON] = ActionEntry(REDUCE, 33);
+ _actionMap[305][SYSSIZE] = ActionEntry(REDUCE, 97);
+ _actionMap[305][TMPSIZE] = ActionEntry(REDUCE, 97);
+ _actionMap[305][LOGSIZE] = ActionEntry(REDUCE, 97);
+ _actionMap[305][LOGNUM] = ActionEntry(REDUCE, 97);
+ _actionMap[305][SORTAREASIZE] = ActionEntry(REDUCE, 97);
+ _actionMap[305][TSROOT] = ActionEntry(REDUCE, 97);
+ _actionMap[305][TSTICKET] = ActionEntry(REDUCE, 97);
+ _actionMap[306][SEMICOLON] = ActionEntry(REDUCE, 101);
+ _actionMap[306][PRIMARY] = ActionEntry(REDUCE, 101);
+ _actionMap[306][SECONDARY] = ActionEntry(REDUCE, 101);
+ _actionMap[306][SYSSIZE] = ActionEntry(REDUCE, 101);
+ _actionMap[306][TMPSIZE] = ActionEntry(REDUCE, 101);
+ _actionMap[306][LOGSIZE] = ActionEntry(REDUCE, 101);
+ _actionMap[306][LOGNUM] = ActionEntry(REDUCE, 101);
+ _actionMap[306][SORTAREASIZE] = ActionEntry(REDUCE, 101);
+ _actionMap[306][TSROOT] = ActionEntry(REDUCE, 101);
+ _actionMap[306][TSTICKET] = ActionEntry(REDUCE, 101);
+ _actionMap[307][SEMICOLON] = ActionEntry(REDUCE, 80);
+ _actionMap[255][TO] = ActionEntry(SHIFT, 285);
+ _actionMap[256][STRINGVAL] = ActionEntry(SHIFT, 286);
+ _actionMap[257][SEMICOLON] = ActionEntry(REDUCE, 73);
+ _actionMap[258][FROM] = ActionEntry(SHIFT, 287);
+ _actionMap[259][STRINGVAL] = ActionEntry(SHIFT, 288);
+ _actionMap[260][NOLOGGING] = ActionEntry(SHIFT, 290);
+ _actionMap[260][SEMICOLON] = ActionEntry(REDUCE, 83);
+ _jumpMap[260][LogOpt] = 289;
+ _actionMap[261][IDENTIFIER] = ActionEntry(SHIFT, 291);
+ _actionMap[262][ROLE] = ActionEntry(SHIFT, 292);
+ _actionMap[263][TABLESET] = ActionEntry(SHIFT, 223);
+ _actionMap[263][FILTER] = ActionEntry(SHIFT, 221);
+ _actionMap[263][RIGHT] = ActionEntry(SHIFT, 222);
+ _jumpMap[263][PermEntry] = 293;
+ _actionMap[264][STRINGVAL] = ActionEntry(SHIFT, 294);
+ _actionMap[265][IDENTIFIER] = ActionEntry(SHIFT, 295);
+ _actionMap[266][IDENTIFIER] = ActionEntry(SHIFT, 296);
+ _actionMap[267][SEMICOLON] = ActionEntry(REDUCE, 41);
+ _actionMap[268][TO] = ActionEntry(SHIFT, 297);
+ _actionMap[269][STRINGVAL] = ActionEntry(SHIFT, 298);
+ _actionMap[270][INTVAL] = ActionEntry(SHIFT, 299);
+ _actionMap[271][INTVAL] = ActionEntry(SHIFT, 300);
+ _actionMap[272][STRINGVAL] = ActionEntry(SHIFT, 301);
+ _actionMap[273][STRINGVAL] = ActionEntry(SHIFT, 302);
+ _actionMap[274][INTVAL] = ActionEntry(SHIFT, 303);
+ _actionMap[275][INTVAL] = ActionEntry(SHIFT, 304);
+ _actionMap[276][INTVAL] = ActionEntry(SHIFT, 305);
+ _actionMap[277][STRINGVAL] = ActionEntry(SHIFT, 306);
+ _actionMap[278][SEMICOLON] = ActionEntry(REDUCE, 78);
+ _actionMap[279][SEMICOLON] = ActionEntry(REDUCE, 44);
+ _actionMap[280][SEMICOLON] = ActionEntry(REDUCE, 34);
+ _actionMap[281][SEMICOLON] = ActionEntry(REDUCE, 33);
}
void CegoAdm::loadParser3()
{
- _actionMap[284][SEMICOLON] = ActionEntry(REDUCE, 57);
- _actionMap[285][SEMICOLON] = ActionEntry(REDUCE, 67);
- _actionMap[286][INTVAL] = ActionEntry(SHIFT, 311);
- _actionMap[287][SEMICOLON] = ActionEntry(REDUCE, 59);
- _actionMap[288][SEMICOLON] = ActionEntry(REDUCE, 58);
- _actionMap[212][IDENTIFIER] = ActionEntry(SHIFT, 257);
- _actionMap[213][TO] = ActionEntry(SHIFT, 258);
- _actionMap[214][STRINGVAL] = ActionEntry(SHIFT, 259);
- _actionMap[215][IDENTIFIER] = ActionEntry(SHIFT, 260);
- _actionMap[216][FROM] = ActionEntry(SHIFT, 261);
- _actionMap[217][STRINGVAL] = ActionEntry(SHIFT, 262);
- _actionMap[218][TO] = ActionEntry(SHIFT, 263);
- _actionMap[219][TO] = ActionEntry(SHIFT, 264);
- _actionMap[219][KSEP] = ActionEntry(SHIFT, 265);
+ _actionMap[282][SEMICOLON] = ActionEntry(REDUCE, 57);
+ _actionMap[283][SEMICOLON] = ActionEntry(REDUCE, 67);
+ _actionMap[284][INTVAL] = ActionEntry(SHIFT, 307);
+ _actionMap[212][IDENTIFIER] = ActionEntry(SHIFT, 255);
+ _actionMap[213][TO] = ActionEntry(SHIFT, 256);
+ _actionMap[214][STRINGVAL] = ActionEntry(SHIFT, 257);
+ _actionMap[215][IDENTIFIER] = ActionEntry(SHIFT, 258);
+ _actionMap[216][FROM] = ActionEntry(SHIFT, 259);
+ _actionMap[217][STRINGVAL] = ActionEntry(SHIFT, 260);
+ _actionMap[218][TO] = ActionEntry(SHIFT, 261);
+ _actionMap[219][TO] = ActionEntry(SHIFT, 262);
+ _actionMap[219][KSEP] = ActionEntry(SHIFT, 263);
_actionMap[220][KSEP] = ActionEntry(REDUCE, 53);
_actionMap[220][TO] = ActionEntry(REDUCE, 53);
- _actionMap[221][EQU] = ActionEntry(SHIFT, 266);
- _actionMap[222][EQU] = ActionEntry(SHIFT, 267);
- _actionMap[223][EQU] = ActionEntry(SHIFT, 268);
- _actionMap[224][STRINGVAL] = ActionEntry(SHIFT, 269);
- _actionMap[225][INTVAL] = ActionEntry(SHIFT, 270);
+ _actionMap[221][EQU] = ActionEntry(SHIFT, 264);
+ _actionMap[222][EQU] = ActionEntry(SHIFT, 265);
+ _actionMap[223][EQU] = ActionEntry(SHIFT, 266);
+ _actionMap[224][STRINGVAL] = ActionEntry(SHIFT, 267);
+ _actionMap[225][INTVAL] = ActionEntry(SHIFT, 268);
_actionMap[226][SEMICOLON] = ActionEntry(REDUCE, 45);
_actionMap[227][SEMICOLON] = ActionEntry(REDUCE, 71);
_actionMap[228][SEMICOLON] = ActionEntry(REDUCE, 92);
@@ -2228,28 +2226,28 @@
_actionMap[228][SORTAREASIZE] = ActionEntry(REDUCE, 92);
_actionMap[228][TSROOT] = ActionEntry(REDUCE, 92);
_actionMap[228][TSTICKET] = ActionEntry(REDUCE, 92);
- _actionMap[229][EQU] = ActionEntry(SHIFT, 271);
- _actionMap[230][EQU] = ActionEntry(SHIFT, 272);
- _actionMap[231][EQU] = ActionEntry(SHIFT, 273);
- _actionMap[232][EQU] = ActionEntry(SHIFT, 274);
- _actionMap[233][EQU] = ActionEntry(SHIFT, 275);
- _actionMap[234][EQU] = ActionEntry(SHIFT, 276);
- _actionMap[235][EQU] = ActionEntry(SHIFT, 277);
- _actionMap[236][EQU] = ActionEntry(SHIFT, 278);
- _actionMap[237][EQU] = ActionEntry(SHIFT, 279);
+ _actionMap[229][EQU] = ActionEntry(SHIFT, 269);
+ _actionMap[230][EQU] = ActionEntry(SHIFT, 270);
+ _actionMap[231][EQU] = ActionEntry(SHIFT, 271);
+ _actionMap[232][EQU] = ActionEntry(SHIFT, 272);
+ _actionMap[233][EQU] = ActionEntry(SHIFT, 273);
+ _actionMap[234][EQU] = ActionEntry(SHIFT, 274);
+ _actionMap[235][EQU] = ActionEntry(SHIFT, 275);
+ _actionMap[236][EQU] = ActionEntry(SHIFT, 276);
+ _actionMap[237][EQU] = ActionEntry(SHIFT, 277);
_actionMap[238][SEMICOLON] = ActionEntry(REDUCE, 110);
_actionMap[239][SEMICOLON] = ActionEntry(REDUCE, 109);
_actionMap[240][SEMICOLON] = ActionEntry(REDUCE, 65);
- _actionMap[241][TICKET] = ActionEntry(SHIFT, 280);
- _actionMap[242][STRINGVAL] = ActionEntry(SHIFT, 281);
- _actionMap[243][STRINGVAL] = ActionEntry(SHIFT, 282);
- _actionMap[244][STRINGVAL] = ActionEntry(SHIFT, 283);
+ _actionMap[241][TICKET] = ActionEntry(SHIFT, 278);
+ _actionMap[242][STRINGVAL] = ActionEntry(SHIFT, 279);
+ _actionMap[243][STRINGVAL] = ActionEntry(SHIFT, 280);
+ _actionMap[244][STRINGVAL] = ActionEntry(SHIFT, 281);
_actionMap[245][SEMICOLON] = ActionEntry(REDUCE, 63);
+ _actionMap[246][IDENTIFIER] = ActionEntry(SHIFT, 282);
+ _actionMap[247][SEMICOLON] = ActionEntry(REDUCE, 46);
}
void CegoAdm::loadParser4()
{
- _actionMap[246][IDENTIFIER] = ActionEntry(SHIFT, 284);
- _actionMap[247][SEMICOLON] = ActionEntry(REDUCE, 46);
_actionMap[248][SEMICOLON] = ActionEntry(REDUCE, 103);
_actionMap[249][SEMICOLON] = ActionEntry(REDUCE, 70);
_actionMap[250][SEMICOLON] = ActionEntry(REDUCE, 107);
@@ -2262,11 +2260,9 @@
_actionMap[253][SEMICOLON] = ActionEntry(REDUCE, 87);
_actionMap[253][CLEANUP] = ActionEntry(REDUCE, 87);
_actionMap[253][FORCELOAD] = ActionEntry(REDUCE, 87);
- _actionMap[254][TIMEOUT] = ActionEntry(SHIFT, 286);
+ _actionMap[254][TIMEOUT] = ActionEntry(SHIFT, 284);
_actionMap[254][SEMICOLON] = ActionEntry(REDUCE, 81);
- _jumpMap[254][TimeoutOpt] = 285;
- _actionMap[255][IDENTIFIER] = ActionEntry(SHIFT, 287);
- _actionMap[256][IDENTIFIER] = ActionEntry(SHIFT, 288);
+ _jumpMap[254][TimeoutOpt] = 283;
_actionMap[169][FROM] = ActionEntry(SHIFT, 212);
_actionMap[170][IDENTIFIER] = ActionEntry(SHIFT, 213);
_actionMap[171][TO] = ActionEntry(SHIFT, 214);
@@ -2298,13 +2294,13 @@
_jumpMap[183][Attr] = 228;
_actionMap[184][SEMICOLON] = ActionEntry(REDUCE, 61);
_actionMap[185][IDENTIFIER] = ActionEntry(SHIFT, 238);
-}
-void CegoAdm::loadParser5()
-{
_actionMap[186][IDENTIFIER] = ActionEntry(SHIFT, 239);
_actionMap[187][SEMICOLON] = ActionEntry(REDUCE, 60);
_actionMap[188][KEEP] = ActionEntry(SHIFT, 241);
_actionMap[188][SEMICOLON] = ActionEntry(REDUCE, 79);
+}
+void CegoAdm::loadParser5()
+{
_jumpMap[188][KeepTicketOpt] = 240;
_actionMap[189][SEMICOLON] = ActionEntry(REDUCE, 8);
_actionMap[190][SEMICOLON] = ActionEntry(REDUCE, 13);
@@ -2330,8 +2326,8 @@
_actionMap[207][SEMICOLON] = ActionEntry(REDUCE, 32);
_actionMap[208][SEMICOLON] = ActionEntry(REDUCE, 31);
_actionMap[209][STRINGVAL] = ActionEntry(SHIFT, 254);
- _actionMap[210][FOR] = ActionEntry(SHIFT, 255);
- _actionMap[211][FOR] = ActionEntry(SHIFT, 256);
+ _actionMap[210][SEMICOLON] = ActionEntry(REDUCE, 59);
+ _actionMap[211][SEMICOLON] = ActionEntry(REDUCE, 58);
_actionMap[111][IDENTIFIER] = ActionEntry(SHIFT, 169);
_actionMap[112][IDENTIFIER] = ActionEntry(SHIFT, 171);
_actionMap[112][STRUCTURE] = ActionEntry(SHIFT, 170);
@@ -2351,13 +2347,13 @@
_actionMap[125][SEMICOLON] = ActionEntry(REDUCE, 29);
_actionMap[126][SEMICOLON] = ActionEntry(REDUCE, 40);
_actionMap[127][SEMICOLON] = ActionEntry(REDUCE, 49);
-}
-void CegoAdm::loadParser6()
-{
_actionMap[128][SEMICOLON] = ActionEntry(REDUCE, 26);
_actionMap[129][PRIMARY] = ActionEntry(REDUCE, 93);
_actionMap[129][SECONDARY] = ActionEntry(REDUCE, 93);
_actionMap[129][SYSSIZE] = ActionEntry(REDUCE, 93);
+}
+void CegoAdm::loadParser6()
+{
_actionMap[129][TMPSIZE] = ActionEntry(REDUCE, 93);
_actionMap[129][LOGSIZE] = ActionEntry(REDUCE, 93);
_actionMap[129][LOGNUM] = ActionEntry(REDUCE, 93);
@@ -2404,13 +2400,13 @@
_actionMap[160][SEMICOLON] = ActionEntry(REDUCE, 28);
_actionMap[161][IDENTIFIER] = ActionEntry(SHIFT, 207);
_actionMap[162][IDENTIFIER] = ActionEntry(SHIFT, 208);
-}
-void CegoAdm::loadParser7()
-{
_actionMap[163][SEMICOLON] = ActionEntry(REDUCE, 30);
_actionMap[164][SEMICOLON] = ActionEntry(REDUCE, 66);
_actionMap[164][WITH] = ActionEntry(SHIFT, 209);
_actionMap[165][SEMICOLON] = ActionEntry(REDUCE, 18);
+}
+void CegoAdm::loadParser7()
+{
_actionMap[166][IDENTIFIER] = ActionEntry(SHIFT, 210);
_actionMap[167][IDENTIFIER] = ActionEntry(SHIFT, 211);
_actionMap[168][SEMICOLON] = ActionEntry(REDUCE, 39);
@@ -2457,13 +2453,13 @@
_actionMap[80][LOCK] = ActionEntry(SHIFT, 143);
_actionMap[81][IDENTIFIER] = ActionEntry(SHIFT, 144);
_actionMap[82][IDENTIFIER] = ActionEntry(SHIFT, 145);
-}
-void CegoAdm::loadParser8()
-{
_actionMap[83][SEMICOLON] = ActionEntry(REDUCE, 4);
_actionMap[84][SEMICOLON] = ActionEntry(REDUCE, 3);
_actionMap[85][FOR] = ActionEntry(SHIFT, 146);
_actionMap[86][FOR] = ActionEntry(SHIFT, 147);
+}
+void CegoAdm::loadParser8()
+{
_actionMap[87][IDENTIFIER] = ActionEntry(SHIFT, 148);
_actionMap[88][IDENTIFIER] = ActionEntry(SHIFT, 149);
_actionMap[89][IDENTIFIER] = ActionEntry(SHIFT, 150);
@@ -2510,13 +2506,13 @@
_actionMap[12][ROLE] = ActionEntry(SHIFT, 57);
_actionMap[13][TABLESET] = ActionEntry(SHIFT, 59);
_actionMap[14][ARCHLOG] = ActionEntry(SHIFT, 60);
-}
-void CegoAdm::loadParser9()
-{
_actionMap[15][TABLESET] = ActionEntry(SHIFT, 62);
_actionMap[15][ROLE] = ActionEntry(SHIFT, 61);
_actionMap[16][TABLE] = ActionEntry(SHIFT, 64);
_actionMap[16][UINDEX] = ActionEntry(SHIFT, 63);
+}
+void CegoAdm::loadParser9()
+{
_actionMap[17][ARCHLOG] = ActionEntry(SHIFT, 65);
_actionMap[18][BACKUP] = ActionEntry(SHIFT, 66);
_actionMap[19][SEMICOLON] = ActionEntry(REDUCE, 105);
@@ -2563,13 +2559,13 @@
_actionMap[36][MEDIATOR] = ActionEntry(SHIFT, 101);
_actionMap[37][TABLESET] = ActionEntry(SHIFT, 104);
_actionMap[38][SEMICOLON] = ActionEntry(REDUCE, 15);
-}
-void CegoAdm::loadParser10()
-{
_actionMap[38][DB] = ActionEntry(SHIFT, 106);
_actionMap[38][ADM] = ActionEntry(SHIFT, 105);
_actionMap[38][LOG] = ActionEntry(SHIFT, 107);
_actionMap[39][ON] = ActionEntry(SHIFT, 109);
+}
+void CegoAdm::loadParser10()
+{
_actionMap[39][OFF] = ActionEntry(SHIFT, 108);
_actionMap[40][TABLESET] = ActionEntry(SHIFT, 110);
_actionMap[41][IMPORT] = ActionEntry(REDUCE, 88);
@@ -2616,12 +2612,9 @@
_actionMap[0][SETTSNODEINFO] = ActionEntry(SHIFT, 32);
_actionMap[0][DUMP] = ActionEntry(SHIFT, 16);
_jumpMap[0][Statement] = 2;
-}
-void CegoAdm::loadParser11()
-{
_jumpMap[0][XPMode] = 1;
}
-void CegoAdm::loadParser12()
+void CegoAdm::loadParser11()
{
_prodInfo.Insert(ProdEntry(110, Statement, 5));
_prodInfo.Insert(ProdEntry(109, Statement, 5));
@@ -2674,8 +2667,8 @@
_prodInfo.Insert(ProdEntry(62, Statement, 7));
_prodInfo.Insert(ProdEntry(61, Statement, 4));
_prodInfo.Insert(ProdEntry(60, Statement, 4));
- _prodInfo.Insert(ProdEntry(59, Statement, 6));
- _prodInfo.Insert(ProdEntry(58, Statement, 6));
+ _prodInfo.Insert(ProdEntry(59, Statement, 4));
+ _prodInfo.Insert(ProdEntry(58, Statement, 4));
_prodInfo.Insert(ProdEntry(57, Statement, 6));
_prodInfo.Insert(ProdEntry(56, PermEntry, 3));
_prodInfo.Insert(ProdEntry(55, PermEntry, 3));
@@ -2739,7 +2732,7 @@
CegoAdm::CegoAdm()
{
loadScanner();
- for ( int i=0; i < 318; i++)
+ for ( int i=0; i < 314; i++)
{
int j;
for ( j = 0; j < 107; j++)
@@ -2759,7 +2752,6 @@
loadParser9();
loadParser10();
loadParser11();
- loadParser12();
_isReserved = false;
}
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdm.def
^
|
@@ -201,8 +201,8 @@
PermEntry : RIGHT EQU IDENTIFIER ; setRightPerm
Statement : REMOVE PERMISSION IDENTIFIER FROM ROLE IDENTIFIER ; removePermAction
-Statement : TRACE ON USER IDENTIFIER FOR IDENTIFIER ; traceOnAction
-Statement : TRACE OFF USER IDENTIFIER FOR IDENTIFIER ; traceOffAction
+Statement : TRACE ON USER IDENTIFIER ; traceOnAction
+Statement : TRACE OFF USER IDENTIFIER ; traceOffAction
#
Statement : ENABLE ARCHLOG FOR IDENTIFIER ; enableArchLogAction
Statement : DISABLE ARCHLOG FOR IDENTIFIER ; disableArchLogAction
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdm.h
^
|
@@ -267,7 +267,6 @@
void loadParser9();
void loadParser10();
void loadParser11();
- void loadParser12();
class ScannerStateEntry {
@@ -364,8 +363,8 @@
int _num;
};
- ActionEntry _actionMap[318][107];
- int _jumpMap[318][14];
+ ActionEntry _actionMap[314][107];
+ int _jumpMap[314][14];
class ProdEntry {
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdmAction.cc
^
|
@@ -2007,24 +2007,17 @@
void CegoAdmAction::traceOnAction()
{
- Chain tableSet;
Chain user;
Chain* pS = getTokenList().First();
if ( pS )
{
- tableSet = *pS;
- }
- pS = getTokenList().Next();
- pS = getTokenList().Next();
- if ( pS )
- {
user = *pS;
}
CegoAdminHandler::ResultType res;
- res = _pAH->medUserTrace(tableSet, user, true);
+ res = _pAH->medUserTrace(user, true);
handleMedResult(res);
}
@@ -2032,24 +2025,17 @@
void CegoAdmAction::traceOffAction()
{
- Chain tableSet;
Chain user;
Chain* pS = getTokenList().First();
if ( pS )
{
- tableSet = *pS;
- }
- pS = getTokenList().Next();
- pS = getTokenList().Next();
- if ( pS )
- {
user = *pS;
}
-
+
CegoAdminHandler::ResultType res;
- res = _pAH->medUserTrace(tableSet, user, false);
+ res = _pAH->medUserTrace(user, false);
handleMedResult(res);
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdmin.cc
^
|
@@ -81,31 +81,20 @@
void showMonitor(CegoAdminHandler *pAH);
void printHelp(const Chain& cs);
+void helpOverview();
void helpAll();
-void helpShow(const Chain& c);
-void helpThreadInfo(const Chain& c);
-void helpList(const Chain& arg);
-void helpCreate();
-void helpDefine();
-void helpStart();
-void helpCopy();
-void helpSwitch();
-void helpStop();
-void helpDrop();
-void helpAdd(const Chain& arg);
-void helpRemove(const Chain& arg);
-void helpPasswd(const Chain& arg);
-void helpSync(const Chain& arg);
-void helpAbort(const Chain& arg);
-void helpImport(const Chain& arg);
-void helpExport(const Chain& arg);
-void helpBegin();
-void helpEnd();
+void helpRole();
+void helpUser();
+void helpPool();
+void helpThread();
+void helpBasic();
+void helpAdvanced();
+void helpExport();
+void helpImport();
+void helpBackup();
void helpRecover();
-void helpEnable();
-void helpDisable();
-void helpRelocate();
-void helpCheck();
+void helpArchLog();
+void helpLock();
extern char __lfcVersionString[];
@@ -482,705 +471,504 @@
void printHelp(const Chain &cs)
{
Tokenizer t(cs, Chain(" "));
- Chain a, b, c;
+ Chain a, b;
t.nextToken(a);
t.nextToken(b);
- t.nextToken(c);
if ( b == Chain("help"))
{
helpAll();
}
- else if ( b == Chain("show"))
+ else if ( b == Chain("user"))
{
- helpShow(c);
+ helpUser();
}
- else if ( b == Chain("threadinfo"))
+ else if ( b == Chain("role"))
{
- helpThreadInfo(c);
+ helpRole();
}
- else if ( b == Chain("list"))
+ else if ( b == Chain("pool"))
{
- helpList(c);
+ helpPool();
}
- else if ( b == Chain("define"))
+ else if ( b == Chain("thread"))
{
- helpDefine();
+ helpThread();
}
- else if ( b == Chain("create"))
+ else if ( b == Chain("basic"))
{
- helpCreate();
+ helpBasic();
}
- else if ( b == Chain("start"))
+ else if ( b == Chain("advanced"))
{
- helpStart();
- }
- else if ( b == Chain("copy"))
- {
- helpCopy();
- }
- else if ( b == Chain("switch"))
- {
- helpSwitch();
- }
- else if ( b == Chain("stop"))
- {
- helpStop();
- }
- else if ( b == Chain("drop"))
- {
- helpDrop();
- }
- else if ( b == Chain("remove"))
- {
- helpRemove(c);
- }
- else if ( b == Chain("sync"))
- {
- helpSync(c);
+ helpAdvanced();
}
else if ( b == Chain("export"))
{
- helpExport(c);
+ helpExport();
}
else if ( b == Chain("import"))
{
- helpImport(c);
+ helpImport();
}
- else if ( b == Chain("add"))
+ else if ( b == Chain("backup"))
{
- helpAdd(c);
+ helpBackup();
}
- else if ( b == Chain("passwd"))
+ else if ( b == Chain("recover"))
{
- helpPasswd(c);
+ helpRecover();
}
- else if ( b == Chain("abort"))
+ else if ( b == Chain("archlog"))
{
- helpAbort(c);
+ helpArchLog();
}
- else if ( b == Chain("begin"))
+ else if ( b == Chain("lock"))
{
- helpBegin();
+ helpLock();
}
- else if ( b == Chain("end"))
+ else if ( b == Chain("all"))
{
- helpEnd();
+ helpAll();
}
else
{
- cout << endl;
- cout << "Available Commands" << endl;
- cout << "==================" << endl;
- cout << endl;
- cout << " Format commands" << endl;
- cout << " ---------------" << endl;
- cout << " rawmode on" << endl;
- cout << " rawmode off" << endl;
- cout << endl;
- cout << " Database information" << endl;
- cout << " --------------------" << endl;
- cout << endl;
- cout << " show pool" << endl;
- cout << " list pool" << endl;
- cout << " list < rec | rbrec | sysrec | bp | dp | ix | sp | df | tp | ts > lock" << endl;
- cout << " lockstat" << endl;
- cout << " list tableset" << endl;
- cout << " list datafile for <tableset>" << endl;
- cout << " list archlog for <tableset>" << endl;
- cout << " list logfile for <tableset>" << endl;
- cout << " list transaction for <tableset>" << endl;
- cout << " list object for <tableset>" << endl;
- cout << " list node" << endl;
- cout << " list session" << endl;
- cout << " list copy" << endl;
- cout << " threadinfo [ db [threadid] | adm | log ]" << endl;
- cout << " abort db thread <tid>" << endl;
-
- cout << endl;
- cout << " Tableset administration" << endl;
- cout << " -----------------------" << endl;
- cout << endl;
- cout << " retrieve tableset from '<hostname>'" << endl;
- cout << " define tableset <tableset> <attr1>=<value1> <attr2=value2> ..." << endl;
- cout << " create tableset" << endl;
- cout << " info tableset <tableset>" << endl;
- cout << " start tableset <tableset> [ cleanup ] [ forceload ]" << endl;
- cout << " stop tableset <tableset>" << endl;
- cout << " copy tableset <tableset>" << endl;
- cout << " switch tableset <tableset>" << endl;
- cout << " switch secondary for <tableset>" << endl;
- cout << " switch mediator for <tableset>" << endl;
- cout << " relocate secondary for <tableset> to '<hostname>'" << endl;
- cout << " relocate mediator for <tableset> to '<hostname>'" << endl;
- cout << " drop tableset <tableset>" << endl;
- cout << " remove tableset <tableset>" << endl;
- cout << " add <app|sys|temp> datafile '<filename>' size <numpages> to <tableset>" << endl;
- cout << " check tableset <tableset>" << endl;
- cout << " verify tableset <tableset>" << endl;
- cout << " correct tableset <tableset>" << endl;
- cout << " checkpoint interval <intval> for <tableset>" << endl;
- cout << " set initfile '<initfile>' for <tableset>" << endl;
- cout << endl;
- cout << " User administration" << endl;
- cout << " -------------------" << endl;
- cout << endl;
- cout << " add user <userid> identified by '<passwd>' to <tableset>" << endl;
- cout << " remove user <userid> from <tableset>" << endl;
- cout << " list user for <tableset>" << endl;
- cout << " passwd user <userid> identified by '<passwd>' to <tableset>" << endl;
- cout << " add role <role> to user <userid> for <tableset>" << endl;
- cout << " remove role <role> from user <userid> for <tableset>" << endl;
- cout << " trace [ on | off ] user <userid> for <tableset>" << endl;
- cout << endl;
- cout << " Backup and Recovery" << endl;
- cout << " -------------------" << endl;
- cout << " set logmng '<progname>'" << endl;
- cout << " enable archlog for <tableset>" << endl;
- cout << " disable archlog for <tableset>" << endl;
- cout << " add archlog <archid> path '<archpath>' to <tableset>" << endl;
- cout << " remove archlog <archid> from <tableset>" << endl;
- cout << " begin backup for <tableset> [ keep ticket ]" << endl;
- cout << " end backup for <tableset>" << endl;
- cout << " sync tableset <tableset> [ with '<command>' [ <timeout> ]]] " << endl;
- cout << " recover tableset <tableset> [ to <point in time> ]" << endl;
- cout << endl;
- cout << " [ xml | binary | plain ] export table <table> from <tableset> to '<filename>'" << endl;
- cout << " [ xml | binary | plain ] export tableset [ structure ] <tableset> to '<filename>'" << endl;
- cout << endl;
- cout << " [ xml | binary | plain ] import table <table> to <tableset> from '<filename>' [ nologging ]" << endl;
- cout << " [ xml | binary | plain ] import tableset [ structure ] <tableset> from '<filename>' [ nologging ]" << endl;
- cout << endl;
- cout << "Close each command with <;> ( e.g.: 'poolinfo;' )" << endl;
- cout << endl;
- cout << "Type \"help help\" ( without ';' ) for online help" << endl;
-
+ helpOverview();
}
}
-void helpAll()
+void helpOverview()
{
cout << "Type \"help <topic>\" for a detailed help" << endl;
cout << "Topic is one of the following items" << endl;
cout << endl;
-
- cout << " show" << endl;
- cout << " threadinfo" << endl;
- cout << " list" << endl;
- cout << " define" << endl;
- cout << " create" << endl;
- cout << " start" << endl;
- cout << " copy" << endl;
- cout << " switch" << endl;
- cout << " stop" << endl;
- cout << " drop" << endl;
- cout << " remove" << endl;
- cout << " sync" << endl;
- cout << " import" << endl;
+
+ cout << " all" << endl;
+ cout << " user" << endl;
+ cout << " role" << endl;
+ cout << " pool" << endl;
+ cout << " thread" << endl;
+ cout << " basic" << endl;
+ cout << " advanced" << endl;
cout << " export" << endl;
- cout << " add" << endl;
- cout << " passwd" << endl;
- cout << " abort" << endl;
- cout << " begin" << endl;
- cout << " end" << endl;
- cout << " recover" << endl;
- cout << " enable" << endl;
- cout << " disable" << endl;
- cout << " relocate" << endl;
+ cout << " import" << endl;
+ cout << " archlog" << endl;
+ cout << " backup" << endl;
+ cout << " recovery" << endl;
+ cout << " lock" << endl;
+
}
-void helpShow(const Chain& arg)
+void helpAll()
{
+ cout << endl;
+ cout << "+====================+" << endl;
+ cout << "| Available commands |" << endl;
+ cout << "+====================+" << endl;
+ cout << endl;
+ cout << " Format commands" << endl;
+ cout << " ---------------" << endl;
+ cout << " rawmode on" << endl;
+ cout << " rawmode off" << endl;
+ cout << endl;
+ cout << " Database information" << endl;
+ cout << " --------------------" << endl;
+ cout << endl;
+ cout << " show pool" << endl;
+ cout << " list pool" << endl;
+ cout << " list < rec | rbrec | sysrec | tp | sp | dp | ix | rb| df | bp | ts > lock" << endl;
+ cout << " lockstat" << endl;
+ cout << " list tableset" << endl;
+ cout << " list datafile for <tableset>" << endl;
+ cout << " list archlog for <tableset>" << endl;
+ cout << " list logfile for <tableset>" << endl;
+ cout << " list transaction for <tableset>" << endl;
+ cout << " list object for <tableset>" << endl;
+ cout << " list node" << endl;
+ cout << " list session" << endl;
+ cout << " list copy" << endl;
+ cout << " threadinfo [ db [threadid] | adm | log ]" << endl;
+ cout << " abort db thread <tid>" << endl;
+
+ cout << endl;
+ cout << " Tableset administration" << endl;
+ cout << " -----------------------" << endl;
+ cout << endl;
+ cout << " retrieve tableset from '<hostname>'" << endl;
+ cout << " define tableset <tableset> <attr1>=<value1> <attr2=value2> ..." << endl;
+ cout << " create tableset" << endl;
+ cout << " info tableset <tableset>" << endl;
+ cout << " start tableset <tableset> [ cleanup ] [ forceload ]" << endl;
+ cout << " stop tableset <tableset>" << endl;
+ cout << " copy tableset <tableset>" << endl;
+ cout << " switch tableset <tableset>" << endl;
+ cout << " switch secondary for <tableset>" << endl;
+ cout << " switch mediator for <tableset>" << endl;
+ cout << " relocate secondary for <tableset> to '<hostname>'" << endl;
+ cout << " relocate mediator for <tableset> to '<hostname>'" << endl;
+ cout << " drop tableset <tableset>" << endl;
+ cout << " remove tableset <tableset>" << endl;
+ cout << " add <app|sys|temp> datafile '<filename>' size <numpages> to <tableset>" << endl;
+ cout << " check tableset <tableset>" << endl;
+ cout << " verify tableset <tableset>" << endl;
+ cout << " correct tableset <tableset>" << endl;
+ cout << " checkpoint interval <intval> for <tableset>" << endl;
+ cout << " set initfile '<initfile>' for <tableset>" << endl;
+ cout << endl;
+ cout << " Role administration" << endl;
+ cout << " -------------------" << endl;
+ cout << endl;
+ cout << " add role <role> to user <userid> for <tableset>" << endl;
+ cout << " remove role <role> from user <userid> for <tableset>" << endl;
+ cout << endl;
+ cout << " User administration" << endl;
+ cout << " -------------------" << endl;
+ cout << endl;
+ cout << " add user <userid> identified by '<passwd>'" << endl;
+ cout << " remove user <userid>" << endl;
+ cout << " list user" << endl;
+ cout << " passwd user <userid> identified by '<passwd>'" << endl;
+ cout << " trace [ on | off ] user <userid>" << endl;
+ cout << endl;
+ cout << " Backup and Recovery" << endl;
+ cout << " -------------------" << endl;
+ cout << " set logmng '<progname>'" << endl;
+ cout << " enable archlog for <tableset>" << endl;
+ cout << " disable archlog for <tableset>" << endl;
+ cout << " add archlog <archid> path '<archpath>' to <tableset>" << endl;
+ cout << " remove archlog <archid> from <tableset>" << endl;
+ cout << " begin backup for <tableset> [ keep ticket ]" << endl;
+ cout << " end backup for <tableset>" << endl;
+ cout << " sync tableset <tableset> [ with '<command>' [ <timeout> ]]] " << endl;
+ cout << " recover tableset <tableset> [ to <point in time> ]" << endl;
+ cout << endl;
+ cout << " [ xml | binary | plain ] export table <table> from <tableset> to '<filename>'" << endl;
+ cout << " [ xml | binary | plain ] export tableset [ structure ] <tableset> to '<filename>'" << endl;
+ cout << endl;
+ cout << " [ xml | binary | plain ] import table <table> to <tableset> from '<filename>' [ nologging ]" << endl;
+ cout << " [ xml | binary | plain ] import tableset [ structure ] <tableset> from '<filename>' [ nologging ]" << endl;
+ cout << endl;
- if ( arg == Chain("pool") )
- {
- cout << endl;
- cout << "show pool" << endl;
- cout << "---------" << endl;
- cout << endl;
- cout << " The poolinfo lists the current status of the database buffer cache parameters." << endl;
- cout << endl;
- cout << " This information may be helpful for performance optimization ( e.g. increase the buffer cache size)" << endl;
- cout << endl;
- cout << " The following parameters are indicated : " << endl;
- cout << endl;
- cout << " Page Size - The size of each page in the buffercache." << endl;
- cout << " This parameter is specified at database creation time and can not be changed." << endl;
- cout << " All subsequent information is given in units of pages based on the given pagesize." << endl;
- cout << endl;
- cout << " Total Pages - The number of pages available in the bufferpool." << endl;
- cout << " There are no special regions in the buffercache for ordering, rollback segments, indices and so on." << endl;
- cout << " Page requests for any reasons are assigned using a modulo hash algorithm" << endl;
- cout << " by treating the corresponding fileId and pageId of the managed database file" << endl;
- cout << endl;
- cout << " Used Pages - The number of pages which are in use. Actual database information is cached in this pages." << endl;
- cout << endl;
- cout << " Free Pages - Pages which are still available and have not been filled with any valid data" << endl;
- cout << endl;
- cout << " Dirty Pages - Pages filled with valid and modified data." << endl;
- cout << endl;
- cout << " Fixed Pages - Pages, which are currently in use by any transaction." << endl;
- cout << endl;
- cout << " Persistent Pages - Pages, which can not be removed from the buffer pool."<< endl;
- cout << " Normally, thes pages contain database dictionary information" << endl;
- cout << endl;
- cout << " No Sync Pages - Forperformance reasones, sometimes pages are used which are not in sync with the transaction log." << endl;
- cout << " These pages can be written to disk as required." << endl;
- cout << " E.g. for creation of indexes, no sync pages are used." << endl;
- cout << endl;
- cout << " Stat Start - Start point of statistics measurement. The following indicated values are collected since this time" << endl;
- cout << endl;
- cout << " Disk Reads - Performed disk database block read opertions since start of statistics measurement." << endl;
- cout << endl;
- cout << " Disk Writes - Performed disk database block write opertions since start of statistics measurement." << endl;
- cout << endl;
- cout << " Read Delay - Average delay of a disk database block read operation, measured since start of statistics." << endl;
- cout << endl;
- cout << " Write Delay - Average delay of a disk database block write operation, measured since start of statistics." << endl;
- cout << endl;
- }
- else if ( arg == Chain("user") )
- {
- cout << endl;
- cout << "show user for <tableset>" << endl;
- cout << "------------------------" << endl;
- cout << endl;
- cout << " Lists the user of the given tableset." << endl;
- cout << endl;
- }
- else
- {
- cout << "Available help for show is" << endl;
- cout << endl;
- cout << " help show pool" << endl;
- cout << endl;
- }
}
-void helpThreadInfo(const Chain& arg)
-{
- if ( arg == Chain("db") )
- {
- }
- else if ( arg == Chain("adm") )
- {
- }
- else if ( arg == Chain("log") )
- {
-
- }
- else
- {
- cout << endl;
- cout << "threadinfo [ db | adm | log]" << endl;
- cout << "------------------------------" << endl;
- cout << endl;
- cout << " With arugument, the threadinfo command lists all configured and current active threads in the database system." << endl;
- cout << " The information is given for all three thread pools ( db, adm and log )." << endl;
- cout << endl;
- cout << " More detailed information for each thread pool is given, if a pool id is specified with the command." << endl;
- cout << " Valid pools id's are db, adm or log." << endl;
- cout << endl;
- }
+void helpUser()
+{
+ cout << endl;
+ cout << "+=====================+" << endl;
+ cout << "| User administration |" << endl;
+ cout << "+=====================+" << endl;
+ cout << endl;
+ cout << "list user" << endl;
+ cout << "------------------------" << endl;
+ cout << " List all defined users in the database" << endl;
+ cout << endl;
+ cout << "add user <userid> identified by '<passwd>'" << endl;
+ cout << "--------------------------------------------------------" << endl;
+ cout << " Adds a user with the specified password to the database" << endl;
+ cout << endl;
+ cout << "passwd user <userid> identified by '<passwd>'" << endl;
+ cout << "-----------------------------------------------------------" << endl;
+ cout << " Set up the user passwd to the given value" << endl;
+ cout << endl;
+ cout << "trace ( on | off ) user <userid>" << endl;
+ cout << "-----------------------------------------------------------" << endl;
+ cout << " Enables or disables trace mode for a user" << endl;
+ cout << endl;
+
}
-void helpList(const Chain& arg)
+void helpRole()
{
- if ( arg == Chain("tableset"))
- {
- cout << endl;
- cout << "list tableset" << endl;
- cout << "-------------" << endl;
- cout << endl;
- cout << " List all known tablesets on the node." << endl;
- cout << " The current status and assigned hosts ( mediator, primary, secondary) are also indicated." << endl;
- cout << endl;
- }
- else if ( arg == Chain("datafile"))
- {
- cout << endl;
- cout << "list datafile" << endl;
- cout << "-------------" << endl;
- cout << " List all configured datafiles for the given tableset" << endl;
- cout << endl;
- }
- else if ( arg == Chain("archlog"))
- {
- cout << endl;
- cout << "list archlog" << endl;
- cout << "-----------" << endl;
- cout << " List all configured archive log locations for the given tableset" << endl;
- cout << endl;
- }
- else if ( arg == Chain("user"))
- {
- cout << endl;
- cout << "list user for <tableset>" << endl;
- cout << "------------------------" << endl;
- cout << " List all defined user for the given tableset" << endl;
- cout << endl;
- }
- else if ( arg == Chain("lock"))
- {
- cout << endl;
- cout << "list lock" << endl;
- cout << "------------------------" << endl;
- cout << " List all lock objects." << endl;
- cout << endl;
- }
- else if ( arg == Chain("node"))
- {
- cout << endl;
- cout << "list node" << endl;
- cout << "------------------------" << endl;
- cout << " List all compute nodes known in the current system" << endl;
- cout << endl;
- }
- else if ( arg == Chain("session"))
- {
- cout << endl;
- cout << "list session" << endl;
- cout << "------------------------" << endl;
- cout << " List all established database connection for distributed queries" << endl;
- cout << endl;
- }
- else if ( arg == Chain("copy"))
- {
- cout << endl;
- cout << "list copy" << endl;
- cout << "------------------------" << endl;
- cout << " List all executed table set copied" << endl;
- cout << endl;
- }
- else
- {
- cout << "Available help options:" << endl;
- cout << endl;
- cout << " list tableset" << endl;
- cout << " list datafile" << endl;
- cout << " list archlog" << endl;
- cout << " list user" << endl;
- cout << " list lock" << endl;
- cout << " list node" << endl;
- cout << " list session" << endl;
- }
-}
+ cout << endl;
+ cout << "+=====================+" << endl;
+ cout << "| Role administration |" << endl;
+ cout << "+=====================+" << endl;
+ cout << endl;
-void helpDefine()
-{
cout << endl;
- cout << "define tableset <tableset> <attr1=val1> <attr2=val2> ..." << endl;
- cout << "--------------------------------------------------------" << endl;
+ cout << "list role" << endl;
+ cout << "---------------------------------------------" << endl;
+ cout << " List all defined roles" << endl;
cout << endl;
- cout << " Define a new tableset. The following attributes must be specified:"<< endl;
+ cout << "show role <role>" << endl;
+ cout << "---------------------------------------------" << endl;
+ cout << " Show the definition of the specified role" << endl;
cout << endl;
- cout << " tsroot - Root directory of the database system and control files." << endl;
+ cout << "create role <role>" << endl;
+ cout << "---------------------------------------------" << endl;
+ cout << " Create the specified role" << endl;
cout << endl;
- cout << " tsticket - Name of the online backup tableset ticket." << endl;
+ cout << "add permission <perm> with <permlist> to role <role>" << endl;
+ cout << "-----------------------------------" << endl;
+ cout << " Add a permission to the specified role" << endl;
+
cout << endl;
- cout << " syssize - Size of the system space in number of pages." << endl;
+ cout << "drop role <role>" << endl;
+ cout << "---------------------------------------------" << endl;
+
cout << endl;
- cout << " tmpsize - Size of the tempory space in number of pages." << endl;
+ cout << "assign role <role> to <userid>" << endl;
+ cout << "-----------------------------------" << endl;
+
cout << endl;
+ cout << "remove role <role> from <userid>" << endl;
+ cout << "-----------------------------------" << endl;
+ cout << " Removes the specified user role from user" << endl;
+
- cout << " logname - Prefix of the configured redolog files." << endl;
+}
+
+void helpPool()
+{
+
cout << endl;
- cout << " logsize - Size of a redolog file in bytes." << endl;
+ cout << "+=====================+" << endl;
+ cout << "| Pool administration |" << endl;
+ cout << "+=====================+" << endl;
cout << endl;
- cout << " lognum - Number of configured redolog files." << endl;
+ cout << "show pool" << endl;
cout << endl;
- cout << " primary - Name of the primary host." << endl;
+ cout << " The poolinfo lists the current status of the database buffer cache parameters." << endl;
+ cout << " This information may be helpful for performance optimization ( e.g. increase the buffer cache size)" << endl;
cout << endl;
- cout << " secondary - Name of the secondary host." << endl;
+ cout << " The following parameters are indicated : " << endl;
cout << endl;
- cout << " For a defintion statement the attributes syssize, tmpsize logsize and logname attributes are specified as integer values." << endl;
- cout << " The attributes logfilename, meiator, primary and secondary are specified as string values." << endl;
+ cout << " Page Size - The size of each page in the buffercache." << endl;
+ cout << " This parameter is specified at database creation time and can not be changed." << endl;
+ cout << " All subsequent information is given in units of pages based on the given pagesize." << endl;
+ cout << " Total Pages - The number of pages available in the bufferpool." << endl;
+ cout << " There are no special regions in the buffercache for ordering, rollback segments, indices and so on." << endl;
+ cout << " Page requests for any reasons are assigned using a modulo hash algorithm" << endl;
+ cout << " by treating the corresponding fileId and pageId of the managed database file" << endl;
+ cout << " Used Pages - The number of pages which are in use. Actual database information is cached in this pages." << endl;
+ cout << " Free Pages - Pages which are still available and have not been filled with any valid data" << endl;
+ cout << " Dirty Pages - Pages filled with valid and modified data." << endl;
+ cout << " Fixed Pages - Pages, which are currently in use by any transaction." << endl;
+ cout << " Persistent Pages - Pages, which can not be removed from the buffer pool."<< endl;
+ cout << " Normally, thes pages contain database dictionary information" << endl;
+ cout << " No Sync Pages - Forperformance reasones, sometimes pages are used which are not in sync with the transaction log." << endl;
+ cout << " These pages can be written to disk as required." << endl;
+ cout << " E.g. for creation of indexes, no sync pages are used." << endl;
+ cout << " Stat Start - Start point of statistics measurement. The following indicated values are collected since this time" << endl;
+ cout << " Disk Reads - Performed disk database block read opertions since start of statistics measurement." << endl;
+ cout << " Disk Writes - Performed disk database block write opertions since start of statistics measurement." << endl;
+ cout << " Read Delay - Average delay of a disk database block read operation, measured since start of statistics." << endl;
+ cout << " Write Delay - Average delay of a disk database block write operation, measured since start of statistics." << endl;
cout << endl;
- cout << " Sample:" << endl;
+
cout << endl;
- cout << " define tableset ts1 tsroot='/cego/ts1' syssize=100 tmpsize=100 logname='/cego/ts1/redolog'" << endl;
- cout << " logsize=100000 lognum=3 primary='geek' secondary='sam';" << endl;
+ cout << "list pool" << endl;
+ cout << endl;
+ cout << " Prints a detailed listing of each buffer pool page." << endl;
cout << endl;
-}
+}
-void helpCreate()
+void helpThread()
{
+
+ cout << endl;
+ cout << "+=======================+" << endl;
+ cout << "| Thread administration |" << endl;
+ cout << "+=======================+" << endl;
cout << endl;
- cout << "create tableset <tableset>" << endl;
- cout << "-------------------------" << endl;
+ cout << "threadinfo [ db | adm | log]" << endl;
cout << endl;
- cout << " Create the specified tableset as defined in the tableset description." << endl;
+ cout << " Without optinal argument, the threadinfo command lists all configured and current active threads in the database system." << endl;
+ cout << " The information is given for all three thread pools ( db, adm and log )." << endl;
cout << endl;
-
-}
-
-void helpStart()
-{
+ cout << " More detailed information for each thread pool is given, if a pool id is specified with the command." << endl;
+ cout << " Valid pools id's are db, adm or log." << endl;
cout << endl;
- cout << "start tableset <tableset>" << endl;
- cout << "-------------------------" << endl;
+
+ cout << "abort db thread <tid>" << endl;
cout << endl;
- cout << " Start the specified tableset on the configured primary node." << endl;
+ cout << " Aborting the actual running query of an active db thread" << endl;
cout << endl;
+
}
-void helpCopy()
+void helpBasic()
{
-
+
cout << endl;
- cout << "copy tableset <tableset>" << endl;
- cout << "------------------------" << endl;
+ cout << "+===============================+" << endl;
+ cout << "| Basic tableset administration |" << endl;
+ cout << "+===============================+" << endl;
cout << endl;
- cout << " Copy the specified tableset from primary to secondary node." << endl;
+
cout << endl;
-}
-
-void helpSwitch()
-{
+ cout << "list tableset" << endl;
cout << endl;
- cout << "switch tableset <tableset>" << endl;
- cout << "switch mediator for <tableset>" << endl;
- cout << "switch secondary for <tableset>" << endl;
- cout << "------------------------------" << endl;
+ cout << " List all known tablesets on the node." << endl;
+ cout << " The current status and assigned hosts ( mediator, primary, secondary) are also indicated." << endl;
+ cout << endl;
+ cout << "define tableset <tableset> <attr1=val1> <attr2=val2> ..." << endl;
cout << endl;
- cout << " Switch the specified tableset to secondary node." << endl;
+ cout << " Define a new tableset. The following attributes must be specified:"<< endl;
+ cout << endl;
+ cout << " tsroot - Root directory of the database system and control files." << endl;
+ cout << " tsticket - Name of the online backup tableset ticket." << endl;
+ cout << " syssize - Size of the system space in number of pages." << endl;
+ cout << " tmpsize - Size of the tempory space in number of pages." << endl;
+ cout << " logname - Prefix of the configured redolog files." << endl;
+ cout << " logsize - Size of a redolog file in bytes." << endl;
+ cout << " lognum - Number of configured redolog files." << endl;
+ cout << " primary - Name of the primary host." << endl;
+ cout << " secondary - Name of the secondary host." << endl;
+ cout << endl;
+ cout << " For a defintion statement the attributes syssize, tmpsize logsize and logname attributes are specified as integer values." << endl;
+ cout << " The attributes logfilename, meiator, primary and secondary are specified as string values." << endl;
+ cout << endl;
+ cout << " Sample:" << endl;
+ cout << endl;
+ cout << " define tableset ts1 tsroot='/cego/ts1' syssize=100 tmpsize=100 logname='/cego/ts1/redolog'" << endl;
+ cout << " logsize=100000 lognum=3 primary='geek' secondary='sam';" << endl;
cout << endl;
-}
-void helpStop()
-{
-
+
+ cout << endl;
+ cout << "create tableset <tableset>" << endl;
+ cout << endl;
+ cout << " Creates the specified tableset as defined in the tableset description." << endl;
+ cout << endl;
+ cout << "start tableset <tableset>" << endl;
+ cout << endl;
+ cout << " Starts the specified tableset on the configured primary node." << endl;
cout << endl;
cout << "stop tableset <tableset>" << endl;
- cout << "------------------------" << endl;
cout << endl;
- cout << " Stop the specified tableset on the primary node." << endl;
+ cout << " Stops the specified tableset on the primary node." << endl;
cout << endl;
-}
-
-void helpDrop()
-{
+ cout << "remove tableset <tableset>" << endl;
+ cout << endl;
+ cout << " Removes the tableset defintion for the specified tableset." << endl;
cout << endl;
cout << "drop tableset <tableset>" << endl;
- cout << "------------------------" << endl;
cout << endl;
- cout << " Drop the specified tableset." << endl;
+ cout << " Drops the specified tableset." << endl;
cout << endl;
-}
-
-void helpRemove(const Chain& arg)
-{
-
- if ( arg == Chain("tableset"))
- {
- cout << endl;
- cout << "remove tableset <tableset>" << endl;
- cout << "------------------------" << endl;
- cout << endl;
- cout << " Remove the tableset defintion for the specified tableset." << endl;
- cout << endl;
- }
- else if ( arg == Chain("archlog"))
- {
- cout << endl;
- cout << "remove archlog <archlog> from <tableset>" << endl;
- cout << "----------------------------------------" << endl;
- cout << " Removes the specified archlog destination from the given tableset" << endl;
- cout << endl;
- }
- else if ( arg == Chain("role"))
- {
- cout << endl;
- cout << "remove role <role> from user <user> for <tableset>" << endl;
- cout << "--------------------------------------------------" << endl;
- cout << " Removes the specified user role from tableset user" << endl;
- cout << endl;
- }
- else
- {
- cout << "Available help options:" << endl;
- cout << endl;
- cout << " remove tableset" << endl;
- cout << " remove archlog" << endl;
- cout << " remove role" << endl;
- cout << endl;
- }
-}
-
-void helpSync(const Chain& arg)
-{
-
+ cout << "list datafile for <tableset>" << endl;
cout << endl;
+ cout << " List all configured datafiles for the given tableset" << endl;
+ cout << endl;
+ cout << endl;
+ cout << "add datafile '<filename>' size <numpages> to <tableset>" << endl;
+ cout << endl;
+ cout << " Adds a new datafile with the specified size to the given tableset" << endl;
+ cout << endl;
cout << "sync tableset <tableset> [ with '<command>' ]" << endl;
- cout << "------------------------------------" << endl;
cout << endl;
cout << " Writes a checkpoint for the given tableset." << endl;
cout << " The optional given command is executed, during the tableset is synchronized and locked." << endl;
cout << " So this can be used to create a consistent snapshot for a tableset ( e.g. with ZFS snapshot commands )" << endl;
cout << endl;
-
-}
-
-void helpImport(const Chain& arg)
-{
- if ( arg == Chain("table"))
- {
- cout << endl;
- cout << "[ xml | binary ] import table <tablename> to <tableset> from '<filename>'" << endl;
- cout << "--------------------------------------------------------" << endl;
- cout << endl;
- cout << " Import of a single table." << endl;
- cout << endl;
- }
- else if ( arg == Chain("tableset"))
- {
- cout << endl;
- cout << "[ xml | binary ] import tableset [ structure ] <tableset> from '<filename>'" << endl;
- cout << "------------------------------------------" << endl;
- cout << endl;
- cout << " Import of a tableset to a file." << endl;
- cout << endl;
- }
- else
- {
- cout << "Available help options:" << endl;
- cout << endl;
- cout << " import table" << endl;
- cout << " import tableset" << endl;
- }
-}
-
-void helpExport(const Chain& arg)
-{
-
- if ( arg == Chain("table"))
- {
- cout << endl;
- cout << "[ xml | binary ] export table <tablename> from <tableset> to '<filename>'" << endl;
- cout << "--------------------------------------------------------" << endl;
- cout << endl;
- cout << " Export of a single table." << endl;
- cout << endl;
- }
- else if ( arg == Chain("tableset"))
- {
- cout << endl;
- cout << "[ xml | binary ] export tableset [ structure ] <tableset> to '<filename>'" << endl;
- cout << "------------------------------------------" << endl;
- cout << endl;
- cout << " Export of a tableset to a file." << endl;
- cout << endl;
- }
- else
- {
- cout << "Available help options:" << endl;
- cout << endl;
- cout << " export table" << endl;
- cout << " export tableset" << endl;
- }
+ cout << "check tableset <tableset>" << endl;
+ cout << endl;
+ cout << " Perform a consistency check for the given tableset" << endl;
+ cout << endl;
}
-void helpAdd(const Chain& arg)
+void helpAdvanced()
{
- if ( arg == Chain("user"))
- {
- cout << endl;
- cout << "add user <userid> identified by '<passwd>' to <tableset>" << endl;
- cout << "--------------------------------------------------------" << endl;
- cout << endl;
- cout << " Starts online backup mode for the given tableset" << endl;
- cout << " During backup mode, any datafile changes are detected" << endl;
- cout << " If any recovery is required, the original page is restored during logfile recovery" << endl;
- cout << endl;
- }
- else if ( arg == Chain("datafile"))
- {
- cout << endl;
- cout << "add datafile '<filename>' size <numpages> to <tableset>" << endl;
- cout << "--------------------------------------------------------" << endl;
- cout << endl;
- }
- else if ( arg == Chain("archlog"))
- {
- cout << endl;
- cout << "add archlog <archid> path '<archpath>' to <tableset>" << endl;
- cout << "----------------------------------------------------" << endl;
- cout << endl;
- }
- else if ( arg == Chain("archlog"))
- {
- cout << endl;
- cout << "add role <role> to user <user> for <tableset>" << endl;
- cout << "---------------------------------------------" << endl;
- cout << " Adds the specified role to tableset user" << endl;
- cout << endl;
- cout << " Valid roles are" << endl;
- cout << endl;
- cout << " ALL - All operations allowed" << endl;
- cout << " READOBJ - Read operations are allowed" << endl;
- cout << " WRITEOBJ - Write operations are allowed" << endl;
- cout << " CREATEOBJ - Object creation is allowed" << endl;
- cout << " DROPOBJ - Object drop is allowed" << endl;
- cout << " EXECPROC - Execution of strored procedures is allowed" << endl;
- cout << endl;
- }
- else
- {
- cout << "Available help options:" << endl;
- cout << endl;
- cout << " add user" << endl;
- cout << " add datafile" << endl;
- cout << " add archlog" << endl;
- cout << " add role" << endl;
- }
+ cout << endl;
+ cout << "+==================================+" << endl;
+ cout << "| Advanced tableset administration |" << endl;
+ cout << "+==================================+" << endl;
+ cout << endl;
+ cout << "list node" << endl;
+ cout << " List all compute nodes known in the current system" << endl;
+ cout << endl;
+ cout << "list session" << endl;
+ cout << " List all established database connection for distributed queries" << endl;
+ cout << endl;
+ cout << "list copy" << endl;
+ cout << " List all executed table set copied" << endl;
+ cout << endl;
+ cout << "copy tableset <tableset>" << endl;
+ cout << " Copy the specified tableset from primary to secondary node." << endl;
+ cout << endl;
+ cout << "switch tableset <tableset>" << endl;
+ cout << " Switch the specified tableset to secondary node." << endl;
+ cout << "switch mediator for <tableset>" << endl;
+ cout << " Switch the mediator for specified tableset to secondary node." << endl;
+ cout << "switch secondary for <tableset>" << endl;
+ cout << " Switch the secondary for specified tableset to mediator node." << endl;
+ cout << endl;
+ cout << "relocate secondary for <tableset> to '<hostname>'" << endl;
+ cout << " Relocates the secondary role to the given hostname." << endl;
+ cout << "relocate mediator for <tableset> to '<hostname>'" << endl;
+ cout << " Relocates the mediator role to the given hostname." << endl;
+ cout << endl;
}
-void helpPasswd(const Chain& arg)
+void helpExport()
{
+
cout << endl;
- cout << "passwd user <userid> identified by '<passwd>' to <tableset>" << endl;
- cout << "-----------------------------------------------------------" << endl;
+ cout << "+=================+" << endl;
+ cout << "| Tableset export |" << endl;
+ cout << "+=================+" << endl;
cout << endl;
- cout << " Set up the user passwd to the given value" << endl;
+ cout << "[ xml | binary | plain ] export table <tablename> from <tableset> to '<filename>'" << endl;
+ cout << endl;
+ cout << " Export of a single table from the given tableset to the given file." << endl;
+ cout << " Either xml, binary or plain export mode can be used. If no mode is specified, xml mode is used." << endl;
+ cout << endl;
+ cout << "[ xml | binary | plain ] export tableset [ structure ] <tableset> to '<filename>'" << endl;
cout << endl;
+ cout << " Export of the complete given tableset to a file." << endl;
+ cout << " This includes all defined user objects of the tableset." << endl;
+ cout << " If the structure option is given, no table content is exported." << endl;
+ cout << " Either xml, binary or plain export mode can be used. If no mode is specified, xml mode is used." << endl;
+ cout << endl;
+
}
-void helpAbort(const Chain& arg)
+void helpImport()
{
cout << endl;
- cout << "abort db thread <tid>" << endl;
- cout << "---------------------" << endl;
+ cout << "+=================+" << endl;
+ cout << "| Tableset import |" << endl;
+ cout << "+=================+" << endl;
cout << endl;
- cout << " Aborting the actual running query of an active db thread" << endl;
+ cout << "[ xml | binary | plain ] import table <tablename> to <tableset> from '<filename>'" << endl;
+ cout << endl;
+ cout << " Import of a single table from the given file to the given tableset ." << endl;
+ cout << " Either xml, binary or plain export mode can be used. If no mode is specified, xml mode is used." << endl;
cout << endl;
+ cout << "[ xml | binary | plain ] import tableset [ structure ] <tableset> from '<filename>'" << endl;
+ cout << endl;
+ cout << " Import of a tableset to a file. For consistency reasons, the name of the given tableset must match with the tableset in the import file." << endl;
+ cout << " If the structure option is given, no table content is imported." << endl;
+ cout << " Either xml, binary or plain export mode can be used. If no mode is specified, xml mode is used." << endl;
+ cout << endl;
+
}
-void helpBegin()
+void helpBackup()
{
+
+ cout << endl;
+ cout << "+=================+" << endl;
+ cout << "| Tableset backup |" << endl;
+ cout << "+=================+" << endl;
cout << endl;
cout << "begin backup for <tableset>" << endl;
- cout << "------------------------" << endl;
cout << endl;
cout << " Starts online backup mode for the given tableset" << endl;
cout << " During backup mode, any datafile changes are detected" << endl;
cout << " If any recovery is required, the original page is restored during logfile recovery" << endl;
cout << endl;
-}
-
-void helpEnd()
-{
- cout << endl;
cout << "end backup for <tableset>" << endl;
- cout << "------------------------" << endl;
cout << endl;
cout << " Finishes online backup mode for the given tableset" << endl;
cout << " Normally this is done, after backup has been finished for all datafiles." << endl;
@@ -1189,9 +977,13 @@
void helpRecover()
{
+
+ cout << endl;
+ cout << "+===================+" << endl;
+ cout << "| Tableset recovery |" << endl;
+ cout << "+===================+" << endl;
cout << endl;
cout << "recover tableset <tableset> [ to <point in time>]" << endl;
- cout << "-------------------------------------------------" << endl;
cout << endl;
cout << " Execute an up-to-crash or point in time recover for the given tableset." << endl;
cout << " The corresponding tableset must be in status offline perform this action." << endl;
@@ -1208,46 +1000,65 @@
cout << endl;
}
-void helpEnable()
+void helpArchLog()
{
+
+ cout << endl;
+ cout << "+============================+" << endl;
+ cout << "| Archive log administration |" << endl;
+ cout << "+============================+" << endl;
+ cout << endl;
+ cout << "list archlog" << endl;
+ cout << endl;
+ cout << " List all configured archive log locations for the given tableset" << endl;
cout << endl;
cout << "enable archlog for <tableset>" << endl;
- cout << "-----------------------------" << endl;
cout << endl;
cout << " Enables archive log mode for the given tableset." << endl;
cout << " At least one valid archive log location must be defined to enable archive log mode" << endl;
cout << endl;
-}
-
-
-void helpDisable()
-{
- cout << endl;
cout << "disable archlog for <tableset>" << endl;
- cout << "------------------------------" << endl;
cout << endl;
cout << " Disables archive log mode for the given tableset." << endl;
cout << endl;
-}
-
-void helpRelocate()
-{
+ cout << "add archlog <archid> path '<archpath>' to <tableset>" << endl;
cout << endl;
- cout << "relocate secondary for <tableset> to '<hostname>'" << endl;
- cout << "relocate mediator for <tableset> to '<hostname>'" << endl;
- cout << "---------------------------------------------" << endl;
+ cout << " Adds the specified archlog destination to the given tableset" << endl;
cout << endl;
- cout << " Relocates the secondary or mediaotr role to the given hostname." << endl;
+ cout << "remove archlog <archlog> from <tableset>" << endl;
+ cout << " Removes the specified archlog destination from the given tableset" << endl;
cout << endl;
+
}
-void helpCheck()
+void helpLock()
{
+
cout << endl;
- cout << "check tableset <tableset>" << endl;
- cout << "---------------------------------------------" << endl;
+ cout << "+=====================+" << endl;
+ cout << "| Lock administration |" << endl;
+ cout << "+=====================+" << endl;
cout << endl;
- cout << " Perform a consistency check for the given tableset" << endl;
+ cout << "lockstat" << endl;
+ cout << endl;
+ cout << " List a statistics of all locks" << endl;
+ cout << endl;
+ cout << "list < rec | rbrec | sysrec | tp | sp | dp | ix | rb| df | bp | ts > lock" << endl;
+ cout << endl;
+ cout << " List statistics for specific lock types" << endl;
+ cout << " Lock type are" << endl;
+ cout << " rec - data table record locks" << endl;
+ cout << " rbrec - rollback table record locks" << endl;
+ cout << " sysrec - system table record locks" << endl;
+ cout << " tp - thread pool locks" << endl;
+ cout << " sp - system page locks" << endl;
+ cout << " dp - data page locks" << endl;
+ cout << " ix - index page locks" << endl;
+ cout << " rb - rollback page locks" << endl;
+ cout << " df - data file locks" << endl;
+ cout << " bp - buffer pool locks" << endl;
+ cout << " ts - table set locks" << endl;
cout << endl;
}
+
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdminHandler.cc
^
|
@@ -1580,10 +1580,9 @@
}
-CegoAdminHandler::ResultType CegoAdminHandler::medUserTrace(const Chain& tableSet, const Chain& user, bool isOn)
+CegoAdminHandler::ResultType CegoAdminHandler::medUserTrace(const Chain& user, bool isOn)
{
Element* pRoot = new Element(XML_FRAME_ELEMENT);
- pRoot->setAttribute(XML_TABLESET_ATTR, tableSet);
pRoot->setAttribute(XML_NAME_ATTR, user);
if ( isOn )
pRoot->setAttribute(XML_TRACE_ATTR, XML_ON_VALUE);
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoAdminHandler.h
^
|
@@ -312,8 +312,7 @@
ResultType medAddPermission(const Chain& role, const Chain& permid, const Chain& tableSet, const Chain& filter, const Chain& perm);
ResultType medRemovePermission(const Chain& role, const Chain& permid);
-
- ResultType medUserTrace(const Chain& tableSet, const Chain& user, bool isOn);
+ ResultType medUserTrace(const Chain& user, bool isOn);
ResultType medBeginBackup(const Chain& tableSet);
ResultType medEndBackup(const Chain& tableSet, bool keepTicket);
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoBlowTab.cc
^
|
@@ -66,9 +66,10 @@
--user=<user>/<password>\n\
[ --server=<host>]\n\
[ --port=<port> ]\n\
- [ --attrformat=<format> ] [ --condformat=<format> ] [ --updformat=<format> ] [ --blobop=<format> ] \n\
+ [ --iset=<insert format> ] [ --pset=<proc format> ] [ --dcond=<delete condition> ] [ --uset=<update format> ] [ --ucond=<update condition>] [ --blobop=<format> ] \n\
[ --count=<count> ]\n\
- [ --table=<tablename> ]\n\
+ [ --proc=<tablename> ]\n\
+ [ --table=<procname> ]\n\
[ --interval<report-interval> ]\n\
[ --simulate ]\n\
[ --append ] [ --dotransaction ] [ --version ] [ --help ]"
@@ -91,12 +92,17 @@
longOpt.addOpt("mode");
longOpt.addOpt("tableset");
longOpt.addOpt("user");
- longOpt.addOpt("attrformat");
- longOpt.addOpt("condformat");
- longOpt.addOpt("updformat");
+
+ longOpt.addOpt("iset");
+ longOpt.addOpt("pset");
+ longOpt.addOpt("dcond");
+ longOpt.addOpt("uset");
+ longOpt.addOpt("ucond");
+
longOpt.addOpt("blobop");
longOpt.addOpt("count");
longOpt.addOpt("table");
+ longOpt.addOpt("proc");
longOpt.addOpt("interval", Chain(DEFAULTINTERVAL));
longOpt.addOpt("append");
longOpt.addOpt("dotransaction");
@@ -146,9 +152,14 @@
Chain serverName = longOpt.getOptValue("server");
int dataPort = longOpt.getOptValue("port").asInteger();
- Chain attrFormat = longOpt.getOptValue("attrformat");
- Chain condFormat = longOpt.getOptValue("condformat");
- Chain updFormat = longOpt.getOptValue("updformat");
+ Chain insertSet = longOpt.getOptValue("iset");
+
+ Chain deleteCond = longOpt.getOptValue("dcond");
+
+ Chain procSet = longOpt.getOptValue("pset");
+
+ Chain updateSet = longOpt.getOptValue("uset");
+ Chain updateCond = longOpt.getOptValue("ucond");
bool appendMode=false;
if ( longOpt.isSet("append") )
@@ -172,6 +183,7 @@
authTok.nextToken(password);
Chain tableName = longOpt.getOptValue("table");
+ Chain procName = longOpt.getOptValue("proc");
Chain tableSet = longOpt.getOptValue("tableset");
int count = longOpt.getOptValue("count").asInteger();
@@ -250,12 +262,6 @@
dispatchCmd(pSH, cmd);
}
-
- if ( transactionMode )
- {
- cmd = "start transaction;";
- dispatchCmd(pSH, cmd);
- }
Timer tim1(6,3);
Timer tim2(6,3);
@@ -264,8 +270,15 @@
tim2.start();
+ if ( transactionMode )
+ {
+ cmd = "start transaction;";
+ dispatchCmd(pSH, cmd);
+ }
+
for ( int i=1; i<=count; i++ )
{
+
Operation actOp;
if ( op == INSERT_OP )
@@ -296,7 +309,7 @@
case INSERT_OP:
{
cmd = "insert into " + tableName + " values (";
- Tokenizer tok(attrFormat, Chain(","));
+ Tokenizer tok(insertSet, Chain(","));
Chain col;
bool moreToken = tok.nextToken(col);
while ( moreToken )
@@ -354,6 +367,10 @@
}
cmd += Chain("[") + Chain(blob.getFileId()) + Chain(",") + Chain(blob.getPageId()) + Chain("]");
}
+ else
+ {
+ throw Exception(EXLOC, "Invalid insert format");
+ }
moreToken = tok.nextToken(col);
if ( moreToken )
@@ -365,39 +382,48 @@
case DELETE_OP:
{
- cmd = "delete from " + tableName + " where ";
- Tokenizer tok1(condFormat, Chain(","));
+ cmd = "delete from " + tableName;
+ Tokenizer tok1(deleteCond, Chain(","));
Chain col;
- bool moreToken = tok1.nextToken(col);
- Tokenizer tok2(col, Chain(":"));
- Chain attr, type, arg;
- tok2.nextToken(attr);
- tok2.nextToken(type);
- tok2.nextToken(arg);
-
- cmd += attr + Chain("=");
-
- if ( type[0] == 'i' )
- {
- int l = arg.asInteger();
- cmd += Chain(rand() % l);
- }
- else if ( type[0] == 's' )
+ bool moreToken = tok1.nextToken(col);
+ if ( moreToken )
{
- int l = rand() % arg.asInteger();
- if ( l == 0 )
- l = arg.asInteger();
+ cmd += Chain(" where ");
+ Tokenizer tok2(col, Chain(":"));
+ Chain attr, type, arg;
+ tok2.nextToken(attr);
+
+ tok2.nextToken(type);
+ tok2.nextToken(arg);
+
+ cmd += attr + Chain("=");
- cmd += Chain("'");
- for ( int j=0; j<l; j++ )
+ if ( type[0] == 'i' )
{
- cmd += Chain((char)(65 + (rand()%26)));
- }
- cmd += Chain("'");
- }
- else if ( type[0] == 'c' )
- {
- cmd += arg;
+ int l = arg.asInteger();
+ cmd += Chain(rand() % l);
+ }
+ else if ( type[0] == 's' )
+ {
+ int l = rand() % arg.asInteger();
+ if ( l == 0 )
+ l = arg.asInteger();
+
+ cmd += Chain("'");
+ for ( int j=0; j<l; j++ )
+ {
+ cmd += Chain((char)(65 + (rand()%26)));
+ }
+ cmd += Chain("'");
+ }
+ else if ( type[0] == 'c' )
+ {
+ cmd += arg;
+ }
+ else
+ {
+ throw Exception(EXLOC, "Invalid condition format");
+ }
}
cmd += Chain(";");
@@ -405,8 +431,8 @@
}
case PROC_OP:
{
- cmd = "call " + tableName + "(";
- Tokenizer tok(attrFormat, Chain(","));
+ cmd = "call " + procName + "(";
+ Tokenizer tok(procSet, Chain(","));
Chain col;
bool moreToken = tok.nextToken(col);
while ( moreToken )
@@ -449,6 +475,10 @@
tok.nextToken(arg);
cmd += arg;
}
+ else
+ {
+ throw Exception(EXLOC, "Invalid proc format");
+ }
moreToken = tok.nextToken(col);
if ( moreToken )
@@ -461,7 +491,7 @@
{
cmd = "update " + tableName + " set ";
- Tokenizer tokA(updFormat, Chain(","));
+ Tokenizer tokA(updateSet, Chain(","));
Chain col;
bool moreToken = tokA.nextToken(col);
@@ -495,6 +525,10 @@
}
cmd += Chain("'");
}
+ else
+ {
+ throw Exception(EXLOC, "Invalid update format");
+ }
moreToken = tokA.nextToken(col);
if ( moreToken )
@@ -504,7 +538,7 @@
cmd += " where ";
- Tokenizer tokB(condFormat, Chain(","));
+ Tokenizer tokB(updateCond, Chain(","));
moreToken = tokB.nextToken(col);
while ( moreToken )
@@ -629,9 +663,24 @@
{
if ( i % interval == 0)
{
+
+ if ( transactionMode )
+ {
+ cmd = "commit;";
+ dispatchCmd(pSH, cmd);
+ }
+
tim1.stop();
cout << interval << " operations : " << tim1 << endl;
tim1.start();
+
+ if ( transactionMode )
+ {
+ cmd = "start transaction;";
+ dispatchCmd(pSH, cmd);
+ }
+
+
}
}
}
@@ -641,7 +690,7 @@
cmd = "commit;";
dispatchCmd(pSH, cmd);
}
-
+
if ( pSH )
{
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoClient.cc
^
|
@@ -760,7 +760,10 @@
exitCode = 0;
if ( cmd.cutTrailing(" ;") == Chain("quit") )
+ {
+ msg = Chain("Goodbye");
return false;
+ }
Tokenizer tok(cmd, Chain(" ;"));
Chain flowTok;
@@ -804,7 +807,7 @@
{
pSH->getMsg(msg);
long affCount = pSH->getAffected();
-
+
// if ( msg == Chain("Goodbye") )
// return true;
@@ -1503,7 +1506,8 @@
if ( _doAbort )
{
- cout << "Aborting query .." << endl;
+ cout << endl << "Aborting query .." << endl;
+
Net n ( NETMNG_MSG_BUFLEN, NETMNG_SIZEBUFLEN );
NetHandler* pN;
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoDbThread.cc
^
|
@@ -98,8 +98,8 @@
int *pTS = _loadList.First();
if ( pTS )
{
- _loadList.Remove(*pTS);
int ts = *pTS;
+ _loadList.Remove(*pTS);
_pPool->V(_idx);
loadObjects(ts);
}
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoDefs.h
^
|
@@ -40,7 +40,7 @@
#endif
#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.11.4"
+#define CEGO_VERSION "2.11.7"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2011 by Bjoern Lemke. All rights reserved"
/*******************************/
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoDistManager.cc
^
|
@@ -238,7 +238,7 @@
if ( cplsn == maxlsn || ( cplsn == 0 && maxlsn == 0 ) )
{
_pDBMng->log(_modId, Logger::NOTICE, Chain("Tableset ") + tableSet + Chain(" in sync at lsn=") + Chain(cplsn) + Chain(", no recovery required"));
- rollbackOpenTransaction(tabSetId);
+ finishOpenTransaction(tabSetId);
}
else if ( cplsn < maxlsn )
{
@@ -263,7 +263,7 @@
throw Exception(EXLOC, Chain("Incomplete recovery"));
}
- rollbackOpenTransaction(tabSetId);
+ finishOpenTransaction(tabSetId);
// set lsn to last lsn in log
maxlsn = writeCheckPoint(tableSet, true, false);
@@ -858,6 +858,7 @@
long numCommitOp=0;
SetT<Chain> tableList;
+
getTransactionAffectedTables(tabSetId, tableList);
Chain *pTable;
@@ -1457,7 +1458,7 @@
vo.encode(buf);
lr.setData(buf);
lr.setDataLen(vo.getEntrySize());
- lr.setTID(0);
+ // lr.setTID(0);
logIt(vo.getTabSetId(), lr);
free(buf);
@@ -1517,7 +1518,7 @@
po.encode(buf);
lr.setData(buf);
lr.setDataLen(po.getEntrySize());
- lr.setTID(0);
+ // lr.setTID(0);
logIt(po.getTabSetId(), lr);
free(buf);
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoFunction.cc
^
|
@@ -1121,11 +1121,13 @@
case CegoFunction::NEXTCOUNT:
{
funcString = Chain("nextcount");
+ argString = _counterId;
break;
}
case CegoFunction::SETCOUNT:
{
funcString = Chain("setcount");
+ argString = _counterId + Chain(",") + argString;
break;
}
case CegoFunction::USERDEFINED:
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoLogReader.cc
^
|
@@ -1,12 +1,12 @@
///////////////////////////////////////////////////////////////////////////////
//
// CegoLogReader.cc
-// ------------
+// ----------------
// Cego log reading and printing
//
// Design and Implementation by Bjoern Lemke
//
-// (C)opyright 2000-2010 Bjoern Lemke
+// (C)opyright 2000-2011 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
@@ -140,6 +140,7 @@
cout << "LSN=" << lr.getLSN() << ":";
cout << "TS=" << dt.asChain() << ":";
+ cout << "TID=" << lr.getTID() << ":";
if ( lr.getObjName().length() > 0 )
{
@@ -309,29 +310,38 @@
cout << "DELETE:" << endl;
cout << "--- Log Data Start ---" << endl;
+
+ CegoPredDesc *pPred = 0;
+ CegoQueryHelper qh;
+ Chain tableAlias;
+
+ qh.decodeDelRec(tableAlias, pPred, lr.getData(), lr.getDataLen(), 0);
+
+ cout << " TableAlias=" << tableAlias << endl;
- if ( lr.getDataLen() > 0 )
+ if ( pPred )
{
- CegoPredDesc *pPred = new CegoPredDesc ( lr.getData(), 0);
- cout << "Predicate -> [" << pPred->toChain() << "]"<< endl;
+ cout << "where " << pPred->toChain() << endl;
}
cout << "--- Log Data End ---" << endl;
break;
}
+ case CegoLogRecord::LOGREC_DELETE_COMMIT:
+ {
+ cout << "DELETE_COMMIT:" << endl;
+ cout << "--- No log data ---" << endl;
+ break;
+ }
case CegoLogRecord::LOGREC_UPDATE:
{
- cout << "UPDATE:" << endl;
-
+ cout << "UPDATE:" << endl;
cout << "--- Log Data Start ---" << endl;
-
-
Chain tableAlias;
CegoPredDesc *pPred = 0;
ListT<CegoField> updList;
ListT<CegoExpr*> exprList;
-
qh.decodeUpdRec(tableAlias,
pPred,
@@ -355,6 +365,12 @@
break;
}
+ case CegoLogRecord::LOGREC_UPDATE_COMMIT:
+ {
+ cout << "UPDATE_COMMIT:" << endl;
+ cout << "--- No log data ---" << endl;
+ break;
+ }
case CegoLogRecord::LOGREC_BEGIN:
{
cout << "BEGIN:" << endl;
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoLogRecord.cc
^
|
@@ -251,7 +251,6 @@
memcpy( &_logAction, lrp, sizeof(CegoLogRecord::LogAction));
lrp = lrp + sizeof(CegoLogRecord::LogAction);
-
if ( _logAction == CegoLogRecord::LOGREC_BUPAGE )
{
@@ -348,7 +347,7 @@
Chain s;
- s = Chain("[") + getObjName() + Chain(",") + Chain(getTID()) + Chain(",");
+ s = Chain("[") + getObjName() + Chain(",") + Chain(_tid) + Chain(",");
switch (_logAction)
{
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoLogRecord.h
^
|
@@ -50,8 +50,10 @@
LOGREC_ALTER,
LOGREC_RENAME,
LOGREC_INSERT,
- LOGREC_DELETE,
+ LOGREC_DELETE,
+ LOGREC_DELETE_COMMIT,
LOGREC_UPDATE,
+ LOGREC_UPDATE_COMMIT,
LOGREC_BEGIN,
LOGREC_COMMIT,
LOGREC_ABORT,
@@ -65,15 +67,18 @@
CegoLogRecord();
~CegoLogRecord();
+ // log sequence number
long getLSN() const;
void setLSN(long lsn);
- int getTID() const;
- void setTID(int tid);
-
+ // log timestamp
int getTS() const;
void setTS(int ts);
+ // tid
+ int getTID() const;
+ void setTID(int tid);
+
void setObjectInfo(const Chain& objName, CegoObject::ObjectType type);
const Chain& getObjName() const;
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoPredDesc.cc
^
|
@@ -470,10 +470,9 @@
else if ( _pC->getCondType() == CegoCondDesc::PRED )
return _pC->Left()->hasOrCond();
}
- else
- {
- return false;
- }
+
+ return false;
+
}
const Chain& CegoPredDesc::getPattern() const
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoProcAssignStmt.cc
^
|
@@ -82,7 +82,6 @@
setValue(_paramName, _pExpr->evalFieldValue());
break;
}
-
}
return NONE_EXCEP;
}
@@ -95,7 +94,7 @@
case CegoProcAssignStmt::EXPR2NULL:
{
Chain s;
- s = _pExpr->toChain();
+ s = indent + _pExpr->toChain();
return s;
}
case CegoProcAssignStmt::EXPR2PARAM:
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoQueryHelper.cc
^
|
@@ -1617,8 +1617,7 @@
CegoPredDesc* &pPred,
char* pBuf, int buflen,
CegoDistManager *pGTM)
-{
-
+{
int aliasLen;
memcpy(&aliasLen, pBuf, sizeof(int));
pBuf += sizeof(int);
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoRecoveryManager.cc
^
|
@@ -153,7 +153,7 @@
catch ( Exception e )
{
// Chain msg = e.getBaseMsg();
-
+
_pDBMng->setRecoveryMode(tabSetId, CegoDatabaseManager::OFF );
throw Exception(EXLOC, Chain("Recovery failed"), e);
}
@@ -398,11 +398,11 @@
_pDBMng->setLogFile(tabSetId, sourceFileName, true);
_pDBMng->setLSN(tabSetId, cplsn + 1);
-
- // recover offline logs
+
long lsn;
+
pitReached = recoverCurrentTransactionLog(tabSetId, pit, lsn, ts);
-
+
if ( lsn > 0 )
{
cplsn = lsn;
@@ -538,6 +538,7 @@
lsn=logRec.getLSN();
ts=logRec.getTS();
+ int tid=logRec.getTID();
_pDBMng->log(_modId, Logger::DEBUG, Chain("Recovering lsn ") + Chain(logRec.getLSN()) + Chain(" ..."));
@@ -613,16 +614,18 @@
}
case CegoLogRecord::LOGREC_BEGIN:
{
- _pGTM->beginTransaction(tabSetId);
+ // _pGTM->beginTransaction(tabSetId);
break;
}
case CegoLogRecord::LOGREC_COMMIT:
{
+ _pGTM->setTID(tabSetId, tid);
_pGTM->commitTransaction(tabSetId);
break;
}
case CegoLogRecord::LOGREC_ABORT:
{
+ _pGTM->setTID(tabSetId, tid);
_pGTM->rollbackTransaction(tabSetId);
break;
}
@@ -640,12 +643,12 @@
}
ListT<CegoField> fvl = oe.getSchema();
- int tid = 0;
+ int rectid = 0;
int tastep = 0;
CegoTupleState ts;
ListT<CegoBlob> blobList;
CegoQueryHelper qh;
- qh.decodeFVL(fvl, blobList, logRec.getData(), logRec.getDataLen(), tid, tastep, ts);
+ qh.decodeFVL(fvl, blobList, logRec.getData(), logRec.getDataLen(), rectid, tastep, ts);
CegoBlob *pBlob = blobList.First();
CegoField *pF = fvl.First();
@@ -678,31 +681,56 @@
bool lastPage = true;
CegoDataPointer dp;
-
+
+ _pGTM->setTID(tabSetId, tid);
_pGTM->insertDataTable(oe, fvl, dp, lastPage);
break;
}
case CegoLogRecord::LOGREC_DELETE:
{
-
- CegoTableObject oe;
- _pGTM->getObject(tabSetId, logRec.getObjName(), CegoObject::TABLE, oe);
-
- CegoPredDesc *pPred = 0;
+
+ CegoPredDesc *pPred = 0;
CegoQueryHelper qh;
Chain tableAlias;
+
qh.decodeDelRec(tableAlias, pPred, logRec.getData(), logRec.getDataLen(), _pGTM);
- if ( invalidateSet.Find(logRec.getObjName()) == 0 )
- {
- _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
- _pGTM->invalidateIndexForTable(tabSetId, logRec.getObjName());
- invalidateSet.Insert(logRec.getObjName());
- }
+ _delRecList.Insert(DeleteRecord(tid, tableAlias, pPred));
- _pGTM->deleteDataTable(oe, pPred, 0);
+ break;
+ }
+ case CegoLogRecord::LOGREC_DELETE_COMMIT:
+ {
+
+ DeleteRecord* delRecord = _delRecList.Find(DeleteRecord(tid));
+ if ( delRecord )
+ {
+
+ CegoTableObject oe;
+ _pGTM->getObject(tabSetId, logRec.getObjName(), CegoObject::TABLE, oe);
+
+ if ( invalidateSet.Find(logRec.getObjName()) == 0 )
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
+ _pGTM->invalidateIndexForTable(tabSetId, logRec.getObjName());
+ invalidateSet.Insert(logRec.getObjName());
+ }
+
+ _pGTM->setTID(tabSetId, tid);
+ _pGTM->deleteDataTable(oe, delRecord->getPred(), 0);
+
+ delRecord->clean();
+ _delRecList.Remove(DeleteRecord(tid));
+
+
+ }
+ else
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Cannot find delete record for transaction ") + Chain(tid));
+
+ }
break;
}
case CegoLogRecord::LOGREC_UPDATE:
@@ -716,14 +744,39 @@
Chain tableAlias;
qh.decodeUpdRec(tableAlias, pPred, updList, exprList, logRec.getData(), logRec.getDataLen(), _pGTM);
- if ( invalidateSet.Find(logRec.getObjName()) == 0 )
+ _updRecList.Insert(UpdateRecord(tid, tableAlias, pPred, updList, exprList));
+
+ break;
+ }
+ case CegoLogRecord::LOGREC_UPDATE_COMMIT:
+ {
+
+ UpdateRecord* updRecord = _updRecList.Find(UpdateRecord(tid));
+
+ if ( updRecord )
{
- _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
- _pGTM->invalidateIndexForTable(tabSetId, logRec.getObjName());
- invalidateSet.Insert(logRec.getObjName());
- }
+
+ if ( invalidateSet.Find(logRec.getObjName()) == 0 )
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Invalidating index for table ") + logRec.getObjName());
+ _pGTM->invalidateIndexForTable(tabSetId, logRec.getObjName());
+ invalidateSet.Insert(logRec.getObjName());
+ }
- _pGTM->updateDataTable(tabSetId, logRec.getObjName(), tableAlias, pPred, updList, exprList, 0);
+ _pGTM->setTID(tabSetId,tid);
+ _pGTM->updateDataTable(tabSetId, logRec.getObjName(),
+ updRecord->getTable(),
+ updRecord->getPred(),
+ updRecord->getUpdateList(),
+ updRecord->getExprList(), 0);
+
+ updRecord->clean();
+ _updRecList.Remove(UpdateRecord(tid));
+ }
+ else
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Cannot find update record for transaction ") + Chain(tid));
+ }
break;
}
case CegoLogRecord::LOGREC_ADDCOUNTER:
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoRecoveryManager.h
^
|
@@ -69,7 +69,138 @@
bool recoverCurrentTransactionLog(int tabSetId, int pit, long& lsn, int& ts);
private:
-
+
+ class DeleteRecord {
+
+ public:
+
+ DeleteRecord()
+ {
+ _tid = 0;
+ _pPred = 0;
+ };
+ DeleteRecord(int tid)
+ {
+ _tid = tid;
+ _pPred = 0;
+ };
+ DeleteRecord(
+ int tid,
+ const Chain& table,
+ CegoPredDesc* pPred)
+ {
+ _tid = tid;
+ _table = table;
+ _pPred = pPred;
+ };
+
+ ~DeleteRecord()
+ {
+ };
+
+ void clean()
+ {
+ if ( _pPred )
+ delete _pPred;
+ }
+
+
+ int getTid() { return _tid; };
+ const Chain& getTable() { return _table; };
+ CegoPredDesc* getPred() { return _pPred; };
+
+ DeleteRecord& operator = ( const DeleteRecord& dr) {
+ _tid = dr._tid;
+ _table = dr._table;
+ _pPred = dr._pPred;
+ return *this;
+ };
+
+ bool operator == ( const DeleteRecord& dr) {
+ return ( dr._tid == _tid );
+ };
+
+ private:
+ int _tid;
+ Chain _table;
+ CegoPredDesc* _pPred;
+ };
+
+ class UpdateRecord {
+
+ public:
+
+ UpdateRecord()
+ {
+ _tid=0;
+ _pPred=0;
+ };
+ UpdateRecord(int tid)
+ {
+ _tid = tid;
+ _pPred=0;
+ };
+ UpdateRecord(
+ int tid,
+ const Chain& table,
+ CegoPredDesc* pPred,
+ const ListT<CegoField>& updList,
+ const ListT<CegoExpr*>& exprList )
+ {
+ _tid = tid;
+ _table = table;
+ _pPred = pPred;
+ _updList = updList;
+ _exprList = exprList;
+ };
+
+ ~UpdateRecord()
+ {
+ };
+
+ int getTid() { return _tid; };
+ const Chain& getTable() { return _table; };
+ CegoPredDesc* getPred() { return _pPred; };
+ ListT<CegoField>& getUpdateList() { return _updList; };
+ ListT<CegoExpr*>& getExprList() { return _exprList; };
+
+ void clean()
+ {
+ if ( _pPred )
+ delete _pPred;
+ CegoExpr **pExpr = _exprList.First();
+ while ( pExpr )
+ {
+ delete *pExpr;
+ pExpr = _exprList.Next();
+ }
+ }
+
+ UpdateRecord& operator = ( const UpdateRecord& ur) {
+ _tid = ur._tid;
+ _table = ur._table;
+ _pPred = ur._pPred;
+ _updList = ur._updList;
+ _exprList = ur._exprList;
+ return *this;
+ };
+
+ bool operator == ( const UpdateRecord& ur) {
+ return ( ur._tid == _tid );
+ };
+
+ private:
+ int _tid;
+ Chain _table;
+ CegoPredDesc* _pPred;
+ ListT<CegoField> _updList;
+ ListT<CegoExpr*> _exprList;
+ };
+
+
+ ListT<DeleteRecord> _delRecList;
+ ListT<UpdateRecord> _updRecList;
+
void dataFileRecovery(const Chain& tableSet, int tabSetId, long lsn, const Chain& logMngProg = Chain(""));
long transactionRecovery(const Chain& tableSet, int tabSetId, long cplsn, int pit=0, const Chain& logMngProg = Chain(""));
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoTableManager.cc
^
|
@@ -731,6 +731,7 @@
void CegoTableManager::beginTransaction(int tabSetId)
{
+
if (_tid[tabSetId] == 0)
{
_tid[tabSetId]=_pDBMng->nextTID(tabSetId);
@@ -742,6 +743,7 @@
lr.setTID(_tid[tabSetId]);
logIt(tabSetId, lr);
+
}
else
{
@@ -769,7 +771,7 @@
// create log entry
CegoLogRecord lr;
lr.setAction(CegoLogRecord::LOGREC_COMMIT);
- lr.setTID(_tid[tabSetId]);
+ lr.setTID(ctid);
long n = _pTM->commitTransaction(tabSetId, ctid);
@@ -816,6 +818,11 @@
return(_tastep[tabSetId]);
}
+void CegoTableManager::setTID(int tabSetId, int tid)
+{
+ _tid[tabSetId] = tid;
+}
+
void CegoTableManager::setTupleInfo(int tabSetId, const CegoDataPointer dp, int tid, int tastep, CegoTupleState ts)
{
@@ -914,24 +921,26 @@
oe.setMaxFid(id);
createTableObject(oe);
- // create log entry
- CegoLogRecord lr;
- lr.setObjectInfo(oe.getName(), oe.getType());
- lr.setAction(CegoLogRecord::LOGREC_CREATE);
-
- char *buf;
- buf = (char*)malloc(oe.getEntrySize());
- if (buf == NULL)
+ if ( oe.getType() != CegoObject::RBSEG )
{
- throw Exception(EXLOC, "malloc system error");
- }
- oe.encode(buf);
- lr.setData(buf);
- lr.setDataLen(oe.getEntrySize());
- lr.setTID(0);
+ // create log entry
+ CegoLogRecord lr;
+ lr.setObjectInfo(oe.getName(), oe.getType());
+ lr.setAction(CegoLogRecord::LOGREC_CREATE);
+
+ char *buf;
+ buf = (char*)malloc(oe.getEntrySize());
+ if (buf == NULL)
+ {
+ throw Exception(EXLOC, "malloc system error");
+ }
+ oe.encode(buf);
+ lr.setData(buf);
+ lr.setDataLen(oe.getEntrySize());
- logIt(oe.getTabSetId(), lr);
- free(buf);
+ logIt(oe.getTabSetId(), lr);
+ free(buf);
+ }
}
@@ -1166,7 +1175,6 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
logIt(tabSetId, lr);
pDropKey = keyDropList.Next();
@@ -1183,7 +1191,6 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
logIt(tabSetId, lr);
pDropIdx = idxDropList.Next();
@@ -1209,7 +1216,6 @@
pKey->encode(buf);
lr.setData(buf);
lr.setDataLen(pKey->getEntrySize());
- lr.setTID(0);
logIt(tabSetId, lr);
@@ -1241,7 +1247,6 @@
pIdx->encode(buf);
lr.setData(buf);
lr.setDataLen(pIdx->getEntrySize());
- lr.setTID(0);
logIt(tabSetId, lr);
@@ -1270,7 +1275,6 @@
aoe.encode(buf);
lr.setData(buf);
lr.setDataLen(aoe.getEntrySize());
- lr.setTID(0);
logIt(aoe.getTabSetId(), lr);
@@ -1392,7 +1396,6 @@
lr.setData((char*)newTableName);
lr.setDataLen(newTableName.length());
- lr.setTID(0);
logIt(oe.getTabSetId(), lr);
@@ -1419,7 +1422,6 @@
lr.setData((char*)newIdxName);
lr.setDataLen(newIdxName.length());
- lr.setTID(0);
logIt(oe.getTabSetId(), lr);
@@ -1442,7 +1444,6 @@
lr.setData((char*)newKeyName);
lr.setDataLen(newKeyName.length());
- lr.setTID(0);
logIt(tabSetId, lr);
@@ -1458,17 +1459,19 @@
alterTableObject(tabSetId, rboName, CegoObject::RBSEG, rbo);
- // create log entry
+ // no need to create log entry
+
/*
CegoLogRecord lr;
- lr.setObjectInfo(keyName, CegoObject::FKEY);
+ lr.setObjectInfo(rboName, CegoObject::RBSEG);
lr.setAction(CegoLogRecord::LOGREC_RENAME);
- lr.setData((char*)newKeyName);
- lr.setDataLen(newKeyName.length());
+ lr.setData((char*)newRboName);
+ lr.setDataLen(newRboName.length());
lr.setTID(0);
logIt(tabSetId, lr);
+
*/
}
@@ -1492,7 +1495,6 @@
lr.setData((char*)newProcName);
lr.setDataLen(newProcName.length());
- lr.setTID(0);
logIt(tabSetId, lr);
@@ -1512,11 +1514,8 @@
CegoLogRecord lr;
lr.setObjectInfo(viewName, CegoObject::VIEW);
lr.setAction(CegoLogRecord::LOGREC_RENAME);
-
-
lr.setData((char*)newViewName);
lr.setDataLen(newViewName.length());
- lr.setTID(0);
logIt(tabSetId, lr);
@@ -1536,11 +1535,8 @@
CegoLogRecord lr;
lr.setObjectInfo(checkName, CegoObject::CHECK);
lr.setAction(CegoLogRecord::LOGREC_RENAME);
-
-
lr.setData((char*)newCheckName);
lr.setDataLen(newCheckName.length());
- lr.setTID(0);
logIt(tabSetId, lr);
@@ -1857,7 +1853,7 @@
lr.setAction(CegoLogRecord::LOGREC_INSERT);
lr.setData(pBufBase);
lr.setDataLen(buflen);
- lr.setTID(0);
+ lr.setTID(getTID(oe.getTabSetId()));
logIt(oe.getTabSetId(), lr);
@@ -1922,14 +1918,35 @@
long updCount = 0;
+ int tid = getTID(tabSetId);
+
// nextTAStep
- if ( getTID(tabSetId) != 0 )
+ if ( tid != 0 )
_tastep[tabSetId]++;
-
+
CegoTableObject oe;
CegoBufferPage bp;
getObjectWithFix(tabSetId, tableName, CegoObject::TABLE, oe, bp);
+ // make log entry first
+
+ CegoLogRecord lr;
+ lr.setObjectInfo(tableName, CegoObject::TABLE);
+ lr.setAction(CegoLogRecord::LOGREC_UPDATE);
+
+ char *pBuf = 0;
+ int buflen = 0;
+
+ _qh.encodeUpdRec(tableAlias, pPred, updList, exprList, pBlock, pBuf, buflen);
+
+ lr.setData(pBuf);
+ lr.setDataLen(buflen);
+ lr.setTID(tid);
+
+ logIt(oe.getTabSetId(), lr);
+ if ( buflen > 0 )
+ free ( pBuf );
+
try
{
@@ -2178,24 +2195,16 @@
_pDBMng->bufferUnfix(bp, true, _pLockHandle);
- CegoLogRecord lr;
- lr.setObjectInfo(tableName, CegoObject::TABLE);
- lr.setAction(CegoLogRecord::LOGREC_UPDATE);
-
- char *pBuf = 0;
- int buflen = 0;
-
- _qh.encodeUpdRec(tableAlias, pPred, updList, exprList, pBlock, pBuf, buflen);
+ _pDBMng->log(_modId, Logger::DEBUG, Chain("Update finished, updCount = ") + Chain(updCount));
- lr.setData(pBuf);
- lr.setDataLen(buflen);
- lr.setTID(0);
-
- logIt(oe.getTabSetId(), lr);
- if ( buflen > 0 )
- free ( pBuf );
+ // commit update record
- _pDBMng->log(_modId, Logger::DEBUG, Chain("Update finished, updCount = ") + Chain(updCount));
+ CegoLogRecord lrc;
+ lrc.setObjectInfo(tableName, CegoObject::TABLE);
+ lrc.setAction(CegoLogRecord::LOGREC_UPDATE_COMMIT);
+ lrc.setTID(tid);
+
+ logIt(oe.getTabSetId(), lrc);
return updCount;
}
@@ -2608,7 +2617,9 @@
long delCount = 0;
- if ( getTID(oe.getTabSetId()) != 0 )
+ int tid = getTID(oe.getTabSetId());
+
+ if ( tid != 0 )
_tastep[oe.getTabSetId()]++;
ListT<CegoTableObject> idxList;
@@ -2617,6 +2628,27 @@
getObjectListByTable(oe.getTabSetId(), oe.getTabName(), idxList, keyList, checkList);
+ // make log entry first
+
+ CegoLogRecord lr;
+ lr.setObjectInfo(oe.getName(), oe.getType());
+ lr.setAction(CegoLogRecord::LOGREC_DELETE);
+
+ char *pBuf = 0;
+ int buflen = 0;
+
+ _qh.encodeDelRec(oe.getTabAlias(), pPred, pBlock, pBuf, buflen);
+
+ lr.setData(pBuf);
+ lr.setDataLen(buflen);
+ lr.setTID(tid);
+
+ logIt(oe.getTabSetId(), lr);
+
+ if ( buflen > 0 )
+ free ( pBuf );
+
+
if (pPred == 0)
{
@@ -2704,7 +2736,7 @@
if (_qh.evalPredicate(0, 0, 0, &fl, 0, 1, pPred, pBlock))
{
- if ( getTID(oe.getTabSetId()) == 0 )
+ if ( tid == 0 )
{
// before deleting, we first have to skip to next valid tuple
ListT<CegoField> nfl = oe.getSchema();
@@ -2764,7 +2796,7 @@
if ( _qh.evalPredicate(0, 0, 0, &fl, 0, 1, pPred, pBlock))
{
- if ( getTID(oe.getTabSetId()) == 0 )
+ if ( tid == 0 )
{
pTC->abort();
@@ -2801,26 +2833,19 @@
throw Exception(EXLOC, "Delete aborted by user");
}
- CegoLogRecord lr;
- lr.setObjectInfo(oe.getName(), oe.getType());
- lr.setAction(CegoLogRecord::LOGREC_DELETE);
+ _pDBMng->log(_modId, Logger::DEBUG, Chain("Delete finished, delCount = ") + Chain(delCount));
- char *pBuf = 0;
- int buflen = 0;
+ // commit delete record
- _qh.encodeDelRec(oe.getTabAlias(), pPred, pBlock, pBuf, buflen);
+ CegoLogRecord lrc;
+ lrc.setObjectInfo(oe.getName(), oe.getType());
+ lrc.setAction(CegoLogRecord::LOGREC_DELETE_COMMIT);
- lr.setData(pBuf);
- lr.setDataLen(buflen);
- lr.setTID(0);
-
- logIt(oe.getTabSetId(), lr);
+ lrc.setData(pBuf);
+ lrc.setDataLen(buflen);
+ lrc.setTID(tid);
- if ( buflen > 0 )
- free ( pBuf );
-
- _pDBMng->log(_modId, Logger::DEBUG, Chain("Delete finished, delCount = ") + Chain(delCount));
-
+ logIt(oe.getTabSetId(), lrc);
return delCount;
@@ -2957,7 +2982,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
}
@@ -2977,7 +3002,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
pKO = keyList.Next();
@@ -2996,7 +3021,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
pCO = checkList.Next();
@@ -3067,7 +3092,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
@@ -3098,7 +3123,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
@@ -3116,7 +3141,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
}
@@ -3131,7 +3156,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
}
@@ -3145,7 +3170,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
}
@@ -3160,7 +3185,7 @@
lr.setAction(CegoLogRecord::LOGREC_DROP);
lr.setData(0);
lr.setDataLen(0);
- lr.setTID(0);
+ // lr.setTID(0);
logIt(tabSetId, lr);
}
@@ -3443,7 +3468,7 @@
ioe.encode(buf);
lr.setData(buf);
lr.setDataLen(ioe.getEntrySize());
- lr.setTID(0);
+ // lr.setTID(0);
logIt(ioe.getTabSetId(), lr);
free(buf);
@@ -3597,7 +3622,7 @@
oe.encode(buf);
lr.setData(buf);
lr.setDataLen(oe.getEntrySize());
- lr.setTID(0);
+ // lr.setTID(0);
logIt(oe.getTabSetId(), lr);
free(buf);
}
@@ -3717,7 +3742,7 @@
oe.encode(buf);
lr.setData(buf);
lr.setDataLen(oe.getEntrySize());
- lr.setTID(0);
+ // lr.setTID(0);
logIt(oe.getTabSetId(), lr);
free(buf);
}
@@ -4317,25 +4342,9 @@
return true;
}
-void CegoTableManager::rollbackOpenTransaction(int tabSetId)
+void CegoTableManager::finishOpenTransaction(int tabSetId)
{
-
- _pTM->rollbackOpenTransaction(tabSetId);
-
- /*
- SetT<int> tidSet;
- _pTM->getOpenTid(tabSetId, tidSet);
-
- int *pTid = tidSet.First();
- while ( pTid )
- {
-
- _pDBMng->log(_modId,Logger::NOTICE, Chain("Rollback transaction ") + Chain(*pTid) + Chain(" ..."));
- _pTM->rollbackTransaction(tabSetId, *pTid);
- pTid = tidSet.Next();
- }
- */
-
+ _pTM->finishOpenTransaction(tabSetId);
}
void CegoTableManager::extractIndexValue(const ListT<CegoField>& tableSchema, const ListT<CegoField>& indexSchema, char* p, int len, int& idxLen)
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoTableManager.h
^
|
@@ -101,6 +101,8 @@
int getTID(int tabSetId);
int getTAStep(int tabSetId);
+ void setTID(int tabSetId, int tid);
+
void getTupleInfo(int tabSetId, const CegoDataPointer dp, int &tid, int &tastep, CegoTupleState &ts);
void setTupleInfo(int tabSetId, const CegoDataPointer dp, int tid, int tastep, CegoTupleState ts);
@@ -234,7 +236,7 @@
CegoTransactionManager *_pTM;
- void rollbackOpenTransaction(int tabSetId);
+ void finishOpenTransaction(int tabSetId);
private:
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoTransactionManager.cc
^
|
@@ -41,6 +41,7 @@
#include <lfc/Exception.h>
#include <lfc/Sleeper.h>
#include <lfc/ThreadLock.h>
+#include <lfc/Tokenizer.h>
// cego includes
#include "CegoTransactionManager.h"
@@ -54,6 +55,7 @@
#include "CegoTableManager.h"
#include "CegoIndexManager.h"
+#define RBSEP "#"
#define SYS_RB "rbcatlog"
#define SYS_RBCOMMIT "rbcommit"
#define SYS_RBROLLBACK "rbrollback"
@@ -65,9 +67,7 @@
#define SYS_RB_PAGEID "pageid"
#define SYS_RB_OFFSET "offset"
#define SYS_RB_TABLE "table"
-// #define SYS_RB_FILEID "rb_fileid"
-// #define SYS_RB_RB_PAGEID "rb_pageid"
-// #define SYS_RB_RB_OFFSET "rb_offset"
+
#define SYS_UPDTAB_TID "tid"
#define SYS_UPDTAB_FILEID "fileid"
@@ -162,26 +162,22 @@
CegoTransactionManager::~CegoTransactionManager()
{
-
TAEntry *pTAE = _taList.First();
while ( pTAE )
{
_pDBMng->bufferUnfix(pTAE->getBufferPage(), true, _pTM->getLockHandler());
pTAE = _taList.Next();
- }
-
+ }
}
void CegoTransactionManager::release(int tabSetId)
{
-
TAEntry *pTAE = _taList.First();
while ( pTAE )
{
_pDBMng->bufferUnfix(pTAE->getBufferPage(), true, _pTM->getLockHandler());
pTAE = _taList.Next();
}
-
}
void CegoTransactionManager::reorgSystemSpace(int tabSetId)
@@ -206,11 +202,16 @@
if ( pTAE == 0 )
{
- Chain taTable = Chain(SYS_RB) + Chain(tid);
+ Chain taTable = Chain(SYS_RB) + Chain(RBSEP) + Chain(tid);
CegoBufferPage bp;
CegoTableObject oe;
- _pTM->createDataTable(tabSetId, taTable, CegoObject::RBSEG, _rbcatSchema);
+
+ // in case of recovery, the rb table might already exist
+ if ( _pTM->objectExists(tabSetId, taTable, CegoObject::RBSEG) == false )
+ {
+ _pTM->createDataTable(tabSetId, taTable, CegoObject::RBSEG, _rbcatSchema);
+ }
_pTM->getObjectWithFix(tabSetId, taTable, CegoObject::RBSEG, oe, bp);
TAEntry tae(tid, bp, oe);
@@ -298,11 +299,13 @@
moreTuple = _pTM->getNextTuple(pOC, schema, dp);
}
+
+ pOC->abort();
+ delete pOC;
+ pOC = 0;
+
}
- pOC->abort();
- delete pOC;
- pOC = 0;
}
catch ( Exception e )
{
@@ -329,7 +332,13 @@
{
// no transaction entry found. It seems, no
- // modifying operations have been take place, so we can retrn immediately
+ // modifying operations have been take place, so we can remove the segment and return immediately
+
+ Chain taTable = Chain(SYS_RB) + Chain(RBSEP) + Chain(tid);
+ if ( _pTM->objectExists(tabSetId, taTable, CegoObject::RBSEG) )
+ {
+ _pTM->removeObject(tabSetId, taTable, CegoObject::RBSEG);
+ }
return opCount;
// throw Exception(EXLOC, Chain("Cannot find transaction ") + Chain(tid));
@@ -338,135 +347,152 @@
// rename the transaction object
Chain taTable = pTAE->getTableObject().getName();
- Chain commitTa = Chain(SYS_RBCOMMIT) + Chain(tid);
+ Chain commitTa = Chain(SYS_RBCOMMIT) + Chain(RBSEP) + Chain(tid);
_pTM->renameObject(tabSetId, taTable, CegoObject::RBSEG, commitTa);
pTAE->getTableObject().setName(commitTa);
- CegoObjectCursor *pOC = _pTM->getObjectCursor(tabSetId, commitTa, commitTa, CegoObject::RBSEG);
+ opCount = commitTransaction(tabSetId, commitTa);
+
+ // Step 2 : Cleaning up rollback segment
- ListT<CegoField> schema = _rbcatSchema;
+ _pDBMng->bufferUnfix(pTAE->getBufferPage(), true, _pTM->getLockHandler());
+ _pTM->removeObject(tabSetId, commitTa, CegoObject::RBSEG);
+ _taList.Remove(TAEntry(tid));
+
+ }
+ catch ( Exception e )
+ {
+ throw Exception(EXLOC, Chain("Cannot commit transaction"), e);
+ }
+
+ return opCount;
+}
+
+long CegoTransactionManager::commitTransaction(int tabSetId, const Chain& rbo)
+{
+
+ long opCount = 0;
+
+ CegoObjectCursor *pOC = _pTM->getObjectCursor(tabSetId, rbo, rbo, CegoObject::RBSEG);
+
+ ListT<CegoField> schema = _rbcatSchema;
+
+ // Step 1 : Committing all attached tuples
+
+ try
+ {
- // Step 1 : Committing all attached tuples
+ CegoDataPointer rbdp;
+ bool moreTuple = _pTM->getFirstTuple(pOC, schema, rbdp);
- try
+ Chain cachedTable;
+ ListT<CegoField> cachedFvl;
+ ListT<CegoTableObject> cachedIdxList;
+ ListT<CegoKeyObject> cachedKeyList;
+ ListT<CegoCheckObject> cachedCheckList;
+
+ while (moreTuple)
{
+
+ int fileId, pageId, offset;
+
+ CegoField *pF = schema.Find(CegoField(SYS_RB, SYS_RB_FILEID));
+ if (pF)
+ memcpy(&fileId, pF->getValue().getValue(), sizeof(int));
+
+ pF = schema.Find(CegoField(SYS_RB, SYS_RB_PAGEID));
+ if (pF)
+ memcpy(&pageId, pF->getValue().getValue(), sizeof(int));
+
+ pF = schema.Find(CegoField(SYS_RB, SYS_RB_OFFSET));
+ if (pF)
+ memcpy(&offset, pF->getValue().getValue(), sizeof(int));
+
+ CegoDataPointer dp(fileId, pageId, offset);
+
+ int tid;
+ int tastep;
+ CegoTupleState ts;
+
+ _pTM->getTupleInfo(tabSetId, dp, tid, tastep, ts);
+ _pTM->setTupleInfo(tabSetId, dp, 0, 0, COMMITTED);
- CegoDataPointer dp;
- bool moreTuple = _pTM->getFirstTuple(pOC, schema, dp);
-
- Chain cachedTable;
- ListT<CegoField> cachedFvl;
- ListT<CegoTableObject> cachedIdxList;
- ListT<CegoKeyObject> cachedKeyList;
- ListT<CegoCheckObject> cachedCheckList;
-
- while (moreTuple)
+ opCount++;
+ if ( ts == DELETED || ts == OBSOLETE )
{
- int fileId, pageId, offset;
+ Chain tableName;
- CegoField *pF = schema.Find(CegoField(SYS_RB, SYS_RB_FILEID));
+ pF = schema.Find(CegoField(SYS_RB, SYS_RB_TABLE));
if (pF)
- memcpy(&fileId, pF->getValue().getValue(), sizeof(int));
+ tableName = Chain((char*)pF->getValue().getValue());
- pF = schema.Find(CegoField(SYS_RB, SYS_RB_PAGEID));
- if (pF)
- memcpy(&pageId, pF->getValue().getValue(), sizeof(int));
-
- pF = schema.Find(CegoField(SYS_RB, SYS_RB_OFFSET));
- if (pF)
- memcpy(&offset, pF->getValue().getValue(), sizeof(int));
- CegoDataPointer dp(fileId, pageId, offset);
-
- int tid;
- int tastep;
- CegoTupleState ts;
-
- _pTM->getTupleInfo(tabSetId, dp, tid, tastep, ts);
- _pTM->setTupleInfo(tabSetId, dp, 0, 0, COMMITTED);
- opCount++;
- if ( ts == DELETED || ts == OBSOLETE )
+ if ( cachedTable != tableName )
{
+ CegoTableObject oe;
+ _pTM->getObject(tabSetId, tableName, CegoObject::TABLE, oe);
+ cachedFvl = oe.getSchema();
+ cachedTable = tableName;
+ cachedIdxList.Empty();
+ cachedKeyList.Empty();
+ cachedCheckList.Empty();
+ _pTM->getObjectListByTable(tabSetId, cachedTable, cachedIdxList, cachedKeyList, cachedCheckList);
- Chain tableName;
-
- pF = schema.Find(CegoField(SYS_RB, SYS_RB_TABLE));
- if (pF)
- tableName = Chain((char*)pF->getValue().getValue());
-
-
- if ( cachedTable != tableName )
- {
- CegoTableObject oe;
- _pTM->getObject(tabSetId, tableName, CegoObject::TABLE, oe);
- cachedFvl = oe.getSchema();
- cachedTable = tableName;
- cachedIdxList.Empty();
- cachedKeyList.Empty();
- cachedCheckList.Empty();
- _pTM->getObjectListByTable(tabSetId, cachedTable, cachedIdxList, cachedKeyList, cachedCheckList);
-
- }
+ }
+
+ char* p;
+ int len;
+ unsigned long lockId;
+
+ try
+ {
+ lockId = _pTM->claimDataPtr(tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len);
- char* p;
- int len;
- unsigned long lockId;
+ int tid;
+ int tastep;
+ CegoTupleState ts;
+ _qh.decodeFVL(cachedFvl, p, len, tid, tastep, ts);
- try
- {
- lockId = _pTM->claimDataPtr(tabSetId, CegoLockHandler::READ, CegoBufferPool::SYNC, dp, p, len);
-
- int tid;
- int tastep;
- CegoTupleState ts;
- _qh.decodeFVL(cachedFvl, p, len, tid, tastep, ts);
-
- _pTM->deleteDataTable(tabSetId, cachedTable, CegoObject::TABLE, dp, cachedFvl, cachedIdxList, cachedKeyList, false);
-
- }
- catch ( Exception e)
- {
- _pTM->releaseDataPtr(lockId);
- throw Exception(EXLOC, Chain("Cannot commit transaction"), e );
- }
- _pTM->releaseDataPtr(lockId);
+ _pTM->deleteDataTable(tabSetId, cachedTable, CegoObject::TABLE, dp, cachedFvl, cachedIdxList, cachedKeyList, false);
}
+ catch ( Exception e)
+ {
+ _pTM->releaseDataPtr(lockId);
+ throw Exception(EXLOC, Chain("Cannot commit transaction"), e );
+ }
+ _pTM->releaseDataPtr(lockId);
- moreTuple = _pTM->getNextTuple(pOC, schema, dp);
}
- }
- catch ( Exception e )
- {
- pOC->abort();
- delete pOC;
- throw Exception(EXLOC, Chain("Cannot commit transaction"), e);
- }
-
-
- pOC->abort();
- delete pOC;
-
- // Step 2 : Cleaning up rollback segment
-
- _pDBMng->bufferUnfix(pTAE->getBufferPage(), true, _pTM->getLockHandler());
- _pTM->removeObject(tabSetId, commitTa, CegoObject::RBSEG);
- _taList.Remove(TAEntry(tid));
+ // set the rb datapointer to the current tid
+ // in case of a crash recovery, this tuple is ignored by the object cursor
+ // so we avoid a double commit
+
+ _pTM->setTupleInfo(tabSetId, rbdp, tid, 0, COMMITTED);
+
+ moreTuple = _pTM->getNextTuple(pOC, schema, rbdp);
+ }
}
catch ( Exception e )
{
+ pOC->abort();
+ delete pOC;
throw Exception(EXLOC, Chain("Cannot commit transaction"), e);
}
+
+
+ pOC->abort();
+ delete pOC;
return opCount;
}
-
-void CegoTransactionManager::rollbackOpenTransaction(int tabSetId)
+void CegoTransactionManager::finishOpenTransaction(int tabSetId)
{
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Finishing open transaction for tableset ") + Chain(tabSetId));
ListT<Chain> rboList;
_pTM->getObjectList(tabSetId, CegoObject::RBSEG, rboList);
@@ -476,13 +502,43 @@
while ( pRBO )
{
- rollbackTransaction(tabSetId, *pRBO);
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Treating ") + *pRBO);
+ Tokenizer t(*pRBO, Chain(RBSEP));
+ Chain taType;
+ Chain taTid;
+
+ t.nextToken(taType);
+ t.nextToken(taTid);
+
+ int tid = taTid.asInteger();
+
+ if ( taType == Chain(SYS_RB) )
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Rollback transaction ") + Chain(tid));
+ // transaction still was not in commit or rollback phase
+ // so we roll back
+ rollbackTransaction(tabSetId, tid);
+ }
+ else if ( taType == Chain(SYS_RBROLLBACK) )
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Finishing rollback for transaction ") + Chain(tid));
+ // transaction already was in rollback phase
+ // we have to finish rollback
- _pTM->removeObject(tabSetId, *pRBO, CegoObject::RBSEG);
+ rollbackTransaction(tabSetId, *pRBO);
+ _pTM->removeObject(tabSetId, *pRBO, CegoObject::RBSEG);
+ }
+ else if ( taType == Chain(SYS_RBCOMMIT) )
+ {
+ _pDBMng->log(_modId, Logger::NOTICE, Chain("Finishing commit for transaction ") + Chain(tid));
+ // transaction already was in commit phase
+ // we have to finish commit
+ commitTransaction(tabSetId, *pRBO);
+ _pTM->removeObject(tabSetId, *pRBO, CegoObject::RBSEG);
+ }
pRBO = rboList.Next();
- }
-
+ }
}
long CegoTransactionManager::rollbackTransaction(int tabSetId, int tid)
@@ -494,22 +550,37 @@
{
TAEntry *pTAE = _taList.Find( TAEntry(tid) );
-
+ if ( pTAE == 0 )
+ {
+
+ // no transaction entry found. It seems, no
+ // modifying operations have been take place, so we can remove the segemtn and return immediately
+
+ Chain taTable = Chain(SYS_RB) + Chain(RBSEP) + Chain(tid);
+ if ( _pTM->objectExists(tabSetId, taTable, CegoObject::RBSEG) )
+ {
+ _pTM->removeObject(tabSetId, taTable, CegoObject::RBSEG);
+ }
+ return opCount;
+
+ // throw Exception(EXLOC, Chain("Cannot find transaction ") + Chain(tid));
+ }
+
// rename the transaction object
Chain rbo = pTAE->getTableObject().getName();
-
- Chain rollbackTa = Chain(SYS_RBROLLBACK) + Chain(tid);
+
+ Chain rollbackTa = Chain(SYS_RBROLLBACK) + Chain(RBSEP) + Chain(tid);
_pTM->renameObject(tabSetId, rbo, CegoObject::RBSEG, rollbackTa);
pTAE->getTableObject().setName(rollbackTa);
-
-
+
opCount = rollbackTransaction(tabSetId, rollbackTa);
-
+
_pDBMng->bufferUnfix(pTAE->getBufferPage(), true, _pTM->getLockHandler());
_pTM->removeObject(tabSetId, rollbackTa, CegoObject::RBSEG);
_taList.Remove(TAEntry(tid));
+
}
catch ( Exception e )
@@ -536,10 +607,9 @@
ListT<CegoField> schema = _rbcatSchema;
// step 1 ( tid setting )
-
- CegoDataPointer dp;
- bool moreTuple = _pTM->getFirstTuple(pOC, schema, dp);
+ CegoDataPointer rbdp;
+ bool moreTuple = _pTM->getFirstTuple(pOC, schema, rbdp);
Chain cachedTable;
ListT<CegoField> cachedFvl;
@@ -624,7 +694,14 @@
_pTM->releaseDataPtr(lockId);
}
- moreTuple = _pTM->getNextTuple(pOC, schema, dp);
+
+ // set the rb datapointer to the current tid
+ // in case of a crash recovery, this tuple is ignored by the object cursor
+ // so we avoid a double rollback
+
+ _pTM->setTupleInfo(tabSetId, rbdp, tid, 0, COMMITTED);
+
+ moreTuple = _pTM->getNextTuple(pOC, schema, rbdp);
}
}
catch ( Exception e )
@@ -691,7 +768,10 @@
CegoBufferPage bp;
CegoTableObject oe;
- _pTM->createDataTable(tabSetId, udTable, CegoObject::RBSEG, _updSchema);
+ if ( _pTM->objectExists(tabSetId, udTable, CegoObject::RBSEG) == false )
+ {
+ _pTM->createDataTable(tabSetId, udTable, CegoObject::RBSEG, _updSchema);
+ }
_pTM->getObjectWithFix(tabSetId, udTable, CegoObject::RBSEG, oe, bp);
TAEntry ude(tid, bp, oe);
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoTransactionManager.h
^
|
@@ -75,13 +75,14 @@
void getTransactionAffectedTables(int tabSetId, int tid, SetT<Chain>& tableList);
- void rollbackOpenTransaction(int tabSetId);
+ void finishOpenTransaction(int tabSetId);
long rollbackTransaction(int tabSetId, int tid);
void getTransactionInfo(int tabSetId, const Chain& rbo, int& numop);
private:
+ long commitTransaction(int tabSetId, const Chain& rbo);
long rollbackTransaction(int tabSetId, const Chain& rbo);
class TAEntry {
|
[-]
[+]
|
Changed |
cego-2.11.7.tar.bz2/src/CegoXMLSpace.cc
^
|
@@ -1827,6 +1827,7 @@
}
V();
+ return 0;
}
@@ -1854,7 +1855,8 @@
return pRoleList;
}
V();
-
+
+ return 0;
}
@@ -2051,6 +2053,13 @@
long CegoXMLSpace::getSortAreaSize(int tabSetId)
{
Element *pE = getCachedTableSetElement(tabSetId);
+
+ if ( pE == 0 )
+ {
+ Chain msg = Chain("Unknown tableset id ") + Chain(tabSetId);
+ throw Exception(EXLOC, msg);
+ }
+
P();
long sortAreaSize = pE->getAttributeValue(XML_SORTAREASIZE_ATTR).asLong();
V();
@@ -2060,6 +2069,13 @@
int CegoXMLSpace::nextTID(int tabSetId)
{
Element *pE = getCachedTableSetElement(tabSetId);
+
+ if ( pE == 0 )
+ {
+ Chain msg = Chain("Unknown tableset id ") + Chain(tabSetId);
+ throw Exception(EXLOC, msg);
+ }
+
P();
int tid = pE->getAttributeValue(XML_TID_ATTR).asInteger();
tid++;
@@ -2770,6 +2786,8 @@
else
return false;
}
+
+ return false;
}
Element* CegoXMLSpace::getTableSetElement(const Chain& tableSet)
|