[erlang-questions] ODBC and longtext limitation
Leif Einar Aune
leif.einar@REDACTED
Mon May 8 14:12:07 CEST 2017
Thanks for the tip, but BLOBs have the same error – from the source code (lib/odbc/c_src/odbcserver.c):
if(sql_type == SQL_LONGVARCHAR || sql_type == SQL_LONGVARBINARY || sql_type == SQL_WLONGVARCHAR)
size = MAXCOLSIZE;
So BLOBs will be chopped off as well ☹
Best Regards
Leif Einar
From: Éric Pailleau [mailto:eric.pailleau@REDACTED]
Sent: mandag 8. mai 2017 12.31
To: Erlang Questions <erlang-questions@REDACTED>; Leif Einar Aune <leif.einar@REDACTED>
Subject: Re: [erlang-questions] ODBC and longtext limitation
Hi,
Did you considered using blob and LONGVARBINARY instead ?
This however imply use of temporary tables on some request at mysql side if I remember well.
Regards
"Envoyé depuis mon mobile " Eric
---- Leif Einar Aune a écrit ----
Hi list,
We are using OTP18.3 on Centos towards a MySQL database using ODBC. When switching a column to LONGTEXT, ODBC type SQL_LONGVARCHAR, we noticed that the values were chopped off when reading from Erlang.
Reading odbcserver.h and odbcserver.c in the erlang distribution this was no surprise, as the ‘size’ variable is set to MAXCOLSIZE (=8001).
Increasing this define and recompiling the odbcserver fixed the limitation. Has anyone else experienced this limitation, and perhaps come up with a better solution? The solution feels wrong, since the maximum value of a LONGTEXT is rather big, and you do not want to malloc 4GB of memory for each LONGTEXT column.
Best Regards
Leif Einar Aune
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170508/d06aceb2/attachment.htm>
More information about the erlang-questions
mailing list