[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.10.5
+ Version 2.10.6
(C)opyright 2006,2007,2008,2009,2010,2011 by Bjoern Lemke
|
[-]
[+]
|
Added |
cego-2.10.6.tar.bz2/samples/chkdb/check029.sql
^
|
@@ -0,0 +1,25 @@
+--
+-- ### Counter checks
+--
+-- and basic table creation / retrieval
+--
+
+drop if exists table fico_account;
+drop if exists counter 'accid';
+
+create table fico_account ( primary aid int not null, accountname string(20));
+create counter 'accid';
+insert into fico_account values ( nextcount('accid'), 'MyAccount');
+insert into fico_account values ( nextcount('accid'), 'YourAccount');
+set counter 'accid' to 1000;
+insert into fico_account values ( nextcount('accid'), 'XAccount');
+insert into fico_account values ( nextcount('accid'), 'YAccount');
+
+
+
+set b = nextcount('accid');
+
+insert into fico_account values ( setcount('accid', 10000), 'MoreAccount');
+
+insert into fico_account values ( nextcount('accid'), 'LastAccount');
+select * from fico_account;
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/src/CegoAction.cc
^
|
@@ -3537,7 +3537,7 @@
_pSelect = new CegoSelect(coList, exprList, pPredDesc, pGroupList, pHavingDesc, pOrderingList, pOrderingOptList, isDistinct, rowLimit, _pTabMng);
- int tabSetId = _pTabMng->getDBMng()->getTabSetId(_tableSet);
+ int tabSetId = _pTabMng->getDBMng()->getTabSetId(_tableSet);
_pSelect->setTabSetId(tabSetId);
CegoSelect *pUnion = 0;
@@ -4416,11 +4416,13 @@
}
else if ( functionName.toLower() == Chain("nextcount") )
{
- pFunc = new CegoFunction(CegoFunction::NEXTCOUNT);
+ int tabSetId = _pTabMng->getDBMng()->getTabSetId(_tableSet);
+ pFunc = new CegoFunction(_pTabMng, tabSetId, CegoFunction::NEXTCOUNT);
}
else if ( functionName.toLower() == Chain("setcount") )
{
- pFunc = new CegoFunction(CegoFunction::SETCOUNT);
+ int tabSetId = _pTabMng->getDBMng()->getTabSetId(_tableSet);
+ pFunc = new CegoFunction(_pTabMng, tabSetId, CegoFunction::SETCOUNT);
}
else
{
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/src/CegoDefs.h
^
|
@@ -40,7 +40,7 @@
#endif
#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.10.5"
+#define CEGO_VERSION "2.10.6"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2011 by Bjoern Lemke. All rights reserved"
/*******************************/
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/src/CegoFunction.cc
^
|
@@ -63,6 +63,13 @@
_type = type;
}
+CegoFunction::CegoFunction(CegoDistManager* pTabMng, int tabSetId, CegoFunction::FunctionType type)
+{
+ _pTabMng = pTabMng;
+ _tabSetId = tabSetId;
+ _type = type;
+}
+
CegoFunction::CegoFunction(CegoDistManager* pTabMng, int tabSetId, const Chain& funcName, ListT<CegoExpr*>& exprList)
{
_pTabMng = pTabMng;
@@ -142,9 +149,9 @@
if ( _type == BITXOR && exprList.Size() != 2)
throw Exception(EXLOC, "Invalid parameter count for bitxor function");
if ( _type == NEXTCOUNT && exprList.Size() != 1)
- throw Exception(EXLOC, "Invalid parameter count for bitxor function");
+ throw Exception(EXLOC, "Invalid parameter count for nextcount function");
if ( _type == SETCOUNT && exprList.Size() != 2)
- throw Exception(EXLOC, "Invalid parameter count for bitxor function");
+ throw Exception(EXLOC, "Invalid parameter count for setcount function");
_exprList = exprList;
}
@@ -847,16 +854,18 @@
}
case CegoFunction::NEXTCOUNT:
{
-
+
CegoExpr** pExpr = _exprList.First();
CegoFieldValue fv;
fv = (*pExpr)->evalFieldValue();
Chain counter = fv.valAsChain();
-
+
long v = _pTabMng->getDBMng()->getCounterValue(_tabSetId, counter, 1);
+
CegoFieldValue retVal(LONG_TYPE, Chain(v));
+
return retVal;
}
case CegoFunction::SETCOUNT:
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/src/CegoFunction.h
^
|
@@ -85,6 +85,8 @@
CegoFunction(char* buf, CegoDistManager *pGTM);
CegoFunction(FunctionType funcType);
CegoFunction(FunctionType funcType, ListT<CegoExpr*>& exprList);
+
+ CegoFunction(CegoDistManager* pTabMng, int tabSetId, CegoFunction::FunctionType type);
CegoFunction(CegoDistManager* pTabMng, int tabSetId, const Chain& funcName, ListT<CegoExpr*>& exprList);
CegoFunction(Element* pFunctionElement, CegoDistManager *pGTM);
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/src/CegoMain.cc
^
|
@@ -1085,10 +1085,6 @@
{
cout << "Batch done" << endl;
}
- else
- {
- cerr << "ERROR: " << errorMsg << endl;
- }
return exitCode;
@@ -1572,7 +1568,8 @@
}
pDBMng->log(modId, Logger::LOGERR, Chain("Batch Thread : ") + exep);
-
+
+ errorMsg=e.getBaseMsg();
if ( ignoreError )
{
@@ -1580,7 +1577,7 @@
if ( consoleOut )
{
cerr << Chain("Error ignored at line number ") + Chain(lineNo) + " : ";
- cerr << exep << endl;
+ cerr << errorMsg << endl;
}
}
else
@@ -1588,10 +1585,9 @@
if ( consoleOut )
{
cerr << Chain("Line Number ") + Chain(lineNo) + Chain(" : ");
- cerr << exep << endl;
+ cerr << errorMsg << endl;
}
- errorMsg=e.getBaseMsg();
return false;
}
|
[-]
[+]
|
Changed |
cego-2.10.6.tar.bz2/src/CegoSelect.cc
^
|
@@ -637,7 +637,7 @@
if ( (*pAD)->isValid() == false )
{
// cout << "Detected " << (*pAD)->toChain() << " as unknwon" << endl;;
- throw Exception(EXLOC, Chain("Unknown attribute :") + (*pAD)->toChain());
+ throw Exception(EXLOC, Chain("Unknown attribute ") + (*pAD)->toChain());
}
_pLogger->log(_modId, Logger::DEBUG, Chain("Validated attribute reference ") + (*pAD)->toChain());
|