dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Dolt generates different column name for aggregate function expressions.

Open nicktobey opened this issue 1 year ago • 0 comments

Reproduction steps:

create table t1 (i int);
insert into table t1 values (1);
create table t2 select sum(i) FROM t1;
show create t2;

MySQL:

+-------+------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                 |
+-------+------------------------------------------------------------------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `sum(i)` decimal(32,0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+------------------------------------------------------------------------------------------------------------------------------+

Dolt:

+-------+------------------------------------------------------------------+
| Table | Create Table                                                     |
+-------+------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (                                              |
|       |   `sum(t1.i)` decimal(33,0) NOT NULL                             |
|       | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+-------+------------------------------------------------------------------+

nicktobey avatar Sep 14 '23 21:09 nicktobey