Commit | Line | Data |
---|---|---|
41519379 | 1 | use strict; |
2 | use warnings; | |
3 | ||
4 | use Test::More; | |
5 | ||
6 | use lib qw(t/lib); | |
7 | use DBIC::SqlMakerTest; | |
8 | ||
9 | use_ok('DBICTest'); | |
10 | ||
11 | my $schema = DBICTest->init_schema(); | |
12 | ||
13 | my $sql_maker = $schema->storage->sql_maker; | |
14 | ||
15 | for my $q ('', '"') { | |
16 | ||
17 | $sql_maker->quote_char($q); | |
18 | ||
19 | is_same_sql_bind ( | |
20 | \[ $sql_maker->select ('artist', '*', { arr1 => { -value => [1,2] }, arr2 => { '>', { -value => [3,4] } }, field => [5,6] } ) ], | |
21 | "SELECT * | |
22 | FROM ${q}artist${q} | |
23 | WHERE ${q}arr1${q} = ? AND | |
24 | ${q}arr2${q} > ? AND | |
25 | ( ${q}field${q} = ? OR ${q}field${q} = ? ) | |
26 | ", | |
27 | [ | |
28 | [ arr1 => [1,2] ], | |
29 | [ arr2 => [3,4] ], | |
30 | [ field => 5 ], | |
31 | [ field => 6 ], | |
32 | ], | |
33 | ); | |
34 | } | |
35 | ||
36 | done_testing; |