1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00
DBD-SQLite-SQLcipher/t/02create_table.t
2009-04-03 15:38:17 +00:00

27 lines
544 B
Perl

#!/usr/bin/perl
# Tests simple table creation
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
use Test::More tests => 5;
use t::lib::Test;
my $dbh = sqlite_connect();
$dbh->{AutoCommit} = 1;
$dbh->do("CREATE TABLE f (f1, f2, f3)");
SCOPE: {
my $sth = $dbh->prepare("SELECT f.f1, f.* FROM f");
isa_ok( $sth, 'DBI::st' );
ok( $sth->execute, '->execute ok' );
my $names = $sth->{NAME};
is( scalar(@$names), 4, 'Got 4 columns' );
is_deeply( $names, [ 'f1', 'f1', 'f2', 'f3' ], 'Table prepending is disabled by default' );
}
$dbh->disconnect;