[MCOL-1035] Convert() function 's result is diffrent, windowing function and order by list? Created: 2017-11-16  Updated: 2022-11-05  Resolved: 2022-11-05

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.0.11
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Allen Chan Assignee: Unassigned
Resolution: Won't Do Votes: 1
Labels: optimizer
Environment:

CentOS 7


Epic Link: ColumnStore Compatibility Improvements

 Description   

show create table t_windowing_function_convert;
CREATE TABLE `t_windowing_function_convert` (
`ids` bigint(20) DEFAULT NULL,
`names` varchar(100) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8;
MariaDB [mcsinfo]> select * from t_windowing_function_convert;
---------------+

ids names

---------------+

1 陈兴隆
1 贡娜
3 安逸

---------------+
3 rows in set (0.00 sec)

result 1:
MariaDB [mcsinfo]> select ids,names from t_windowing_function_convert order by convert(names using gbk) desc;
---------------+

ids names

---------------+

1 贡娜
1 陈兴隆
3 安逸

---------------+
3 rows in set (0.02 sec)
result 2:
MariaDB [mcsinfo]> select ids,names, row_number() over(order by convert(names using gbk) desc) from t_windowing_function_convert;
------------------------------------------------------------------------

ids names row_number() over(order by convert(names using gbk) desc)

------------------------------------------------------------------------

1 陈兴隆 1
1 贡娜 2
3 安逸 3

------------------------------------------------------------------------
3 rows in set (0.00 sec)



 Comments   
Comment by David Thompson (Inactive) [ 2017-11-16 ]

When you use a function in the select list or outer order by it is actually executed by the mysqld process. The order by in a window function is executed in the columnstore code. We normally only claim support for UTF8 character sets only within ColumnStore. What i suspect is that the character set conversion is not really happening when the function is executed withing cs code and so the sort is happening based on utf8 order rather than gbk order.

Comment by Todd Stoffel (Inactive) [ 2022-11-05 ]

This item is being closed because it was well passed the expiration date with no activity. If you suspect this was done in error please create a new ticket.

Generated at Thu Feb 08 02:25:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.