[freetds] issues connecting with perl DBD::ODBC
linux at evolone.org
Wed Jun 24 01:41:58 EDT 2009
On Tue, 23 Jun 2009 17:59:16 -0400
"Kulik, Scott" <SKulik at severstalna.com> wrote:
> If I try to use a format similar to:
> my $dbh = DBI->connect("dbi:ODBC:$DSN",'_user','_pass');
> like mentioned in the last response I always get a segmentation fault.
Sorry, I missed that.
Anyway, you may want to try doing this same kind of connect, but with one of, however you want to set it:
... which works with DBI if I just set %ENV in a BEGIN block. This didn't work with DBIx-Class (though LD_BIND_NOW did if set outside the script).
If that makes a difference to the segfault (it does for me), then I think maybe you can connect in any way. IOW, I think the problem, whatever it is, is what causes the segfault. It is just a different result of the same underlying problem, but things are in fact handled differently depending on what is in the connect string.
I think there's some SQL_ERROR library that isn't available at connect, but perhaps could be. When the library is preloaded, then you get normal error responses, which prompts the right behaviour, a second attempt at a SQL connect. This is mostly a guess, though, inferred from reading.
Finally, I just put /usr/lib/libtdsodbc.so in /etc/ld.so.preload ... which may, or may not be right, or right for your distro, but hopefully you see the point. I think there is something wrong in the library linking from unixODBC to FreeTDS when called with DBD::ODBC. I know squat about it... though I can say this above is what works for me.
|\ /| | | ~ ~
| \/ | |---| `|` ?
| |ichael | |iggins \^ /
More information about the FreeTDS