StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.61k stars 1.74k forks source link

With caluse crash array_concat crash #34982

Closed fzhedu closed 3 months ago

fzhedu commented 9 months ago

Steps to reproduce the behavior (Required)

 CREATE TABLE `t` (
  `in` varchar(65533) NULL COMMENT "",
  `out` varchar(65533) NULL COMMENT "",
  `linkattr` bigint(20) NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`in`)
DISTRIBUTED BY RANDOM
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"enable_persistent_index" = "false",
"replicated_storage" = "true",
"compression" = "LZ4");

insert into t values ("B","F",9),("C","B",3);

-- crash
WITH `tc` AS (
  SELECT 
    [] AS `aa`, 
    MD5SUM_NUMERIC(t.`IN`, t.`LINKATTR`, t.`OUT`) AS `bb` 
  FROM 
    t
) 
SELECT 
  ARRAY_CONCAT(
    `tc`.`aa`, 
    [ (`tc`.`bb`) ]
  ) AS `res` 
FROM 
  `tc`

---ok

SELECT 
  array_concat(
    [], 
    [MD5SUM_NUMERIC(t.`IN`, t.`LINKATTR`, t.`OUT`) ]
  ) 
FROM 
  t;

Expected behavior (Required)

Real behavior (Required)

StarRocks version (Required)

fzhedu commented 9 months ago

on main resulting into different resutls

mysql> SELECT    array_concat(     [],      [MD5SUM_NUMERIC(t.`IN`, t.`LINKATTR`, t.`OUT`) ]   )  FROM    t;
+-------------------------------------------------------------+
| array_concat([], [md5sum_numeric(t.IN, t.LINKATTR, t.OUT)]) |
+-------------------------------------------------------------+
| [166447080664827458533765763306809118404]                   |
| [98790225452812278081487393989635148350]                    |
+-------------------------------------------------------------+
2 rows in set (0.01 sec)

mysql>  WITH `tc` AS (   SELECT      [] AS `aa`,      MD5SUM_NUMERIC(t.`IN`, t.`LINKATTR`, t.`OUT`) AS `bb`    FROM      t )  SELECT    ARRAY_CONCAT(     `tc`.`aa`,      [ (`tc`.`bb`) ]   ) AS `res`  FROM    `tc`;
+-------+
| res   |
+-------+
| [196] |
| [206] |
+-------+
2 rows in set (0.01 sec)
github-actions[bot] commented 3 months ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!