mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 13:52:59 +00:00
* 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>
105 lines
1.8 KiB
Plaintext
105 lines
1.8 KiB
Plaintext
-- SQLNESS PROTOCOL MYSQL
|
|
SELECt @@tx_isolation;
|
|
|
|
+-----------------+
|
|
| @@tx_isolation |
|
|
+-----------------+
|
|
| REPEATABLE-READ |
|
|
+-----------------+
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT @@version_comment;
|
|
|
|
+-------------------+
|
|
| @@version_comment |
|
|
+-------------------+
|
|
| Greptime |
|
|
+-------------------+
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SHOW DATABASES;
|
|
|
|
+--------------------+
|
|
| Database |
|
|
+--------------------+
|
|
| greptime_private |
|
|
| information_schema |
|
|
| public |
|
|
+--------------------+
|
|
|
|
-- ======================================================
|
|
-- MySQL compatibility tests for JDBC connectors
|
|
-- ======================================================
|
|
-- Test MySQL IF() function (issue #7278 compatibility)
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT IF(1, 'yes', 'no') as result;
|
|
|
|
+--------+
|
|
| result |
|
|
+--------+
|
|
| yes |
|
|
+--------+
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT IF(0, 'yes', 'no') as result;
|
|
|
|
+--------+
|
|
| result |
|
|
+--------+
|
|
| no |
|
|
+--------+
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT IF(NULL, 'yes', 'no') as result;
|
|
|
|
+--------+
|
|
| result |
|
|
+--------+
|
|
| no |
|
|
+--------+
|
|
|
|
-- Test IFNULL (should work via DataFusion)
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT IFNULL(NULL, 'default') as result;
|
|
|
|
+---------+
|
|
| result |
|
|
+---------+
|
|
| default |
|
|
+---------+
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT IFNULL('value', 'default') as result;
|
|
|
|
+--------+
|
|
| result |
|
|
+--------+
|
|
| value |
|
|
+--------+
|
|
|
|
-- Test COALESCE
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT COALESCE(NULL, NULL, 'third') as result;
|
|
|
|
+--------+
|
|
| result |
|
|
+--------+
|
|
| third |
|
|
+--------+
|
|
|
|
-- Verify SHOW TABLES column naming
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
USE public;
|
|
|
|
affected_rows: 0
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SHOW TABLES;
|
|
|
|
+------------------+
|
|
| Tables_in_public |
|
|
+------------------+
|
|
| numbers |
|
|
+------------------+
|
|
|