On Wed Oct 09 08:10:45 2013, MICHIELB wrote:
Show quoted text> Hi,
>
> I installed libmyodbc in debian from the repositories.
> The t/02simple.t test fails on DBD::ODBC, latest version from CPAN,
> and also when run on the git master branch.
>
> contents of /etc/odbcinst.ini
>
> [MySQL]
> Description = ODBC for MySQL
> Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so
> Setup = /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so
> FileUsage = 1
>
> # Perl 5.14.2
> # osname=linux, osvers=2.6.32-5-686-bigmem, archname=i486-linux-gnu-
> thread-multi-64int
> # Using DBI 1.622
> # Using DBD::ODBC 1.44_3
> # Using DBMS_NAME 'MySQL'
> # Using DBMS_VER '5.5.31-0+wheezy1'
> # Using DRIVER_NAME 'libmyodbc5.so'
> # Using DRIVER_VER '05.01.0010'
> # odbc_has_unicode 0
>
> DBI_DSN=dbi:ODBC:DRIVER={MySQL};Server=localhost;Port=3306;Database=test
>
> # Failed test 'ReadOnly set'
> # at t/02simple.t line 57.
> # got: '0'
> # expected: '1'
> # Looks like you failed 1 test of 66.
> t/02simple.t ................. Dubious, test returned 1 (wstat 256,
> 0x100)
> Failed 1/66 subtests
> (less 3 skipped subtests: 62 okay)
The problem here is DBD::ODBC calls SQLSetConnectAttr to set SQL_ACCESS_MODE and when it asks for it back it is not what it was set to. It is possibly the same issue as with SQLite in that it may be the ODBC driver says it doesn't do SQL_ACCESS_MODE and although DBD::ODBC can detect this and issue a warning the warning will never be seen because of
https://rt.cpan.org/Ticket/Display.html?id=89015 in DBI.
However, it could just as easily be a bug in the MySQL driver. I cannot tell without seeing what the call to SQLSetConnectAttr returns. If it is SQL_SUCCESS_WITH_INFO it does not handle it and can be added to the SQLite list thus waiting for DBI fix (which I personally, haven't quite got to grips with yet).
If you are prepared to do a unixODBC log to tell me which of the above it is you do this:
Edit /etc/odbcinst.ini and the top of this file add something like:
[ODBC]
Trace=yes
TraceFile=/tmp/unixodbc.log
Now just run the 02simple test with something like:
prove -vb t/02simple.t
Now edit /etc/odbcinst.ini to change the Yes to a No (or logging will slow down ODBC from now on). Look in /tmp/unixodbc.log for SQL_ACCESS_MODE string and paste around 20 or lines before and after it here.
Martin
--
Martin J. Evans
Wetherby, UK