Reviewed: https://reviews.mahara.org/5494 Committed: https://git.nzoss.org.nz/mahara/mahara/commit/aba6982423b7a7eecff79c1687503db99f5decfe Submitter: Robert Lyon ([email protected]) Branch: 15.04_STABLE
commit aba6982423b7a7eecff79c1687503db99f5decfe Author: Jono Mingard <[email protected]> Date: Thu Oct 8 16:14:34 2015 +1300 Make institution member queries more scalable (Bug #1497053) Use a subquery instead of passing in all user IDs as question marks Also add behat test for viewing basic institution statistics Change-Id: I006493d291a9e2d75d4ad66d946df8ac3978eeb8 (cherry picked from commit 75d9375a03d051f3e47ba36a795f2c61300c566a) -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1497053 Title: Cron error with over 65535 users Status in Mahara: Fix Committed Status in Mahara 1.10 series: Won't Fix Status in Mahara 1.9 series: Won't Fix Status in Mahara 15.04 series: Fix Committed Status in Mahara 15.10 series: Fix Committed Status in Mahara 16.04 series: Fix Committed Bug description: I discovered another case of things failing when there are too many users to substitute IDs as question marks in a postgres query - specifically, when running cron on a site with ~68000 users I get: [WAR] 3f (lib/dml.php:480) Failed to get a recordset: postgres8 error: [-1: number of parameters must be between 0 and 65535] in EXECUTE("SELECT COUNT(*) FROM "usr" WHERE lastaccess >= DATE(?) AND lastaccess < DATE(?)+ INTERVAL '1 day' AND id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,...) Command was: SELECT COUNT(*) FROM "usr" WHERE lastaccess >= DATE(?) AND lastaccess < DATE(?)+ INTERVAL '1 day' AND id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,...) Call stack (most recent first): get_recordset_sql("SELECT COUNT(*) FROM "usr" WHERE lastaccess >= DAT...", array(size 66885)) at /home/jonom/mahara/mahara/htdocs/lib/dml.php:269 count_records_sql("SELECT COUNT(*) FROM "usr" WHERE lastaccess >= DAT...", array(size 66885)) at /home/jonom/mahara/mahara/htdocs/lib/dml.php:251 count_records_select("usr", "lastaccess >= DATE(?) AND lastaccess < DATE(?)+ IN...", array(size 66885)) at /home/jonom/mahara/mahara/htdocs/lib/mahara.php:3782 cron_institution_data_daily() at /home/jonom/mahara/mahara/htdocs/lib/cron.php:142 Should be a similar fix to Bug #1456849 To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1497053/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

