Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 49412
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: cpan [...] askneil.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: execute_array fails with "no metadata iformation while trying to describe result set".
Download (untitled) / with headers
text/plain 761b
I'm having trouble with execute_array, when binding to an array with more than one element. (binding to one element works fine). I believe it is a problem in dbd-mysql, but I guess it could be a dbi problem. The issue is the driver is dying with this error: ERROR: 19 'no metadata information while trying describe result set' It dies when processing the 2nd bound array element. The dbd_sth->result field is free'ed after the first element, but the dbd_describe method is called for each bound element. (I am using prepared statements). This was run against mysql 5.0.78 on a centos 5.3 box. I've attached a small test program that demonstrates the problem, and output from the program. The dbd-mysql version was 4.012, but dbi was "stock" (1.52).
Subject: dbi-error-output.txt
DBI::db=HASH(0x2b4e740) trace level set to 0x0/2 (DBI @ 0x0/0) in DBI 1.52-ithread (pid 2724) -> prepare for DBD::mysql::db (DBI::db=HASH(0x2b81570)~0x2b4e740 'select ? from dual') thr#28fe010 -> dbd_st_prepare MYSQL_VERSION_ID 50077, SQL statement: select ? from dual >- dbd_st_free_result_sets <- dbd_st_free_result_sets RC -1 <- dbd_st_free_result_sets use_server_side_prepare set, check LIMIT need to test for LIMIT use_server_side_prepare set mysql_stmt_prepare returned 0 mysql_to_perl_type returned 253 <- dbd_st_prepare <- prepare= DBI::st=HASH(0x2b4e4d0) at dbitest line 34 -> bind_param_array in DBD::_::st for DBD::mysql::st (DBI::st=HASH(0x2b4e4d0)~0x2b4e290 1 ARRAY(0x29f6780)) thr#28fe010 <- bind_param_array= 1 at dbitest line 35 -> execute_array in DBD::_::st for DBD::mysql::st (DBI::st=HASH(0x2b4e4d0)~0x2b4e290 HASH(0x2b4e500)) thr#28fe010 1 -> FETCH for DBD::mysql::st (DBI::st=HASH(0x2b4e290)~INNER 'NUM_OF_PARAMS') thr#28fe010 -> dbd_st_FETCH_attrib for 02ada330, key NUM_OF_PARAMS 1 <- FETCH= 1 at DBI.pm line 1843 1 -> execute_for_fetch in DBD::_::st for DBD::mysql::st (DBI::st=HASH(0x2b4e290)~INNER CODE(0x2b4e080) undef) thr#28fe010 2 -> execute for DBD::mysql::st (DBI::st=HASH(0x2b4e290)~INNER 1) thr#28fe010 SCALAR type 0 ->length 1<- IS A STRING or BLOB -> dbd_st_execute for 02ae8b70 >- dbd_st_free_result_sets <- dbd_st_free_result_sets RC -1 <- dbd_st_free_result_sets -> mysql_st_internal_execute41 mysql_st_internal_execute41 calling mysql_execute with 1 num_params mysql_stmt_execute returned 0 <- mysql_internal_execute_41 returning 1 rows <- dbd_st_execute returning imp_sth->row_num 1 2 <- execute= 1 at DBI.pm line 1926 2 -> execute for DBD::mysql::st (DBI::st=HASH(0x2b4e290)~INNER 1) thr#28fe010 SCALAR type 0 ->length 1<- IS A STRING or BLOB -> dbd_st_execute for 02ae8b70 >- dbd_st_free_result_sets <- dbd_st_free_result_sets RC -1 <- dbd_st_free_result_sets --> dbd_describe dbd_describe() num_fields 1 --> do_error no metadata information while trying describe result set error 19 recorded: no metadata information while trying describe result set <-- do_error -> mysql_st_internal_execute41 mysql_st_internal_execute41 calling mysql_execute with 1 num_params mysql_stmt_execute returned 0 <- mysql_internal_execute_41 returning 1 rows <- dbd_st_execute returning imp_sth->row_num 1 !! ERROR: 19 'no metadata information while trying describe result set' (err#0) 2 <- execute= 1 at DBI.pm line 1926 !! ERROR: 19 'no metadata information while trying describe result set' (err#0) 1 <- execute_for_fetch= 2 at DBI.pm line 1916 !! ERROR: 19 'no metadata information while trying describe result set' (err#0) <- execute_array= 2 at dbitest line 36 DBD::mysql::st execute_array failed: no metadata information while trying describe result set at /home/neil/.bin/dbitest line 36. DBD::mysql::st execute_array failed: no metadata information while trying describe result set at /home/neil/.bin/dbitest line 36. -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x2b4e290)~INNER) thr#28fe010 --> dbd_st_finish --> dbd_describe dbd_describe() num_fields 1 i 0 col_type 254 fbh->length 0 fields[i].length 1 fields[i].type 254 fields[i].charsetnr 8 mysql_to_perl_type returned 254 <- dbd_describe >- dbd_st_free_result_sets <- dbd_st_free_result_sets RC -1 <- dbd_st_free_result_sets <-- dbd_st_finish Freeing 1 parameters, bind 2bdbbc0 fbind 2bdbc40 ERROR: 19 'no metadata information while trying describe result set' (err#0) <- DESTROY= undef -> STORE for DBD::mysql::db (DBI::db=HASH(0x2b4e740)~INNER 'TraceLevel' 0) thr#28fe010 ERROR: 19 'no metadata information while trying describe result set' (err#0) <- STORE= 1 Issuing rollback() for database handle being DESTROY'd without explicit disconnect().
Subject: dbitest
Download dbitest
application/octet-stream 1.1k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 398b
Thanks for this report and sorry it's taken so long to reply. I tested this and indeed it does fail. It's difficult to ascertain if the cause is the prepared statement API or DBD itself. The statement that is executed is correct, but the result calls don't seem to provide a complete data result. For now, don't use server-side prepared statements and I'll continue to try to find a fix for this.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.