Commit Graph

122 Commits

Author SHA1 Message Date
Evan Miller
99099cdada Remove unnecessary "extern" keywords from header files 2020-08-09 16:14:19 -04:00
Evan Miller
2e6e88b96f Improve bounds and return-value checking
Fixes a memory leak and a number of buffer overruns
2020-08-06 15:17:04 -04:00
Evan Miller
e9f4c6c786 Remove GLib dependency WIP
Add a shim implementing half-assed versions of most of the GLib
functions used by MDB Tools. If GLib is detected at compile-time,
use it, otherwise use the shim.

This work is not complete, as the option-parsing code is not yet
implemented - so most of the command-line tools crash.
2020-08-03 17:19:40 -04:00
VJ
c8fd67bf84 Fix more warnings as a result of #14 2019-05-31 21:59:37 -04:00
Evan Miller
cdde7c3268 Enable strict prototypes warnings, and fix warnings
If a host project has -Wstrict-prototypes enabled, the mdbtools header
results in warnings. Turn on -Wstrict-prototypes for the whole project
so that these never occur again.
2018-12-29 10:34:54 -05:00
Evan Miller
0e9c1810f1 Improved support for Access 2010, 2013, and 2016
Some Access 2010 files use 0x03 as the version number rather than
0x0103. For this reason I have changed the call to mdb_get_int32 to
mdb_get_byte.

In addition, according to the Library of Congress page:

https://www.loc.gov/preservation/digital/formats/fdd/fdd000463.shtml

Access 2016 uses 0x05 as the version number. I have inferred from the
Wikipedia page that Access 2013 likely uses 0x04.
2018-03-05 06:39:57 -05:00
Cyber Emissary
278f9ba441 Implemented bulk insert 2018-02-12 15:21:15 -05: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
135f452407
Merge branch 'master' into master 2017-12-03 17:02:15 +01:00
Ewen McNeill
8b1db6c08e mdb-export: Add boolean words option (TRUE/FALSE)
Adds "-B" (--boolean-words) option to mdb-export, which will reconfigure
mdb/data.c to export TRUE/FALSE for boolean values instead of 1/0.  The
option is needed to support BOOLEAN fields on PostgreSQL, which will not
implicitly cast bare 1/0 into a BOOLEAN value.  Value literals are the
SQL TRUE/FALSE, and _quoted_ words meaning true/false and _quoted_
'1'/'0'.  With this flag the SQL TRUE/FALSE values are output, which should
work with several SQL databases.

PostgreSQL Reference:

http://www.postgresql.org/docs/current/static/datatype-boolean.html
2016-04-07 08:45:06 +12:00
leecher1337
e2449c11f3 Added strptime function to SQL parser as a feature. This is needed to i.e. be able to query time-fields in DB and to use dates <1.1.1970 and >19.1.2038. All changes should be backwards-compatible to not break existing queries. 2015-08-30 11:23:57 +02:00
Nirgal Vourgère
7495034eef Fix FSF address in headers 2013-07-04 13:50:33 +02:00
Nirgal Vourgère
0196d34d7b __attribute__ change into macro
Makes it easier to port to another compiler.
Thanks Jimmy Taker
2013-06-28 01:51:52 +02:00
Jimmytaker
46005ae009 MDB_DEPRECATED redefined, Constructor MACRO, generate_table_schema changed to not static, date_fmt to ISODate
__attribute__ does not exist in Visual Studio. Therefore replaced wherever it appeared with a macro:
Redefines MDB_DEPRECATED to support Visual Studio
Define a Constructor MACRO so that __attribute__((constructor/destructor)) behavior is achieved in Visual Studio.

Just using generate_table_schema through mdb_print_schema deletes the purpose of a very good tool. generate_table_schemas is a rewrite of generate_table_schema but sends the data to a char* instead of FILE*. There is NO fmemopen() or similar in Visual Studio, so there is NO way to access memory through a FILE* except for first writing to the disk and then reading from the disk in memory.

I cannot suggest how to handle the case when td == 0 for the dates. The databases I work with often have just 00:00:00 in the DateTime column which is not consistent with the rest of the column either, but I have to deal with it somehow.

Leaving void* where char* is needed as a function parameter returns a compilation error in Visual Studio.
2013-01-14 19:27:53 +01:00
Nirgal Vourgère
a972c1638d merge with master 2013-01-14 14:20:10 +01:00
Nirgal Vourgère
eeadcb54f3 Use macros for depreacated function attributes
This will help porting on compilers that don't support it
2013-01-13 23:50:42 +01:00
Nirgal Vourgère
8a545120d7 Migrate mdb-export changes to gmdb2
Support for octal/stip of binary
Customisation of escape string
Quoting is done according to types rather that empiric analysis of str
conversion.
2013-01-13 21:20:00 +01:00
Jimmytaker
6df0aa6ce0 Port to Windows and SQLite Extension 2012-12-31 20:40:12 +01:00
Nirgal Vourgère
5f09513c85 Deprecate more mdb_{init|remove}_backends
These functions now use the __attribute__((constructor)) & destructor.
Old names were keep for compatibility

