Skip to content
Permalink
Browse files

Added test for rt50304 - column_info and ().

This is a test for:
https://rt.cpan.org/Public/Bug/Display.html?id=50304

The actual FIX for this test was already committed in
4a2f3bc and courtesy
of Kevin Bosak.
  • Loading branch information...
mbeijen committed Oct 31, 2013
1 parent 4382efc commit aa6b66f5ccedcb9b7e01a191921021539029ee56
Showing with 41 additions and 0 deletions.
  1. +1 −0 ChangeLog
  2. +1 −0 MANIFEST
  3. +39 −0 t/rt50304-column_info_parentheses.t
@@ -1,4 +1,5 @@
2013-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.025)
* Set with parentheses and column_info - RT50304 - reported and fixed by Kevin Bosak.
* Fix method redefinition warnings in threads on Perl >= 5.16 - Dagfinn Ilmari Manns�ker
* use strict and warnings everywhere.
* Minimum perl version is now 5.8.1, just as for DBI.
@@ -84,6 +84,7 @@ t/manifest.t
t/mysql.dbtest
t/mysql.mtest
t/pod.t
t/rt50304-column_info_parentheses.t
t/rt83494-quotes-comments.t
t/rt85919-fetch-lost-connection.t
TODO
@@ -0,0 +1,39 @@
#!/usr/bin/perl
use strict;
use warnings;

use DBI;

use vars qw($test_dsn $test_user $test_password $state);
require "t/lib.pl";

use Test::More tests => 7;

my $dbh = DBI->connect( $test_dsn, $test_user, $test_password)
|| die $DBI::errstr;

my $create = <<EOC;
CREATE TEMPORARY TABLE dbd_mysql_rt50304_column_info (
id int(10)unsigned NOT NULL AUTO_INCREMENT,
problem_column SET('','(Some Text)') DEFAULT NULL,
regular_column SET('','Some Text') DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY id (id)
);
EOC

ok $dbh->do($create), "create temporary table dbd_mysql_rt50304_column_info";

my $info;

my $sth = $dbh->column_info(undef, undef, 'dbd_mysql_rt50304_column_info', 'problem_column');
$info = $sth->fetchall_arrayref({});
is ( scalar @{$info->[0]->{mysql_values}}, 2, 'problem_column values');
is ( $info->[0]->{mysql_values}->[0], '', 'problem_column first value');
is ( $info->[0]->{mysql_values}->[1], '(Some Text)', 'problem_column second value');

$sth= $dbh->column_info(undef, undef, 'dbd_mysql_rt50304_column_info', 'regular_column');
$info = $sth->fetchall_arrayref({});
is ( scalar @{$info->[0]->{mysql_values}}, 2, 'regular_column values');
is ( $info->[0]->{mysql_values}->[0], '', 'regular_column first value');
is ( $info->[0]->{mysql_values}->[1], 'Some Text', 'regular_column second value');

0 comments on commit aa6b66f

Please sign in to comment.
You can’t perform that action at this time.