mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-10 07:12:54 +00:00
* test: migrate duckdb tests Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: style Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test: add more duckdb tests Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: stable order Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * chore: simplfy comments Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * chore: remove tests/cases/standalone/common/DUCKDB_MIGRATION_GUIDE.md * fix: incorrect_sql.sql Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: integer flow test Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: integer flow test Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * docs: add todo Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
127 lines
3.3 KiB
Plaintext
127 lines
3.3 KiB
Plaintext
-- Existing operator precedence tests
|
|
SELECT 2*3+1;
|
|
|
|
+--------------------------------+
|
|
| Int64(2) * Int64(3) + Int64(1) |
|
|
+--------------------------------+
|
|
| 7 |
|
|
+--------------------------------+
|
|
|
|
SELECT 1+2*3;
|
|
|
|
+--------------------------------+
|
|
| Int64(1) + Int64(2) * Int64(3) |
|
|
+--------------------------------+
|
|
| 7 |
|
|
+--------------------------------+
|
|
|
|
SELECT 2^2 + 1;
|
|
|
|
+--------------------------------------+
|
|
| Int64(2) BIT_XOR Int64(2) + Int64(1) |
|
|
+--------------------------------------+
|
|
| 1 |
|
|
+--------------------------------------+
|
|
|
|
SELECT 1+2^2;
|
|
|
|
+--------------------------------------+
|
|
| Int64(1) + Int64(2) BIT_XOR Int64(2) |
|
|
+--------------------------------------+
|
|
| 1 |
|
|
+--------------------------------------+
|
|
|
|
SELECT 2*4 / 2;
|
|
|
|
+--------------------------------+
|
|
| Int64(2) * Int64(4) / Int64(2) |
|
|
+--------------------------------+
|
|
| 4 |
|
|
+--------------------------------+
|
|
|
|
SELECT 2*(4 / 2);
|
|
|
|
+--------------------------------+
|
|
| Int64(2) * Int64(4) / Int64(2) |
|
|
+--------------------------------+
|
|
| 4 |
|
|
+--------------------------------+
|
|
|
|
SELECT 16/2*4;
|
|
|
|
+---------------------------------+
|
|
| Int64(16) / Int64(2) * Int64(4) |
|
|
+---------------------------------+
|
|
| 32 |
|
|
+---------------------------------+
|
|
|
|
SELECT (16/2)*4;
|
|
|
|
+---------------------------------+
|
|
| Int64(16) / Int64(2) * Int64(4) |
|
|
+---------------------------------+
|
|
| 32 |
|
|
+---------------------------------+
|
|
|
|
SELECT 2*3*2;
|
|
|
|
+--------------------------------+
|
|
| Int64(2) * Int64(3) * Int64(2) |
|
|
+--------------------------------+
|
|
| 12 |
|
|
+--------------------------------+
|
|
|
|
SELECT 2^3*2;
|
|
|
|
+--------------------------------------+
|
|
| Int64(2) BIT_XOR Int64(3) * Int64(2) |
|
|
+--------------------------------------+
|
|
| 4 |
|
|
+--------------------------------------+
|
|
|
|
SELECT 2*3^2;
|
|
|
|
+--------------------------------------+
|
|
| Int64(2) * Int64(3) BIT_XOR Int64(2) |
|
|
+--------------------------------------+
|
|
| 4 |
|
|
+--------------------------------------+
|
|
|
|
-- Migrated from DuckDB test: test/sql/parser/division_operator_precedence.test
|
|
-- Additional division operator precedence tests (only standard division)
|
|
-- Division operator precedence
|
|
SELECT 6 * 1 / 2;
|
|
|
|
+--------------------------------+
|
|
| Int64(6) * Int64(1) / Int64(2) |
|
|
+--------------------------------+
|
|
| 3 |
|
|
+--------------------------------+
|
|
|
|
-- Addition and division precedence
|
|
SELECT 6 + 1 / 2;
|
|
|
|
+--------------------------------+
|
|
| Int64(6) + Int64(1) / Int64(2) |
|
|
+--------------------------------+
|
|
| 6 |
|
|
+--------------------------------+
|
|
|
|
-- More division precedence tests
|
|
SELECT 10 / 2 * 3;
|
|
|
|
+---------------------------------+
|
|
| Int64(10) / Int64(2) * Int64(3) |
|
|
+---------------------------------+
|
|
| 15 |
|
|
+---------------------------------+
|
|
|
|
SELECT 10 / (2 * 3);
|
|
|
|
+---------------------------------+
|
|
| Int64(10) / Int64(2) * Int64(3) |
|
|
+---------------------------------+
|
|
| 1 |
|
|
+---------------------------------+
|
|
|