@@ -314,6 +314,44 @@ public function testSelectDistinct() {
314314 $ this ->deleteTestingRows ('testFirstResult2 ' );
315315 }
316316
317+ public function testSelectDistinctMultiple () {
318+ $ this ->deleteTestingRows ('testFirstResult1 ' );
319+ $ this ->deleteTestingRows ('testFirstResult2 ' );
320+ $ this ->createTestingRows ('testFirstResult1 ' );
321+ $ this ->createTestingRows ('testFirstResult2 ' );
322+
323+ $ this ->queryBuilder ->selectDistinct (['appid ' , 'configkey ' ]);
324+
325+ $ this ->queryBuilder ->from ('*PREFIX*appconfig ' )
326+ ->where ($ this ->queryBuilder ->expr ()->eq (
327+ 'appid ' ,
328+ $ this ->queryBuilder ->expr ()->literal ('testFirstResult1 ' )
329+ ))
330+ ->orderBy ('appid ' , 'DESC ' );
331+
332+ $ query = $ this ->queryBuilder ->execute ();
333+ $ rows = $ query ->fetchAll ();
334+ $ query ->closeCursor ();
335+
336+ $ this ->assertEquals (
337+ [
338+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing1 ' ],
339+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing2 ' ],
340+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing3 ' ],
341+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing4 ' ],
342+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing5 ' ],
343+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing6 ' ],
344+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing7 ' ],
345+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing8 ' ],
346+ ['appid ' => 'testFirstResult1 ' , 'configkey ' => 'testing9 ' ],
347+ ],
348+ $ rows
349+ );
350+
351+ $ this ->deleteTestingRows ('testFirstResult1 ' );
352+ $ this ->deleteTestingRows ('testFirstResult2 ' );
353+ }
354+
317355 public function dataAddSelect () {
318356 $ config = $ this ->createMock (SystemConfig::class);
319357 $ logger = $ this ->createMock (ILogger::class);
0 commit comments