Skip to content
Snippets Groups Projects
Commit 4dafd0ff authored by Matt Butcher's avatar Matt Butcher
Browse files

#453384 by spydmobile and mbutcher: Added explicit type casting to satisfy pgsql SQL interpreter.

parent e83afe49
No related branches found
No related tags found
No related merge requests found
......@@ -900,7 +900,8 @@ function quiz_type_access_load($arg) {
* Returns the number of quiz questions.
*/
function quiz_get_number_of_questions($vid, $nid) {
$sql = 'SELECT COUNT(*) + (SELECT number_of_random_questions FROM {quiz_node_properties} WHERE vid = %d AND nid = %d)
// The CAST is required for PostgreSQL.
$sql = 'SELECT CAST (COUNT(*) AS INT) + CAST((SELECT number_of_random_questions FROM {quiz_node_properties} WHERE vid = %d AND nid = %d) AS INT)
FROM {quiz_node_relationship} qnr
WHERE qnr.parent_vid = %d
AND qnr.parent_nid = %d
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment