Commit Graph

61 Commits

Author SHA1 Message Date
Evan Miller
fe0175aa63
Migrate to g_memdup2 (#288)
With fakeglib and older versions of GLib, fall back to g_memdup with
a #define inside mdbprivate.h.

Fixes #287
2021-04-05 09:04:29 -04:00
Evan Miller
c31daeb2c4 Improved bounds and return value checking (oss-fuzz/29329) 2021-01-07 19:59:45 -05:00
Evan Miller
538711e450 Remove unnecessary casts 2020-12-28 22:30:20 -05:00
Evan Miller
5705d595c8 Replace constant with sizeof() 2020-12-28 21:06:38 -05:00
Evan Miller
3001c3b94f Use the language ID from the DB header for indexing
According to the HACKING file, the file's default language ID is stored
in the database header. Use this value instead of a generic English
language locale for indexing JET4 files.

Columns can have their own text sorting rules, including language ID
distinct from the file's language ID, but this is not addressed as we'd
have to break the mdb_index_hash_text function signature, which I'm not
prepared to do just yet.

There appear to be two bytes after the language ID that may indicate
additional sorting flags. These bytes need additional research.
2020-12-21 09:11:42 -05:00
Rainer Hurling
5b292e0063
Unsigned error in index.c
On FreeBSD 13.0-CURRENT its compiler clang-11.0.0 complains:
index.c:388:14: error: comparison of integers of different signs: 'int' and 'unsigned int' [-Werror,-Wsign-compare]
                for (i=0; i<len+1; i++) {
                          ~^~~~~~
2020-10-24 20:29:46 +02:00
Evan Miller
131b443102 Do not exit from library 2020-10-18 09:45:51 -04:00
Evan Miller
90ee7bfcb5 Remove references to dmalloc
There are more modern tools for memory debugging, get rid of DMALLOC
crap in the source code.

I've left one reference in backend.c to prevent a merge conflict but
this can be removed later.
2020-08-20 08:59:08 -04:00
Nyall Dawson
1639283779 Fix int/guint comparison warnings 2020-08-12 13:04:20 +10:00
Evan Miller
c93156626c Fix all sign-compare warnings
Also flip on -Wsign-compare in the default configuration
2020-08-09 16:15:20 -04:00
Evan Miller
0407fc3a8d Fix type-pun warning 2020-08-05 23:03:10 -04:00
leecher1337
e9ec53f6bd Fixing JET4 Index support via libmswstr. Used as a separate library to do it like MS Jet and to ensure that mdbtools library doesn't get tainted with its source. 2017-12-05 00:13:28 +01:00
leecher1337
c81d35f2ea Optimization: Assuming that the index is sorted, I guess an index search can bail out as soon as target value has been found? 2017-12-03 23:25:35 +01:00
leecher1337
4edb48ed17 Bugfixes for JET4 indices. 2017-12-03 23:20:11 +01:00
leecher1337
42cdc6727e index.c: Centralised debugging helper 2017-12-03 18:18:21 +01:00
Ewen McNeill
999f6f5f10 JET 4: index flags (eg, UNIQUE) 4 bytes later
Re-reverse engineered index meta information layout in JET 4
file format, based particularly on jackcess (Java) JET/Access
database library (https://github.com/jahlborn/jackcess), and
hexdumps of JET 4 database index meta information.  Based both
on byte counting of jackcess reading of index definitions and
also expected flag values (0x80, 0x89, etc), the flags of JET 4
index definition are 4 bytes later than mdbtools previously thought.

See IndexData.read() and private static class Jet4Format in
src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java
src/main/java/com/healthmarketscience/jackcess/impl/JetFormat.java
in jackcess source for layout reference.

Now appears to get sensible "CREATE INDEX"/"CREATE UNIQUE INDEX"
behaviour on export to PostgreSQL schema.

Also added extensive index definition byte layout reference to top
of src/libmdb/index.c for ease of reference, plus more debugging
assistance (and comments of phases reading index for readability).
2016-04-08 10:23:10 +12:00
Nirgal Vourgère
7841d30d43 Revert use of config.h
Revert
7162e8db74
088493d499

And drop AC_CONFIG_HEADERS so that config goes though the command line.
No longer generating config.h, update .gitignore
2013-07-15 02:42:12 +02:00
Nirgal Vourgère
7162e8db74 Include config.h in all .c files
Need to be the first file since it may define large files support
and other options.
2013-07-04 10:53:13 +02:00
Jean-Michel Vourgère
c566407eaf Experimental support for JET5 .accdb files
Right now, they are handled like JET4 file.
2012-07-03 00:31:23 +02:00
Jean-Michel Vourgère
8becb3fa6d Don't try to update index if it is not found
This quiets compiler warning about possibly uninitialized var
2012-07-01 12:50:00 +02:00
Nirgal Vourgre
dd0f4c3819 Patch docs.diff from Nirgal 2011-08-28 19:53:29 -04:00
Nirgal Vourgre
aee657f603 Patch warnings.diff from Nirgal 2011-08-28 19:48:44 -04:00
Nirgal Vourgre
1f2749cdfc Patch bufferdump.diff from Nirgal 2011-08-28 19:43:52 -04:00
Mark Williams
b5cabb1834 Fixing segfault-causing off-by-one error in index.c 2011-08-28 18:52:16 -04:00
Brian Bruns
be2a287f5c fix index counting, from Nirgal Vourgère 2011-02-07 21:57:13 -05:00
whydoubt
bc71178167 Fix and tidy up read_pg_in* functions 2005-12-17 15:59:18 +00:00
whydoubt
eb9bba1d10 Alter buffer_dump's third parameter from 'end' to 'length' 2005-07-02 07:16:04 +00:00
whydoubt
d0474b4692 Remove remaining int24 uses 2005-06-23 07:04:17 +00:00
whydoubt
160418635d Clean up some gcc4 warnings 2005-05-02 12:46:33 +00:00
brianb
2002c19cee mdb-import fixes, kinda works now 2005-02-11 16:24:01 +00:00
whydoubt
d271b5fae5 Better compressed text handling 2004-12-11 06:07:20 +00:00
brianb
fa8d24dd2b patch from Wind Li for iconv on jet3.
Small changes from me for writing.
2004-12-01 23:31:48 +00:00
brianb
34a9eac4ea iconv conversion code 2004-11-26 05:22:52 +00:00
whydoubt
4cc424f913 Warnings fixes 2004-07-17 14:21:43 +00:00
whydoubt
e121a82946 Lots more gcc warnings fixes 2004-07-09 12:47:04 +00:00
whydoubt
40f3afdbb7 Fixes based on 'gcc -W -Wall' warnings 2004-07-03 04:56:07 +00:00
whydoubt
ba6f5b30cc Replace a function with an equivalent GLib macro 2004-06-18 06:05:33 +00:00
whydoubt
00d9fddc69 Reconcile code/documentation inconsistencies 2004-06-18 05:10:44 +00:00
brianb
bde195357e fix reading of deleted/added columns 2004-04-16 15:45:12 +00:00
brianb
1295d079ae first cut at gtk-doc 2004-04-13 00:39:12 +00:00
brianb
4bb08b6661 lots of small fixes (see Changelog) 2004-03-13 15:07:18 +00:00
brianb
fb02e23b6b code to handle options and debugging 2004-02-16 02:00:45 +00:00
brianb
eb2b863b35 support routine for index writes
port fix from data.c to mdb_crack_row?()
more tdef4 dissector work in gmdb2
2004-02-15 06:00:25 +00:00
brianb
feba3eece6 bugfix for new index algortihm. 2004-02-14 19:40:35 +00:00
brianb
3a9aa2ceb7 add -M option to mdb-ver
make gmdb2 version match mainline code
new dissector for jet4 tdef pages in gmdb2
gmdb2 right mouse click behaviour bugfix
pre-compute index page bitmap in mdb_index_unpack_page() in preparation for index writes.
2004-02-13 18:49:51 +00:00
brianb
a62f26df50 support for compressed index keys and trailing leaves 2004-02-11 22:05:13 +00:00
brianb
5f02ba4fd2 add IS NULL/IS NOT NULL support, patches 2004-02-06 23:55:18 +00:00
brianb
a74094c667 sync up, see ChangeLog for details 2004-02-06 02:34:20 +00:00
brianb
278cf8ef42 fix compiler warnings in libmdb/ util/ sql/ 2004-01-10 01:52:56 +00:00
brianb
d39cc57b44 Some work on indexes/write support. Bug fixes. Preliminary temp table/worktable work. 2004-01-09 21:05:56 +00:00