[erlang-questions] ODBC and longtext limitation
Leif Einar Aune
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 ☹
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
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.
"Envoyé depuis mon mobile " Eric
---- Leif Einar Aune a écrit ----
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.
Leif Einar Aune
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions