Commit Graph

6674 Commits

Author SHA1 Message Date
Philipp Riemer
5f68458112 delete more code that was commented out
Change-Id: I8a37b482ca4abb440691b2490e43ecd93a8dbbc5
2013-08-31 22:41:11 +02:00
Philipp Riemer
78ced6235b fix indentation
This is a follow up commit to
 - 22d1beb78a
 - 1c7af455ab

Change-Id: I55ff666c357c89ad355a1a5bc0d0347fcc188476
2013-08-31 22:41:11 +02:00
Philipp Riemer
160a4dd9a3 deleted code that was commented out
This is a follow up commit to
 - 22d1beb78a
 - 1c7af455ab

Change-Id: I7a67c3768c0d7e36784ee88fc46680037acb244d
2013-08-31 22:41:11 +02:00
Philipp Riemer
bf42b6f9f5 fdo#62475 - remove visual noise
This is a follow up commit to
 - 22d1beb78a
 - 1c7af455ab

Change-Id: I102685391125f3b4f7bdf838f8bd17a2283d558d
2013-08-31 22:41:10 +02:00
Andrzej J.R. Hunt
819b72bb03 Set path and not url for FIREBIRD_[TMP|LOCK]. (firebird-sdbc)
Otherwise firbird fails to load databases since it can't access a url.

Change-Id: I1bebc6fa18c2d1920291dcf5a7300009ede4452a
2013-08-30 15:29:27 +01:00
Andrzej J.R. Hunt
fc7e7b6831 Improve TIMESTAMP display. (firebird-sdbc)
Change-Id: Ief7ec180e3787a3354e2034693052ebf05a30e81
2013-08-30 11:33:12 +01:00
Andrzej J.R. Hunt
026fe9c53b Implement setTimeStamp. (firebird-sdbc)
Change-Id: I58907d42ec9e1b4098e2947fdb89b1ab264358a6
2013-08-30 11:33:12 +01:00
Andrzej J.R. Hunt
437dd0369a Cast pointer before dereferencing. (firebird-sdbc)
We have a char* pointing to arbitrary data hence we need to cast
to the right type, othwerwise we retrieve the first byte only.

Change-Id: I6d3d08d15105a506c140044008c5255a8a8e4c39
2013-08-30 11:33:12 +01:00
Andrzej J.R. Hunt
3f56234ecb Implement set[Date|Time]. (firebird-sdbc)
Change-Id: Ibf3bc34f316c0a299afc2e015ff4c49ad57099a5
2013-08-30 11:33:12 +01:00
Andrzej J.R. Hunt
73720f9a83 Implement malloc'ing of date/time/timestamp (firebird-sdbc)
Change-Id: I22abb334a337ae2e25188ae43696789d37ecd7d4
2013-08-30 11:33:11 +01:00
Andrzej J.R. Hunt
84fe40e369 Implement set[Date|Time]. (firebird-sdbc)
Change-Id: Ia519b2ec9c6be94f6f21bbd2951a295da8079479
2013-08-30 11:33:11 +01:00
Andrzej J.R. Hunt
295759c053 Set FIREBIRD_TMP and FIREBIRD_LOCK with sane values. (firebird-sdbc)
Currently firebird uses /tmp and C://temp/ as default temporary directories,
both of which can be incorrect. Instead we now pass the correct temp
directories to firebird.

Change-Id: I807a47475e76600365e7a2ccfa78d755621dedb7
Reviewed-on: https://gerrit.libreoffice.org/5678
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
2013-08-30 08:34:10 +00:00
Stephan Bergmann
2410b3c3dd TPropertyValueLessFunctor must actually compare for "<"
Change-Id: I584a410d90531a0f7b784e62f94c39e715713cf1
2013-08-29 16:08:02 +02:00
Andrzej J.R. Hunt
d5cb782f9e Implement setTimestamp. (firebird-sdbc)
Change-Id: I0c009a99061de787cd250912406a74a75fbc260a
2013-08-29 10:07:41 +01:00
Andrzej J.R. Hunt
e218242ebd Pass by reference instead of value, fix template parameters. (firebird-sdbc)
We will also want to pass structs etc. into setValue hence we should pass
by reference.

Change-Id: Ia8aa02ca14414003c33cd8d070510759091b5ec9
2013-08-29 10:07:41 +01:00
Lionel Elie Mamane
7bf8739fd1 janitorial: more constness
Change-Id: Icf4746d70488bec20b4c47fc65fa989cfe90992b
2013-08-28 19:27:43 +02:00
Lionel Elie Mamane
313a81f915 ODBC OResultSet::ensureCacheForColumn initialise *all* new elements
e.g. when growing m_aRow from size 3 to size 10
(that is, columnIndex==9),
the old code was initialising only position 9
while it we need to initialise all new positions,
that is positions 3 to 9.

