Skip to content

Commit

Permalink
fix: use information_schema returns Unknown database (#4774)
Browse files Browse the repository at this point in the history
* fix: use information_schema returns Unknown database 'information_schema'

* test: make sure 'use information_schma' successful
  • Loading branch information
J0HN50N133 authored Sep 27, 2024
1 parent 934bc13 commit 3a46c1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/frontend/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ impl SqlQueryHandler for Instance {
.schema_exists(catalog, schema, None)
.await
.context(error::CatalogSnafu)
.map(|b| b && !self.catalog_manager.is_reserved_schema_name(schema))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ database my_db;

Affected Rows: 1

use information_schema;

Affected Rows: 0

use my_db;

Affected Rows: 0
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/standalone/common/system/information_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ select * from information_schema.columns order by table_schema, table_name, colu
create
database my_db;

use information_schema;

use my_db;

create table foo
Expand Down

0 comments on commit 3a46c1b

Please sign in to comment.