Author: mjevans
Date: Mon Nov 14 10:56:24 2011
New Revision: 14997
Modified:
dbi/trunk/ex/unicode_test.pl
Log:
Remove 2 TODOs in the unicode table name test which now:
a) checks for any unicode table names
b) if the table is not found it tries to decode the table names
and performs the search again
the latter of which shows DBD::SQLite seems to fail to decode table names
which I'll report to rt.
Modified: dbi/trunk/ex/unicode_test.pl
==============================================================================
--- dbi/trunk/ex/unicode_test.pl (original)
+++ dbi/trunk/ex/unicode_test.pl Mon Nov 14 10:56:24 2011
@@ -268,13 +268,28 @@
my $found = first { $_->[2] =~ /$table/i} @$r;
ok($found, 'unicode table found in unqualified table_info');
- # TODO also report if any of the table names have utf8 on
- # TODO also check if decoding as utf8 enables finding the table
+ SKIP: {
+ skip "table found via table_info", 1 if $found;
+
+ $found = first { Encode::decode_utf8($_->[2]) =~ /$table/i} @$r;
+ ok(!$found, "Table not found initially but when table name decoded
it was found as $table");
+ };
+ my $found_some_utf8_tables;
+ foreach ($r) {
+ $found_some_utf8_tables++ if Encode::is_utf8($_->[2]);
+ }
+ note(($found_some_utf8_tables ? 'Found' : 'Did not find') ,
+ ' tables with utf8 on');
$s = $h->table_info(undef, undef, $table, 'TABLE');
$r = $s->fetchall_arrayref;
$found = first {$_->[2] =~ /$table/i} @$r;
ok($found, 'unicode table found by qualified table_info');
+ SKIP {
+ skip "table not found", 1 if !$found;
+
+ ok(Encode::is_utf8($found), 'utf8 flag set of unicode table name');
+ }
}
sub find_column {