This should fix long-standing complaints about the default bind size
without causing undue memory inflation in existing applications.
Could make this adjustable on the command line later.
Supersedes:
https://github.com/mdbtools/mdbtools/pull/137
Quickstart (requires Clang 6 or later):
$ export LIB_FUZZING_ENGINE=/path/to/fuzzing/library.a
$ ./configure --enable-fuzz-testing
$ make
$ cd src/fuzz
$ make fuzz_mdb
$ ./fuzz_mdb
Also add a new `mdb_open_buffer function` to facilitate in-memory
fuzz-testing. This requires fmemopen, which may not be present on all
systems. The internal API has been reworked to use file streams instead
of file descriptors. This allows reading from memory and reading from
files using a consistent API.
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.
The *col_val <= 0 check appears to have been intended to print ASCII
characters as-is. But this is not a good check, and goes against the
documented behavior.
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.
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.
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
The memory for sql->bound_values is now freed by mdb_sql_reset, so these values no longer should be freed in dump_results_pp. Also, this fixes a memory leak that was occurring when results were not being pretty printed.
SQL engine was being reset in both dump_results functions. Rather than having several different functions responsible for resetting the engine depending on the circumstances, the reset now only occurs in run_query, the same function where the query is executed.
Now mdb-exportjson output can be successfully imported into MongoDB with
mongoimport even if:
* columns have unicode names
* there are fields of binary types (e.g. OLE)
One can now compile with CFLAGS="-std=c99 -D_POSIX_C_SOURCE=1 -pedantic"
Trade getopt.h function for glib equivalents:
This mean all utilities now have long option names.
Adjust manuals and bash_completion accordingly.
Added missing manual and bash_completion for mdb-import.
This commit adds another binary output conversion option to convert
binary blobs into hexadecimal notation, similar to the output of the
following command:
xxd -p binaryfile.bin | tr -d '\n'
(In other words, a single line string of hexadecimal characters
representing a binary blob)
When exporting SQL INSERT statements for SQLite and PostgreSQL and when
the hexadecimal notation is specified with 'mdb-export -b hex ...',
special consideration is given to ensure that binary blobs are safely
written to the SQLite or PostgreSQL database.
Signed-off-by: David Hicks <david@hicks.id.au>
A new binary util for exporting mdb rows as json lines.
This is very useful for importing mdb data to mongo in combination with mongoimport.
The code is vastly similar to the mdb-export but there are enough dissimilarities and disagreement
about flag values that I thought a separate util is warranted.
Generated files config.guess config.sub depcomp install-sh ltmain.sh missing
and ylwrap have been moved to build-aux/
Ran autoupdate
Replaced AC_TRY_LINK/AC_TRY_COMPILE by AC_LINK_IFELSE/AC_COMPILE_IFELSE
Droped -I$(top_srcdir)/include from CFLAGS since AC_CONFIG_HEADERS already
adds the -I
Fixed bison detection
Added AM_PROG_AR as required by autoreconf -i -Wall
Updated NEWS and .gitignore
Supported modes are:
- strip (don't export)
- raw (compatibility)
- octal (export as \ooo)
Note that gmdb2 dialog where updated, but not the code. Many fixes to do
there first :/
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