Skip to content

Commit

Permalink
Fixed issue #13010: MySQL 8 reserved word used as table alias in query
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jan 29, 2018
1 parent 61f1fa7 commit 8f84b48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions application/helpers/common_helper.php
Expand Up @@ -1542,12 +1542,12 @@ function createFieldMap($survey, $style = 'short', $force_refresh = false, $ques

// Main query
$aquery = "SELECT * "
." FROM {{questions}} as questions, {{groups}} as groups"
." WHERE questions.gid=groups.gid AND "
." FROM {{questions}} as questions, {{groups}} as question_groups"
." WHERE questions.gid=question_groups.gid AND "
." questions.sid=$surveyid AND "
." questions.language='{$sLanguage}' AND "
." questions.parent_qid=0 AND "
." groups.language='{$sLanguage}' ";
." question_groups.language='{$sLanguage}' ";
if ($questionid !== false) {
$aquery .= " and questions.qid={$questionid} ";
}
Expand Down
8 changes: 4 additions & 4 deletions application/models/Question.php
Expand Up @@ -419,10 +419,10 @@ public function getQuestionsForStatistics($fields, $condition, $orderby = false)
*/
public function getQuestionList($surveyid, $language)
{
$query = "SELECT questions.*, groups.group_name, groups.group_order"
." FROM {{questions}} as questions, {{groups}} as groups"
." WHERE groups.gid=questions.gid"
." AND groups.language=:language1"
$query = "SELECT questions.*, question_groups.group_name, question_groups.group_order"
." FROM {{questions}} as questions, {{groups}} as question_groups"
." WHERE question_groups.gid=questions.gid"
." AND question_groups.language=:language1"
." AND questions.language=:language2"
." AND questions.parent_qid=0"
." AND questions.sid=:sid";
Expand Down

0 comments on commit 8f84b48

Please sign in to comment.