Modify the virtual table definition on the master in advance
This commit is contained in:
@ -515,6 +515,11 @@ int ObTableColumns::fill_row_cells(const ObTableSchema &table_schema,
|
||||
ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
break;
|
||||
}
|
||||
case IS_HIDDEN: {
|
||||
// is_hidden is used for SHOW EXTENDED in 4.2.2
|
||||
cur_row_.cells_[cell_idx].set_int(0);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid column id", K(ret), K(cell_idx),
|
||||
@ -627,6 +632,11 @@ int ObTableColumns::fill_row_cells(
|
||||
ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
break;
|
||||
}
|
||||
case IS_HIDDEN: {
|
||||
// is_hidden is used for SHOW EXTENDED in 4.2.2
|
||||
cur_row_.cells_[cell_idx].set_int(0);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid column id", K(ret), K(cell_idx),
|
||||
|
@ -99,7 +99,8 @@ private:
|
||||
DEFAULT,
|
||||
EXTRA,
|
||||
PRIVILEGES,
|
||||
COMMENT
|
||||
COMMENT,
|
||||
IS_HIDDEN
|
||||
};
|
||||
int calc_show_table_id(uint64_t &show_table_id);
|
||||
int fill_row_cells(const share::schema::ObTableSchema &table_schema,
|
||||
|
@ -431,6 +431,12 @@ int ObTableIndex::add_rowkey_indexes(const ObTableSchema &table_schema,
|
||||
cells[cell_idx].set_null();
|
||||
break;
|
||||
}
|
||||
// is_column_visible
|
||||
case OB_APP_MIN_COLUMN_ID + 18: {
|
||||
// is_column_visible is used for SHOW EXTENDED in 4.2.2
|
||||
cells[cell_idx].set_int(1);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
@ -777,6 +783,12 @@ int ObTableIndex::add_normal_index_column(const ObString &database_name,
|
||||
}
|
||||
break;
|
||||
}
|
||||
// is_column_visible
|
||||
case OB_APP_MIN_COLUMN_ID + 18: {
|
||||
// is_column_visible is used for SHOW EXTENDED in 4.2.2
|
||||
cells[cell_idx].set_int(1);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SERVER_LOG(WARN, "invalid column id", K(ret), K(cell_idx),
|
||||
@ -967,6 +979,12 @@ int ObTableIndex::add_fulltext_index_column(const ObString &database_name,
|
||||
cells[cell_idx].set_null();
|
||||
break;
|
||||
}
|
||||
// is_column_visible
|
||||
case OB_APP_MIN_COLUMN_ID + 18: {
|
||||
// is_column_visible is used for SHOW EXTENDED in 4.2.2
|
||||
cells[cell_idx].set_int(1);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SERVER_LOG(WARN, "invalid column id", K(ret), K(cell_idx),
|
||||
|
@ -555,6 +555,21 @@ int ObInnerTableSchema::tenant_virtual_table_column_schema(ObTableSchema &table_
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("is_hidden", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
@ -913,6 +928,21 @@ int ObInnerTableSchema::tenant_virtual_table_index_schema(ObTableSchema &table_s
|
||||
true, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("is_column_visible", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -371,6 +371,21 @@ int ObInnerTableSchema::tenant_virtual_table_column_ora_schema(ObTableSchema &ta
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("IS_HIDDEN", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -6422,6 +6422,7 @@ def_table_schema(
|
||||
('extra', 'varchar:COLUMN_EXTRA_LENGTH'),
|
||||
('privileges', 'varchar:MAX_COLUMN_PRIVILEGE_LENGTH'),
|
||||
('comment', 'varchar:MAX_COLUMN_COMMENT_LENGTH'),
|
||||
('is_hidden', 'int', 'false', '0')
|
||||
],
|
||||
)
|
||||
|
||||
@ -6453,7 +6454,8 @@ def_table_schema(
|
||||
('comment', 'varchar:MAX_TABLE_COMMENT_LENGTH', 'true'),
|
||||
('index_comment', 'varchar:MAX_TABLE_COMMENT_LENGTH', 'false', ''),
|
||||
('is_visible', 'varchar:MAX_COLUMN_YES_NO_LENGTH', 'false', ''),
|
||||
('expression', 'varchar:OB_MAX_DEFAULT_VALUE_LENGTH', 'true')
|
||||
('expression', 'varchar:OB_MAX_DEFAULT_VALUE_LENGTH', 'true'),
|
||||
('is_column_visible', 'int', 'false', '0')
|
||||
],
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user