matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: Function 'from_unixtime' does not have two parameters

Open daviszhen opened this issue 3 years ago • 2 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):5bc46ebe8cb3ade55d562bcb68e00d3cfc5a7889
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

[ERROR] [SCRIPT FILE]: /Users/pengzhen/Documents/GitHub/matrixone/test/cases/function/func_if.test [ROW NUMBER]: 129 [SQL STATEMENT]: SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord ASC; [EXPECT RESULT]: id date_ord text 1 05-03-2005 Day 1 2 17-03-2005 Day 2 3 28-03-2005 Day 3 [ACTUAL RESULT]: Function 'from_unixtime' with parameters [INT VARCHAR] will be implemented in future version.

[ERROR] [SCRIPT FILE]: /Users/pengzhen/Documents/GitHub/matrixone/test/cases/function/func_if.test [ROW NUMBER]: 130 [SQL STATEMENT]: SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord DESC; [EXPECT RESULT]: id date_ord text 3 28-03-2005 Day 3 2 17-03-2005 Day 2 1 05-03-2005 Day 1 [ACTUAL RESULT]: Function 'from_unixtime' with parameters [INT VARCHAR] will be implemented in future version.

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

daviszhen avatar Jul 01 '22 02:07 daviszhen

maybe move to 0.6

daviszhen avatar Jul 05 '22 03:07 daviszhen

maybe move to 0.6

ok

dengn avatar Jul 05 '22 03:07 dengn

mysql> CREATE TABLE t1 ( -> id int(11) NOT NULL , -> date int(10) default NULL, -> text varchar(32) NOT NULL -> ); Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO t1 VALUES (1,1110000000,'Day 1'),(2,1111000000,'Day 2'),(3,1112000000,'Day 3'); Query OK, 3 rows affected (0.00 sec)

mysql> SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord ASC; +------+------------+-------+ | id | date_ord | text | +------+------------+-------+ | 1 | 05-03-2005 | Day 1 | | 2 | 17-03-2005 | Day 2 | | 3 | 28-03-2005 | Day 3 | +------+------------+-------+ 3 rows in set (0.00 sec)

mysql> SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord DESC; +------+------------+-------+ | id | date_ord | text | +------+------------+-------+ | 3 | 28-03-2005 | Day 3 | | 2 | 17-03-2005 | Day 2 | | 1 | 05-03-2005 | Day 1 | +------+------------+-------+ 3 rows in set (0.00 sec)

mysql> DROP TABLE t1; Query OK, 0 rows affected (0.01 sec)

mysql>

aressu1985 avatar Oct 24 '22 12:10 aressu1985