From 74aca167d5209c148bcbc349d7d6cee7cde55467 Mon Sep 17 00:00:00 2001 From: brianb Date: Thu, 9 Mar 2000 03:01:41 +0000 Subject: [PATCH] Fixed some doc. Reverted to Access datatype names in table.c --- HACKERS | 15 ++++++--------- TODO | 11 +++++++++++ src/libmdb/table.c | 14 +++++++------- 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 TODO diff --git a/HACKERS b/HACKERS index 85711a2..16a71e2 100644 --- a/HACKERS +++ b/HACKERS @@ -63,6 +63,10 @@ record ends on byte 2047 (0 based). Some of the offsets are not within the bounds of the page. The reason for this is not presently understood and the current code discards them silently. +Offsets that have 0x40 in the high order byte point to a location within the +page where a pointer to another catalog page is stored. This does not seem to +yeild a complete chain of catalog pages and is currently being ignored in favor +of a brute force read of the entire database for catalog pages. Little is understood of the meaning of the bytes that make up the records. They vary in size, but portion prior to the objects name seems to be fixed. All @@ -182,7 +186,7 @@ have not looked at tables large enough for this to occur yet. KKD Records ----------- -Design View table definitions look to be stored in 'KKD' records (my name for +Design View table definitions appear to be stored in 'KKD' records (my name for them...they always start with 'KKD\0'). Again these reside on pages, packed to the end of the page. @@ -205,12 +209,5 @@ Next comes one of more rows of data. (column names, descriptions, etc...) 16 bit length field (non-inclusive) value (07.53 for the AccessVersion example above) -See kkd.c for an examples, although it needs cleanup. - -Futures -------- - -Near term, I'd like to be able to pull the definitions for user tables out of -the MDB file and into a MySQL/Postgresql/Sybase/Oracle/DB2/etc... and then -populate the data across in one clean automated process. +See kkd.c for an example, although it needs cleanup. diff --git a/TODO b/TODO new file mode 100644 index 0000000..9510875 --- /dev/null +++ b/TODO @@ -0,0 +1,11 @@ +Things to Do +------------ + +. Implement code for reading data rows +. Complete list of datatypes +. Figure out how to properly determine fixed of variable length columns +. Figure out how NULLs are stored in data rows +. Figure out what happens for varchar columns > 256 +. Write schema-export utility supporting different backend databases +. Write data-export utility supporting different backend databases + diff --git a/src/libmdb/table.c b/src/libmdb/table.c index a7c37fb..03c019d 100644 --- a/src/libmdb/table.c +++ b/src/libmdb/table.c @@ -24,22 +24,22 @@ char *mdb_get_coltype_string(int col_type) { /* -** need to do this is a way that will allow multiple outputs for different -** backend servers...these are MS SQL/Sybase specific +** These are the Access datatype names, each backend will have to provide +** its own mapping. */ static char *type_name[] = {"Unknown 0x00", "Unknown 0x01", "Unknown 0x02", - "smallint", - "int", + "Integer", + "Long Integer", "Unknown 0x05", "Unknown 0x06", "Unknown 0x07", - "smalldatetime", + "DateTime (Short)", "Unknown 0x09", - "varchar", + "Varchar", "Unknown 0x0b" - "hyperlink -- fixme" + "Hyperlink" }; if (col_type > 11) {