Commit Graph

807 Commits

Author SHA1 Message Date
Evan Miller
5f55b259de Merge pull request #195 from evanmiller/thread-safety
Use re-entrant functions and thread-local storage in a couple of places
2020-11-12 16:14:15 -05:00
Evan Miller
df48fcb284 Use thread-local storage to cache run-time options 2020-11-12 13:38:32 -05:00
Evan Miller
1bef1b1dca Use re-entrant functions in a couple of places
Replace strtok and gmtime with their re-entrant versions. More to come.
2020-11-12 11:20:05 -05:00
Evan Miller
514e0fded0 Merge pull request #185 from mjwoodcock/odbc-string-truncation
Don't include length of '\0' in SQLGetData pcbValue
2020-11-08 09:19:28 -05:00
Evan Miller
38ce7db045 Large file support on 32-bit systems
* Add AC_SYS_LARGEFILE to configure.ac

* Replace fseek with fseeko
2020-11-07 11:40:44 -05:00
Evan Miller
ad14a04dfa Merge pull request #192 from evanmiller/merge-166
Original author: @rogerswb 

* Dynamic allocation of MdbSQL->bound_values 

Was previously hardcoded to 256 columns max.
2020-11-01 08:31:50 -05:00
James Woodcock
42996dad65 Send error message to stderr 2020-11-01 12:56:38 +00:00
Evan Miller
8b7162ded3 Merge branch 'dev' of github.com:mdbtools/mdbtools into merge-166 2020-11-01 07:55:53 -05:00
James Woodcock
de4f5516b7 Handle errors from mdb_bind_column() 2020-10-31 09:46:00 +00:00
James Woodcock
50f1bd4a86 Return column number from mdb_bind_column()
To match the return from mdb_bind_column_by_name().
2020-10-31 09:40:24 +00:00
James Woodcock
2e8480d7e5 Merge branch 'dev' of https://github.com/mdbtools/mdbtools into bounds-check-mdb-bind-column 2020-10-31 09:38:03 +00:00
Nirgal Vourgère
9e50c7401d Modernize bash-completion
Use _init_completion
Support long options with or without =
Auto generate options from the --help using _parse_help
2020-10-27 00:05:26 +01:00
nirgal
58f240ac6f Added back -q support 2020-10-25 20:49:20 +00:00
Nirgal Vourgère
f6053aa211 Quote shell special characters ...
... and add support for mdb-count mdb-json and mdb-queries
2020-10-25 20:19:39 +01:00
Nirgal Vourgère
c7d527fdeb mdb-export: Rename --backend into --insert 2020-10-25 12:09:51 +01:00
Nirgal Vourgère
ea478f3bc6 mdb-export: reorder options, man, bash-completion 2020-10-25 11:24:28 +01: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
James Woodcock
a7885f2680 Bounds check mdb_bind_column()
Return -1 to report out of bounds column number.
2020-10-24 13:27:34 +01:00
James Woodcock
06868e58ae Don't include length of '\0' in SQLGetData pcbValue
SQLGetData() should return the length of the string without the
null terminator.
2020-10-24 09:47:10 +01:00
James Woodcock
9bf70e0e1e mdb-export: use sensible date formats 2020-10-24 09:41:39 +01:00
Nirgal Vourgère
d0d95f6503 Install bash-completion snippets by default
Added autoconf --with-bash-completion-dir and --without-bash-completion-dir options
2020-10-23 18:58:45 +02:00
Nirgal Vourgère
f192c258ab bash-completion: get rid of "have" calls
have function disappeared in bash-completion 1.90 (2011)
2020-10-23 14:05:50 +02:00
Evan Miller
131b443102 Do not exit from library 2020-10-18 09:45:51 -04:00
Evan Miller
d8ed91bb05 Include missing header files in make dist 2020-10-18 07:59:45 -04:00
nirgal
6a41020538 Spelling typo 2020-10-18 08:59:36 +00:00
Nyall Dawson
3ac497c6ff Fix crash when a missing file is accessed via ODBC 2020-10-12 13:47:11 +10:00
Evan Miller
a051350ba1 make distcheck fixes 2020-10-11 15:46:19 -04:00
Evan Miller
c19654ad40 Remove gmdb2
Split off the Gnome MDB file viewer into its own project:

    https://github.com/mdbtools/gmdb2

