DBD-mysql
DBD-mysql copied to clipboard
Critical error when using dot '.'
trafficstars
dbd::mysql module not correctly work when use options "mysql_bind_type_guessing" => 1 and dot(.) in request
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my $dbh = &_conn();
my $z = $dbh->selectall_arrayref("SELECT user_id FROM tokens where user_id = ?", undef, ($ARGV[0]));
sub _conn
{
my $dbh = DBI->connect(
"DBI:mysql:database=test;host=localhost;port=3306",
'test',
'test',
{
"RaiseError" => 1,
"PrintError" => 1,
"PrintWarn" => 1,
"InactiveDestroy" => 1,
"AutoCommit" => 1,
"mysql_enable_utf8" => 1,
"mysql_bind_type_guessing" => 1,
}
);
return $dbh;
}
$ perl test.pl '.'
+ and - too
Hi! This problem is fixed in DBD::MariaDB project: https://github.com/gooddata/DBD-MariaDB.
working on fix
https://github.com/gooddata/DBD-MariaDB/pull/57
See docker pull capttofu/mysql-5.7-dbd-dev
https://github.com/perl5-dbi/DBD-mysql/pull/273
Review from @dveeden requested