Files
greptimedb/tests/cases/standalone/order/limit.result
dennis zhuang 9428e70971 feat: integration test (#770)
* feat: add insert test cases

* fix: update results after rebase develop

* feat: supports unsigned integer types and big_insert test

* test: add insert_invalid test

* feat: supports time index constraint for bigint type

* chore: time index column at last

* test: adds more order, limit test

* fix: style

* feat: adds numbers table in standable memory catalog mode

* feat: enable fail_fast and test_filter in sqlness

* feat: add more tests

* fix: test_filter

* test: add alter tests

* feat: supports if_not_exists when create database

* test: filter_push_down and catalog test

* fix: compile error

* fix: delete output file

* chore: ignore integration test output in git

* test: update all integration test results

* fix: by code review

* chore: revert .gitignore

* feat: sort the show tables/databases results

* chore: remove issue link

* fix: compile error and code format after rebase

* test: update all integration test results
2023-01-10 18:15:50 +08:00

134 lines
3.0 KiB
Plaintext

CREATE TABLE test (a BIGINT time index, b INTEGER);
Affected Rows: 0
INSERT INTO test VALUES (11, 22), (12, 21), (13, 22);
Affected Rows: 3
SELECT a FROM test LIMIT 1;
+----+
| a |
+----+
| 11 |
+----+
SELECT a FROM test LIMIT 1.25;
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT a FROM test LIMIT 2-1;
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT a FROM test LIMIT a;
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT a FROM test LIMIT a+1;
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT a FROM test LIMIT SUM(42);
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT a FROM test LIMIT row_number() OVER ();
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
CREATE TABLE test2 (a STRING, ts BIGINT TIME INDEX);
Affected Rows: 0
INSERT INTO test2 VALUES ('Hello World', 1);
Affected Rows: 1
SELECT * FROM test2 LIMIT 3;
+-------------+----+
| a | ts |
+-------------+----+
| Hello World | 1 |
+-------------+----+
select 1 limit date '1992-01-01';
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
CREATE TABLE integers(i BIGINT TIME INDEX);
Affected Rows: 0
INSERT INTO integers VALUES (1), (2), (3), (4), (5);
Affected Rows: 5
SELECT * FROM integers LIMIT 3;
+---+
| i |
+---+
| 1 |
| 2 |
| 3 |
+---+
SELECT * FROM integers LIMIT 4;
+---+
| i |
+---+
| 1 |
| 2 |
| 3 |
| 4 |
+---+
SELECT * FROM integers as int LIMIT (SELECT MIN(integers.i) FROM integers);
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT * FROM integers as int OFFSET (SELECT MIN(integers.i) FROM integers);
Error: 3000(PlanQuery), Error during planning: Unexpected expression in OFFSET clause
SELECT * FROM integers as int LIMIT (SELECT MAX(integers.i) FROM integers) OFFSET (SELECT MIN(integers.i) FROM integers);
Error: 3000(PlanQuery), Error during planning: Unexpected expression in OFFSET clause
SELECT * FROM integers as int LIMIT (SELECT max(integers.i) FROM integers where i > 5);
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT * FROM integers as int LIMIT (SELECT max(integers.i) FROM integers where i > 5);
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT * FROM integers as int LIMIT (SELECT NULL);
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT * FROM integers as int LIMIT (SELECT -1);
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
SELECT * FROM integers as int LIMIT (SELECT 'ab');
Error: 3000(PlanQuery), Error during planning: Unexpected expression for LIMIT clause
DROP TABLE integers;
Affected Rows: 1
DROP TABLE test;
Affected Rows: 1
DROP TABLE test2;
Affected Rows: 1