It looks like the midas history system has problems with data padding:
- log_system_history() in mlogger writes “/history/links” history, it calls hs_write_event() with a data buffer that does not have any padding, data size is the sum of individual link items.
- log_history() in mlogger writes “/equipment/xxx/variables” history, it calls hs_write_event() with a data buffer filled by db_get_record(), where each data item is padded per c++ padding rules for struct data members. data size includes the struct size padding (see bug
Obviously the two data formats are not compatible (one has padded data, the other has unpadded data).
When reading from history:
- mhdump.cxx assumes padded data, not clear if padding rules are same as db_get_record()
- history.cxx (“MIDAS” history) seems to assume unpadded data, hs_read() computes the offset by adding size of all tags, without padding.
- history_schema.cxx (MySQL, Sqlite and “FILE” history) assumes unpadded data.
So the best I can tell, mlogger writes padded data, all readers assume unpadded data. How did all this ever work?!? I will need to debug it some more.