Commit Graph

1222 Commits

Author SHA1 Message Date
Evan Miller
8c2f8221b5 Allow dashes in paths #275
This is not a complete fix, but should address the immediate reported issue.
2021-03-24 09:57:41 -04:00
Evan Miller
d8a81c49a3
Merge pull request #277 from mdbtools/access-2019
Support Access 2019
2021-03-24 09:28:00 -04:00
Evan Miller
8ddf8e6411
Merge pull request #278 from uweber/SQLGetTypeInfo_segv
Fix segfault when attempting to access empty table (e.g. from ODBC)
2021-03-24 09:27:27 -04:00
Ulrich Weber
970023c4e6 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>
2021-03-24 13:09:48 +00:00
Evan Miller
8f1f080e3f 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.
2021-03-23 15:56:39 -04:00
Evan Miller
e1a850d1a7
Merge pull request #272 from HenriHakonen/patch-1
Update write.c
2021-03-23 11:34:05 -04:00
HenriHakonen
d8a0d279e4
Update write.c
This way fwrite returns length. mdb_crack_row takes size instead of end.
2021-03-23 17:17:35 +02:00
Evan Miller
735351d0cb Fix signed-unsigned comparison
Fixes #269
2021-03-15 17:32:47 -04:00
Evan Miller
cdfefe08e6
Merge pull request #268 from mdbtools/nirgal-patch-1
Refresh AUTHORS
2021-03-15 08:50:09 -04:00
nirgal
e35244e4f0
Refresh AUTHORS
mostly from git log, up to 9.0.2 included
2021-03-15 08:24:52 +00:00
Evan Miller
ad8c80892b Fix compilation error 2021-03-07 14:36:07 -05:00
Evan Miller
46a65b9789 Fix warning when reading binary properties
Also fix some type-size issues in mdb_col_to_string.

See #262
2021-03-07 09:03:39 -05:00
Evan Miller
636d54b530 Clarify docs about the necessity of autoreconf 2021-03-07 09:02:51 -05:00
Evan Miller
b185c277dc
Merge pull request #261 from thesamesam/dev
configure.ac: Respect --libdir for unixODBC
2021-02-27 11:16:16 -05:00
Sam James
686110d224
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>
2021-02-27 14:33:23 +00:00
Evan Miller
9b200549d7 Version 0.9.2, final 2021-02-27 09:04:27 -05:00
Evan Miller
1464882931 mdb-tables: Support --version flag 2021-02-22 09:24:06 -05:00
Evan Miller
d59abb99b4 Version 0.9.2, Beta 6 2021-02-22 09:02:06 -05:00
Evan Miller
ed894ef12c
Merge pull request #257 from mjwoodcock/mysql-schema
Mysql schema
2021-02-16 16:48:42 -05:00
James Woodcock
2be45a3a0b Implement MySQL relations for schema exports 2021-02-16 19:39:00 +00:00
James Woodcock
8bf8806d4f Implement a MySQL serial type for schema exports 2021-02-16 19:32:27 +00:00
Evan Miller
1bfce353d4 Move mdb_col_to_string warning 2021-02-15 21:25:53 -05:00
Evan Miller
abe820c66c Version 0.9.2, Beta 5 2021-02-15 19:59:23 -05:00
Evan Miller
e655cba907 Fix handling of numeric types in ODBC driver
Fixes #255 and supersedes #256
2021-02-15 19:50:15 -05:00
Evan Miller
b9c065885c
Merge pull request #254 from h3xx/fix-library-cflags
Add -DHAVE_GLIB to library cflags if needed
2021-02-10 16:11:24 -05:00
Dan Church
65c9c2763a
Add -DHAVE_GLIB to library cflags if needed 2021-02-10 14:21:25 -06:00
Evan Miller
c5593d893e
Merge pull request #253 from kalpha2/patch-1
Update write.c
2021-02-10 12:45:22 -05:00
kalpha2
25c39f38d0
Update write.c
added table name and column number to fprintf when invalid data location detected in mdb_crack_row
2021-02-10 15:33:33 +00:00
Evan Miller
0c34e1aa2b Versio 0.9.2, Beta 4 2021-02-05 14:02:12 -05:00
James Woodcock
a980d73447
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.
2021-02-03 14:48:56 -05:00
Evan Miller
763716ecc6 Fix unused function warning without iconv 2021-02-02 18:40:40 -05:00
Evan Miller
77f78ea757 Version 0.9.2, Beta 3 2021-01-29 08:32:49 -05:00
Evan Miller
4e969425ac Add (fake) g_unichar_to_utf8 2021-01-22 07:45:47 -05:00
Evan Miller
da80fb3430 Make mdb_iconv_name_from_code_page static 2021-01-21 23:25:46 -05:00
Evan Miller
468502bc87 Terminate string 2021-01-21 23:16:33 -05:00
Evan Miller
0aa3aeee42 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.
2021-01-21 23:08:55 -05:00
Evan Miller
f1eac042b5 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
2bb31f05ee
2021-01-21 18:27:20 -05:00
Evan Miller
848303f9f0 Version 0.9.2, Beta 2 2021-01-20 09:14:29 -05:00
Evan Miller
9904b079bf Restore the HACKING file with a redirect notice
Several pages link to the old file and we don't want to break those
links.
2021-01-20 09:13:30 -05:00
Evan Miller
70c1b66278
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
2021-01-20 09:00:48 -05:00
Evan Miller
615b625d79 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.
2021-01-19 21:24:31 -05:00
Evan Miller
f99c5539e7 Add --version option to the CLI tools
See #232
2021-01-19 20:37:25 -05:00
Evan Miller
9e85bc4153 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
2021-01-19 18:03:10 -05:00
Evan Miller
dbc1aa7ea2 Document TOP and LIMIT clauses in the man page 2021-01-19 16:43:10 -05:00
Evan Miller
8c91654426 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
2021-01-19 16:27:36 -05:00
Evan Miller
0aa88f85d5 Support scale/precision with more column types 2021-01-19 15:55:57 -05:00
Evan Miller
aec667a033 Fix numeric scale/precision on Jet3 databases 2021-01-19 15:23:28 -05:00
Evan Miller
d089c4072d More locale-awareness for command line arguments 2021-01-18 18:15:30 -05:00
Evan Miller
1e35bddc62 Migrate mdb-queries over to the GLib machinery
This buys us an auto-generated usage string and locale-awareness for the
query name. Short option names are preserved and long names are added.
2021-01-18 17:45:24 -05:00
Evan Miller
8fff5b0ac0
Merge pull request #239 from pedromorgan/apidocs_1
apidocs with doxygen
2021-01-16 11:49:12 -05:00