From d9199fea0033e2c46f4d66504b084892e9463169 Mon Sep 17 00:00:00 2001 From: mattab <matthieu.aubry@gmail.com> Date: Wed, 17 Dec 2014 15:27:44 +1300 Subject: [PATCH] fixes #6862 use array_values when using as a bind + submodules --- core/DataAccess/ArchiveSelector.php | 2 +- core/DataAccess/Model.php | 4 +++- plugins/CustomAlerts | 2 +- plugins/QueuedTracking | 2 +- tests/PHPUnit/UI | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/DataAccess/ArchiveSelector.php b/core/DataAccess/ArchiveSelector.php index a89638f964..8011924b0c 100644 --- a/core/DataAccess/ArchiveSelector.php +++ b/core/DataAccess/ArchiveSelector.php @@ -171,7 +171,7 @@ class ArchiveSelector foreach ($monthToPeriods as $table => $periods) { $firstPeriod = reset($periods); - $bind = $siteIds; + $bind = array_values($siteIds); if ($firstPeriod instanceof Range) { $dateCondition = "period = ? AND date1 = ? AND date2 = ?"; diff --git a/core/DataAccess/Model.php b/core/DataAccess/Model.php index 6e072bf1bc..0e4b2845a7 100644 --- a/core/DataAccess/Model.php +++ b/core/DataAccess/Model.php @@ -37,6 +37,7 @@ class Model // prevent error 'The SELECT would examine more than MAX_JOIN_SIZE rows' Db::get()->query('SET SQL_BIG_SELECTS=1'); + $idSites = array_values($idSites); $idSitesString = Common::getSqlStringFieldsArray($idSites); $query = 'SELECT t1.idarchive FROM `' . $archiveTable . '` t1 @@ -82,7 +83,7 @@ class Model } $sql = implode(" OR ", $sql); - + $idSites = array_values($idSites); $sqlSites = " AND idsite IN (" . Common::getSqlStringFieldsArray($idSites) . ")"; $bind = array_merge($bind, $idSites); @@ -128,6 +129,7 @@ class Model public function deleteArchiveIds($numericTable, $blobTable, $idsToDelete) { + $idsToDelete = array_values($idsToDelete); $query = "DELETE FROM %s WHERE idarchive IN (" . Common::getSqlStringFieldsArray($idsToDelete) . ")"; Db::query(sprintf($query, $numericTable), $idsToDelete); diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts index 8d6dd84283..e886aa43f4 160000 --- a/plugins/CustomAlerts +++ b/plugins/CustomAlerts @@ -1 +1 @@ -Subproject commit 8d6dd8428317c24e997f335f27f1d3fb522c1935 +Subproject commit e886aa43f4c248bf6aaeeef05885f4acdf190a82 diff --git a/plugins/QueuedTracking b/plugins/QueuedTracking index f73280a649..bad46dc2a0 160000 --- a/plugins/QueuedTracking +++ b/plugins/QueuedTracking @@ -1 +1 @@ -Subproject commit f73280a649974a2b0882f1606f732057cee50dc5 +Subproject commit bad46dc2a021edf239fe603b40dfcf8532e5712f diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 4cdf80fc99..3c3fe985f1 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 4cdf80fc99025b71e5d8e59419d2af749e466df6 +Subproject commit 3c3fe985f1af4f1d897d6c1551057124fd6bffa4 -- GitLab