RE: DBD::mysql...solved

RE: DBD::mysql...solved

am 19.08.2003 19:58:27 von Jeff.Hodge

------_=_NextPart_001_01C3667B.7DC52AF0
Content-Type: text/plain;
charset="iso-8859-1"

>If this is the case, there is a patch available, see the last weeks of the
>mailing list archive. In either case, you can safely go on and do a
>"make install".
ah ha. I was thinking it might be ok to install.


>And, please, be so kind to post what you did to get things working.

Sure....


I installed mysql 4.0.14 with rpms (actualy upgraded from .12 to be prescise
I heard there was issues with sorting with .12). At the time I didn't think
I needed the
MySQL-devel-4.0.14-0.i386.rpm
MySQL-shared-4.0.14-0.i386.rpm
RPM's, since I assumed from the name that it had to do with devloping mysql.
I thought it had to do with UDF's or accesing c interpreters for mysql; or
the like. Naming convention not very intuitive....

At any rate, while installing the DBD::mysql I was getting many errors. The
first was that it couldn't find mysql_config. Not knowing that it came from
the 2 rpms listed above, I downloaded/untared the source and found the
script in the bin directory. Simply copying the config script helped, but
other scripts were still missing. So I added the path of the source to my
env and re-made the makefile. This allowed allowed it to create the make
file.

I had trouble with connecting to the database with the default settings.
Then I remembered that I removed the default settings from mysql for
security reasons. So I re-made the makefile with a valid user and a valid
password. This got me to the point where it would connect, but many tests
would fail.

With the scripts not properly installed I had the
> cflags (Users choice) = -I
> libs (Users choice) = /usr/lib/

not set correctly. At this point I found that the other rpm's (see above)
held the scripts that could be installed properly, so I installed them via
the rpm.

At this point I re-made the makefile (with user/pw set)
perl Makefile.PL -testpassword='password' -testuser='user'
This brought me to the point where all but three tests passed.
-6/21 New testab not in DSN list
-10/21DSN testab not in DSN list
-14/21DSN testac not in DSN list
which are explained as:

>These are most probably bugs in the test suite, triggered by the need to
use a password. (

....which is exactly what I did.

So basicly...all of the rpms need to be installed and you need to change the
user/pw when running the makefile.



....hope this info helps.


Cheers,

-jh

------_=_NextPart_001_01C3667B.7DC52AF0--

Re: DBD::mysql...solved

am 19.08.2003 22:00:34 von Alexey Stroganov

On Tue, Aug 19, 2003 at 10:58:27AM -0700, Hodge, Jeff F (ECIII) wrote:

[skip]

> At this point I re-made the makefile (with user/pw set)
> perl Makefile.PL -testpassword='password' -testuser='user'
> This brought me to the point where all but three tests passed.
> -6/21 New testab not in DSN list
> -10/21DSN testab not in DSN list
> -14/21DSN testac not in DSN list
> which are explained as:
>
> >These are most probably bugs in the test suite, triggered by the need to
> use a password. (
>
> ...which is exactly what I did.
>
> So basicly...all of the rpms need to be installed and you need to change the
> user/pw when running the makefile.

Yes. Small bugs are in both test suite and driver.
This bug was already fixed in my local tree.
You can apply patch below (against fresh 2.9002) to fix this issue.


diff -ur DBD-mysql-2.9002/lib/DBD/mysql.pm DBD-mysql-2.9002-RC1/lib/DBD/mysql.pm
--- DBD-mysql-2.9002/lib/DBD/mysql.pm 2003-06-24 03:25:19 +0300
+++ DBD-mysql-2.9002/lib/DBD/mysql.pm 2003-07-10 08:02:25 +0300
@@ -137,12 +144,14 @@
sub data_sources {
my($self) = shift;
my($attributes) = shift;
- my($host, $port) = ('', '');
+ my($host, $port, $user, $password) = ('', '', '', '');
if ($attributes) {
$host = $attributes->{host} || '';
$port = $attributes->{port} || '';
+ $user = $attributes->{user} || '';
+ $password = $attributes->{password} || '';
}
- my(@dsn) = $self->func($host, $port, '_ListDBs');
+ my(@dsn) = $self->func($host, $port, $user, $password, '_ListDBs');
my($i);
for ($i = 0; $i < @dsn; $i++) {
$dsn[$i] = "DBI:mysql:$dsn[$i]";

--- DBD-mysql-2.9002/t/dbdadmin.t 2003-03-18 04:53:28 +0200
+++ DBD-mysql-2.9002/t/dbdadmin.t 2003-08-08 13:35:03 +0300
@@ -76,7 +75,7 @@
or ServerError();

Test($state or (@dsn = DBI->data_sources(
- $mdriver, {host => $test_host, port => $test_port})) >= 0);
+ $mdriver, {host => $test_host, port => $test_port, user=> $test_user, password=>$test_password})) >= 0);
Test($state or (@dsn = DBI->data_sources($mdriver)) >= 0);
if (!$state && $verbose) {
my $d;
@@ -136,7 +135,9 @@
or InDsnList($testdsn, DBI->data_sources($mdriver))
or InDsnList($testdsn, DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port})))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password})))
or print STDERR ("New DB not in DSN list\n");

Test($state or $accessDenied
@@ -150,7 +151,9 @@
!InDsnList($testdsn,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port}))))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password}))))
or print STDERR ("New DB not removed from DSN list\n");

my($mayShutdown) = $ENV{'DB_SHUTDOWN_ALLOWED'};
@@ -165,7 +168,9 @@
or InDsnList($testdsn1,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port})))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password})))
or printf STDERR ("DSN $testdsn1 not in DSN list.\n");
Test($state or $accessDenied
or $drh->func('dropdb', $testdsn1, $test_host,
@@ -177,7 +182,9 @@
!InDsnList($testdsn1,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port}))))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password}))))
or printf STDERR ("DSN $testdsn1 not removed from DSN list.\n");
Test($state or $accessDenied
or $drh->func('createdb', $testdsn2, $test_host,
@@ -189,7 +196,9 @@
or InDsnList($testdsn2,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port})))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password})))
or printf STDERR ("DSN $testdsn2 not in DSN list.\n");
Test($state or $accessDenied
or $drh->func('dropdb', $testdsn2, $test_host,
@@ -201,7 +210,9 @@
!InDsnList($testdsn2,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port}))))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password}))))
or printf STDERR ("DSN $testdsn2 not removed from DSN list.\n");

if ($mdriver eq 'mysql') {


--
Mr. Alexey Stroganov
Full-Time Benchmarks Developer
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: DBD::mysql...solved

am 19.08.2003 22:00:34 von Alexey Stroganov

On Tue, Aug 19, 2003 at 10:58:27AM -0700, Hodge, Jeff F (ECIII) wrote:

[skip]

> At this point I re-made the makefile (with user/pw set)
> perl Makefile.PL -testpassword='password' -testuser='user'
> This brought me to the point where all but three tests passed.
> -6/21 New testab not in DSN list
> -10/21DSN testab not in DSN list
> -14/21DSN testac not in DSN list
> which are explained as:
>
> >These are most probably bugs in the test suite, triggered by the need to
> use a password. (
>
> ...which is exactly what I did.
>
> So basicly...all of the rpms need to be installed and you need to change the
> user/pw when running the makefile.

Yes. Small bugs are in both test suite and driver.
This bug was already fixed in my local tree.
You can apply patch below (against fresh 2.9002) to fix this issue.


diff -ur DBD-mysql-2.9002/lib/DBD/mysql.pm DBD-mysql-2.9002-RC1/lib/DBD/mysql.pm
--- DBD-mysql-2.9002/lib/DBD/mysql.pm 2003-06-24 03:25:19 +0300
+++ DBD-mysql-2.9002/lib/DBD/mysql.pm 2003-07-10 08:02:25 +0300
@@ -137,12 +144,14 @@
sub data_sources {
my($self) = shift;
my($attributes) = shift;
- my($host, $port) = ('', '');
+ my($host, $port, $user, $password) = ('', '', '', '');
if ($attributes) {
$host = $attributes->{host} || '';
$port = $attributes->{port} || '';
+ $user = $attributes->{user} || '';
+ $password = $attributes->{password} || '';
}
- my(@dsn) = $self->func($host, $port, '_ListDBs');
+ my(@dsn) = $self->func($host, $port, $user, $password, '_ListDBs');
my($i);
for ($i = 0; $i < @dsn; $i++) {
$dsn[$i] = "DBI:mysql:$dsn[$i]";

--- DBD-mysql-2.9002/t/dbdadmin.t 2003-03-18 04:53:28 +0200
+++ DBD-mysql-2.9002/t/dbdadmin.t 2003-08-08 13:35:03 +0300
@@ -76,7 +75,7 @@
or ServerError();

Test($state or (@dsn = DBI->data_sources(
- $mdriver, {host => $test_host, port => $test_port})) >= 0);
+ $mdriver, {host => $test_host, port => $test_port, user=> $test_user, password=>$test_password})) >= 0);
Test($state or (@dsn = DBI->data_sources($mdriver)) >= 0);
if (!$state && $verbose) {
my $d;
@@ -136,7 +135,9 @@
or InDsnList($testdsn, DBI->data_sources($mdriver))
or InDsnList($testdsn, DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port})))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password})))
or print STDERR ("New DB not in DSN list\n");

