Subject: | DBI->data_sources() segfault with DBD::mysql |
Hello,
A program I maintain tries to find the databases available in a MySQL
server. When using the DBI->data_sources() method, the program
segfaults. The attached program is a example for Debian systems. When
run on a Debian etch system, it generates the following output:
# ./mysql_listdb
using DBI v1.53, DBD::mysql v3.0008
reading credentials from /etc/mysql/debian.cnf..
trying with user 'debian-sys-maint'..
- fetching list of database with MySQL 'SHOW' command
=> found 4 databases: information_schema mysql spp spp_unit
- fetching list of database with DBD::mysql ListDBs() function
=> found 4 databases: information_schema mysql spp spp_unit
- fetching available data sources with DBI data_sources() function
Segmentation fault
# echo $?
139
Given the first two methods works, the problem doesn't seem to lies in
DBD::mysql, but to be honest, looking at the source of both DBI and
DBD::mysql, I don't understand how these methods can segfault.
Summary of the software:
- Debian etch / Linux 2.6.18-12-xen-amd64
- Perl v5.8.8 built for i486-linux-gnu-thread-multi
- DBI v1.53
- DBD::mysql v3.0008
- MySQL v5.1.27
Trying with DBI v1.607 doesn't fix the problem:
DBI-1.607# perl -Mblib ../mysql_listdb
using DBI v1.607, DBD::mysql v3.0008
reading credentials from /etc/mysql/debian.cnf..
trying with user 'debian-sys-maint'..
- fetching list of database with MySQL 'SHOW' command
=> found 4 databases: information_schema mysql spp spp_unit
- fetching list of database with DBD::mysql ListDBs() function
=> found 4 databases: information_schema mysql spp spp_unit
- fetching available data sources with DBI data_sources() function
Segmentation fault
However, trying with DBD::mysql v4.011 solves the problem:
DBD-mysql-4.011# perl -Mblib ../mysql_listdb
using DBI v1.53, DBD::mysql v4.011
reading credentials from /etc/mysql/debian.cnf..
trying with user 'debian-sys-maint'..
- fetching list of database with MySQL 'SHOW' command
=> found 4 databases: information_schema mysql spp spp_unit
- fetching list of database with DBD::mysql ListDBs() function
=> found 4 databases: information_schema mysql spp spp_unit
- fetching available data sources with DBI data_sources() function
=> found 4 sources
Of course, you can't fix an old version, but maybe it's a documentation
bug, given nothing is mentionned in the changelog about a data_source()
bugfix.
--
Close the world, txEn eht nepO.
Subject: | mysql_listdb |
Message body not shown because it is not plain text.