Change-Id: I6a51b816104e33fdd7773b68e254e9bea50110ef
2013-08-28 19:27:40 +02:00
Lionel Elie Mamane
c72a6ebd4a remove risk of infinite recursion
fillColumn is the only caller of impl_getBookmark, so all necessary
setup (in particular ensureCacheForColumn) is already done, and
does not need to be done in impl_getBookmark again.

Change-Id: Ic78b7dabd7c536abd9ed956baa178d685a63f713
2013-08-28 19:27:36 +02:00
Andrzej J.R. Hunt
0501026fb8 Implement set[Float|Double]. (firebird-sdbc)
Change-Id: I70d5ab9bacdeabe6c4edf6f70a9ba283b46c180f
2013-08-28 17:56:21 +01:00
Andrzej J.R. Hunt
9310cf2b9f Firebird uses "DOUBLE PRECISION" for doubles. (firebird-sdbc)
Change-Id: I99bac2cfde956d2b91dce33fc12ce9044a9c219a
2013-08-28 17:56:20 +01:00
Andrzej J.R. Hunt
3eddbbec43 SQL_FLOAT corresponds to DataType::FLOAT.
Change-Id: Id5e2aab669ba047e9ecb392187aae7c4aa384dda
2013-08-28 17:56:20 +01:00
Andrzej J.R. Hunt
c2602a4c2e Use correct type for SQL_FLOAT. (firebird-sdbc)
Change-Id: Ic27e886643128edeb5b2d5c81e86681f4dd8d33b
2013-08-28 17:56:20 +01:00
Andrzej J.R. Hunt
fe8e3be835 Remove unused code (firebird-sdbc)
Change-Id: I88f47ee442ade499c7f4018ce8b1ffe54b362067
2013-08-28 17:56:19 +01:00
Andrzej J.R. Hunt
c338f1cf70 Use template to set integer parameters. (firebird-sdbc)
Change-Id: I8a6c9f335574196a50827db7eb44b82f9ea4df16
2013-08-28 17:56:19 +01:00
Andrzej J.R. Hunt
7bc88db8c5 Implemet setNull. (firebird-sdbc)
Change-Id: I9fd53a5e8b5d1dba467fa8064f9f2ea1b93f26df
2013-08-27 20:58:32 +01:00
Andrzej J.R. Hunt
186f264dc2 Implement set[Int|Long]. (firebird-sdbc)
Change-Id: I234b8f136b90f56c689553d0df8ec2d473a92225
2013-08-27 20:58:31 +01:00
Andrzej J.R. Hunt
8620524f19 Implement setShort. (firebird-sdbc)
Change-Id: Ia543f34344915c4621ba0c6ce6984dce7ca9e08b
2013-08-27 20:58:31 +01:00
Andrzej J.R. Hunt
dadba3efcb Return change count for Statement:executeUpdate too. (firebird-sdbc)
This also simplifies Statement, although not using execute_immediate
is somewhat less efficient.

Change-Id: I4bebe13e5a63cb02e6b2659dec534f0c6feeba52
2013-08-27 20:58:31 +01:00
Andrzej J.R. Hunt
73aaa4da67 Implement retrieving change count for executeUpdate. (firebird-sdbc)
Change-Id: Ied47f421dc801bb6790bed49b28d3231844e6ee5
2013-08-27 20:58:31 +01:00
Lionel Elie Mamane
4033532e9f release m_aLengthVector even when m_aBindVector is empty
Change-Id: Ia3bd53402d436e296005f4f93113cc08daea2421
2013-08-27 18:50:21 +02:00
Lionel Elie Mamane
1c7b0b08b2 the place reserved for bookmark in m_aBindVector is never used
Change-Id: Iae4850739c329a7b04f8eea75047ab75465e3dea
2013-08-27 18:50:17 +02:00
Lionel Elie Mamane
89c6e2327f odbc insert: unbind as soon bindings not necessary
SQLFetchScroll uses the bound columns, and writes to them.
This has two problems:
1) For non-bookmark columns, this happens in our buffers,
   and at first sight could be innocuous.
   However, it allows the driver to disallow us to use
   SQLGetData on the same columns, which we intend to do...
2) For bookmark column, the "read bookmark from" and
   "write bookmark to" buffers end up being the same.
   This unnecessarily exposes us to driver bugs in this corner case.

Change-Id: I594d34cf5a64564766f06b49c86f8737961573c0
2013-08-27 18:50:14 +02:00
Lionel Elie Mamane
2939a1fa63 odbc insert: adjust buffer size *after* it is written to
the buffer (aBookmark) is written to by SQLBulkOperations or
SQLSetPos, not by SQLBindCol, which merely sets up the instruction
that the next call should write there. So its finak size is known
only *after* the call that makes the write, obviously.