Also put __attribute__((deprecated)) in mdbtools.h for all deprecated
functions.
2012-08-09 14:55:17 +02:00
Nirgal Vourgère
f6cd70494c Automatically init/exit libmdb code
mdb_init() and mdb_exit() are now deprecated.
2012-07-22 02:29:04 +02:00
Nirgal Vourgère
f587d30995 Remaining gmdb2 info data from properties
New method mdb_get_catalogentry_by_name()
Bumped libmdb version from 2.0.1 to 2.1.0
2012-07-08 02:24:42 +02:00
Nirgal Vourgère
b0fb6a4167 Add basic support for Access 2010
Thanks Jakob Egger:
a928a36804
2012-07-07 21:08:25 +02:00
jakob
88ff1c023e Basic support for Complex Columns (Access 2007+)
The major new feature in Access 2007 where so called complex columns.
These can be multivalued fields, attachments, or MEMO fields with
version history. All of them are implemented using hidden helper tables,
and the column itself has type MDB_COMPLEX (0x12) which is basically a
long int used as a key.

This commit adds basic support for this complex type to libmdb.
2012-07-07 20:23:20 +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
212337cfaa Renamed _mdb_put_int* into mdb_put_int*
These were the only symbols exported not starting with mdb_
Old names stay available as aliases
Bumped libmdb version to 2.0.1

Added these prototypes to mdbtools.h: Fixes compilation warning

Added mdb_insert_row prototype to mdbtools.h: Fixes compilation warning
2012-07-02 21:38:26 +02:00
Nirgal Vourgère
7634e329c7 Renamed namespace into dbnamespace: C++ keyword 2012-02-11 18:38:43 +01:00
Nirgal Vourgre
fba597765d Patch wheredate.diff from Nirgal 2011-08-28 19:47:18 -04:00
Nirgal Vourgre
1f2749cdfc Patch bufferdump.diff from Nirgal 2011-08-28 19:43:52 -04:00
Nirgal Vourgre
3e2407044d Patch prop_abi.diff from Nirgal 2011-08-28 19:42:34 -04:00
Nirgal Vourgre
8ef50c444e Patch nosanitize.diff form Nirgal 2011-08-28 18:56:03 -04:00
Brian Bruns
d794c6e2a1 patch default_values from Nirgal Vourgère 2011-02-16 18:59:25 -05:00
Brian Bruns
39277312d4 patch 'schema2' from Nirgal Vourgère 2011-02-16 18:58:22 -05:00
Brian Bruns
6696edf1f8 patch 'props' from Nirgal Vourgère 2011-02-16 18:58:02 -05:00
Brian Bruns
fa83ed0af0 patch 'ole' from Nirgal Vourgère 2011-02-16 18:57:40 -05:00
Brian Bruns
0eea4c148f patch schema-indexes from Nirgal Vourgère 2011-02-16 18:57:05 -05:00
Brian Bruns
85be8bbe68 patch 180-slowmap-fallback from Nirgal Vourgère 2010-11-01 09:26:46 -04:00
Brian Bruns
87af69a15e Debian patch 170-sequences from Nirgal Vourgère 2010-06-20 16:30:47 -04:00
Brian Bruns
30e5a6f4bb Debian patch 150-backend-quote from Nirgal Vourgère 2010-06-20 16:27:42 -04:00
Brian Bruns
7a073df76e Patch 155-blob from Nirgal Vourgère 2010-06-17 22:12:44 -04:00
brianb
a3497d089a remove config.h from mdbtools.h 2007-03-05 23:34:47 +00:00
brianb
4ec0c79d12 remove mdb_backend declaration 2007-03-05 23:01:07 +00:00
whydoubt
bc71178167 Fix and tidy up read_pg_in* functions 2005-12-17 15:59:18 +00:00
whydoubt
8b9438dff5 Make backend_name parameter a const char * 2005-10-17 12:04:34 +00:00
whydoubt
c6300ecf16 Use size_t instead of unsigned int for calling iconv 2005-08-05 15:52:16 +00:00
whydoubt
eb9bba1d10 Alter buffer_dump's third parameter from 'end' to 'length' 2005-07-02 07:16:04 +00:00
whydoubt
22c3b15218 Use more appropriate types (void *, size_t) 2005-06-28 04:53:37 +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