mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #26947
[Bug 1456849] [NEW] Problem with prepared statements in stats functions
Public bug reported:
Failed to get a recordset: postgres8 error: [-1: number of parameters must be between 0 and 65535] in EXECUTE("
SELECT (0.0 + COUNT(id)) / NULLIF(COUNT(DISTINCT "owner"), 0)
FROM "view"
WHERE id IN (?,? ... ?,?)
and values was (2848,81339 ... 123,456)
The full error shows 65000+ question marks etc
There are a bunch of functions that generate stats but are poorly
written (in lib/registration.php I think) where it tries to get info by
passing in every user id that relates to the search as a prepared
statement value - but when we have too many users (like on Mahara.org)
it dies as there is a maximum number of ? we can have in prepared
statement before the underlying database chokes.
Need to rewrite the stats so that they scale better
** Affects: mahara
Importance: High
Assignee: Jono Mingard (mingard)
Status: Confirmed
--
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/1456849
Title:
Problem with prepared statements in stats functions
Status in Mahara ePortfolio:
Confirmed
Bug description:
Failed to get a recordset: postgres8 error: [-1: number of parameters must be between 0 and 65535] in EXECUTE("
SELECT (0.0 + COUNT(id)) / NULLIF(COUNT(DISTINCT "owner"), 0)
FROM "view"
WHERE id IN (?,? ... ?,?)
and values was (2848,81339 ... 123,456)
The full error shows 65000+ question marks etc
There are a bunch of functions that generate stats but are poorly
written (in lib/registration.php I think) where it tries to get info
by passing in every user id that relates to the search as a prepared
statement value - but when we have too many users (like on Mahara.org)
it dies as there is a maximum number of ? we can have in prepared
statement before the underlying database chokes.
Need to rewrite the stats so that they scale better
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1456849/+subscriptions
Follow ups
-
[Bug 1456849] Re: Problem with prepared statements in stats functions
From: Robert Lyon, 2016-11-06
-
[Bug 1456849] Re: Problem with prepared statements in stats functions
From: Aaron Wells, 2015-10-23
-
[Bug 1456849] Re: Problem with prepared statements in stats functions
From: Robert Lyon, 2015-08-19
-
[Bug 1456849] Re: Problem with prepared statements in stats functions
From: Robert Lyon, 2015-07-27
-
[Bug 1456849] A change has been merged
From: Mahara Bot, 2015-07-22
-
[Bug 1456849] Re: Problem with prepared statements in stats functions
From: Aaron Wells, 2015-07-22
-
[Bug 1456849] A patch has been submitted for review
From: Mahara Bot, 2015-07-22
-
[Bug 1456849] A change has been merged
From: Mahara Bot, 2015-07-01
-
[Bug 1456849] A patch has been submitted for review
From: Mahara Bot, 2015-06-05
-
[Bug 1456849] Re: Problem with prepared statements in stats functions
From: Jono Mingard, 2015-06-05
-
[Bug 1456849] [NEW] Problem with prepared statements in stats functions
From: Robert Lyon, 2015-05-20
References