← Back to team overview

maria-discuss team mailing list archive

Re: Since MariaDB 10.1 aggregate functions return different field type for columns with date values

 

Hello Sergei!


> Not for the same query. You can use a CAST or e.g. CONCAT, it'll force
> the column into a string type, for example:
>
>   SELECT CONCAT(MIN(NOW()))

Thanks for the hint, but unfortunately the actual application is not
under my control. So I cannot change the query or how the result is treated.

Best regards,
Stefan

On 03.07.19 10:02, Sergei Golubchik wrote:
> Hi, Stefan!
> 
> On Jul 02, Stefan Langenmaier wrote:
>> Hi all,
>>
>> If I execute the following query on MariaDB 10.1 or later, the result
>> contains a column with a datetime field type (MYSQL_TYPE_DATETIME):
>>
>> SELECT MIN(NOW()) AS t
>>
>> On older versions or any version of MySQL this column is a text type
>> (MYSQL_TYPE_VAR_STRING).
>>
>> https://dev.mysql.com/doc/dev/mysql-server/latest/field__types_8h.html
>>
>> Is there a possibility to use the old behavior in newer version?
> 
> Not for the same query. You can use a CAST or e.g. CONCAT, it'll force
> the column into a string type, for example:
> 
>   SELECT CONCAT(MIN(NOW()))
> 
> Regards,
> Sergei
> VP of MariaDB Server Engineering
> and security@xxxxxxxxxxx
> 

-- 
Stefan Langenmaier
Senior Operations Engineer

makandra GmbH
Werner-von-Siemens-Str. 6
86159 Augsburg

Fon +49 (0) 821 58866 178

Geschäftsführer: Dr. Thomas Eisenbarth, Henning Koch
Amtsgericht Augsburg, HRB 24202


References