DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

Critical error when using dot '.'

Open m-jackson opened this issue 7 years ago • 5 comments

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 '.'

m-jackson avatar May 14 '18 15:05 m-jackson

+ and - too

m-jackson avatar May 14 '18 15:05 m-jackson

Hi! This problem is fixed in DBD::MariaDB project: https://github.com/gooddata/DBD-MariaDB.

pali avatar May 21 '18 10:05 pali

working on fix

CaptTofu avatar Sep 23 '18 16:09 CaptTofu

https://github.com/gooddata/DBD-MariaDB/pull/57

pali avatar Sep 23 '18 17:09 pali

See docker pull capttofu/mysql-5.7-dbd-dev https://github.com/perl5-dbi/DBD-mysql/pull/273

Review from @dveeden requested

CaptTofu avatar Sep 29 '18 16:09 CaptTofu