Bug #38904 documentation error in DBD::mysql
Submitted: 20 Aug 2008 0:03 Modified: 21 Sep 2008 0:09
Reporter: Jonathan Buhacoff Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S3 (Non-critical)
Version:4.008 OS:Any
Assigned to: CPU Architecture:Any
Tags: connection string, DSN

[20 Aug 2008 0:03] Jonathan Buhacoff
Description:
Manual page for DBD::mysql states that a database name is always required in the connection string.

This is not true for connections that only access global settings such as show processlist, show variables, show master status, show client status ... 

The procedure below was repeatable with mysql 3.23.58, 4.1.22, and 5.0.51.

How to repeat:
in mysql server:

GRANT USAGE ON *.* TO username IDENTIFIED BY 'password';

Then run this script and see it works:

#!/usr/bin/perl
use DBI;
my $dbh = DBI->connect("DBI:mysql:host=127.0.0.1",'username','password');
my $sth = $dbh->prepare("SHOW VARIABLES LIKE 'version'");
$sth->execute;
	while( my ($name,$value) = $sth->fetchrow_array) {
		print "connected to mysql $value\n"  if $name eq "version";
	}
$sth->finish;
$dbh->disconnect;

Suggested fix:
Change documentation to say: 

A database be specified unless you are connecting to exercise only global privileges such as USAGE, SUPER, REPLICATION CLIENT, etc.
[21 Aug 2008 0:09] MySQL Verification Team
Thank you for the bug report. Could you please provide the exact URL of the documentatio related?. Thanks in advance.
[21 Sep 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".