File: 53sqlengine_adv.t

package info (click to toggle)
libdbi-perl 1.642-1%2Bdeb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,564 kB
  • sloc: perl: 18,089; ansic: 606; makefile: 29; cpp: 4
file content (49 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!perl -w
$| = 1;

use strict;
use warnings;

require DBD::DBM;

use File::Path;
use File::Spec;
use Test::More;
use Cwd;
use Config qw(%Config);
use Storable qw(dclone);

my $using_dbd_gofer = ( $ENV{DBI_AUTOPROXY} || '' ) =~ /^dbi:Gofer.*transport=/i;
plan skip_all => "Modifying driver state won't compute running behind Gofer" if($using_dbd_gofer);

use DBI;

# <[Sno]> what I could do is create a new test case where inserting into a DBD::DBM and after that clone the meta into a DBD::File $dbh
# <[Sno]> would that help to get a better picture?

do "./t/lib.pl";
my $dir = test_dir();

my $dbm_dbh = DBI->connect( 'dbi:DBM:', undef, undef, {
      f_dir               => $dir,
      sql_identifier_case => 2,      # SQL_IC_LOWER
    }
);

$dbm_dbh->do(q/create table FRED (a integer, b integer)/);
$dbm_dbh->do(q/insert into fRED (a,b) values(1,2)/);
$dbm_dbh->do(q/insert into FRED (a,b) values(2,1)/);

my $f_dbh = DBI->connect( 'dbi:File:', undef, undef, {
      f_dir               => $dir,
      sql_identifier_case => 2,      # SQL_IC_LOWER
    }
);

my $dbm_fred_meta = $dbm_dbh->f_get_meta("fred", [qw(dbm_type)]);
$f_dbh->f_new_meta( "fred", {sql_table_class => "DBD::DBM::Table"} );

my $r = $f_dbh->selectall_arrayref(q/select * from Fred/);
ok( @$r == 2, 'rows found via mixed case table' );

done_testing();