Skip to content
Permalink
Browse files

Fix issue with postgres.

Postgres gets pretty picky about aliases in subqueries.
  • Loading branch information...
markstory committed Aug 8, 2015
1 parent 80908ec commit 7c42905d10f978ba08b8dc765f8f1d6b692d74d2
Showing with 8 additions and 4 deletions.
  1. +8 −4 tests/TestCase/ORM/QueryRegressionTest.php
@@ -1032,12 +1032,16 @@ public function testComplexOrderWithUnion()
{
$table = TableRegistry::get('Comments');
$query = $table->find();
$inner = $table->find()->where(['id >' => 3]);
$inner2 = $table->find()->where(['id <' => 3]);
$inner = $table->find()
->select(['content' => 'comment'])
->where(['id >' => 3]);
$inner2 = $table->find()
->select(['content' => 'comment'])
->where(['id <' => 3]);
$order = $query->func()->concat(['inside__comment' => 'literal', 'test']);
$order = $query->func()->concat(['content' => 'literal', 'test']);
$query->select(['inside__comment' => 'Comments__comment'])
$query->select(['inside.content'])
->from(['inside' => $inner->unionAll($inner2)])
->orderAsc($order);

0 comments on commit 7c42905

Please sign in to comment.
You can’t perform that action at this time.