fix: table resolving logic related to pg_catalog (#4580)

* fix: table resolving logic related to pg_catalog

refer to
https://github.com/GreptimeTeam/greptimedb/issues/3560#issuecomment-2287794348
and #4543

* refactor: remove CatalogProtocol type

* fix: sqlness

* fix: forbid create database pg_catalog with mysql client

* refactor: use QueryContext as arguments rather than Channel

* refactor: pass None as default behaviour in information_schema

* test: fix test
This commit is contained in:
JohnsonLee
2024-09-09 08:47:59 +08:00
committed by GitHub
parent b950e705f5
commit a8477e4142
49 changed files with 359 additions and 250 deletions

View File

@@ -181,7 +181,8 @@ mod test {
.table(
"greptime",
"database_created_through_grpc",
"table_created_through_grpc"
"table_created_through_grpc",
None,
)
.await
.unwrap()
@@ -510,7 +511,7 @@ CREATE TABLE {table_name} (
let table = instance
.frontend()
.catalog_manager()
.table("greptime", "public", table_name)
.table("greptime", "public", table_name, None)
.await
.unwrap()
.unwrap();

View File

@@ -278,7 +278,7 @@ mod tests {
assert!(instance
.frontend()
.catalog_manager()
.table("greptime", "public", "demo")
.table("greptime", "public", "demo", None)
.await
.unwrap()
.is_none())

View File

@@ -462,7 +462,6 @@ async fn test_execute_show_databases_tables(instance: Arc<dyn MockInstance>) {
+--------------------+
| greptime_private |
| information_schema |
| pg_catalog |
| public |
+--------------------+\
";
@@ -1900,7 +1899,6 @@ async fn test_show_databases(instance: Arc<dyn MockInstance>) {
+--------------------+
| greptime_private |
| information_schema |
| pg_catalog |
| public |
+--------------------+";
check_output_stream(output, expected).await;
@@ -1914,7 +1912,6 @@ async fn test_show_databases(instance: Arc<dyn MockInstance>) {
| Database |
+--------------------+
| information_schema |
| pg_catalog |
+--------------------+";
check_output_stream(output, expected).await;
}