[MCOL-132] Columnstore does not allow duplicate column aliases (and reports it as duplicate column *name*) Created: 2016-06-12  Updated: 2019-07-10  Resolved: 2019-07-10

Status: Closed
Project: MariaDB ColumnStore
Component/s: ?
Affects Version/s: None
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Justin Swanhart (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None

Epic Link: ColumnStore Compatibility Improvements

 Description   

Stock MySQL:

mysql> create table t1(c1 int) engine=myisam;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t2(c1 int) engine=myisam;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from t1 join t2;
Empty set (0.00 sec)

ColumnStore

mysql> create table t1(c1 int) engine=myisam;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t2(c1 int) engine=myisam;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from t1 join t2;
ERROR 1060 (42S21): Duplicate column name 'c1'



 Comments   
Comment by Justin Swanhart (Inactive) [ 2016-06-12 ]

Stock

mysql> select t1.c1 t1_c1, t2.c1 t1_c1 from t1 join t2;
Empty set (0.00 sec)

ColumnStore

mysql> select t1.c1 t1_c1, t2.c1 t1_c1 from t1 join t2;
ERROR 1060 (42S21): Duplicate column name 't1_c1'

Note not only is behavior wrong, but error is about column alias, not column name

Comment by Justin Swanhart (Inactive) [ 2016-06-12 ]

This is likely due to the fact that CS tries to materialize all queries into temporary tables, and these don't support duplicate column names. ColumnStore could append _ (or whatever) onto duplicate column aliases,
to avoid this problem, but results will still deviate from stock MySQL.

Comment by Justin Swanhart (Inactive) [ 2016-06-12 ]

This breaks Shard-Query installation (works on all other MySQL variants):
INSERT INTO gearman_functions(schema_id,function_name_id, worker_count, enabled)
select 1,id, 6, 1
from gearman_function_names
ON DUPLICATE KEY UPDATE worker_count = 6

;

*SETUP FAILED: 1060Duplicate column name '1'*

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