cvs commit: p5ee/App-Repository/t DBI-select.t

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     06/02/05 20:20:17

  Modified:    App-Repository/t DBI-select.t
  Log:
  add tests for literal aggregation functions
  
  Revision  Changes    Path
  1.13      +38 -0     p5ee/App-Repository/t/DBI-select.t
  
  Index: DBI-select.t
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/t/DBI-select.t,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DBI-select.t	20 Oct 2005 20:08:38 -0000	1.12
  +++ DBI-select.t	6 Feb 2006 04:20:17 -0000	1.13
  @@ -41,6 +41,11 @@
                   table => {
                       test_person => {
                           primary_key => ["person_id"],
  +                        column => {
  +                            gender => {
  +                                alias => "gnd",
  +                            },
  +                        },
                       },
                   },
               },
  @@ -601,6 +606,39 @@
   &check_select($sql,0);
   
   ###########################################################################
  +# LITERAL EXPRESSIONS
  +###########################################################################
  +
  +$expect_sql = <<EOF;
  +select
  +   t1.gender gnd,
  +   max(age) max_age_
  +from
  +   test_person t1
  +group by
  +   gnd
  +order by
  +   gnd
  +EOF
  +&test_get_rows($expect_sql, 0, "_mk_select_joined_sql(): literal aggregation function",
  +    "test_person",
  +    {},
  +    ["gender","max(age)"],
  +    { group_by => ["gender"], order_by => ["gender"] });
  +
  +$expect_sql = <<EOF;
  +select
  +   t1.gender gnd,
  +   2*age _2_age
  +from
  +   test_person t1
  +EOF
  +&test_get_rows($expect_sql, 0, "_mk_select_joined_sql(): literal aggregation function",
  +    "test_person",
  +    {},
  +    ["gender","2*age"]);
  +
  +###########################################################################
   # EXCEPTIONS
   ###########################################################################
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.