Unknown column in fieldlist

Silverstripe Version: 4.4.1


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.