Summary
Add a PerlOnJava DBD::mysql compatibility shim backed by the existing
DBD::JDBC infrastructure and MySQL Connector/J.
Motivation
PerlOnJava already provides DBI through JDBC and has a working DBD::JDBC
base driver plus a DBD::SQLite DSN-translation shim. However, CPAN modules
that use the conventional dbi:mysql: DSN or declare DBD::mysql currently
cannot load or connect.
MetaCPAN lists dozens of reverse dependents, including:
Mojo::mysql
PApp
DBIx::Class::Storage::DBI::mysql::Retryable
Tapper::Schema
DBIx::TxnPool
Mojolicious::Command::migration
Wiki::Toolkit
Coro::Mysql
DBIx::MysqlCoroAnyEvent
DBIx::SecureCGI
MySQL::Util
App::Prove::Plugin::MySQLPool
The current CPAN failure that prompted this request is
MySQL::TableInfo-1.01, whose pure-Perl implementation depends on
DBD::mysql and a live MySQL database.
Reverse-dependency evidence:
https://metacpan.org/dist/DBD-mysql/requires
Proposed scope
- Add
src/main/perl/lib/DBD/mysql.pm as a PerlOnJava compatibility driver.
- Inherit the common handle implementation from
DBD::JDBC.
- Translate common DSNs such as:
dbi:mysql:database=name
dbi:mysql:database=name;host=host;port=3306
dbi:mysql:name;mysql_socket=/path/to/socket
into Connector/J URLs.
- Preserve standard DBI operations: connect, prepare, execute, fetch,
transactions, metadata, quoting, and error handling.
- Provide common MySQL compatibility fields such as
mysql_insertid where
JDBC exposes an equivalent.
- Keep Connector/J optional and use the existing
Configure.pl/classpath
driver configuration path.
- Add focused DSN and handle tests without requiring a live server, plus an
optional integration suite against MySQL/MariaDB when a JDBC driver and
server are available.
Compatibility boundaries
This should not perform broad SQL rewriting. MySQL SQL semantics should be
provided by MySQL/MariaDB through Connector/J. MySQL-specific attributes and
methods such as mysql_auto_reconnect, mysql_enable_utf8, and
mysql_server_prepare need explicit mapping, documented no-op behavior, or a
clear unsupported-feature error.
The shim must not claim to replace the native driver for code that depends on
native client-library behavior or undocumented DBD::mysql internals.
Acceptance criteria
use DBD::mysql succeeds under PerlOnJava without XS loading.
- Standard
DBI->connect('dbi:mysql:...', ...) reaches Connector/J.
- A MySQL-backed smoke test exercises schema introspection, prepared
statements, transactions, generated IDs, and error propagation.
MySQL::TableInfo can run its upstream test when supplied with a MySQL
server and Connector/J.
- JVM and interpreter backends have equivalent behavior for the shim.
Summary
Add a PerlOnJava
DBD::mysqlcompatibility shim backed by the existingDBD::JDBCinfrastructure and MySQL Connector/J.Motivation
PerlOnJava already provides DBI through JDBC and has a working
DBD::JDBCbase driver plus a
DBD::SQLiteDSN-translation shim. However, CPAN modulesthat use the conventional
dbi:mysql:DSN or declareDBD::mysqlcurrentlycannot load or connect.
MetaCPAN lists dozens of reverse dependents, including:
Mojo::mysqlPAppDBIx::Class::Storage::DBI::mysql::RetryableTapper::SchemaDBIx::TxnPoolMojolicious::Command::migrationWiki::ToolkitCoro::MysqlDBIx::MysqlCoroAnyEventDBIx::SecureCGIMySQL::UtilApp::Prove::Plugin::MySQLPoolThe current CPAN failure that prompted this request is
MySQL::TableInfo-1.01, whose pure-Perl implementation depends onDBD::mysqland a live MySQL database.Reverse-dependency evidence:
https://metacpan.org/dist/DBD-mysql/requires
Proposed scope
src/main/perl/lib/DBD/mysql.pmas a PerlOnJava compatibility driver.DBD::JDBC.dbi:mysql:database=namedbi:mysql:database=name;host=host;port=3306dbi:mysql:name;mysql_socket=/path/to/socketinto Connector/J URLs.
transactions, metadata, quoting, and error handling.
mysql_insertidwhereJDBC exposes an equivalent.
Configure.pl/classpathdriver configuration path.
optional integration suite against MySQL/MariaDB when a JDBC driver and
server are available.
Compatibility boundaries
This should not perform broad SQL rewriting. MySQL SQL semantics should be
provided by MySQL/MariaDB through Connector/J. MySQL-specific attributes and
methods such as
mysql_auto_reconnect,mysql_enable_utf8, andmysql_server_prepareneed explicit mapping, documented no-op behavior, or aclear unsupported-feature error.
The shim must not claim to replace the native driver for code that depends on
native client-library behavior or undocumented
DBD::mysqlinternals.Acceptance criteria
use DBD::mysqlsucceeds under PerlOnJava without XS loading.DBI->connect('dbi:mysql:...', ...)reaches Connector/J.statements, transactions, generated IDs, and error propagation.
MySQL::TableInfocan run its upstream test when supplied with a MySQLserver and Connector/J.