Repository: risingwavelabs/risingwave (language: python)

Issue:
Comment on table get table not found error
### Describe the bug

When using risingwave to create table and schema and then comment on the table, there is bug related to `COMMENT ON` command. It will output the error of table not found, but the table actually exists.

### Error message/log

```text
Caused by these errors (recent errors listed first):
  1: Catalog error
  2: table not found: test_table
```
```


### To Reproduce

- Create the schema `create schema test_schema_h04rwzvk;`
- Create the table `create table test_schema_h04rwzvk.test_table (id int);`
- Try to comment `COMMENT ON TABLE "test_schema_h04rwzvk"."test_table" IS 'test table description';`

### Expected behavior

_No response_

### How did you deploy RisingWave?

I am using `risingwave playground`.

### The version of RisingWave

_No response_

### Additional context

_No response_
Sqlsmith: Sql feature generation
As we add more features, these should be tested via sqlsmith as well.

SQL Features:
- [ ] Generate other table functions: `generate_series`, `unnest`. See: https://github.com/singularity-data/risingwave/issues/4540
- [ ] Generate array_agg, jsonb_agg, jsonb_object_agg
- [ ] Generate select from System Tables
- [ ] Generate `NATURAL JOIN`
- [ ] Generate `JOIN` with `USING`
- [ ] Generate query w/o `GROUP BY`
- [ ] Randomly toggle session variables
- [ ] Generate `pow`/`exp`.
- [ ] Generate TopN by group: https://www.risingwave.dev/docs/current/sql-pattern-topn/
- [ ] Generate jsonb exprs, see: https://github.com/risingwavelabs/risingwave/issues/7714
- [ ] #7132
- [x] Generate order-by-clauses with `NULLS { FIRST | LAST }` (will be done in https://github.com/risingwavelabs/risingwave/pull/10864/commits/000cbc11cbc04f20abfd127b1bf4b3fd24e75c44)
- [ ] Generate `max`,`min`,`count` for `timestamptz`
- [ ] Generate `bit_and`, `bit_or` and `big_xor` in batch queries, and `bit_xor` in streaming queries.
- [ ] Generate array range access.
- [ ] https://github.com/risingwavelabs/risingwave/issues/10241
- [ ] Generate window functions other than `row_number`, `rank`.
- [ ] Generate `ALTER` DDL statements.\
- [ ] https://github.com/risingwavelabs/risingwave/issues/10516
- [ ] Generate temporal filter in sqlsmith


Discussion / hints:

Fix patch:
diff --git a/src/frontend/src/handler/comment.rs b/src/frontend/src/handler/comment.rs
index b35a65112ffa6..4140805eb5798 100644
--- a/src/frontend/src/handler/comment.rs
+++ b/src/frontend/src/handler/comment.rs
@@ -48,8 +48,8 @@ pub async fn handle_comment(
                 )?;
 
                 let (database_id, schema_id) =
-                    session.get_database_and_schema_id_for_create(schema)?;
-                let table = binder.bind_table(None, &table, None)?;
+                    session.get_database_and_schema_id_for_create(schema.clone())?;
+                let table = binder.bind_table(schema.as_deref(), &table, None)?;
                 binder.bind_columns_to_context(col.real_value(), &table.table_catalog.columns)?;
 
                 let column = binder.bind_column(object_name.0.as_slice())?;
@@ -66,8 +66,8 @@ pub async fn handle_comment(
                 let (schema, table) =
                     Binder::resolve_schema_qualified_name(session.database(), object_name)?;
                 let (database_id, schema_id) =
-                    session.get_database_and_schema_id_for_create(schema)?;
-                let table = binder.bind_table(None, &table, None)?;
+                    session.get_database_and_schema_id_for_create(schema.clone())?;
+                let table = binder.bind_table(schema.as_deref(), &table, None)?;
 
                 PbComment {
                     table_id: table.table_id.into(),


Test patch:
diff --git a/e2e_test/ddl/show.slt b/e2e_test/ddl/show.slt
index afcc386d7adff..8eece6d7c18a9 100644
--- a/e2e_test/ddl/show.slt
+++ b/e2e_test/ddl/show.slt
@@ -227,6 +227,12 @@ create schema show_another_schema;
 statement ok
 create table show_another_schema.t_another (v1 int);
 
+statement ok
+comment on table "show_another_schema"."t_another" IS 'test table description with schema';
+
+statement ok
+comment on column "show_another_schema"."t_another".v1 IS 'test column description with schema';
+
 statement ok
 create table t4 (v1 int);