Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove calls to mysql_reload() and mysql_list_fields() #415

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

dveeden
Copy link
Collaborator

@dveeden dveeden commented Mar 12, 2024

Closes #411

@dveeden dveeden marked this pull request as ready for review March 12, 2024 08:07
@dveeden dveeden force-pushed the mysql_830_deprecated_functions branch from e0dbe96 to f24b529 Compare March 12, 2024 15:15
@dveeden
Copy link
Collaborator Author

dveeden commented Mar 12, 2024

Testing:

#!/bin/perl
use v5.36;
use DBI;

my $drh = DBI->install_driver("mysql");

$drh->func('reload', '127.0.0.1:3306', 'root', 'xxx', 'admin');
$drh->func('createdb', 'admin', '127.0.0.1:3306', 'root', 'xxx', 'admin');
$drh->func('dropdb', 'admin', '127.0.0.1:3306', 'root', 'xxx', 'admin');
$drh->func('shutdown', '127.0.0.1:3306', 'root', 'xxx', 'admin');

And the general log output:

2024-03-12T15:13:57.766619Z	    8 Connect	root@localhost on  using SSL/TLS
2024-03-12T15:13:57.766801Z	    8 Query	FLUSH PRIVILEGES
2024-03-12T15:13:57.792007Z	    9 Connect	root@localhost on  using SSL/TLS
2024-03-12T15:13:57.792260Z	    9 Query	CREATE DATABASE admin
2024-03-12T15:13:57.816245Z	   10 Connect	root@localhost on  using SSL/TLS
2024-03-12T15:13:57.816412Z	   10 Query	DROP DATABASE admin
2024-03-12T15:13:57.843647Z	   11 Connect	root@localhost on  using SSL/TLS
2024-03-12T15:13:57.843783Z	   11 Query	SHUTDOWN
2024-03-12T15:13:57.843829Z	   11 Query	

Note that this functionality will be removed soon-ish.

@dveeden
Copy link
Collaborator Author

dveeden commented Mar 12, 2024

And the test for mysql_list_fields() replacement:

#!/bin/perl
use v5.36;
use DBI;
use Data::Dumper;


my $dbh = DBI->connect('DBI:mysql:database=test', 'root', 'Root123@', {
    mysql_auto_reconnect => 1,
    RaiseError => 1,
    AutoCommit => 1,
});

$dbh->do('LISTFIELDS t1');
2024-03-12T15:31:15.175045Z	   10 Connect	root@localhost on test using Socket
2024-03-12T15:31:15.175285Z	   10 Query	SHOW COLUMNS FROM t1
2024-03-12T15:31:15.176284Z	   10 Quit

@dveeden dveeden merged commit ce24d98 into perl5-dbi:master Mar 12, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile fails with MySQL 8.3.0 due to MySQL removing a deprecated function DBD::mysql uses
1 participant