Commit Graph

1005 Commits

Author SHA1 Message Date
Brian Bruns
a291917615 Merge pull request #91 from samshawsds/master
Improve Oracle Support
2016-08-29 09:13:10 -04:00
Joshua Short
e85c3438ec Adding option to for user-defined NULL token in CSV output (not sure if it should be escaped..) 2016-08-01 09:11:21 -07:00
Nirgal Vourgère
bd88fb7d43 Use 'official' words for GFDL license 2016-04-27 04:58:17 +02:00
Ewen McNeill
999f6f5f10 JET 4: index flags (eg, UNIQUE) 4 bytes later
Re-reverse engineered index meta information layout in JET 4
file format, based particularly on jackcess (Java) JET/Access
database library (https://github.com/jahlborn/jackcess), and
hexdumps of JET 4 database index meta information.  Based both
on byte counting of jackcess reading of index definitions and
also expected flag values (0x80, 0x89, etc), the flags of JET 4
index definition are 4 bytes later than mdbtools previously thought.

See IndexData.read() and private static class Jet4Format in
src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java
src/main/java/com/healthmarketscience/jackcess/impl/JetFormat.java
in jackcess source for layout reference.

Now appears to get sensible "CREATE INDEX"/"CREATE UNIQUE INDEX"
behaviour on export to PostgreSQL schema.

Also added extensive index definition byte layout reference to top
of src/libmdb/index.c for ease of reference, plus more debugging
assistance (and comments of phases reading index for readability).
2016-04-08 10:23:10 +12: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
Sam Shaw
ffccc9d1cf Oracle Foreign Keys
Oracle doesn't support the "ON UPDATE" clause for foreign keys.
2016-01-12 09:58:17 +08:00
Sam Shaw
7f21d4e030 Oracle BLOB & CLOB
BLOB and CLOB do not have a size constraint in Oracle
2015-12-23 13:46:31 +08:00
Sam Shaw
ffbc492a8b Oracle Indexes
Add syntax for creating indexes in oracle (it's the same as PostgreSQL)
2015-12-23 13:31:05 +08:00
Jimmytaker
55d57c65cf Use bigger buffer when reading big blobs to increase performance 2015-10-06 20:43:10 +02:00
Dan Villiom Podlaski Christiansen
e22791606f odbc: support reading OLE entries
This adds support for reading OLE objects to the ODBC driver. The APIs
for reading OLE appear somewhat idiosyncratic, so we read the string
fully and stash it in a static variable.

Tested by reading an old Access database, with checking for memory leaks.
2015-09-28 13:56:10 +02:00
Dan Villiom Podlaski Christiansen
1b8c2ca483 odbc: don't assume sizeof(int) == sizeof(long)
Most  64-bit environments use 64 bit longs and 32 bit ints; as such,
comparing an int to LONG_MIN/MAX makes no sense. Since SQL LONGs
appear limited to 32 bits, I assume INT_MIN/MAX was intended.
2015-09-28 13:56:09 +02:00
Dan Villiom Podlaski Christiansen
87a5593a4d allow building without gnome-doc-utils
'gnome-doc-utils' is a rather large dependency on OS X, and the build
system has checks for gnome-doc-utils surrounding its use, but the
autoconf check errors out in its absence.
2015-09-28 13:55:59 +02:00
nirgal
3b6d88f347 Merge pull request #86 from steko/patch-1
Fix typo in list of command line utils
2015-09-28 10:25:59 +02:00
Stefano Costa
6dfccdd37e Fix typo in list of command line utils 2015-09-26 22:40:04 +02: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
leecher1337
5ce4cc5528 At least for me IS NULL and IS NOT NULL are the wrong way round in SQL, fixed it. 2015-08-21 14:50:34 +02:00
leecher1337
16bf355d6b Added simple support for count(*) to SQL parser to quickly get number of rows in table 2015-08-20 14:35:09 +02:00
leecher1337
0e508c82d8 Fixed a severe design flaw in ODBC driver that prevented the driver from using multiple SELECTs at once and instead crashed the driver 2015-08-16 11:39:17 +02:00
leecher1337
f1bc697d6a Fixed bug in ODBC driver causing incomplete data on SQLGetData when doing SQLFetch and SQLGetData for one column in a loop if there was an incomplete fetch of some previous dataset 2015-08-16 00:58:34 +02:00
Nirgal Vourgère
584119e415 Split bash-completion snippet in small ones
/usr/share/bash-completion/completions/ now uses dynamic loading based on file name.
2015-05-30 15:40:58 +02:00
Nirgal Vourgère
428834bbc4 Merge pull request 78 2015-05-26 17:34:51 +02:00
Nirgal Vourgère
eb7d03187f Space normalisation 2015-05-26 17:34:34 +02:00
William Rogers
4148518906 Freed memory on SQL engine termination
Modified mdb_sql_exit to free the memory allocated for the SQL engine in mdb_sql_init
2015-05-24 18:04:14 -05:00
William Rogers
d0472d96ba Added proper SQL engine termination
Since the SQL engine is initialized in _SQLAllocEnv, the engine should be also terminated in SQLFreeEnv.
2015-05-24 17:38:50 -05:00
William Rogers
82e3436494 Corrected memory being improperly freed
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.
2015-05-24 17:15:52 -05:00
William Rogers
0123d7e1c2 Fixed memory leak - sql->bound_values
Memory allocated by mdb_sql_bind_all for sql->bound_values was being leaked at each query execution.  Memory is now freed in mdb_sql_reset
2015-05-24 17:12:29 -05:00
William Rogers
9276aca347 Consolidated calls to mdb_sql_reset
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.
2015-05-24 17:05:41 -05:00
William Rogers
bcc7ad5a7a Fixed memory leak in _SQLFreeEnv
Memory allocated for the _henv structure was not being freed which caused a small memory leak.
2015-05-24 16:49:44 -05:00
William Rogers
5888c4a52c Correction to SQLGetData string length handling
According to http://download.oracle.com/otn_hosted_doc/timesten/703/TimesTen-Documentation/ms.odbc.pdf and https://msdn.microsoft.com/en-us/library/ms710980(v=vs.85).aspx, the string length should not include the NULL character at the end.

Previous behavior would likely work without problems for any language that uses C-style null terminated strings, but adds a null character in the string when using the driver with a language that does not use C-style strings.
2015-05-22 20:10:10 -05:00
William Rogers
dca7552d8b Implemented SQL_DESC_UNSIGNED attribute in SQLColAttributes 2015-05-22 16:30:13 -05:00
nirgal
22b5b6222e Merge pull request #69 from czarkoff/readme
State in README that glib is required
2015-03-06 15:54:56 +00:00
nirgal
74b85d782a Merge pull request #73 from rutsky/patch-3
fix typo: "popluated"
2015-03-05 14:57:17 +01:00
Vladimir Rutsky
772b5675dd fix typo: "popluated" 2015-03-05 16:20:12 +03:00
nirgal
ea44a36f50 Merge pull request #72 from rutsky/patch-2
fix typo: "over-ride"
2015-03-04 14:29:19 +01:00
Vladimir Rutsky
2f996874af fix typo: "over-ridden" 2015-03-04 14:11:07 +03:00
Vladimir Rutsky
270e0ae8cb fix typo: "over-ride" 2015-03-04 14:08:52 +03:00
nirgal
6e6a410f68 Merge pull request #71 from rutsky/patch-1
fix typo: "enought"
2015-03-04 11:57:26 +01:00
Vladimir Rutsky
9fb36c0f07 fix typo: "enought" 2015-03-04 13:23:23 +03:00
Dmitrij D. Czarkoff
f32e2d975e State that glib is required
Currently build system requires Glib, so it should be listed as hard dependency
2015-02-21 06:51:47 +01:00
Vladimir Rutsky
9f6e630246 ignore mdb-exportjson compiled binary 2015-02-20 20:23:17 +03:00
Vladimir Rutsky
3216c8de03 output all non-binary fields as unicode strings and binary fields as MongoDB extended JSON binary field
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)
2015-02-19 21:05:49 +03:00
Vladimir Rutsky
f894cc708f add base64 encoding implementation from Wikibooks
Source <https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64>.

Licensed probably under CC-BY-SA. Compatibility with mdb-tools GPL
license should be checked.
2015-02-19 21:05:49 +03:00
Vladimir Rutsky
bc1483429d use JSON unicode escape \uUUUU instead \xXX for [0, 0x20) characters
JSON specification doesn't allow `\xXX` escape sequences
2015-02-19 21:05:49 +03:00
Vladimir Rutsky
47c0698609 treat only characters with codes in [0, 0x20) range as non-ascii 2015-02-19 21:05:49 +03:00
Vladimir Rutsky
d8cba08493 fix delimiter outputting when some fields values are missing 2015-02-19 20:51:57 +03:00
Vladimir Rutsky
b842480cd5 don't drop non-ascii characters by default
This corresponds to `-A` option description.
2015-02-19 20:48:44 +03:00
Vladimir Rutsky
1758d99d4d Merge PR #52 - mdb-exportjson added 2015-02-19 20:46:33 +03:00
nirgal
c314913b25 Merge pull request #67 from rutsky/patch-1
add missing comma
2015-02-16 15:15:26 +01:00
Vladimir Rutsky
776416ebfc add missing comma 2015-02-16 15:11:12 +03:00
nirgal
603601982e Merge pull request #65 from greenskeleton/master
Fix configure for CentOS 6
2015-01-20 19:20:07 +00:00