Change-Id: I4faaaeffc060433645188f0eda3d9958b087cf6c
2013-08-27 18:50:10 +02:00
Lionel Elie Mamane
8f9388c023 fdo#68315 odbc update *reads* a bookmark, not *writes* a bookmark
This code was completely inverted. The row update operation
*reads* a bookmark (that is, what row to update), not *writes*
a bookmark.

So we were passing an empty bookmark, and thus the update was failing
because we were refering to a non-existent row.

Change-Id: I676b1a7727a88e13a3e465bd96cbbaf18dad2fa6
2013-08-27 18:50:07 +02:00
Michael Stahl
250864d869 connectivity: firebird::OResultSet: convert to C++98
Change-Id: I9036539204789d0886a51fcbc3d821012cc9eaee
2013-08-26 20:26:39 +02:00
Andrzej J.R. Hunt
3b22854129 Quick hack to make driver usable with dbaccess/KeySet. (firebird-sdbc)
Change-Id: I6500a7666ad2fc2ffcb29934d6f2b36761867950
2013-08-26 18:52:15 +01:00
Andrzej J.R. Hunt
b3b560e295 Clean up PropertyHelper stuff, set ResultSet properties. (firebird-sdbc)
Change-Id: If2f2041b0f072f36fe56e92b9e54bbb0be8a5860
2013-08-26 18:52:14 +01:00
Andrzej J.R. Hunt
197688f3fd Actually set m_bIsAfterLast. (firebird-sdbc)
Change-Id: If8558fb53acd1175fa3fd8724a5febca4286abe6
2013-08-26 18:52:14 +01:00
Andrzej J.R. Hunt
35ab624acd Set Null indicator in input SQLDA as appropriate. (firebird-sdbc)
If this is incorrectly (or randomly set) then firebird will end up just
ignoring any input parameters (previously the case). The documentation
claims that -1 is the null indicator, however the inevitably-random
values previously provided (from malloc) also caused firebird to treat
all input data as null.

Change-Id: I79b9704df0a307ec493e74e782551b9b0ff109a2
2013-08-23 17:52:01 +01:00
Andrzej J.R. Hunt
1f50aee94d Improve comment. (firebird-sdbc)
Change-Id: Iec5c5a434a371d73bba0345362f991a948d28c6a
2013-08-23 17:52:01 +01:00
Andrzej J.R. Hunt
19cb39f0ff Close cursors in PreparedStatement. (firebird-sdbc)
Trying to reuse a statement that still has an open cursor leads to
errors -- in this usage isc_free_statement doesn't actually free
the statement but simply closes the db-internal cursor used by
that statement previously.

Change-Id: Iedbe42bc46e6b6f972b7b19f17a60d5f59bae28c
2013-08-23 10:32:20 +01:00
Andrzej J.R. Hunt
ddc3818322 Use correct sqlda for number of parameters. (firebird-sdbc)
Change-Id: Ief966fb9bd9f3344cfe9f3b4c4b37540e00ad063
2013-08-23 10:32:20 +01:00
Andrzej J.R. Hunt
33b011e6ff RefreshRow is unuspported. (firebird-sdbc)
Change-Id: Iec8e72a6236de83a1698e2d6e9dbcb609f0f858f
2013-08-23 10:32:20 +01:00
Andrzej J.R. Hunt
ab59b7176f Remove unsupported XRowLocate/XDeleteRows (firebird-sdbc)
Change-Id: I74bf84c8aae4d4ba6b9a2a9ca497ed0cbc092d35
2013-08-23 10:32:19 +01:00
Andrzej J.R. Hunt
f69b198ded Remove unsupporte XRowUpdate/XResultSetUpdate. (firebird-sdbc)
Change-Id: I3b9f8c7199e66f90e1573069996962294793d95e
2013-08-23 10:32:19 +01:00
Andrzej J.R. Hunt
7a3eff2652 Set Table privileges. (firebird-sdbc)
Change-Id: Ia73f2f2107e17c03bc568075a0a99bc7a21fb8a7
2013-08-23 10:32:19 +01:00
Stephan Bergmann
f1b5c883cb No need currently for static oslThread m_Mozilla_UI_Thread
...though the real fix of course would be to keep the oslThread around to join
it later.

Change-Id: I604431cd59e623a7ec97734800136464fd272802
2013-08-22 14:55:29 +02:00
Luboš Luňák
1ece204b54 valueOf is deprecated
Change-Id: I8966ecd4e94c7b11af4d59b5b4461ce03a888891
2013-08-21 16:09:07 +02:00
Tor Lillqvist
ecae2b16c1 WaE: 'valueOf' is deprecated
Change-Id: I9e7e0872eeb5011b79648e1fca436d09304c44ef
2013-08-21 16:48:30 +03:00
Luboš Luňák
64b993e046 finish deprecation of O(U)String::valueOf()
Compiler plugin to replace with matching number(), boolean() or OUString ctor,
ran it, few manual tweaks, mark as really deprecated.

Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
2013-08-21 15:10:35 +02:00