[OceanBase] Materialized views are missing from schema and SELECT fails with masking resource-not-found error · Issue #21326 · bytebase/bytebase · GitHub
Skip to content

[OceanBase] Materialized views are missing from schema and SELECT fails with masking resource-not-found error #21326

Open

Description

@Myifan610

Provide the Bytebase version you are using

3.22.0

Describe the bug

When Bytebase connects to OceanBase 4.3.5, materialized views are not shown in the database schema browser.

Running a direct SELECT against an existing materialized view also fails in Bytebase with the following error (database and object names redacted):

internal: failed to mask data: resource not found: database: <redacted>, schema: , table: <redacted_materialized_view>

The same materialized view is displayed correctly in DBeaver and can be queried successfully there. Navicat does not list the materialized view separately in its object browser, but the same SELECT query still succeeds.

This suggests that Bytebase does not discover or classify OceanBase materialized views correctly, and the data-masking/resource lookup path then treats the materialized view as a missing table.

Steps to reproduce

  1. Connect Bytebase 3.22.0 to an OceanBase 4.3.5 instance containing a materialized view.
  2. Open the corresponding database/schema in Bytebase.
  3. Observe that the materialized view is not listed in the schema browser.
  4. Open the SQL editor and run:
    SELECT * FROM <materialized_view>;
  5. Observe the failed to mask data: resource not found error.
  6. Run the same query with the same database account in DBeaver or Navicat and observe that it succeeds.

Expected behavior

  • OceanBase materialized views should be discovered and displayed in the schema browser.
  • Direct SELECT queries against existing materialized views should execute successfully.
  • If data masking applies, Bytebase should resolve the materialized view metadata correctly instead of reporting it as a missing table.

Provide the database you are using

OceanBase 4.3.5

Additional context

  • DBeaver displays the materialized view and queries it successfully.
  • Navicat may not display the materialized view separately, but queries it successfully.
  • Database, schema, and object names have been redacted from the error message for privacy.

Activity

  1. adela-bytebase commented on Sep 3, 2026

    @adela-bytebase
    Contributor

    Thanks for the detailed report! You're right — Bytebase doesn't currently discover OceanBase materialized views during schema sync, so they're missing from the schema browser, and queries against them then fail the resource lookup during masking checks.

    Could you run these on your OceanBase 4.3.5 instance and share the output (redact names as needed)? This will help us see exactly where the metadata is exposed.

    SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = '<your_database>' AND TABLE_NAME = '<your_materialized_view>';
    
    SHOW TABLES FROM oceanbase LIKE '%MVIEW%';
    SHOW TABLES FROM information_schema LIKE '%MVIEW%';
    
  2. Myifan610 commented on Sep 3, 2026

    @Myifan610
    Author

    Thanks. I ran the queries on OceanBase 4.3.5.

    Only the following command returned rows:

    SHOW TABLES FROM oceanbase LIKE '%MVIEW%';

    Output:

    Tables_in_oceanbase (%MVIEW%)
    DBA_MVIEWS
    DBA_MVIEW_DEPS
    DBA_MVIEW_LOGS
    DBA_MVIEW_RUNNING_JOBS
    __all_mview
    __all_mview_dep
    __all_mview_refresh_change_stats
    __all_mview_refresh_run_stats
    __all_mview_refresh_stats
    __all_mview_refresh_stats_params
    __all_mview_refresh_stats_sys_defaults
    __all_mview_refresh_stmt_stats
    

    These two queries returned no rows:

    SELECT TABLE_NAME, TABLE_TYPE
    FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = '<your_database>'
      AND TABLE_NAME = '<your_materialized_view>';
    
    SHOW TABLES FROM information_schema LIKE '%MVIEW%';

    However, querying DBA_MVIEWS directly returns the materialized-view names:

    SELECT MVIEW_NAME FROM DBA_MVIEWS;

    Output:

    MVIEW_NAME
    car_holiday_warn_summary
    mv_car_fuelling_info_summary
    mv_car_fuelling_info_summary
    mv_dwd_use_car_cost_wide
    mv_stat_by_use_dept
    car_holiday_warn_summary
    mv_test_mv
    mv_user_stat
    mv_stat_by_use_dept
    mv_dwd_use_car_cost_wide
    v_car_number_owner_dept_summary
    v_car_number_owner_dept_summary
    v_car_number_use_dept_summary
    v_car_number_use_dept_summary
    

    So on this OceanBase instance, the materialized-view metadata appears to be exposed through oceanbase.DBA_MVIEWS, but not through information_schema.TABLES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions