From db8c578d466f97bf5f5f581da7f5908a29a20024 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Sun, 30 Mar 2025 17:01:53 -0400 Subject: [PATCH] Restore DBD:mysql to URI::mysql But leave URI::mariadb using DBD::MariaDB. Fixes #29. --- Changes | 3 +++ lib/URI/mariadb.pm | 2 ++ lib/URI/mysql.pm | 2 +- t/dbi.t | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 9540c12..a158a29 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for Perl extension URI::db. 0.24 + - Changed the URI::mysql `dbi_dsn()` back to use the DBD::mysql driver. + URI::mariadb, however, still uses DBD::MariaDB. Thanks to Alastair + Douglas for the completely reasonable gripe (#29). 0.23 2025-01-09T02:48:06Z - Added URI::clickhouse. Thanks to Ilia Rassadin for the PR (#18). diff --git a/lib/URI/mariadb.pm b/lib/URI/mariadb.pm index d3c161e..8acdf64 100644 --- a/lib/URI/mariadb.pm +++ b/lib/URI/mariadb.pm @@ -2,4 +2,6 @@ package URI::mariadb; use base 'URI::mysql'; our $VERSION = '0.24'; +sub dbi_driver { 'MariaDB' } + 1; diff --git a/lib/URI/mysql.pm b/lib/URI/mysql.pm index c9f2836..2622b98 100644 --- a/lib/URI/mysql.pm +++ b/lib/URI/mysql.pm @@ -3,7 +3,7 @@ use base 'URI::_db'; our $VERSION = '0.24'; sub default_port { 3306 } -sub dbi_driver { 'MariaDB' } +sub dbi_driver { 'mysql' } sub canonical_engine { 'mysql' } sub _dbi_param_map { diff --git a/t/dbi.t b/t/dbi.t index 5daf6f1..a87d80d 100644 --- a/t/dbi.t +++ b/t/dbi.t @@ -194,7 +194,7 @@ for my $spec ( }, { uri => 'db:mysql://localhost:33/foo', - dsn => 'dbi:MariaDB:host=localhost;port=33;database=foo', + dsn => 'dbi:mysql:host=localhost;port=33;database=foo', dbi => [ [host => 'localhost'], [port => 33], [database => 'foo'] ], qry => [], },