Re: tblog decode of HUPDAT type record
Posted in 1994
In article <opusRXAY8233@starsight.com>, daniel@starsight.com, dwood@informix.com (Daniel Wood) wrote: > charlie_sadler@mathworks.com (Charlie Sadler) writes: > > Can anyone tell me the before and after column values of this updated row? > > The following segment is output from the "tblog -l" command. > > > > 402c 56 HUPDAT 3 0 4018 2000380 101 0 20 > > 20 3 > > 00380049 00000003 00004018 02000380 .8.I.... ..@..... > > 00000101 00000000 00140014 00030000 ........ ........ > > 00026332 43320006 00020000 1700000c ..c2C2.. ........ > > 00026332 43326e2f ..c2C2n/ > > [...] > > I ran in a similar situation where I wanted to rollback a committed transaction. > I was going to run a sed/awk script over the log records to create a reverse > update but when I looked at the logs I found the undocumented HUPDAT record > type. After staring at this hex for a bit I found the following(Using the > above as an example): > > The two '0014' are probably the row size before and after the update. > The '0003' is the number of change fragment entries that follow and > look like: > rowoffset=0000 len=0002 olddata=6332 newdata=4332 > rowoffset=0006 len=0002 olddata=0000 newdata=1700 > rowoffset=000c len=0002 olddata=6332 newdata=4332 > > So your old row looked like: > 6332........0000........6332.............. > and the new old like: > 4332........1700........4332.............. > where the dots represent unchanged nibbles. > > [...] Daniel: Thanks for the decode! I understand why Informix would want to encode updates into the log in this manner. This obviously has a performance advantage over an entire before and after image of the changed columns. However this manner of encoding makes using the log file in an audit manner more difficult. I cannot look at the current value of a rows column and immediately match that to the after update value contained in the log. I see that you are associated with Informix, so at the risk that you are not the correct person to make this plea to, IT WOULD BE VERY VERY NICE IF THERE WAS A TBCONFIG FLAG THAT FORCES THE LOG TO CONTAIN BEFORE AND AFTER IMAGES OF AN UPDATED ROW ON A COLUMN (NOT BYTE) BASIS!!! Then people who (like me) are willing to sacrifice a little performance for an improved audit trail would take advantage of the new flag. Thanks for listening, charlie_sadler@mathworks.com