Skip to content

Commit 075d9c3

Browse files
committed
Use DBD::MariaDB instead of DBD::mysql
It features better Unicode support and older versions of the MySQL client library, whereas DBD::mysql v5 requires the v8 MySQL library. So DBD::MariaDB is more compatible these days. Discussion: https://www.perlmonks.org/?node_id=11163487
1 parent f21368b commit 075d9c3

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Changes

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Revision history for Perl extension URI::db.
22

33
0.23
4+
- Changed the MySQL (and MariaDB) URI `dbi_dsn()` method to use
5+
DBD::MariaDB instead of DBD::mysql, because it better supports older
6+
MySQL client libraries and improves Unicode support.
47

58
0.22 2024-04-05T01:38:17Z
69
- Changed Oracle database DBI parameter generation as follows:

lib/URI/db.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ DBI DSN. Some examples:
282282
| URI | DSN |
283283
|--------------------------------------+--------------------------------------------------|
284284
| db:pg:try | dbi:Pg:dbname=try |
285-
| db:mysql://localhost:33/foo | dbi:mysql:host=localhost;port=33;database=foo |
285+
| db:mysql://localhost:33/foo | dbi:MariaDB:host=localhost;port=33;database=foo |
286286
| db:db2://localhost:33/foo | dbi:DB2:HOSTNAME=localhost;PORT=33;DATABASE=foo |
287287
| db:vertica:dbadmin | dbi:ODBC:DSN=dbadmin |
288288
| db:mssql://foo.com/pubs?Driver=MSSQL | dbi:ODBC:Host=foo.com;Database=pubs;Driver=MSSQL |

lib/URI/mysql.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use base 'URI::_db';
33
our $VERSION = '0.23';
44

55
sub default_port { 3306 }
6-
sub dbi_driver { 'mysql' }
6+
sub dbi_driver { 'MariaDB' }
77
sub canonical_engine { 'mysql' }
88

99
sub _dbi_param_map {

t/dbi.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ for my $spec (
194194
},
195195
{
196196
uri => 'db:mysql://localhost:33/foo',
197-
dsn => 'dbi:mysql:host=localhost;port=33;database=foo',
197+
dsn => 'dbi:MariaDB:host=localhost;port=33;database=foo',
198198
dbi => [ [host => 'localhost'], [port => 33], [database => 'foo'] ],
199199
qry => [],
200200
},
201201
{
202202
uri => 'db:mariadb://localhost:33/foo',
203-
dsn => 'dbi:mysql:host=localhost;port=33;database=foo',
203+
dsn => 'dbi:MariaDB:host=localhost;port=33;database=foo',
204204
dbi => [ [host => 'localhost'], [port => 33], [database => 'foo'] ],
205205
qry => [],
206206
},

0 commit comments

Comments
 (0)