With hopes that I know why you're asking (yuck, concat multiple 255 fields), I get these results from the test below. Note that my version of MySQL (Ver 8.23 Distrib 3.23.55, for Win95/Win98 on i32
with DBD::mysql 2.9002) does *not* behave the way yours does:


ok - DBD::AnyData:
ok - DBD::CSV:
ok - DBD::SQLite:mi
ok - DBD::PgPP:dbname=mi;host=localhost
bad - DBD::mysql:database=mi
bad - DBD::ODBC:msaccess

DBD::mysql::db do failed: Too big column length for column 'x' (max = 255). Use BLOB instead at d:/htdocs/a/create.pl line 31.

DBD::ODBC::db do failed: [Microsoft][ODBC Microsoft Access Driver] Size of field 'x' is too long. (SQL-42000)(DBD: Execute immediate failed err=-1) at d:/htdocs/a/create.pl line 31.

-- start of test code --
#!/usr/local/bin/perl -w
$|=1;
use strict;
use warnings;
use DBI;
use vars qw/$errmsg/;
$errmsg = '';
test($_,undef,undef) for (
   ['dbi:AnyData:'],
   ['dbi:CSV:'],
   ['dbi:SQLite:mi'],
   ['dbi:PgPP:dbname=mi;host=localhost','userFoo'],
   ['dbi:mysql:database=mi'],
   ['dbi:ODBC:msaccess'],
);
print "\n$errmsg";


sub test {
my($dsn,$user,$auth)[EMAIL PROTECTED];
my $table = 'tmp';
my $dbh;
eval {
$dbh = DBI->connect($dsn,$user,$auth,{RaiseError=>1,PrintError=>0});
};
return unless $dbh;
eval {
$dbh->do("DROP TABLE $table");
};
my $longvar= '1'x1024;
eval {
$dbh->do("CREATE TABLE $table (x VARCHAR(1024))");
$dbh->do("INSERT INTO $table (x) VALUES ('$longvar')");
};
$errmsg .= "[EMAIL PROTECTED]" if $@;
if (1) {
my $str='';
eval {$str=$dbh->selectall_arrayref("SELECT x FROM $table")->[0]->[0]};
my $success = ($str eq $longvar) ? ' ok' : 'bad';
$dsn =~ s/dbi://;
print "$success - DBD::$dsn\n";
}
eval {
$dbh->do("DROP TABLE $table");
};
$dbh->disconnect;
}
-- end of test code --


--
Jeff




Reply via email to