Unknown column in fieldlist

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe Version: 4.4.1

Question:

We have a simple module which we use to allow people to run reports on their DB through their website. It simply loads up some stored SQL and runs it through DB::Query.

It works well except that we have struck an issue when using concatenation. An easy example is:

SELECT CONCAT( FirstName, " ", Surname ) as 'Name' FROM Member;

Pretty straight forward. However, when it is run via Silverstripe it returns:

[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn’t run query: SELECT CONCAT( FirstName, " ", Surname) as ‘Name’ FROM Member 42S22-1054: Unknown column ’ ’ in ‘field list’

Is SS doing something funky to the " " in the CONCAT function call?
Is this an SS bug?

EDIT: Putting any character in the CONCAT causes the error:

Unknown column ‘|’ in ‘field list’

Thank you for any reponse.

You should say this instead:

select CONCAT(FirstName, ' ', Surname) as Name from Member

Note the single quotes. This is because SilverStripe runs MySQL in ANSI mode.