Skip to content

Commit acc82d6

Browse files
committed
use GROUP_CONCAT_DISTINCT
1 parent 4183cc1 commit acc82d6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

_test/AccessTableDataSQLTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function buildGetDataSQL_testdata()
5151
"SELECT DATA.pid AS PID,
5252
DATA.col1 AS out1,
5353
DATA.col2 AS out2,
54-
GROUP_CONCAT(M3.value,'" . Search::CONCAT_SEPARATOR . "') AS out3
54+
GROUP_CONCAT_DISTINCT(M3.value,'" . Search::CONCAT_SEPARATOR . "') AS out3
5555
FROM data_testtable AS DATA
5656
LEFT OUTER JOIN multi_testtable AS M3
5757
ON DATA.pid = M3.pid
@@ -70,8 +70,8 @@ public static function buildGetDataSQL_testdata()
7070
'multis' => ['dokuwiki\\plugin\\struct\\types\\Text', 'dokuwiki\\plugin\\struct\\types\\Text']
7171
],
7272
"SELECT DATA.pid AS PID,
73-
GROUP_CONCAT(M1.value,'" . Search::CONCAT_SEPARATOR . "') AS out1,
74-
GROUP_CONCAT(M2.value,'" . Search::CONCAT_SEPARATOR . "') AS out2
73+
GROUP_CONCAT_DISTINCT(M1.value,'" . Search::CONCAT_SEPARATOR . "') AS out1,
74+
GROUP_CONCAT_DISTINCT(M2.value,'" . Search::CONCAT_SEPARATOR . "') AS out2
7575
FROM data_testtable AS DATA
7676
LEFT OUTER JOIN multi_testtable AS M2
7777
ON DATA.pid = M2.pid

meta/AccessTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ protected function buildGetDataSQL($idColumn = 'pid')
518518
);
519519
$col->getType()->select($QB, $tn, 'value', $outname);
520520
$sel = $QB->getSelectStatement($outname);
521-
$QB->addSelectStatement("GROUP_CONCAT($sel, '$sep')", $outname);
521+
$QB->addSelectStatement("GROUP_CONCAT_DISTINCT($sel, '$sep')", $outname);
522522
} else {
523523
$col->getType()->select($QB, 'DATA', $colname, $outname);
524524
$QB->addGroupByStatement($outname);

meta/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public function getSQL()
501501

502502
$col->getType()->select($QB, $MN, 'value', $CN);
503503
$sel = $QB->getSelectStatement($CN);
504-
$QB->addSelectStatement("GROUP_CONCAT($sel, '$sep')", $CN);
504+
$QB->addSelectStatement("GROUP_CONCAT_DISTINCT($sel, '$sep')", $CN);
505505
} else {
506506
$col->getType()->select($QB, 'data_' . $col->getTable(), $col->getColName(), $CN);
507507
$QB->addGroupByStatement($CN);

0 commit comments

Comments
 (0)