Issue #3159982 by nuklive, ultrabob, J2, billywardrop, antojose, daffie,...
Issue #3159982 by nuklive, ultrabob, J2, billywardrop, antojose, daffie, mradcliffe, mcdruid, jungle: AS keyword should be capitalised in SQL queries
(cherry picked from commit fad8b52c)
@@ -686,11 +686,11 @@ public function getComment($table, $column = NULL) {
$condition->condition('column_name',$column);
$condition->compile($this->connection,$this);
// Don't use {} around information_schema.columns table.
return$this->connection->query("SELECT column_comment as column_comment FROM information_schema.columns WHERE ".(string)$condition,$condition->arguments())->fetchField();
return$this->connection->query("SELECT column_comment AS column_comment FROM information_schema.columns WHERE ".(string)$condition,$condition->arguments())->fetchField();
}
$condition->compile($this->connection,$this);
// Don't use {} around information_schema.tables table.
$comment=$this->connection->query("SELECT table_comment as table_comment FROM information_schema.tables WHERE ".(string)$condition,$condition->arguments())->fetchField();
$comment=$this->connection->query("SELECT table_comment AS table_comment FROM information_schema.tables WHERE ".(string)$condition,$condition->arguments())->fetchField();
// Work-around for MySQL 5.0 bug http://bugs.mysql.com/bug.php?id=11379
@@ -163,7 +163,7 @@ public function preRender(&$values) {
}
if($nids){
$result=$this->database->query("SELECT n.nid, COUNT(c.cid) as num_comments FROM {node} n INNER JOIN {comment_field_data} c ON n.nid = c.entity_id AND c.entity_type = 'node' AND c.default_langcode = 1
$result=$this->database->query("SELECT n.nid, COUNT(c.cid) AS num_comments FROM {node} n INNER JOIN {comment_field_data} c ON n.nid = c.entity_id AND c.entity_type = 'node' AND c.default_langcode = 1
LEFT JOIN {history} h ON h.nid = n.nid AND h.uid = :h_uid WHERE n.nid IN ( :nids[] )
AND c.changed > GREATEST(COALESCE(h.timestamp, :timestamp1), :timestamp2) AND c.status = :status GROUP BY n.nid",[