-
Notifications
You must be signed in to change notification settings - Fork 103
Open
@reteps
Description
Bug report
SELECT 1 FROM assessments AS a WHERE a.id = $assessment_id FOR NO KEY UPDATE;
apps/prairielearn/src/lib/assessment.sql:544:12 syntax ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Invalid statement: syntax error at or near ";"
542 │ WHERE
543 │ a.id = $assessment_id
> 544 │ FOR NO KEY UPDATE;
│ ^^^^^^^
545 │
546 │ -- BLOCK select_assessment_needs_statistics_update
WITH RECURSIVE template_questions AS ( -- non-recursive term that finds the ID of the template question (if any) for question_id SELECT tq.id, tq.qid, tq.course_id, tq.template_directory FROM questions AS q JOIN questions AS tq ON ( tq.qid = q.template_directory AND tq.course_id = q.course_id ) WHERE q.id = $question_id AND tq.deleted_at IS NULL -- required UNION for a recursive WITH statement UNION -- recursive term that references template_questions again SELECT tq.id, tq.qid, tq.course_id, tq.template_directory FROM template_questions AS q JOIN questions AS tq ON ( tq.qid = q.template_directory AND tq.course_id = q.course_id ) WHERE tq.deleted_at IS NULL ) SELECT id FROM template_questions LIMIT 100;
apps/prairielearn/src/lib/chunks.sql:73:6 syntax ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Expected IDENT
72 │ -- BLOCK select_template_question_ids
> 73 │ WITH RECURSIVE
│ ^^^^^^^^^
74 │ template_questions AS (
75 │ -- non-recursive term that finds the ID of the template question (if any) for question_id
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
To Reproduce
Reproduction is identical to #482
System information
- v0.12.0 (latest)