Commit 557b1a87 authored by claes's avatar claes

Bugfix in update classes, all attrrefs wasn't updated

parent 049818cd
/*
* Proview $Id: wb_vrepdb.cpp,v 1.52 2007-06-18 06:23:06 claes Exp $
* Proview $Id: wb_vrepdb.cpp,v 1.53 2007-07-12 12:20:15 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -78,6 +78,8 @@ typedef struct sClass
pwr_tObjName name;
pwr_tTime o_time;
pwr_tTime n_time;
size_t o_rbsize;
size_t n_rbsize;
pwr_tUInt32 count;
} sClass;
......@@ -1776,6 +1778,7 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
{
pwr_tStatus sts;
sArefKey ak;
int nAref[2] = {0, 0};
int rbSize = 0;
int dbSize = 0;
......@@ -1835,8 +1838,22 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
if (EVEN(sts)) printf("n_cdrep sts %d", sts);
wb_bdrep *n_bdrep = n_cdrep->bdrep(&sts, ap->key.bix);
if (EVEN(sts)) printf("n_bdrep sts %d", sts);
if (EVEN(sts)) {
ap = (sAref *)tree_FindSuccessor(&sts, m_aref_th, &ap->key);
continue;
}
if ( arp->Flags.b.Object) {
// Check if rbody size of changed
pwr_tCid cid = aohead.cid();
sClass *cp = (sClass *)tree_Find(&sts, m_class_th, &cid);
if ( cp && cp->n_rbsize != cp->o_rbsize) {
arp->Size = cp->n_rbsize;
nAref[ap->key.bix - 1]++;
}
}
else {
sAttributeKey k;
k.cid = aohead.cid();
k.bix = ap->key.bix;
......@@ -1865,7 +1882,7 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
arp->Size = nElementSize;
}
}
}
} catch (DbException &e) {
//printf("DbException vrepdb updateArefs 2: %s, oid: %d.%d, cid: %d \n", e.what(), oid.vid, oid.oix, cid);
} catch (wb_error &e) {
......@@ -1928,6 +1945,8 @@ pwr_tStatus wb_vrepdb::updateMeta()
pwr_tCid cid = ip.cid();
sClass *cp = (sClass *)tree_Find(&sts, m_class_th, &cid);
nAref += updateArefs(ip.oid(), ip.cid());
if (!cp)
continue;
......@@ -1936,7 +1955,6 @@ pwr_tStatus wb_vrepdb::updateMeta()
if (time_IsNull(&cp->n_time))
continue;
nAref += updateArefs(ip.oid(), ip.cid());
nObject += updateObject(ip.oid(), ip.cid());
}
} catch (DbException &e) {
......@@ -2043,6 +2061,8 @@ wb_vrepdb::checkClass(pwr_tCid cid)
sClass *ccp = (sClass *)tree_Insert(&sts, m_class_th, &cid);
ccp->o_time = o_time;
ccp->n_time = n_time;
ccp->o_rbsize = o_crep->size( pwr_eBix_rt);
ccp->n_rbsize = n_crep->size( pwr_eBix_rt);
strcpy(ccp->name, o_crep->name());
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment