Commit c26fd98c authored by Claes's avatar Claes Committed by Esteban Blanc

Sev db tree didn't work for array elements

parent 65c102df
......@@ -48,6 +48,7 @@ pwr_tStatus sev_db::tree_update()
int onum;
pwr_tAName hname;
pwr_tAName aname;
pwr_tAName attrname;
pwr_tStatus sts;
pwr_tOid oid;
pwr_tCid cid = 0;
......@@ -100,7 +101,17 @@ pwr_tStatus sev_db::tree_update()
strcpy(aname, s);
strcat(aname, ".");
strcat(aname, m_items[i].attr[j].aname);
strcpy(attrname, m_items[i].attr[j].aname);
// Replace array index [x] with __x
if ((s = strrchr(attrname, '['))) {
int idx;
num = sscanf(s+1, "%d", &idx);
if ( num != 1)
continue;
*s = 0;
sprintf(s, "__%d", idx);
}
strcat(aname, attrname);
onum = dcli_parse(aname, "-", "", (char*)oname_array,
sizeof(oname_array) / sizeof(oname_array[0]), sizeof(oname_array[0]),
0);
......
......@@ -2605,8 +2605,6 @@ int sev_dbms::store_event(
else
con = m_env->con();
printf("Store event:eventstatus %u\n", ep->eventstatus);
*sts = time_AtoAscii(
&ep->time, time_eFormat_NumDateAndTime, timstr, sizeof(timstr));
if (EVEN(*sts))
......@@ -5081,7 +5079,6 @@ int sev_dbms::get_events(pwr_tStatus *sts, void *thread, pwr_tOid oid,
sprintf(query, "select %s from %s %s order by %s %s", column_part,
item.tablename, where_part, orderby_part, limit_part);
printf("Query: %s\n", query);
rc = mysql_query(con, query);
if (rc) {
printf("In %s row %d:\n", __FILE__, __LINE__);
......
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