File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -117,23 +117,28 @@ public function testSubQuery()
117117 public function testUnionAll ()
118118 {
119119 $ db = $ this ->getConnection ();
120- $ secondQuery = (new Query ())
120+ $ query1 = (new Query ())
121121 ->select ('name ' )
122122 ->from ('{{customer}} ' )
123123 ->where ([
124124 'id ' => [1 ]
125125 ]);
126126
127- $ rows = (new Query ())
127+ $ query2 = (new Query ())
128128 ->select ('name ' )
129129 ->from ('{{customer}} ' )
130130 ->where ([
131131 'id ' => [2 ]
132- ])
133- ->union ($ secondQuery , true )
132+ ]);
133+
134+ $ rows = (new Query ())
135+ ->select ('name ' )
136+ ->from (['result ' => $ query1 ->union ($ query2 , true )])
134137 ->orderBy (['name ' => SORT_ASC ])
135138 ->all ($ db );
136139
140+ // Using Subquery, because of ClickHouse does not sort result
141+
137142 $ this ->assertEquals ([
138143 ['name ' => 'user1 ' ],
139144 ['name ' => 'user2 ' ]
You can’t perform that action at this time.
0 commit comments