[ejabberd] Re: jd2ejd bugs

Tomasz Sterna tomasz.sterna at gmail.com
Mon Oct 24 17:06:42 MSD 2005


2005/10/24, Tomasz Sterna <tomasz.sterna at gmail.com>:
> When the SQL query is very long (ie. 79847 characters) the odbc module
> breaks connection with DB. My guess is, that it doesn't handle such
> large queries.

I did some more work.

First I recompiled unixODBC with:
#define SQL_MAX_MESSAGE_LENGTH 1048576

My test C application returns whole field data now.
But when testing from erlang I get only 8215 characters of field data:

$ erl
Erlang (BEAM) emulator version 5.4.9 [source] [hipe] [threads:0] [kernel-poll]

Eshell V5.4.9  (abort with ^G)
1> {ok, Ref} = odbc:connect("DSN=ejabberd;", [{scrollable_cursors,off}]).
{ok,<0.38.0>}
2> odbc:sql_query(Ref, "SELECT * FROM users WHERE username='smoku'").
{selected,["username","password"],[{"smoku","xxxxxxxx"}]}
3> odbc:sql_query(Ref, "SELECT * FROM vcard WHERE username='smoku'").
{selected,["username","vcard"],
          [{"smoku",
            "<vCard xmlns='vcard-temp' prodid='-//HandGen//NONSGML
vGen v1.0//EN' version='2.0' xdbns='vcard-temp'>\r\n<FN>Tomasz
Sterna</FN>\r\n<NICKNAME>smoku</NICKNAME>\r\n<PHOTO>\r\n<TYPE>image/png</TYPE>\r\n<BINVAL>\r\niVBORw0[.BASE64_DATA.]67vSHQi"}]}

Any idea on how to overcome this limitation?


--
smk


More information about the ejabberd mailing list