'+columns' => { sibling_count => $cdrs->search(
{
'siblings.artist' => { -ident => 'me.artist' },
- 'siblings.cdid' => { '!=' => ['-and', { -ident => 'me.cdid' }, 'bogus condition'] },
+ 'siblings.cdid' => { '!=' => ['-and', { -ident => 'me.cdid' }, 23414] },
}, { alias => 'siblings' },
)->count_rs->as_query,
},
[
# subselect
- [ 'siblings.cdid' => 'bogus condition' ],
- [ 'me.artist' => 2 ],
+ [ { sqlt_datatype => 'integer', dbic_colname => 'siblings.cdid' }
+ => 23414 ],
+
+ [ { sqlt_datatype => 'integer', dbic_colname => 'me.artist' }
+ => 2 ],
# outher WHERE
- [ 'me.artist' => 2 ],
+ [ { sqlt_datatype => 'integer', dbic_colname => 'me.artist' }
+ => 2 ],
],
'Expected SQL on correlated realiased subquery'
);
# first add a lone non-as-ed select
# it should be reordered to appear at the end without throwing prefetch/bind off
-$c_rs = $c_rs->search({}, { '+select' => \[ 'me.cdid + ?', [ __add => 1 ] ] });
+$c_rs = $c_rs->search({}, { '+select' => \[ 'me.cdid + ?', [ \ 'inTEger' => 1 ] ] });
# now add an unbalanced select/as pair
$c_rs = $c_rs->search ({}, {
[
# first subselect
- [ 'siblings.cdid' => 'bogus condition' ],
- [ 'me.artist' => 2 ],
+ [ { sqlt_datatype => 'integer', dbic_colname => 'siblings.cdid' }
+ => 23414 ],
+
+ [ { sqlt_datatype => 'integer', dbic_colname => 'me.artist' }
+ => 2 ],
# second subselect
- [ 'me.artist' => 2 ],
+ [ { sqlt_datatype => 'integer', dbic_colname => 'me.artist' }
+ => 2 ],
# the addition
- [ __add => 1 ],
+ [ { sqlt_datatype => 'inTEger' }
+ => 1 ],
# outher WHERE
- [ 'me.artist' => 2 ],
+ [ { sqlt_datatype => 'integer', dbic_colname => 'me.artist' }
+ => 2 ],
],
'Expected SQL on correlated realiased subquery'
);