Closed gedrox closed 7 years ago
Caused by line removal https://github.com/zozlak/RODBCext/commit/359506b3f51996151c95b09d10171c5c654844d4#diff-54c58beea857a89caa55e1b73c348b4cL290 which capped replaced the value of datalen
to 256 if it's below.
The only Oracle instance I can test against is 11g express edition but I hope it should not make a difference.
I will look at it by the end of week.
It looks like a problem with the Oracle ODBC driver.
26
for timestamp
, 20 + n
for timestamp(n)
).timestamp(9)
and there are no segfaults (although reported column length is 29).timestamp(0)
to avoid segfaults (although reported column length is 20).My guess is that while there is only one timestamp data type in ODBC the Oracle ODBC driver is internally casting all the timestamps to Oracle's "ordinary" timestamp
before passing them to the client. So sad it doesn't report column length accordingly...
The workaround will be to add a check
if (column->dataType == SQL_TYPE_TIMESTAMP && datalen < 26) {
datalen = 26;
}
It's not very pretty. The standard ODBC timestamp
length is 20 and it will
unnecessarily increase memory usage for ODBC drivers passing timestamps shorter then 26 characters. On the other hand who would care about 6 bytes per row nowadays. Especially taking into account that by default 100 rows are fetched at once.
I should upload updated version to CRAN next week.
On CRAN now.
Segmentation fault on reading at least 100 rows of
TIMESTAMP(3)
(which is not the default precision) data from Oracle DB usingRODBCext 0.3.0
onR 3.3.2
. Also fails inR 3.4.0
andR 3.4.1
.The code works fine with
RODBCext 0.2.7
.Oracle version: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
Code to reproduce:
Output: