Jose Hernandez [Sat, 8 May 2021 15:49:07 +0000 (8 16:49 +0100)]
Add support for custom create table statements and table name normalisation.
Evan Miller [Sat, 31 Jul 2021 12:49:13 +0000 (31 08:49 -0400)]
Merge pull request #321 from doraemoncito/custom-create-table-statements-standalone
Introduced customised "create table" DDL statements per database type.
Jose Hernandez [Sat, 31 Jul 2021 12:33:54 +0000 (31 13:33 +0100)]
Introduced customised "create table" DDL statements per database type and made table creation statement in PostgreSQL idempotent so that the DDL generated by mdbtools works nicely with database versioning tools such as flyway or liquibase.
Evan Miller [Sat, 31 Jul 2021 11:39:24 +0000 (31 07:39 -0400)]
Merge pull request #320 from doraemoncito/ignore-intellij-idea-state-files
Ignore the the .idea folder in the project's root directory contains IntelliJ IDE project specific settings files.
Jose Hernandez [Sat, 31 Jul 2021 10:59:45 +0000 (31 11:59 +0100)]
Ignore the the .idea folder in the project's root directory contains IntelliJ IDE project specific settings files.
Evan Miller [Sat, 24 Jul 2021 15:33:33 +0000 (24 11:33 -0400)]
Only install libmdbsql.pc if libmdbsql is built
Evan Miller [Sun, 18 Jul 2021 18:01:24 +0000 (18 14:01 -0400)]
MDB Tools 0.9.4, Beta 1
Evan Miller [Sat, 17 Jul 2021 14:35:00 +0000 (17 10:35 -0400)]
Remove obsolete AC_HEADER_STDC macro
Evan Miller [Sat, 17 Jul 2021 14:13:24 +0000 (17 10:13 -0400)]
Fix RC4 decryption on big-endian platforms
Evan Miller [Wed, 14 Jul 2021 16:41:59 +0000 (14 12:41 -0400)]
Merge pull request #319 from Bob620/dev
sql: Properly handle arbitrary parentheses placements in PATH breaking SELECT functions
Evan Miller [Wed, 14 Jul 2021 13:33:24 +0000 (14 09:33 -0400)]
Remove uses of ntohl
bob620 [Tue, 13 Jul 2021 21:25:32 +0000 (13 16:25 -0500)]
sql: fix arbitrary path parentheses placement interfering with functions
bob620 [Tue, 13 Jul 2021 19:41:31 +0000 (13 14:41 -0500)]
sql: fix function arbitrary length requirement
Evan Miller [Thu, 8 Jul 2021 20:53:02 +0000 (8 16:53 -0400)]
Merge pull request #313 from jwrdegoede/fedora34-compile-fix
Fix -Werror=array-bounds compile error in src/odbc/odbc.c
Hans de Goede [Thu, 8 Jul 2021 20:08:00 +0000 (8 22:08 +0200)]
Fix -Werror=array-bounds compile error in src/odbc/odbc.c
Use a local variable instead of casting the address of a SQLSMALLINT
to a (size_t *). sizeof(SQLSMALLINT) < sizeof(size_t) so gcc is
rightfully giving the following errors when building on Fedora 34:
/usr/include/sqlucode.h: In function 'SQLErrorW':
odbc.c:130:20: error: array subscript 'size_t[0]' is partly outside array bounds of 'SQLSMALLINT[1]' [-Werror=array-bounds]
130 | size_t lin=*_lin, lout=*_lout;
| ^~~~~
odbc.c:974:21: note: while referencing 'pcbErrorMsg8'
974 | SQLSMALLINT pcbErrorMsg8;
| ^~~~~~~~~~~~
odbc.c:133:15: error: array subscript 'size_t[0]' is partly outside array bounds of 'SQLSMALLINT[1]' [-Werror=array-bounds]
133 | *_lin -= lin;
| ^~
odbc.c:974:21: note: while referencing 'pcbErrorMsg8'
974 | SQLSMALLINT pcbErrorMsg8;
| ^~~~~~~~~~~~
odbc.c:133:15: error: array subscript 'size_t[0]' is partly outside array bounds of 'SQLSMALLINT[1]' [-Werror=array-bounds]
133 | *_lin -= lin;
| ~~~~~~^~~~~~
odbc.c:974:21: note: while referencing 'pcbErrorMsg8'
974 | SQLSMALLINT pcbErrorMsg8;
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
Evan Miller [Thu, 10 Jun 2021 13:50:51 +0000 (10 09:50 -0400)]
Remove tautological comparison
Fixes warnings with some versions of GCC
Evan Miller [Thu, 3 Jun 2021 14:05:18 +0000 (3 10:05 -0400)]
Fix build on some ancient systems
Patrick Reynolds [Wed, 2 Jun 2021 14:34:35 +0000 (2 10:34 -0400)]
Add backticks around table names in `mdb-query` output (#307)
* Add [brackets] around mdb-query table names
* Allow column and table names to be in brackets
Column and table names can have whitespace in them. The traditional way
to indicate that is with bracket characters, like so:
```sql
SELECT [column name] FROM [table name]
```
This change updates the parser to allow bracket format -- similar to
double-quoted format -- in all NAME contexts, i.e., column names, table
names, and database names.
Co-authored-by: Patrick Reynolds <patrick.reynolds@github.com>
Evan Miller [Wed, 2 Jun 2021 13:16:55 +0000 (2 09:16 -0400)]
Simplify logic
Evan Miller [Wed, 19 May 2021 14:09:15 +0000 (19 10:09 -0400)]
Merge pull request #306 from mdbtools/issue-301
Set _XOPEN_SOURCE to 600
Evan Miller [Wed, 19 May 2021 14:08:54 +0000 (19 10:08 -0400)]
Merge pull request #305 from filmor/write-encrypted-pages
Write encrypted pages
Benedikt Reinartz [Wed, 19 May 2021 05:45:43 +0000 (19 07:45 +0200)]
Rename function to mdbi_rc4 to prevent it from being exported
Evan Miller [Tue, 18 May 2021 18:01:01 +0000 (18 14:01 -0400)]
Set _XOPEN_SOURCE to 600. Fixes #301
Some platforms including RHEL need _XOPEN_SOURCE to be defined as a
particular value. 600 seems to be a popular choice.
Benedikt Reinartz [Tue, 18 May 2021 05:20:58 +0000 (18 07:20 +0200)]
Review comments
Benedikt Reinartz [Mon, 17 May 2021 13:47:59 +0000 (17 15:47 +0200)]
Fix accidental include
Benedikt Reinartz [Mon, 17 May 2021 05:27:49 +0000 (17 07:27 +0200)]
Re-encrypt pages on write
Benedikt Reinartz [Mon, 17 May 2021 05:21:44 +0000 (17 07:21 +0200)]
Extract RC4 code to separate file
Evan Miller [Sat, 1 May 2021 11:03:58 +0000 (1 07:03 -0400)]
Version 0.9.3, final
Evan Miller [Sun, 25 Apr 2021 17:25:57 +0000 (25 13:25 -0400)]
MDB Tools 0.9.3, Beta 4
Evan Miller [Sun, 25 Apr 2021 15:23:38 +0000 (25 11:23 -0400)]
Remove function pointer casts
Evan Miller [Sun, 25 Apr 2021 15:22:46 +0000 (25 11:22 -0400)]
Merge pull request #299 from filmor/patch-1
Adjust loop callback signatures (improve emscripten compatibility)
Benedikt Reinartz [Sun, 25 Apr 2021 10:47:33 +0000 (25 12:47 +0200)]
Adjust loop callback signatures
`GFunc` is `void (gpointer, gpointer)` and `GHFunc` is `void (gpointer, gpointer, gpointer)`,
so the respective callback functions should have the same signature.
Evan Miller [Fri, 16 Apr 2021 17:43:03 +0000 (16 13:43 -0400)]
MDB Tools 0.9.3, Beta 3
Evan Miller [Fri, 16 Apr 2021 17:04:40 +0000 (16 13:04 -0400)]
Remove unnecessary _XOPEN_SOURCE
This was originally intended to expose strptime, which is no longer
(never?) used by data.c
Evan Miller [Tue, 13 Apr 2021 11:19:19 +0000 (13 07:19 -0400)]
Conditionally define _XOPEN_SOURCE
Fixes #298
Evan Miller [Thu, 8 Apr 2021 18:59:50 +0000 (8 14:59 -0400)]
Version 0.9.3, Beta 2
Evan Miller [Mon, 5 Apr 2021 13:04:29 +0000 (5 09:04 -0400)]
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
Evan Miller [Mon, 5 Apr 2021 13:00:57 +0000 (5 09:00 -0400)]
Merge pull request #293 from mdbtools/no-wordexp
SQL: Allow spaces in DB names (remove wordexp.h)
Evan Miller [Mon, 5 Apr 2021 02:13:02 +0000 (4 22:13 -0400)]
GitHub Actions: Enable fail-fast for macOS iODBC builds
Evan Miller [Mon, 5 Apr 2021 02:07:31 +0000 (4 22:07 -0400)]
SQL: Allow spaces in DB names (remove wordexp.h)
Fixes #292
Evan Miller [Mon, 5 Apr 2021 01:59:48 +0000 (4 21:59 -0400)]
Merge pull request #291 from Bob620/quoted-database-string
SQL: allow double quoted (") database names
bob620 [Mon, 5 Apr 2021 00:42:34 +0000 (4 19:42 -0500)]
sql: allow double quoted (") database names
Evan Miller [Sat, 3 Apr 2021 12:30:56 +0000 (3 08:30 -0400)]
Remove GCC 8 from GitHub Actions
This version of GCC has been removed from the default image; see
https://github.com/actions/virtual-environments/issues/2950
Evan Miller [Wed, 31 Mar 2021 18:27:31 +0000 (31 14:27 -0400)]
Merge pull request #286 from andipaetzold/patch-1
Add JET version for access 2013/2016/2019 to docs
Andi Pätzold [Wed, 31 Mar 2021 17:22:53 +0000 (31 19:22 +0200)]
Add JET version for access 2013/2016/2019 to docs
Evan Miller [Wed, 31 Mar 2021 13:10:29 +0000 (31 09:10 -0400)]
Version 0.9.3, Beta 1
Evan Miller [Fri, 26 Mar 2021 02:38:09 +0000 (25 22:38 -0400)]
Merge pull request #285 from Bob620/issue-283
sql: correctly parse 'inverse' operators
bob620 [Fri, 26 Mar 2021 01:36:44 +0000 (25 20:36 -0500)]
sql: correctly parse 'inverse' operators
Evan Miller [Thu, 25 Mar 2021 12:23:53 +0000 (25 08:23 -0400)]
Merge pull request #282 from Bob620/support-more-uri
Support more valid uri
bob620 [Wed, 24 Mar 2021 22:58:29 +0000 (24 17:58 -0500)]
libmdbsql: remove valid character *
bob620 [Wed, 24 Mar 2021 22:50:33 +0000 (24 17:50 -0500)]
libmdbsql: Allow all special characters from valid URIs in paths
Evan Miller [Wed, 24 Mar 2021 22:36:09 +0000 (24 18:36 -0400)]
Merge pull request #280 from mdbtools/issue-275
libmdbsql: Allow dashes in paths
Evan Miller [Wed, 24 Mar 2021 22:35:20 +0000 (24 18:35 -0400)]
Merge pull request #279 from mdbtools/issue-274
libmdbsql: Support negative floating point literals
Evan Miller [Wed, 24 Mar 2021 13:57:41 +0000 (24 09:57 -0400)]
Allow dashes in paths #275
This is not a complete fix, but should address the immediate reported issue.
Evan Miller [Wed, 24 Mar 2021 13:47:52 +0000 (24 09:47 -0400)]
libmdbsql: Support negative floating point literals
Fixes #274
Evan Miller [Wed, 24 Mar 2021 13:28:00 +0000 (24 09:28 -0400)]
Merge pull request #277 from mdbtools/access-2019
Support Access 2019
Evan Miller [Wed, 24 Mar 2021 13:27:27 +0000 (24 09:27 -0400)]
Merge pull request #278 from uweber/SQLGetTypeInfo_segv
Fix segfault when attempting to access empty table (e.g. from ODBC)
Ulrich Weber [Wed, 24 Mar 2021 09:44:46 +0000 (24 09:44 +0000)]
fix segfault in SQLGetTypeInfo due pyodbc
dont access pages in mdb_fetch_row when pdata is not initialized.
Happens when a client, e.g. pyodbc, queries for an unsupported type,
e.g. SQL_WVARCHAR, temp_table is empty and further access to it will crash.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff70fe3df in mdb_fetch_row (table=0xa74610) at data.c:467
467 rows = mdb_get_int16(
Backtrace:
0 0x00007ffff70fe3df in mdb_fetch_row (table=0xa74610) at data.c:467
1 0x00007ffff77f8746 in SQLFetch (hstmt=0xa70500) at odbc.c:1074
2 0x00007ffff7729b43 in SQLFetch () from /lib/x86_64-linux-gnu/libodbc.so.2
3 0x00007ffff778d545 in GetColumnSize (cnxn=0x7ffff77eb1f0, cnxn=0x7ffff77eb1f0, psize=0x7ffff77bde00, sqltype=-9) at src/cnxninfo.cpp:81
4 CnxnInfo_New (cnxn=0x7ffff77eb1f0) at src/cnxninfo.cpp:145
Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>
Evan Miller [Tue, 23 Mar 2021 19:56:39 +0000 (23 15:56 -0400)]
Support Access 2019
Per #260 I am assuming that the internal version 6 refers to files
created with Access 2019. I can't find any documentation on this format,
so I am calling it ACE17. Testing welcome.
Evan Miller [Tue, 23 Mar 2021 15:34:05 +0000 (23 11:34 -0400)]
Merge pull request #272 from HenriHakonen/patch-1
Update write.c
HenriHakonen [Tue, 23 Mar 2021 15:17:35 +0000 (23 17:17 +0200)]
Update write.c
This way fwrite returns length. mdb_crack_row takes size instead of end.
Evan Miller [Mon, 15 Mar 2021 21:32:47 +0000 (15 17:32 -0400)]
Fix signed-unsigned comparison
Fixes #269
Evan Miller [Mon, 15 Mar 2021 12:50:09 +0000 (15 08:50 -0400)]
Merge pull request #268 from mdbtools/nirgal-patch-1
Refresh AUTHORS
nirgal [Mon, 15 Mar 2021 08:24:52 +0000 (15 08:24 +0000)]
Refresh AUTHORS
mostly from git log, up to 9.0.2 included
Evan Miller [Sun, 7 Mar 2021 19:36:07 +0000 (7 14:36 -0500)]
Fix compilation error
Evan Miller [Sun, 7 Mar 2021 14:03:39 +0000 (7 09:03 -0500)]
Fix warning when reading binary properties
Also fix some type-size issues in mdb_col_to_string.
See #262
Evan Miller [Sun, 7 Mar 2021 14:02:51 +0000 (7 09:02 -0500)]
Clarify docs about the necessity of autoreconf
Evan Miller [Sat, 27 Feb 2021 16:16:16 +0000 (27 11:16 -0500)]
Merge pull request #261 from thesamesam/dev
configure.ac: Respect --libdir for unixODBC
Sam James [Sat, 27 Feb 2021 14:33:23 +0000 (27 14:33 +0000)]
configure.ac: Respect --libdir for unixODBC
When searching for unixODBC, we want to use
the libdir passed in to autotools (--libdir)
to ensure that we find the library
for the correct ABI.
It is possible that we pick up the wrong
copy from e.g. /usr/lib/ where a 32-bit
unixODBC copy of the library exists
when we're in the middle of a 64-bit build.
Use ${libdir} to ensure we respect
any preferences/information given and
search for ODBC in the right place.
Note that this previously affected
us with iODBC but that's since been
resolved by using their
iodbc-config binary.
Bug: https://bugs.gentoo.org/697568
Signed-off-by: Sam James <sam@gentoo.org>
Evan Miller [Sat, 27 Feb 2021 14:04:27 +0000 (27 09:04 -0500)]
Version 0.9.2, final
Evan Miller [Mon, 22 Feb 2021 14:24:06 +0000 (22 09:24 -0500)]
mdb-tables: Support --version flag
Evan Miller [Mon, 22 Feb 2021 14:02:06 +0000 (22 09:02 -0500)]
Version 0.9.2, Beta 6
Evan Miller [Tue, 16 Feb 2021 21:48:42 +0000 (16 16:48 -0500)]
Merge pull request #257 from mjwoodcock/mysql-schema
Mysql schema
James Woodcock [Tue, 16 Feb 2021 19:39:00 +0000 (16 19:39 +0000)]
Implement MySQL relations for schema exports
James Woodcock [Tue, 16 Feb 2021 19:32:27 +0000 (16 19:32 +0000)]
Implement a MySQL serial type for schema exports
Evan Miller [Tue, 16 Feb 2021 02:25:53 +0000 (15 21:25 -0500)]
Move mdb_col_to_string warning
Evan Miller [Tue, 16 Feb 2021 00:59:23 +0000 (15 19:59 -0500)]
Version 0.9.2, Beta 5
Evan Miller [Tue, 16 Feb 2021 00:50:15 +0000 (15 19:50 -0500)]
Fix handling of numeric types in ODBC driver
Fixes #255 and supersedes #256
Evan Miller [Wed, 10 Feb 2021 21:11:24 +0000 (10 16:11 -0500)]
Merge pull request #254 from h3xx/fix-library-cflags
Add -DHAVE_GLIB to library cflags if needed
Dan Church [Wed, 10 Feb 2021 20:08:00 +0000 (10 14:08 -0600)]
Add -DHAVE_GLIB to library cflags if needed
Evan Miller [Wed, 10 Feb 2021 17:45:22 +0000 (10 12:45 -0500)]
Merge pull request #253 from kalpha2/patch-1
Update write.c
kalpha2 [Wed, 10 Feb 2021 15:33:33 +0000 (10 15:33 +0000)]
Update write.c
added table name and column number to fprintf when invalid data location detected in mdb_crack_row
Evan Miller [Fri, 5 Feb 2021 19:02:12 +0000 (5 14:02 -0500)]
Versio 0.9.2, Beta 4
James Woodcock [Wed, 3 Feb 2021 19:48:56 +0000 (3 19:48 +0000)]
mdb-export: handle MySQL blobs (#250)
* Refactor code so BLOBs are always correctly exported
Previously, BLOBs weren't exported from mdb-export correctly if the
backend had MDB_SHEXP_BULK_INSERT set.
* Export MySQL BLOBs correctly
MySQL BLOBs should be in the form 0x[hex values] when inserting them
with the mysql command line tool.
* MySQL needs a BLOB to store exported MDB_OLE values
MDB_OLE size always comes out as 256 bytes, but varbinary(256) is insufficient
to hold all possible OLE data.
Evan Miller [Tue, 2 Feb 2021 23:40:40 +0000 (2 18:40 -0500)]
Fix unused function warning without iconv
Evan Miller [Fri, 29 Jan 2021 13:32:49 +0000 (29 08:32 -0500)]
Version 0.9.2, Beta 3
Evan Miller [Fri, 22 Jan 2021 12:45:47 +0000 (22 07:45 -0500)]
Add (fake) g_unichar_to_utf8
Evan Miller [Fri, 22 Jan 2021 04:25:46 +0000 (21 23:25 -0500)]
Make mdb_iconv_name_from_code_page static
Evan Miller [Fri, 22 Jan 2021 04:16:33 +0000 (21 23:16 -0500)]
Terminate string
Evan Miller [Fri, 22 Jan 2021 04:08:55 +0000 (21 23:08 -0500)]
Simplify (fake) g_locale_to_utf8
Use mbstowcs and a manual UTF-8 conversion so we don't have to sniff
the locale and require iconv.
Evan Miller [Thu, 21 Jan 2021 23:27:20 +0000 (21 18:27 -0500)]
Fix misuse of "%*s" in sprintf strings
%*s takes the output length, not the input length. The intended
specifier was %.*s in several places. Bug(s) introduced in
2bb31f05eee1d40645ae5febdc303d1d3765893d
Evan Miller [Wed, 20 Jan 2021 14:14:29 +0000 (20 09:14 -0500)]
Version 0.9.2, Beta 2
Evan Miller [Wed, 20 Jan 2021 14:13:30 +0000 (20 09:13 -0500)]
Restore the HACKING file with a redirect notice
Several pages link to the old file and we don't want to break those
links.
Evan Miller [Wed, 20 Jan 2021 14:00:48 +0000 (20 09:00 -0500)]
Use correct bind types for SQLBindCol / SQLFetch (#242)
SQLFetch / SQLExtendedFetch now skip the mdb_sql machinery and use
SQLGetData on their bound columns instead. We rely on mdb_fetch_row
to skip to the correct page without any bindings and then SQLGetData will
do the rest.
SQLFetch will now correctly return SQL_SUCCESS_WITH_INFO if one or more
bound columns have their data truncated, and will return several kinds of errors
(provided by SQLGetData) that were previously ignored.
Updated the unit test with a SQL_C_LONG type for demonstration purposes.
Fixes #23
Evan Miller [Wed, 20 Jan 2021 02:24:31 +0000 (19 21:24 -0500)]
Let LC_COLLATE influence string-comparison operations
By default this will be set to the C locale, but set it to the user's
locale when string comparisons are performed from mdb-sql. Note that
this can be overridden with the LC_COLLATE environment variable.
We could infer the collation locale from the file itself, but this will
likely require a big ball of glue between the Windows locales and Unix
ones.
Evan Miller [Wed, 20 Jan 2021 01:37:25 +0000 (19 20:37 -0500)]
Add --version option to the CLI tools
See #232
Evan Miller [Tue, 19 Jan 2021 23:03:10 +0000 (19 18:03 -0500)]
Clean up backend export logic
* Differentiate character lengths from byte lengths (see #112)
* Use GNU-style indexed initializers for clarity
* Remove needs_quotes since it's not used anywhere
Evan Miller [Tue, 19 Jan 2021 21:43:10 +0000 (19 16:43 -0500)]
Document TOP and LIMIT clauses in the man page
Evan Miller [Tue, 19 Jan 2021 21:27:36 +0000 (19 16:27 -0500)]
Man page and usage updates
* MDBOPTS=no_memo is not used anywhere; mark deprecated and print a
warning if enabled
* Mark MDBOPTS=use_index as experimental in the man pages
* MDBOPTS need to be colon separated
* Document new long forms of mdb-queries options
Evan Miller [Tue, 19 Jan 2021 20:55:57 +0000 (19 15:55 -0500)]
Support scale/precision with more column types