This simplifies the build process somewhat and lets us focus on the core
project. (For starters, no more -Wno-portability flag!)
2020-10-11 14:59:08 -04:00
James Woodcock
eb5dd4d0b7 Support "SELECT TOP n [PERCENT]... " queries.
Updated the SQL parser to support "SELECT TOP n [PERCENT]... " queries,
matching the Mocrosoft Access SQL language.

Export these queries from databases with mdb-queries.
2020-09-26 11:28:34 +01:00
Evan Miller
9d0c40905d Merge branch 'dev' of github.com:mdbtools/mdbtools 2020-09-19 14:01:23 -04:00
James Woodcock
833985043f mdb-sql: Simplify handling files loaded by ":r"
:r is an undocumented command to load SQL files from the msb-sql prompt
2020-09-19 11:29:41 +01:00
James Woodcock
eab60a6060 mdb-sql: Handle ';' as terminators in SQL input files 2020-09-19 11:28:44 +01:00
James Woodcock
9c8b67b8f8 mdb-sql: support ';' as an SQL terminator 2020-09-19 11:28:00 +01:00
Evan Miller
9f41e03278 Fix up libtool version-info logic 2020-09-05 10:50:24 -04:00
Evan Miller
6e08ad5ae9 Add copyright info for fakeglib 2020-09-05 10:49:56 -04:00
Evan Miller
7f7761e884 Improved support for "Short Date" fields
* Separate -D (date only) and -T (date/time) format options in mdb-export and mdb-json

* New public mdb_set_shortdate_fmt() function in libmdb

* New private(ish) mdb_col_is_shortdate() function

I'm calling it "shortdate" in order to preserve the existing API.

See https://github.com/mdbtools/mdbtools/issues/12
2020-09-02 22:14:57 -04:00
Evan Miller
0023e4efe4 Update options documentation [CI SKIP] 2020-09-02 21:33:49 -04:00
Evan Miller
a13936bd77 Support comparisons with MDB_FLOAT and MDB_DOUBLE
See https://github.com/mdbtools/mdbtools/issues/105
2020-09-02 21:24:24 -04:00
Evan Miller
aa0ce8fb3e Consolidate print_col functions into backend.c 2020-09-02 20:38:15 -04:00
Evan Miller
5897a9220d Merge branch 'master' into merge-166 2020-09-02 16:18:59 -04:00
Evan Miller
f915a4f601 Fix double free (merge error) 2020-09-02 16:18:34 -04:00
Evan Miller
55e39b6ba9 Fix merge errors 2020-09-02 15:53:21 -04:00
Evan Miller
7b5d547acf Merge branch 'mysql-comments' of github.com:mdbtools/mdbtools into merge-164 2020-09-02 15:48:29 -04:00
Evan Miller
e30b8a395a Merge branch 'sql_dynamic_bound_length' of github.com:mdbtools/mdbtools into merge-166 2020-09-02 15:33:20 -04:00
Evan Miller
0fb33c2eb6 Fix prototype error with GCC 2020-09-02 15:07:13 -04:00
Evan Miller
9f23385a8c New mdb_get_version() function
See https://github.com/mdbtools/mdbtools/issues/138
2020-09-02 14:55:32 -04:00
Evan Miller
fb960553e6 New mdb_set_bind_size function overrides MDB_BIND_SIZE
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
2020-09-02 14:30:07 -04:00
Evan Miller
b7dd44d0d4 Merge pull request #42 from evanmiller/mdb-exportjson
mdb-json tool
2020-09-02 12:05:02 -04:00
Evan Miller
0f5bbdf96c Rename tool to mdb-json and use modern option parsing 2020-09-02 11:47:50 -04:00
Evan Miller
4b177914ee Move test data to separate repository 2020-09-02 10:44:12 -04:00