[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.13.10
+ Version 2.13.11
(C)opyright 2006,2007,2008,2009,2010,2011,2012 by Bjoern Lemke
|
[-]
[+]
|
Added |
cego-2.13.11.tar.bz2/samples/chkdb/bla.xml
^
|
@@ -0,0 +1,5 @@
+<?xml version="1.0" ?>
+<!DOCTYPE CEGO_DB_SPEC>
+<DATABASE NAME="xxx" PAGESIZE="32768" HOSTNAME="localhost" DATAPORT="2200" ADMINPORT="2000" LOGPORT="3000" PIDFILE="./pid"> <USER NAME="lemke" PASSWD="20eb196673144f5c299ef3d0d7a58bd9" TRACE="OFF" ROLE="admin"></USER>
+ <ROLE NAME="myrole"></ROLE>
+</DATABASE>
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/samples/chkdb/chkadm
^
|
@@ -1,2 +1,2 @@
#!/bin/bash
-../../src/cgadm --server=localhost --port=2000 --user=cgadm/lemke $@
+../../src/cgadm --server=localhost --port=2000 --user=cgadm/cgadm $@
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/samples/chkdb/mkdb
^
|
@@ -37,8 +37,8 @@
<?xml version="1.0" ?>
<!DOCTYPE CEGO_DB_SPEC>
<DATABASE NAME="$DBNAME" PAGESIZE="$PAGESIZE" HOSTNAME="$DBHOST" ADMINPORT="$ADMPORT" LOGPORT="$LOGPORT" DATAPORT="$DBPORT"
-PIDFILE="$PIDFILE" MAXFID="1" MAXTSID="1"
-NUMRECSEMA="2141" NUMSYSPAGESEMA="41" NUMDATAPAGESEMA="41"
+PIDFILE="$PIDFILE"
+NUMRECSEMA="2141" NUMSYSPAGESEMA="441" NUMDATAPAGESEMA="41"
NUMIDXPAGESEMA="41" NUMRBPAGESEMA="2141" NUMDATAFILESEMA="11" NUMBUFFERPOOLSEMA="11"
MAXFIXTRIES="30"
CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
|
[-]
[+]
|
Added |
cego-2.13.11.tar.bz2/samples/chkdb/pid
^
|
@@ -0,0 +1 @@
+42326
\ No newline at end of file
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoAdmAction.cc
^
|
@@ -655,7 +655,15 @@
_logNum,
_sortAreaSize);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
+
setDefault();
+
}
void CegoAdmAction::startTableSetAction()
@@ -672,6 +680,12 @@
_doForceload=false;
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::stopTableSetAction()
@@ -685,6 +699,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->medStopTableSet(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::copyTableSetAction()
@@ -698,6 +718,12 @@
}
res = _pAH->medCopyTableSet(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -712,6 +738,12 @@
}
res = _pAH->medSwitchTableSet(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -726,6 +758,12 @@
}
res = _pAH->medDropTableSet(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -740,6 +778,12 @@
}
res = _pAH->medRemoveTableSet(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -754,6 +798,12 @@
}
res = _pAH->medCreateTableSet(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -769,6 +819,11 @@
res = _pAH->reqSyncTableSet(tableSet, Chain(""), 0);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::syncTableSetAction2()
@@ -787,6 +842,12 @@
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
+
_timeout = DEFTIMEOUT;
}
@@ -801,6 +862,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->medBeginBackup(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::endBackupAction()
@@ -815,6 +882,12 @@
res = _pAH->medEndBackup(tableSet, _keepTicket);
_keepTicket = false;
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::keepTicketAction()
@@ -872,6 +945,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->medRecover(tableSet, _pit);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::setLogMngAction()
@@ -1131,6 +1210,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->medSecSwitch(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::switchMediatorAction()
@@ -1144,6 +1229,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->secMedSwitch(tableSet);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -1161,6 +1252,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->medSecRelocate(tableSet, secondary);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::relocateMediatorAction()
@@ -1177,6 +1274,12 @@
CegoAdminHandler::ResultType res;
res = _pAH->secMedRelocate(tableSet, mediator);
handleMedResult(res);
+
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::checkTableSetAction()
@@ -1875,6 +1978,11 @@
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::listUserAction()
@@ -1894,12 +2002,15 @@
output.setRawMode(_rawMode);
output.tabOut(info);
+ /*
if ( _rawMode == false )
{
Chain msg;
_pAH->getMsg(msg);
cout << msg << endl;
}
+
+ */
}
void CegoAdmAction::addUserAction()
@@ -1922,6 +2033,10 @@
res = _pAH->medAddUser(user, password);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
}
@@ -1942,6 +2057,11 @@
res = _pAH->medRemoveUser(user);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::changePwdAction()
@@ -1964,6 +2084,11 @@
res = _pAH->medChangePasswd(user, password);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::assignRoleAction()
@@ -1989,6 +2114,11 @@
res = _pAH->medAssignRole(user, role);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -2015,6 +2145,11 @@
res = _pAH->medRemoveRole(user, role);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::listRoleAction()
@@ -2033,13 +2168,15 @@
CegoOutput output(oe.getSchema());
output.setRawMode(_rawMode);
output.tabOut(info);
-
+
+ /*
if ( _rawMode == false )
{
Chain msg;
_pAH->getMsg(msg);
cout << msg << endl;
}
+ */
}
@@ -2067,13 +2204,15 @@
CegoOutput output(oe.getSchema());
output.setRawMode(_rawMode);
output.tabOut(info);
-
+
+ /*
if ( _rawMode == false )
{
Chain msg;
_pAH->getMsg(msg);
cout << msg << endl;
}
+ */
}
@@ -2093,6 +2232,11 @@
res = _pAH->medCreateRole(role);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::dropRoleAction()
@@ -2111,6 +2255,11 @@
res = _pAH->medDropRole(role);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::setPermAction()
@@ -2138,6 +2287,11 @@
res = _pAH->medSetPermission(role, permid, _tsPerm, _filterPerm, _rightPerm);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::setTableSetPerm()
@@ -2187,6 +2341,11 @@
res = _pAH->medRemovePermission(role, permid);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -2206,6 +2365,11 @@
res = _pAH->medUserTrace(user, true);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::traceOffAction()
@@ -2224,6 +2388,11 @@
res = _pAH->medUserTrace(user, false);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -2254,6 +2423,11 @@
res = _pAH->medAddArchLog(tableSet, archId, archPath);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
@@ -2280,6 +2454,11 @@
res = _pAH->medRemoveArchLog(tableSet, archId);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::enableArchLogAction()
@@ -2298,6 +2477,11 @@
res = _pAH->medEnableArchLog(tableSet);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::disableArchLogAction()
@@ -2316,6 +2500,11 @@
res = _pAH->medDisableArchLog(tableSet);
handleMedResult(res);
+ Chain msg;
+ _pAH->getMsg(msg);
+ if ( _rawMode == false )
+ cout << msg << endl;
+
}
void CegoAdmAction::storeSysSizeAttr()
@@ -2533,12 +2722,13 @@
_pAH->getMsg(msg);
- if ( res == CegoAdminHandler::ADM_OK )
+ /* if ( res == CegoAdminHandler::ADM_OK )
{
- if ( _rawMode == false && _resultMode == VERBOSE )
+ if ( _rawMode == false )
cout << msg << endl;
}
- else if ( res == CegoAdminHandler::ADM_ERROR )
+ else */
+ if ( res == CegoAdminHandler::ADM_ERROR )
{
throw Exception(EXLOC, msg);
}
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoAdminThread.cc
^
|
@@ -5162,10 +5162,10 @@
Host h;
Chain mediator = h.getName();
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role created")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role created")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Role " ) + role + Chain(" created"));
}
@@ -5181,10 +5181,10 @@
Host h;
Chain mediator = h.getName();
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role dropped")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role dropped")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Role ") + role + Chain(" dropped"));
}
@@ -5301,10 +5301,10 @@
Host h;
Chain mediator = h.getName();
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role added")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role added")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Role ") + role + Chain(" assigned"));
}
@@ -5424,7 +5424,7 @@
if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Role removed")) == false )
return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Role ") + role + Chain(" removed"));
}
@@ -5452,10 +5452,11 @@
Host h;
Chain mediator = h.getName();
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Permission set")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Permission set")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Permission ") + permid + Chain(" set"));
+
}
@@ -5473,10 +5474,10 @@
Host h;
Chain mediator = h.getName();
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Permission removed")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Permission removed")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Permission ") + permid + Chain(" removed"));
}
@@ -5580,10 +5581,10 @@
Chain mediator = h.getName();
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("User trace set")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("User trace set")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("User trace set"));
}
@@ -5677,10 +5678,11 @@
}
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Backup mode started")) == false )
- return;
-
- pAH->sendResponse(Chain("Admin action finished"));
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Backup mode started")) == false )
+ // return;
+
+ pAH->sendResponse(Chain("Backup mode started"));
+
}
@@ -5779,10 +5781,11 @@
}
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Backup mode finished")) == false )
- return;
-
- pAH->sendResponse(Chain("Admin action finished"));
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Backup mode finished")) == false )
+ // return;
+
+ pAH->sendResponse(Chain("Backup mode finished"));
+
}
@@ -5889,11 +5892,11 @@
}
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Recovery completed")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Recovery completed")) == false )
+ // return;
+ pAH->sendResponse(Chain("Recover completed"));
- pAH->sendResponse(Chain("Admin action finished"));
}
@@ -5961,10 +5964,11 @@
}
- if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Secondary switched")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Secondary switched")) == false )
+ // return;
+
+ pAH->sendResponse(Chain("Secondary switch"));
- pAH->sendResponse(Chain("Admin action finished"));
}
@@ -6212,11 +6216,11 @@
_pDBMng->setSecondary(tableSet, newSecondary);
- if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Secondary relocated")) == false )
- return;
-
+ // if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Secondary relocated")) == false )
+ // return;
+
+ pAH->sendResponse(Chain("Secondary relocated"));
- pAH->sendResponse("Admin action finished");
}
@@ -6301,11 +6305,11 @@
return;
- if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Secondary switched")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Secondary switched")) == false )
+ // return;
- pAH->sendResponse("Admin action finished");
+ pAH->sendResponse("Secondary switched");
}
@@ -6430,10 +6434,10 @@
_pDBMng->setMediator(tableSet, newMediator);
- if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Mediator relocated")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), h.getName(), Chain("Mediator relocated")) == false )
+ // return;
- pAH->sendResponse("Admin action finished");
+ pAH->sendResponse("Mediator relocated");
}
@@ -6547,11 +6551,11 @@
pCheck->setAttribute(XML_PRIMARY_ATTR, primary);
pCheck->setAttribute(XML_SECONDARY_ATTR, secondary);
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Check completed")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Check completed")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"), pCheck);
+ pAH->sendResponse(Chain("Check completed"), pCheck);
}
void CegoAdminThread::medVerifyTableSet(CegoAdminHandler *pAH)
@@ -6997,11 +7001,11 @@
}
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Arch mode enabled")) == false )
- return;
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Arch mode enabled")) == false )
+ // return;
- pAH->sendResponse(Chain("Admin action finished"));
+ pAH->sendResponse(Chain("Arch mode enabled"));
}
@@ -7076,10 +7080,11 @@
}
- if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Arch mode disabled")) == false )
- return;
-
- pAH->sendResponse(Chain("Admin action finished"));
+ // if ( pAH->syncWithInfo(Chain("mediator"), mediator, Chain("Arch mode disabled")) == false )
+ // return;
+
+ pAH->sendResponse(Chain("Arch mode disabled"));
+
}
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoDefs.h
^
|
@@ -40,7 +40,7 @@
#endif
#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.13.10"
+#define CEGO_VERSION "2.13.11"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2012 by Bjoern Lemke. All rights reserved"
/*******************************/
@@ -381,6 +381,13 @@
#define THRMNG_NUMLOADSAMPLE 5
+/************/
+/* xml defs */
+/************/
+#define CEGO_DB_DOC "CEGO_DB_SPEC"
+#define XML_VERSION_ATTR "version"
+#define XML_VERSION_VALUE "1.0"
+
#endif
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoDistCursor.cc
^
|
@@ -6,7 +6,7 @@
//
// Design and Implementation by Bjoern Lemke
//
-// (C)opyright 2000-2010 Bjoern Lemke
+// (C)opyright 2000-2012 Bjoern Lemke
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -276,6 +276,8 @@
void CegoDistCursor::distSetup( const CegoAttrCond& attrCond)
{
+ // cout << "Attr Comp Size = " << attrCond.numComp() << endl;
+
if ( attrCond.numComp() == 0 )
return distSetup();
@@ -364,8 +366,6 @@
while ( pAC )
{
- // cout << "XX Checking condition " << pAC->toChain() << endl;
-
CegoField *pF = 0;
int i=0;
@@ -389,18 +389,16 @@
return false;
}
- if ( pAC->getCompMode() == CegoAttrComp::ISLIKE )
+ else if ( pAC->getCompMode() == CegoAttrComp::ISLIKE )
{
- if ( pAC->getMatcher()->match(pF->getValue().valAsChain()))
- return true;
- return false;
+ if ( pAC->getMatcher()->match(pF->getValue().valAsChain()) == false)
+ return false;
+
}
- if ( pAC->getCompMode() == CegoAttrComp::ISNOTLIKE )
+ else if ( pAC->getCompMode() == CegoAttrComp::ISNOTLIKE )
{
if ( pAC->getMatcher()->match(pF->getValue().valAsChain()))
- return false;
- return true;
-
+ return false;
}
else
{
@@ -409,8 +407,7 @@
case EQUAL:
{
if ( ( (CegoFieldValue)pF->getValue() == (CegoFieldValue)(pAC->getFieldValue()) ) == false )
- return false;
-
+ return false;
break;
}
case NOT_EQUAL:
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoMain.cc
^
|
@@ -68,6 +68,11 @@
#define USAGE "Usage:\n\n\
Info: cego [ --version ] [ --help ]\n\
\n\
+ Initialization: cego --mode=init --dbxml=<db xml> --dbname=<dbname>\n\
+ [ --hostname=<hostname> ] [ --pgsize=<page size> ]\n\
+ [ --dbport=<data port> ] [ --admport=<admin port> ] [ --logport=<log port ]\n\
+ [ --pidfile=<pid file> ]\n\
+\n\
User setup: cego --mode=adduser --user=<user>/<password>\n\
--role=<role> --dbxml=<db xml>\n\
\n\
@@ -127,6 +132,13 @@
#define DEFAULTAPPFILENAME "./data01.dbf"
#define DEFAULTAPPFILESIZE 1000
+#define DEFAULTHOST "localhost"
+#define DEFAULTPIDFILE "./pid"
+#define DEFAULTPAGESIZE 32768
+#define DEFAULTDBPORT 2200
+#define DEFAULTADMPORT 2000
+#define DEFAULTLOGPORT 3000
+
#define MAXCMDLEN 10000
#define LANGUAGE_ENV "LANG"
@@ -141,6 +153,7 @@
enum XPortFormat { BINARY, XML, PLAIN };
+int init(GetLongOpt& longOpt);
int addUser(GetLongOpt& longOpt);
int addRole(GetLongOpt& longOpt);
int addPerm(GetLongOpt& longOpt);
@@ -162,6 +175,15 @@
longOpt.addOpt("mode");
longOpt.addOpt("user");
longOpt.addOpt("dbxml");
+ longOpt.addOpt("dbname");
+
+ longOpt.addOpt("hostname", DEFAULTHOST);
+ longOpt.addOpt("pidfile", DEFAULTPIDFILE);
+ longOpt.addOpt("pgsize", Chain(DEFAULTPAGESIZE));
+ longOpt.addOpt("dbport", Chain(DEFAULTDBPORT));
+ longOpt.addOpt("admport", Chain(DEFAULTADMPORT));
+ longOpt.addOpt("logport", Chain(DEFAULTLOGPORT));
+
longOpt.addOpt("tableset");
longOpt.addOpt("cleanup");
longOpt.addOpt("forceload");
@@ -237,7 +259,11 @@
int exitCode = 0;
- if ( mode == Chain("adduser") )
+ if ( mode == Chain("init") )
+ {
+ exitCode = init(longOpt);
+ }
+ else if ( mode == Chain("adduser") )
{
exitCode = addUser(longOpt);
}
@@ -298,6 +324,60 @@
exit(exitCode);
}
+
+int init(GetLongOpt& longOpt)
+{
+
+ int exitCode = 0;
+
+ CegoDatabaseManager* pDBMng = 0;
+
+ try {
+
+ Chain logFile = longOpt.getOptValue("logfile");
+ Chain lockFile = longOpt.getOptValue("lockfile");
+ Chain dbXML = longOpt.getOptValue("dbxml");
+ Chain dbName = longOpt.getOptValue("dbname");
+
+ Chain hostname = longOpt.getOptValue("hostname");
+ Chain pidfile = longOpt.getOptValue("pidfile");
+ Chain pgsize = longOpt.getOptValue("pgsize");
+ Chain dbport = longOpt.getOptValue("dbport");
+ Chain admport = longOpt.getOptValue("admport");
+ Chain logport = longOpt.getOptValue("logport");
+
+ if ( dbXML.length() == 0 || dbXML == Chain("") )
+ {
+ throw Exception(EXLOC, "No dbxml set");
+ }
+
+ if ( dbName.length() == 0 || dbName == Chain("") )
+ {
+ throw Exception(EXLOC, "No database name set");
+ }
+
+
+ pDBMng = new CegoDatabaseManager(dbXML, lockFile, logFile);
+
+ pDBMng->initXml(dbName, pgsize.asInteger(), hostname, dbport.asInteger(), admport.asInteger(), logport.asInteger(), pidfile);
+
+ delete pDBMng;
+ }
+ catch ( Exception e)
+ {
+
+ if ( pDBMng )
+ delete pDBMng;
+
+ Chain msg;
+ e.pop(msg);
+ cerr << msg << endl;
+ exitCode = 1;
+ }
+ return exitCode;
+}
+
+
int addUser(GetLongOpt& longOpt)
{
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoSelect.cc
^
|
@@ -1408,6 +1408,7 @@
while ( pPred && checkPred )
{
+
if ( ! (*pPred)->isChecked() )
{
#ifdef CGDEBUG
@@ -1416,6 +1417,8 @@
CegoQueryHelper queryHelper;
// (*pPred)->clearAttrCache();
+
+
checkPred = queryHelper.evalPredicate(_pParentJoinBuf,
0,
_parentJoinBufSize,
@@ -1577,7 +1580,7 @@
void CegoSelect::consolidateConjunctionList()
{
-
+
bool finished = false;
while ( finished == false )
@@ -1602,41 +1605,44 @@
}
else
{
- return;
+ finished = true;
}
- bool isMerged=false;
- CegoPredDesc **pPredB = _conjunctionList.Next();
- while ( pPredB && isMerged == false )
+ if ( finished == false )
{
- if ( (*pPredB)->hasOrCond() )
+ bool isMerged=false;
+ CegoPredDesc **pPredB = _conjunctionList.Next();
+ while ( pPredB && isMerged == false )
{
- pPredB = _conjunctionList.Next();
- }
- else
- {
- tableRefSetB = (*pPredB)->getTableRefSet();
-
- if ( tableRefSetA == tableRefSetB )
+ if ( (*pPredB)->hasOrCond() )
{
- CegoPredDesc *pA = *pPredA;
- CegoPredDesc *pB = *pPredB;
-
- // cout << "Pred A = " << (*pPredA)->toChain() << endl;
- // cout << "Pred B = " << (*pPredB)->toChain() << endl;
-
- _conjunctionList.Remove(*pPredA);
- _conjunctionList.Remove(*pPredB);
-
- CegoCondDesc* pCond = new CegoCondDesc(CegoCondDesc::AND);
- pCond->setLeft(pA);
- pCond->setRight(pB);
+ pPredB = _conjunctionList.Next();
+ }
+ else
+ {
+ tableRefSetB = (*pPredB)->getTableRefSet();
- _conjunctionList.Insert(new CegoPredDesc(pCond));
- isMerged = true;
+ if ( tableRefSetA == tableRefSetB )
+ {
+ CegoPredDesc *pA = *pPredA;
+ CegoPredDesc *pB = *pPredB;
+
+ // cout << "Pred A = " << (*pPredA)->toChain() << endl;
+ // cout << "Pred B = " << (*pPredB)->toChain() << endl;
+
+ _conjunctionList.Remove(*pPredA);
+ _conjunctionList.Remove(*pPredB);
+
+ CegoCondDesc* pCond = new CegoCondDesc(CegoCondDesc::AND);
+ pCond->setLeft(pA);
+ pCond->setRight(pB);
+
+ _conjunctionList.Insert(new CegoPredDesc(pCond));
+ isMerged = true;
+ }
+ if ( isMerged == false )
+ pPredB = _conjunctionList.Next();
}
- if ( isMerged == false )
- pPredB = _conjunctionList.Next();
}
}
}
@@ -1644,7 +1650,7 @@
CegoPredDesc **pPred = _conjunctionList.First();
while ( pPred )
{
- (*pPred)->setChecked(false);
+ (*pPred)->setCheckedRec(false);
pPred = _conjunctionList.Next();
}
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoXMLSpace.cc
^
|
@@ -2124,6 +2124,53 @@
_xmlDef = xmlDef;
}
+
+void CegoXMLSpace::initXml(const Chain& dbName, int pageSize, const Chain& hostName, int dbPort, int admPort, int logPort, const Chain& pidFile)
+{
+
+ P();
+
+ try {
+
+ XMLSuite xml;
+ xml.setDocument(_pDoc);
+
+ _pDoc->setDocType(Chain(CEGO_DB_DOC));
+ _pDoc->setAttribute(XML_VERSION_ATTR, XML_VERSION_VALUE);
+
+ Element *pElement = new Element(XML_DATABASE_ELEMENT);
+ pElement->setAttribute(XML_NAME_ATTR, dbName);
+ pElement->setAttribute(XML_PAGESIZE_ATTR, Chain(pageSize));
+ pElement->setAttribute(XML_HOSTNAME_ATTR, hostName);
+ pElement->setAttribute(XML_DATAPORT_ATTR, Chain(dbPort));
+ pElement->setAttribute(XML_ADMINPORT_ATTR, Chain(admPort));
+ pElement->setAttribute(XML_LOGPORT_ATTR, Chain(logPort));
+ pElement->setAttribute(XML_PIDFILE_ATTR, pidFile);
+
+ _pDoc->setRootElement(pElement);
+
+ Chain xmlChain;
+ xml.getXMLChain(xmlChain);
+
+ File xmlFile(_xmlDef);
+
+ xmlFile.open(File::WRITE);
+
+ xmlFile.writeChain(xmlChain);
+
+ xmlFile.close();
+
+ }
+ catch ( Exception e )
+ {
+ V();
+ throw Exception(EXLOC, Chain("Cannot write file ") + _xmlDef, e);
+ }
+ V();
+}
+
+
+
void CegoXMLSpace::xml2Doc()
{
|
[-]
[+]
|
Changed |
cego-2.13.11.tar.bz2/src/CegoXMLSpace.h
^
|
@@ -177,6 +177,7 @@
void setXmlDef(const Chain& xmlDef);
+ void initXml(const Chain& dbName, int pageSize, const Chain& hostName, int dbPort, int admPort, int logPort, const Chain& pidFile);
void xml2Doc();
void doc2Xml();
void initDoc();
|