Blame t/rt_31324_full_names.t

Packit 723767
#!/usr/bin/perl
Packit 723767
Packit 723767
use strict;
Packit 723767
BEGIN {
Packit 723767
	$|  = 1;
Packit 723767
	$^W = 1;
Packit 723767
}
Packit 723767
Packit 723767
use lib "t/lib";
Packit 723767
use SQLiteTest;
Packit 723767
use Test::More tests => 8;
Packit 723767
use Test::NoWarnings;
Packit 723767
Packit 723767
my $dbh = connect_ok( RaiseError => 1 );
Packit 723767
$dbh->do("CREATE TABLE f (f1, f2, f3)");
Packit 723767
$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 1);
Packit 723767
Packit 723767
SCOPE: {
Packit 723767
	my $sth = $dbh->prepare('SELECT f1 as "a.a", * FROM f', {});
Packit 723767
	isa_ok( $sth, 'DBI::st' );
Packit 723767
	ok( $sth->execute, '->execute ok' );
Packit 723767
	my $row = $sth->fetchrow_hashref;
Packit 723767
	is_deeply( $row, {
Packit 723767
		'a.a' => 'foo',
Packit 723767
		'f1'  => 'foo',
Packit 723767
		'f2'  => 'bar',
Packit 723767
		'f3'  => 1,
Packit 723767
	}, 'Shortname row ok' );
Packit 723767
}
Packit 723767
Packit 723767
$dbh->do("PRAGMA full_column_names = 1");
Packit 723767
$dbh->do("PRAGMA short_column_names = 0");
Packit 723767
Packit 723767
SCOPE: {
Packit 723767
	my $sth = $dbh->prepare('SELECT f1 as "a.a", * FROM f', {});
Packit 723767
	isa_ok( $sth, 'DBI::st' );
Packit 723767
	ok( $sth->execute, '->execute ok' );
Packit 723767
	my $row = $sth->fetchrow_hashref;
Packit 723767
	is_deeply( $row, {
Packit 723767
		'a.a' => 'foo',
Packit 723767
		'f.f1'  => 'foo',
Packit 723767
		'f.f2'  => 'bar',
Packit 723767
		'f.f3'  => 1,
Packit 723767
	}, 'Shortname row ok' );
Packit 723767
}