ap / DBIx-Connector

Fast, safe DBI connection and transaction management
https://metacpan.org/release/DBIx-Connector
40 stars 14 forks source link

DBD::MariaDB support #50

Open bit0mike opened 3 months ago

bit0mike commented 3 months ago

Trying to use DBD::MariaDB in place of DBD::mysql results in some weird behavior sometimes, notably Perl crashing (SIGBUS core dump, on FreeBSD at least) when disconnecting from the database when mixed with Parallel::ForkManager. Obviously normally Parallel::ForkManager shouldn't be used with open DBI handles, but that's one of the things DBIx::Connector is supposed to make "safe". And with the DBD::mysql driver, it is.

I've not tried making my own DBIx::Connector driver for MariaDB by copying the MySQL one yet.

The main difference between the two drivers is their handling of Unicode strings.

theory commented 3 months ago

Would you like to submit a PR to add it?

bit0mike commented 3 months ago

Looks like all it takes is to copy DBIx::Connector::Driver::mysql to DBIx::Connector::Driver::MariaDB and search/replace all "mysql" and "MySQL" strings to "MariaDB", except "mysql_auto_reconnect" becomes "mariadb_auto_reconnect". I'll put together the whole file tomorrow. Just having this there fixes a big performance problem I was having (disconnects were 2x slower) though I don't know yet if it fixes the SIGBUS issue on disconnect.

karenetheridge commented 3 months ago

Why would there be a performance improvement from making this change?