Files
greptimedb/tests/cases/standalone/common/select/dummy.result
Ruihang Xia 56fc77e573 fix: add missing error display message (#2791)
* fix: add missing error display message

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2023-11-23 02:59:49 +00:00

138 lines
3.3 KiB
Plaintext

select 1;
+----------+
| Int64(1) |
+----------+
| 1 |
+----------+
select 2 + 3;
+---------------------+
| Int64(2) + Int64(3) |
+---------------------+
| 5 |
+---------------------+
select 4 + 0.5;
+-------------------------+
| Int64(4) + Float64(0.5) |
+-------------------------+
| 4.5 |
+-------------------------+
select "a";
Error: 3000(PlanQuery), Failed to plan SQL: No field named a.
select "A";
Error: 3000(PlanQuery), Failed to plan SQL: No field named "A".
select * where "a" = "A";
Error: 3000(PlanQuery), Failed to plan SQL: No field named a.
select TO_UNIXTIME('2023-03-01T06:35:02Z');
+-------------------------------------------+
| to_unixtime(Utf8("2023-03-01T06:35:02Z")) |
+-------------------------------------------+
| 1677652502 |
+-------------------------------------------+
select TO_UNIXTIME(' 2023-03-01T06:35:02Z ');
+---------------------------------------------------+
| to_unixtime(Utf8(" 2023-03-01T06:35:02Z ")) |
+---------------------------------------------------+
| 1677652502 |
+---------------------------------------------------+
select TO_UNIXTIME(2);
+-----------------------+
| to_unixtime(Int64(2)) |
+-----------------------+
| 2 |
+-----------------------+
select TO_UNIXTIME('2023-03-01');
+---------------------------------+
| to_unixtime(Utf8("2023-03-01")) |
+---------------------------------+
| 1677628800 |
+---------------------------------+
select TO_UNIXTIME('2023-03-01'::date);
+---------------------------------+
| to_unixtime(Utf8("2023-03-01")) |
+---------------------------------+
| 1677628800 |
+---------------------------------+
select TO_UNIXTIME('2023-03-01 08:00:00+0000');
+-----------------------------------------------+
| to_unixtime(Utf8("2023-03-01 08:00:00+0000")) |
+-----------------------------------------------+
| 1677657600 |
+-----------------------------------------------+
create table test_unixtime(a int, b timestamp_sec time index);
Affected Rows: 0
DESC TABLE test_unixtime;
+--------+-----------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+-----------------+-----+------+---------+---------------+
| a | Int32 | | YES | | FIELD |
| b | TimestampSecond | PRI | NO | | TIMESTAMP |
+--------+-----------------+-----+------+---------+---------------+
insert into test_unixtime values(27, 27);
Affected Rows: 1
select * from test_unixtime;
+----+---------------------+
| a | b |
+----+---------------------+
| 27 | 1970-01-01T00:00:27 |
+----+---------------------+
select a from test_unixtime;
+----+
| a |
+----+
| 27 |
+----+
select b from test_unixtime;
+---------------------+
| b |
+---------------------+
| 1970-01-01T00:00:27 |
+---------------------+
select TO_UNIXTIME(b) from test_unixtime;
+------------------------------+
| to_unixtime(test_unixtime.b) |
+------------------------------+
| 27 |
+------------------------------+
DROP TABLE test_unixtime;
Affected Rows: 0