mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #23922
[Bug 1416147] [NEW] MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
Public bug reported:
For some reason works fine on Postgres...
To reproduce:
1. Create a journal post.
2. Go to pages.
3. Create a page.
4. Add "Journal entry" block.
5. See this error:
Failed to get a recordset: mysqli error: [1064: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near 'BY parent ASC, ctime DESC
LIMIT 10' at line 15] in EXECUTE("SELECT a.*, (a.owner IS NOT NULL AND
a.owner = '1') AS editable FROM "mhr_artefact" a WHERE ( a.owner = '1'
OR a.id IN ( SELECT id FROM "mhr_artefact" WHERE (path = '/5' OR path
LIKE '/5/%') AND institution = 'mahara' ) OR a.id IN ( SELECT
aar.artefact FROM "mhr_group_member" m JOIN "mhr_artefact" aa ON m.group
= aa.group JOIN "mhr_artefact_access_role" aar ON aar.role = m.role AND
aar.artefact = aa.id WHERE m.member = '1' AND aar.can_republish = 1 ) OR
a.id IN (SELECT artefact FROM "mhr_artefact_access_usr" WHERE usr = '1'
AND can_republish = 1) OR a.institution IN ('mahara') ) AND artefacttype
IN('blogpost') AND id = 6ORDER BY parent ASC, ctime DESC LIMIT 10")
Command was: SELECT a.*, (a.owner IS NOT NULL AND a.owner = ?) AS
editable FROM "mhr_artefact" a WHERE ( a.owner = ? OR a.id IN ( SELECT
id FROM "mhr_artefact" WHERE (path = ? OR path LIKE ?) AND institution =
'mahara' ) OR a.id IN ( SELECT aar.artefact FROM "mhr_group_member" m
JOIN "mhr_artefact" aa ON m.group = aa.group JOIN
"mhr_artefact_access_role" aar ON aar.role = m.role AND aar.artefact =
aa.id WHERE m.member = ? AND aar.can_republish = 1 ) OR a.id IN (SELECT
artefact FROM "mhr_artefact_access_usr" WHERE usr = ? AND can_republish
= 1) OR a.institution IN (?) ) AND artefacttype IN(?) AND id = 6ORDER BY
parent ASC, ctime DESC and values was (1,1,/5,/5/%,1,1,mahara,blogpost)
SQL is missing space before ORDER BY...
** Affects: mahara
Importance: Low
Assignee: Yuliya Bozhko (yuliya.bozhko)
Status: New
--
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/1416147
Title:
MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
Status in Mahara ePortfolio:
New
Bug description:
For some reason works fine on Postgres...
To reproduce:
1. Create a journal post.
2. Go to pages.
3. Create a page.
4. Add "Journal entry" block.
5. See this error:
Failed to get a recordset: mysqli error: [1064: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'BY parent ASC, ctime
DESC LIMIT 10' at line 15] in EXECUTE("SELECT a.*, (a.owner IS NOT
NULL AND a.owner = '1') AS editable FROM "mhr_artefact" a WHERE (
a.owner = '1' OR a.id IN ( SELECT id FROM "mhr_artefact" WHERE (path =
'/5' OR path LIKE '/5/%') AND institution = 'mahara' ) OR a.id IN (
SELECT aar.artefact FROM "mhr_group_member" m JOIN "mhr_artefact" aa
ON m.group = aa.group JOIN "mhr_artefact_access_role" aar ON aar.role
= m.role AND aar.artefact = aa.id WHERE m.member = '1' AND
aar.can_republish = 1 ) OR a.id IN (SELECT artefact FROM
"mhr_artefact_access_usr" WHERE usr = '1' AND can_republish = 1) OR
a.institution IN ('mahara') ) AND artefacttype IN('blogpost') AND id =
6ORDER BY parent ASC, ctime DESC LIMIT 10") Command was: SELECT a.*,
(a.owner IS NOT NULL AND a.owner = ?) AS editable FROM "mhr_artefact"
a WHERE ( a.owner = ? OR a.id IN ( SELECT id FROM "mhr_artefact" WHERE
(path = ? OR path LIKE ?) AND institution = 'mahara' ) OR a.id IN (
SELECT aar.artefact FROM "mhr_group_member" m JOIN "mhr_artefact" aa
ON m.group = aa.group JOIN "mhr_artefact_access_role" aar ON aar.role
= m.role AND aar.artefact = aa.id WHERE m.member = ? AND
aar.can_republish = 1 ) OR a.id IN (SELECT artefact FROM
"mhr_artefact_access_usr" WHERE usr = ? AND can_republish = 1) OR
a.institution IN (?) ) AND artefacttype IN(?) AND id = 6ORDER BY
parent ASC, ctime DESC and values was
(1,1,/5,/5/%,1,1,mahara,blogpost)
SQL is missing space before ORDER BY...
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1416147/+subscriptions
Follow ups
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-10-27
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-10-27
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-10-26
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-10-26
-
[Bug 1416147] A change has been merged
From: Mahara Bot, 2015-10-21
-
[Bug 1416147] A change has been merged
From: Mahara Bot, 2015-10-21
-
[Bug 1416147] A patch has been submitted for review
From: Mahara Bot, 2015-10-21
-
[Bug 1416147] A patch has been submitted for review
From: Mahara Bot, 2015-10-21
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-10-21
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-04-17
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Robert Lyon, 2015-01-30
-
[Bug 1416147] A change has been merged
From: Mahara Bot, 2015-01-30
-
[Bug 1416147] Re: MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Yuliya Bozhko, 2015-01-29
-
[Bug 1416147] A patch has been submitted for review
From: Mahara Bot, 2015-01-29
-
[Bug 1416147] [NEW] MySQL error in ORDER BY clause in get_artefactchooser_artefacts()
From: Yuliya Bozhko, 2015-01-29
References