Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: Missing bytes in Jet 4 TDEF block? #430

Open
ReubenFrankel opened this issue Jan 31, 2024 · 1 comment
Open

question: Missing bytes in Jet 4 TDEF block? #430

ReubenFrankel opened this issue Jan 31, 2024 · 1 comment

Comments

@ReubenFrankel
Copy link

mdbtools/HACKING.md

Lines 491 to 506 in bb83142

+-------------------------------------------------------------------------+
| Iterate for the number of num_idx (28 bytes) |
+-------------------------------------------------------------------------+
| ???? | 4 bytes | unknown | matches first unknown definition block |
| ???? | 4 bytes | index_num | Number of the index |
| | | |(warn: not always in the sequential order)|
| ???? | 4 bytes | index_num2 | Index into index cols list |
| 0x00 | 1 byte | rel_tbl_type| type of the other table in this fk |
| | | | (same values as index_type) |
| 0xFF | 4 bytes | rel_idx_num | index number of other index in fk |
| | | | (or -1 if this index is not a fk) |
| 0x00 | 4 bytes | rel_tbl_page| page number of other table in fk |
| 0x01 | 1 byte | cascade_ups | flag indicating if updates are cascaded |
| 0x01 | 1 byte | cascade_dels| flag indicating if deletes are cascaded |
| ???? | 1 byte | index_type | 0x01 if index is primary, 0x02 if foreign|
+-------------------------------------------------------------------------+

In this section of the Jet4 TDEF block, the definition segments don't add up to 28 bytes (24 bytes specified, 4 missing). Should there be another entry at the end like

 +-------------------------------------------------------------------------+ 
 | Iterate for the number of num_idx (28 bytes)                            | 
 +-------------------------------------------------------------------------+ 
 | ???? | 4 bytes | unknown     | matches first unknown definition block   | 
 | ???? | 4 bytes | index_num   | Number of the index                      | 
 |      |         |             |(warn: not always in the sequential order)| 
 | ???? | 4 bytes | index_num2  | Index into index cols list               | 
 | 0x00 | 1 byte  | rel_tbl_type| type of the other table in this fk       | 
 |      |         |             | (same values as index_type)              | 
 | 0xFF | 4 bytes | rel_idx_num | index number of other index in fk        | 
 |      |         |             | (or -1 if this index is not a fk)        | 
 | 0x00 | 4 bytes | rel_tbl_page| page number of other table in fk         | 
 | 0x01 | 1 byte  | cascade_ups | flag indicating if updates are cascaded  | 
 | 0x01 | 1 byte  | cascade_dels| flag indicating if deletes are cascaded  | 
 | ???? | 1 byte  | index_type  | 0x01 if index is primary, 0x02 if foreign| 
 | ???? | 4 bytes | unknown     |                                          |
 +-------------------------------------------------------------------------+ 

?

In testing an implementation of this for access-parser, I've seen the data slowly get more out-of-sync (or offset) on each index iteration, without this 4-byte "padding". I think 28 bytes is the correct size; there's just some missing bytes to account for (my knowledge of Access files is pretty limited, so I could be way off here - I'm definitely struggling with the terminology 😅).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant