From cd1c7214142fe5b343868aaa7d941b99ac5cc94f Mon Sep 17 00:00:00 2001 From: 2149 <260391947@qq.com> Date: Fri, 25 Aug 2023 09:14:09 +0000 Subject: [PATCH] [CP] Change error code for select inner tables --- src/observer/virtual_table/ob_show_create_database.cpp | 4 ++-- src/observer/virtual_table/ob_table_columns.cpp | 4 ++-- src/observer/virtual_table/ob_tenant_all_tables.cpp | 4 ++-- src/observer/virtual_table/ob_tenant_show_tables.cpp | 4 ++-- .../virtual_table/ob_tenant_virtual_current_tenant.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/observer/virtual_table/ob_show_create_database.cpp b/src/observer/virtual_table/ob_show_create_database.cpp index d4e26d28a6..d195d40bc9 100644 --- a/src/observer/virtual_table/ob_show_create_database.cpp +++ b/src/observer/virtual_table/ob_show_create_database.cpp @@ -50,8 +50,8 @@ int ObShowCreateDatabase::inner_get_next_row(common::ObNewRow *&row) if (OB_FAIL(calc_show_database_id(show_database_id))) { LOG_WARN("fail to calc show database id", K(ret)); } else if (OB_UNLIKELY(OB_INVALID_ID == show_database_id)) { - ret = OB_ERR_UNEXPECTED; - LOG_USER_ERROR(OB_ERR_UNEXPECTED, "this table is used for show clause, can't be selected"); + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else if (OB_FAIL(schema_guard_->get_database_schema(effective_tenant_id_, show_database_id, db_schema))) { LOG_WARN("failed to get database_schema", K(ret), K_(effective_tenant_id), K(show_database_id)); diff --git a/src/observer/virtual_table/ob_table_columns.cpp b/src/observer/virtual_table/ob_table_columns.cpp index 51cdd0fa48..df3b0f1297 100644 --- a/src/observer/virtual_table/ob_table_columns.cpp +++ b/src/observer/virtual_table/ob_table_columns.cpp @@ -63,8 +63,8 @@ int ObTableColumns::inner_get_next_row(ObNewRow *&row) if (OB_FAIL(calc_show_table_id(show_table_id))) { LOG_WARN("fail to calc show table id", K(ret), K(show_table_id)); } else if (OB_UNLIKELY(OB_INVALID_ID == show_table_id)) { - ret = OB_ERR_UNEXPECTED; - LOG_USER_ERROR(OB_ERR_UNEXPECTED, "this table is used for show clause, can't be selected"); + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else if (OB_FAIL(schema_guard_->get_table_schema(effective_tenant_id_, show_table_id, table_schema))) { LOG_WARN("fail to get table schema", K(ret), K(effective_tenant_id_)); } else if (OB_UNLIKELY(NULL == table_schema)) { diff --git a/src/observer/virtual_table/ob_tenant_all_tables.cpp b/src/observer/virtual_table/ob_tenant_all_tables.cpp index e8668b264d..19b085196d 100644 --- a/src/observer/virtual_table/ob_tenant_all_tables.cpp +++ b/src/observer/virtual_table/ob_tenant_all_tables.cpp @@ -119,8 +119,8 @@ int ObTenantAllTables::inner_open() if (OB_SUCC(ret)) { if (OB_UNLIKELY(!is_valid_id(database_id_))) { // FIXME(tingshuai.yts):暂时定为显示该错误信息,只有直接查询该虚拟表才可能出现 - ret = OB_ERR_UNEXPECTED; - LOG_USER_ERROR(OB_ERR_UNEXPECTED, "this table is used for show clause, can't be selected"); + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else { if (OB_FAIL(schema_guard_->get_table_schemas_in_database(tenant_id_, database_id_, diff --git a/src/observer/virtual_table/ob_tenant_show_tables.cpp b/src/observer/virtual_table/ob_tenant_show_tables.cpp index d409580327..11305717a3 100644 --- a/src/observer/virtual_table/ob_tenant_show_tables.cpp +++ b/src/observer/virtual_table/ob_tenant_show_tables.cpp @@ -68,8 +68,8 @@ int ObTenantShowTables::inner_open() if (OB_SUCC(ret)) { if (OB_UNLIKELY(!is_valid_id(database_id_))) { // FIXME(tingshuai.yts):暂时定为显示该错误信息,只有直接查询该虚拟表才可能出现 - ret = OB_ERR_UNEXPECTED; - LOG_USER_ERROR(OB_ERR_UNEXPECTED, "this table is used for show clause, can't be selected"); + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else { if (OB_FAIL(schema_guard_->get_table_schemas_in_database(tenant_id_, database_id_, diff --git a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp index bba17ce74b..96a795ffb2 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp @@ -87,8 +87,8 @@ int ObTenantVirtualCurrentTenant::inner_get_next_row(ObNewRow *&row) SERVER_LOG(ERROR, "fail to alloc memory", K(ret)); } else if (OB_UNLIKELY(OB_INVALID_ID == show_tenant_id)) { // FIXME(tingshuai.yts):暂时定为显示该错误信息,只有直接查询该虚拟表才可能出现 - ret = OB_ERR_UNEXPECTED; - LOG_USER_ERROR(OB_ERR_UNEXPECTED, "this table is used for show clause, can't be selected"); + ret = OB_NOT_SUPPORTED; + LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else if (OB_FAIL(schema_guard_->get_tenant_info(show_tenant_id, tenant_schema))) { SERVER_LOG(WARN, "get tenant info failed", K(show_tenant_id), K(ret)); } else if (OB_ISNULL(tenant_schema)) {