Subject: | DBD::ODBC::st fetchrow_array failed: no select statement currently executing (SQL-HY000) |
Date: | Sun, 11 Mar 2012 11:07:03 -0400 |
To: | "bug-DBD-ODBC [...] rt.cpan.org" <bug-DBD-ODBC [...] rt.cpan.org> |
From: | "Bower, Wayne (Wayne)" <Wayne.Bower [...] lsi.com> |
While testing our code with DBD::ODBC 1.33 I found a case that is failing.
The 1st attachment (fetch_no_select.pl) is the script that demonstrates the problem.
And the 2nd attachment (fetch_no_select.log) is from
DBI_TRACE=15=fetch_no_select_dbi.log ./fetch_no_select.pl >fetch_no_select.log 2>&1
And the 3rd attachment (fetch_no_select_dbi.log) is the DBI_TRACE output.
This is using perl 5.14.1, DBI 1.616, DBD::ODBC 1.33 with freeTDS 0.91 and unixODBC on Linux.
The script creates a procedure and executes it resulting in the following error:
DBD::ODBC::st fetchrow_array failed: no select statement currently executing (SQL-HY000)
Essentially the issue occurs if the dbi code attempts to fetch data and the procedure is not selecting anything. Keep in mind that this is just a test case to reveal the issue. Our actual procedure has more complex conditions which determine whether there is anything to select.
The error occurs using DBD::ODBC 1.33 with freeTDS 0.91, but doesn't occur using our older installation of DBD::ODBC 1.16 with freeTDS 0.64.
The prior handling seems correct to me. I.e. fetchrow_array returned an empty list instead of throwing an error.
Please let me know if more information is needed.
Thank you,
Wayne Bower
Message body not shown because it is not plain text.
Message body not shown because it is not plain text.
Message body is not shown because sender requested not to inline it.