Saving file doesn't work
The operators reported that I3 would return error: "Err:insert new rec failed,try to recover old one SQL__SYNTAX". Elog entry 41980.
#2 Updated by Kyle Hazelwood about 6 years ago
- File I3SQLError.PNG I3SQLError.PNG added
- File I3SQLInsert.PNG I3SQLInsert.PNG added
- File I3SQLInsertDataNaN.PNG I3SQLInsertDataNaN.PNG added
- Description updated (diff)
- Assignee set to Kyle Hazelwood
The application appears to be passing NaN to the DB for a few float values.
#5 Updated by Kyle Hazelwood about 6 years ago
So the save feature works as such:
- hv.cpp > hv_save()
- hv.cpp > hv_convert()
- hv.cpp > table.cpp > table_save()
- table.cpp > table_rec_w()
Everything appears fine until table_rec_w(). The float array leaving table_save() has no NaNs. As soon as the float array of values is passed to the table_rec_w() routine using the GEN_TABLE struct the float array is padded with some very small values and NaN at indices 231 and 233. I can get the save to complete successfully by overriding the values at indices 231 and 233 with zero.
#6 Updated by Kyle Hazelwood about 6 years ago
This may have been a problem for sometime. The I3 program log shows this error occurring back on December 30, 2014. Unfortunately the log has a 1000 line limit which puts the logger at December 17, 2014. There are no successful file saves recorded other than the one I fudged tonight.
#8 Updated by Kyle Hazelwood almost 6 years ago
In hv_save() the HV_TABLE object contains a TABLE_HDR object, a float20 for pars and an HV_SLOT52 for slots. The HV_TABLE object is cast to a GEN_TABLE object that contains a TABLE_HDR object and a float236. Each HV_SLOT is 4 floats. That makes a HV_TABLE object actually a TABLE_HDR object and a float228, this is shy 8 floats for the GEN_TABLE object (two HV_SLOTS). The GEN_TABLE object never populates its last 8 float indices leaving in a couple NaNs.
#9 Updated by Kyle Hazelwood almost 6 years ago
- Status changed from Assigned to Resolved
I'm able to fix the issue completely by increasing the HV_MAX_SLOTS constant in table.h to 54 from 52. This causes the GEN_TABLE struct to be filled completely with zeros as padding. I'm not sure why this problem occurred. There hasn't been any significant updates for years to any of the code responsible for this feature. I'm testing the fix tonight.