Files
greptimedb/tests/cases/standalone/common/catalog/schema.result
dennis zhuang 1f91422bae feat!: improve mysql/pg compatibility (#7315)
* feat(mysql): add SHOW WARNINGS support and return warnings for unsupported SET variables

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* feat(function): add MySQL IF() function and PostgreSQL description functions for connector compatibility

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: show tables for mysql

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: partitions table in information_schema and add starrocks external catalog compatibility

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor: async udf

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: set warnings

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* feat: impl pg_my_temp_schema and make description functions simple

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test: add test for issue 7313

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* feat: apply suggestions

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: partition_expression and partition_description

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: test

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: unit tests

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: saerch_path only works for pg

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* feat: improve warnings processing

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: warnings while writing affected rows and refactor

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore: improve ShobjDescriptionFunction signature

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor: array_to_boolean

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-01 20:41:14 +00:00

141 lines
2.6 KiB
Plaintext

CREATE SCHEMA test_public_schema;
Affected Rows: 1
CREATE SCHEMA test_public_schema;
Error: 1004(InvalidArguments), Schema test_public_schema already exists
CREATE SCHEMA IF NOT EXISTS test_public_schema;
Affected Rows: 1
SHOW DATABASES LIKE '%public%';
+--------------------+
| Database |
+--------------------+
| public |
| test_public_schema |
+--------------------+
SHOW DATABASES WHERE Database = 'test_public_schema';
+--------------------+
| Database |
+--------------------+
| test_public_schema |
+--------------------+
USE test_public_schema;
Affected Rows: 0
CREATE TABLE hello(i TIMESTAMP TIME INDEX);
Affected Rows: 0
DROP TABLE hello;
Affected Rows: 0
CREATE TABLE hello(i TIMESTAMP TIME INDEX);
Affected Rows: 0
SHOW TABLES FROM test_public_schema;
+------------------------------+
| Tables_in_test_public_schema |
+------------------------------+
| hello |
+------------------------------+
SHOW TABLES FROM public;
+------------------+
| Tables_in_public |
+------------------+
| numbers |
+------------------+
INSERT INTO hello VALUES (2), (3), (4);
Affected Rows: 3
SELECT * FROM hello;
+-------------------------+
| i |
+-------------------------+
| 1970-01-01T00:00:00.002 |
| 1970-01-01T00:00:00.003 |
| 1970-01-01T00:00:00.004 |
+-------------------------+
SHOW TABLES;
+------------------------------+
| Tables_in_test_public_schema |
+------------------------------+
| hello |
+------------------------------+
SHOW FULL TABLES WHERE Table_type != 'VIEW';
+------------------------------+------------+
| Tables_in_test_public_schema | Table_type |
+------------------------------+------------+
| hello | BASE TABLE |
+------------------------------+------------+
DROP TABLE hello;
Affected Rows: 0
DROP TABLE hello;
Error: 4001(TableNotFound), Table not found: greptime.test_public_schema.hello
SHOW TABLES FROM test_public_schema;
++
++
SHOW TABLES FROM public;
+------------------+
| Tables_in_public |
+------------------+
| numbers |
+------------------+
SHOW TABLES FROM public WHERE Tables = 'numbers';
+------------------+
| Tables_in_public |
+------------------+
| numbers |
+------------------+
DROP SCHEMA test_public_schema;
Error: 1004(InvalidArguments), Schema `test_public_schema` is in use
USE public;
Affected Rows: 0
DROP SCHEMA test_public_schema;
Affected Rows: 0
SELECT * FROM test_public_schema.hello;
Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.test_public_schema.hello
USE public;
Affected Rows: 0