Test($state or $accessDenied
@@ -150,7 +151,9 @@
!InDsnList($testdsn,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port}))))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password}))))
or print STDERR ("New DB not removed from DSN list\n");

my($mayShutdown) = $ENV{'DB_SHUTDOWN_ALLOWED'};
@@ -165,7 +168,9 @@
or InDsnList($testdsn1,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port})))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password})))
or printf STDERR ("DSN $testdsn1 not in DSN list.\n");
Test($state or $accessDenied
or $drh->func('dropdb', $testdsn1, $test_host,
@@ -177,7 +182,9 @@
!InDsnList($testdsn1,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port}))))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password}))))
or printf STDERR ("DSN $testdsn1 not removed from DSN list.\n");
Test($state or $accessDenied
or $drh->func('createdb', $testdsn2, $test_host,
@@ -189,7 +196,9 @@
or InDsnList($testdsn2,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port})))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password})))
or printf STDERR ("DSN $testdsn2 not in DSN list.\n");
Test($state or $accessDenied
or $drh->func('dropdb', $testdsn2, $test_host,
@@ -201,7 +210,9 @@
!InDsnList($testdsn2,
DBI->data_sources($mdriver,
{"host" => $test_host,
- "port" => $test_port}))))
+ "port" => $test_port,
+ "user" => $test_user,
+ "password" => $test_password}))))
or printf STDERR ("DSN $testdsn2 not removed from DSN list.\n");

if ($mdriver eq 'mysql') {


--
Mr. Alexey Stroganov
Full-Time Benchmarks Developer
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: DBD::mysql...solved

am 20.08.2003 18:18:48 von Rudy Lippan

On Tue, 19 Aug 2003, Alexey Stroganov wrote:

> Yes. Small bugs are in both test suite and driver.
> This bug was already fixed in my local tree.
> You can apply patch below (against fresh 2.9002) to fix this issue.


Applied.

Thank you.

Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: DBD::mysql...solved

am 20.08.2003 18:18:48 von Rudy Lippan

On Tue, 19 Aug 2003, Alexey Stroganov wrote:

> Yes. Small bugs are in both test suite and driver.
> This bug was already fixed in my local tree.
> You can apply patch below (against fresh 2.9002) to fix this issue.


Applied.

Thank you.

Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org