Fix show create tablegroup problem

This commit is contained in:
ym0 2022-02-16 19:21:46 +08:00 committed by LINxiansheng
parent bb573a7cd4
commit b79cea0cad
5 changed files with 25 additions and 12 deletions

View File

@ -177,7 +177,8 @@ int ObShowCreateTable::fill_row_cells(uint64_t show_table_id, const ObTableSchem
type_is_lob = column_schema->get_meta_type().is_lob();
}
}
if (type_is_lob) {
if (OB_FAIL(ret)) {
} else if (type_is_lob) {
cur_row_.cells_[cell_idx].set_lob_value(ObLongTextType, table_def_buf, static_cast<int32_t>(pos));
} else {
ObString value_str(static_cast<int32_t>(pos), static_cast<int32_t>(pos), table_def_buf);

View File

@ -139,10 +139,22 @@ int ObShowCreateTablegroup::fill_row_cells(uint64_t show_tablegroup_id, const Ob
show_tablegroup_id, db_def_buf, db_def_buf_size, pos, false, TZ_INFO(session_)))) {
LOG_WARN("Generate tablegroup definition failed");
} else {
ObString value_str(static_cast<int32_t>(db_def_buf_size), static_cast<int32_t>(pos), db_def_buf);
cur_row_.cells_[cell_idx].set_varchar(value_str);
cur_row_.cells_[cell_idx].set_collation_type(
ObCharset::get_default_collation(ObCharset::get_default_charset()));
const ObColumnSchemaV2 *column_schema = NULL;
if (OB_ISNULL(table_schema_) || OB_ISNULL(column_schema = table_schema_->get_column_schema(col_id))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("table or column schema is null", K(ret), KP(table_schema_), KP(column_schema));
} else {
const bool type_is_lob = column_schema->get_meta_type().is_lob();
// for compatibility
if (type_is_lob) {
cur_row_.cells_[cell_idx].set_lob_value(ObLongTextType, db_def_buf, static_cast<int32_t>(pos));
} else {
ObString value_str(static_cast<int32_t>(db_def_buf_size), static_cast<int32_t>(pos), db_def_buf);
cur_row_.cells_[cell_idx].set_varchar(value_str);
}
cur_row_.cells_[cell_idx].set_collation_type(
ObCharset::get_default_collation(ObCharset::get_default_charset()));
}
}
break;
}

View File

@ -9270,9 +9270,9 @@ int ObInnerTableSchema::tenant_virtual_show_create_tablegroup_schema(ObTableSche
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObVarcharType, //column_type
ObLongTextType, //column_type
CS_TYPE_INVALID, //column_collation_type
TABLEGROUP_DEFINE_LENGTH, //column_length
0, //column_length
-1, //column_precision
-1, //column_scale
false, //is_nullable

View File

@ -95,10 +95,10 @@ int ObInnerTableSchema::tenant_virtual_show_create_tablegroup_ora_schema(ObTable
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObVarcharType, //column_type
CS_TYPE_UTF8MB4_BIN, //column_collation_type
TABLEGROUP_DEFINE_LENGTH, //column_length
2, //column_precision
ObLongTextType, //column_type
CS_TYPE_INVALID, //column_collation_type
0, //column_length
-1, //column_precision
-1, //column_scale
false, //is_nullable
false); //is_autoincrement

View File

@ -7545,7 +7545,7 @@ def_table_schema(
normal_columns = [
('tablegroup_name', 'varchar:OB_MAX_TABLEGROUP_NAME_LENGTH'),
('create_tablegroup', 'varchar:TABLEGROUP_DEFINE_LENGTH'),
('create_tablegroup', 'longtext'),
],
)