diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2012-09-24 10:15:50 +0000 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-09-26 13:46:46 +0000 |
commit | 485b97be9f2f2abf5a40923b5fd85f75714a8c02 (patch) | |
tree | ca05cb0ecf3828d909a898c3e5805804a0aff5f8 /t/rt_31324_full_names.t | |
download | perl-dbd-sqlite-tarball-485b97be9f2f2abf5a40923b5fd85f75714a8c02.tar.gz |
Imported from /srv/lorry/lorry-area/perl-dbd-sqlite-tarball/DBD-SQLite-1.38_01.tar.gz.HEADDBD-SQLite-1.38_01masterbaserock/morph
Diffstat (limited to 't/rt_31324_full_names.t')
-rw-r--r-- | t/rt_31324_full_names.t | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/t/rt_31324_full_names.t b/t/rt_31324_full_names.t new file mode 100644 index 0000000..c74181b --- /dev/null +++ b/t/rt_31324_full_names.t @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +use strict; +BEGIN { + $| = 1; + $^W = 1; +} + +use t::lib::Test; +use Test::More tests => 8; +use Test::NoWarnings; + +my $dbh = connect_ok( RaiseError => 1 ); +$dbh->do("CREATE TABLE f (f1, f2, f3)"); +$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 1); + +SCOPE: { + my $sth = $dbh->prepare('SELECT f1 as "a.a", * FROM f', {}); + isa_ok( $sth, 'DBI::st' ); + ok( $sth->execute, '->execute ok' ); + my $row = $sth->fetchrow_hashref; + is_deeply( $row, { + 'a.a' => 'foo', + 'f1' => 'foo', + 'f2' => 'bar', + 'f3' => 1, + }, 'Shortname row ok' ); +} + +$dbh->do("PRAGMA full_column_names = 1"); +$dbh->do("PRAGMA short_column_names = 0"); + +SCOPE: { + my $sth = $dbh->prepare('SELECT f1 as "a.a", * FROM f', {}); + isa_ok( $sth, 'DBI::st' ); + ok( $sth->execute, '->execute ok' ); + my $row = $sth->fetchrow_hashref; + is_deeply( $row, { + 'a.a' => 'foo', + 'f.f1' => 'foo', + 'f.f2' => 'bar', + 'f.f3' => 1, + }, 'Shortname row ok' ); +} |