From: Matt S Trout Date: Wed, 9 Oct 2019 01:53:06 +0000 (+0000) Subject: cleanup rogue whitespace X-Git-Tag: v2.000000~3^2~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b775020df435b6c41c2e03c514da9123a31c0b1e;p=dbsrgits%2FSQL-Abstract.git cleanup rogue whitespace --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index b681900..fdd6399 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1284,7 +1284,7 @@ sub _expand_bool { sub _expand_list { my ($self, undef, $expr) = @_; return { -op => [ - ',', map $self->expand_expr($_), + ',', map $self->expand_expr($_), @{$expr->{-op}}[1..$#{$expr->{-op}}] ] } if ref($expr) eq 'HASH' and ($expr->{-op}||[''])->[0] eq ','; return +{ -op => [ ',', diff --git a/lib/SQL/Abstract/Formatter.pm b/lib/SQL/Abstract/Formatter.pm index cd7eef8..47694f0 100644 --- a/lib/SQL/Abstract/Formatter.pm +++ b/lib/SQL/Abstract/Formatter.pm @@ -77,4 +77,4 @@ sub _fold_sql { return join '', @res, $line; } -1; +1; diff --git a/t/05in_between.t b/t/05in_between.t index ae66b90..f32c57a 100644 --- a/t/05in_between.t +++ b/t/05in_between.t @@ -406,7 +406,7 @@ for my $case (@in_between_tests) { warnings_are { ($stmt, @bind) = $sql->where($case->{where}); } [], "$label gives no warnings"; - + is_same_sql_bind( $stmt, \@bind, diff --git a/t/80extra_clauses.t b/t/80extra_clauses.t index c985c06..2f60558 100644 --- a/t/80extra_clauses.t +++ b/t/80extra_clauses.t @@ -271,7 +271,7 @@ is_same_sql( ($sql, @bind) = $sqlac->insert({ - with => [ + with => [ faculty => { -select => { _ => [qw /p.person p.email/], @@ -288,7 +288,7 @@ is_same_sql( into => 'license', fields => [ qw(kind expires_on valid_from) ], select => { - select => [\(qw('grandfather' '2017-06-30' '2016-07-01'))], + select => [\(qw('grandfather' '2017-06-30' '2016-07-01'))], from => 'faculty', }, returning => 'license_id', @@ -328,7 +328,7 @@ is_same_sql_bind( ($sql, @bind) = $sqlac->delete({ - with => [ + with => [ instructors => { -select => { _ => [qw/p.person_id email default_license_id/], @@ -338,12 +338,12 @@ is_same_sql_bind( to => 'license_person', as => 'lp', on => { 'lp.person_id' => 'p.person_id' }, - }, + }, -join => { to => 'license', as => 'l', on => { 'l.license_id' => 'lp.license_id' }, - }, + }, ], where => { 'p.person_type' => 'faculty', @@ -363,15 +363,15 @@ is_same_sql_bind( to => 'license_person', as => 'lp', on => { 'lp.person_id' => 'i.person_id' }, - }, + }, -join => { to => 'license', as => 'l', on => { 'l.license_id' => 'lp.license_id' }, - }, + }, ], where => { - 'lp.license_id' => { + 'lp.license_id' => { '<>' => {-ident => 'i.default_license_id'} }, 'l.kind' => 'pending', @@ -381,10 +381,10 @@ is_same_sql_bind( ], from => 'license_person', where => { - ctid => { -in => + ctid => { -in => { -select => { - _ => ['ctid'], + _ => ['ctid'], from => 'deletable_licenses', } } @@ -400,8 +400,8 @@ is_same_sql_bind( from person as p join license_person as lp on lp.person_id = p.person_id join license as l on l.license_id = lp.license_id - where l.kind = ? - AND p.person_status != ? + where l.kind = ? + AND p.person_status != ? AND p.person_type = ? group by p.person_id having COUNT(l.license_id) > ?), @@ -413,7 +413,7 @@ is_same_sql_bind( where l.kind = ? and lp.license_id <> i.default_license_id ) - delete from license_person + delete from license_person where ctid IN ( (select ctid from deletable_licenses) ) @@ -428,7 +428,7 @@ is_same_sql_bind( set => { license_id => { -ident => 'info.default_license_id' }, }, - from => [ + from => [ -select => { select => [qw( s.survey_id p.default_license_id p.person_id)], from => [ @@ -437,12 +437,12 @@ is_same_sql_bind( to => 'class', as => 'c', on => { 'c.faculty_id' => 'p.person_id' }, - }, + }, -join => { to => 'survey', as => 's', on => { 's.class_id' => 'c.class_id' }, - }, + }, ], where => { 'p.institution_id' => { -value => 15031 } }, },