2532 lines
73 KiB
C++
2532 lines
73 KiB
C++
/**
|
|
* Copyright (c) 2021 OceanBase
|
|
* OceanBase CE is licensed under Mulan PubL v2.
|
|
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
|
* You may obtain a copy of Mulan PubL v2 at:
|
|
* http://license.coscl.org.cn/MulanPubL-2.0
|
|
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
|
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
|
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
* See the Mulan PubL v2 for more details.
|
|
*/
|
|
|
|
#define USING_LOG_PREFIX SHARE_SCHEMA
|
|
#include "ob_inner_table_schema.h"
|
|
|
|
#include "share/schema/ob_schema_macro_define.h"
|
|
#include "share/schema/ob_schema_service_sql_impl.h"
|
|
#include "share/schema/ob_table_schema.h"
|
|
#include "share/scn.h"
|
|
|
|
namespace oceanbase
|
|
{
|
|
using namespace share::schema;
|
|
using namespace common;
|
|
namespace share
|
|
{
|
|
|
|
int ObInnerTableSchema::all_core_table_schema(ObTableSchema &table_schema)
|
|
{
|
|
int ret = OB_SUCCESS;
|
|
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
|
|
|
//generated fields:
|
|
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
|
table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID);
|
|
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
|
table_schema.set_table_id(OB_ALL_CORE_TABLE_TID);
|
|
table_schema.set_rowkey_split_pos(0);
|
|
table_schema.set_is_use_bloomfilter(false);
|
|
table_schema.set_progressive_merge_num(0);
|
|
table_schema.set_rowkey_column_num(3);
|
|
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
|
table_schema.set_table_type(SYSTEM_TABLE);
|
|
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
|
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_table_name(OB_ALL_CORE_TABLE_TNAME))) {
|
|
LOG_ERROR("fail to set table_name", K(ret));
|
|
}
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
|
LOG_ERROR("fail to set compress_func_name", K(ret));
|
|
}
|
|
}
|
|
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
|
table_schema.set_charset_type(ObCharset::get_default_charset());
|
|
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_create_default;
|
|
ObObj gmt_create_default_null;
|
|
|
|
gmt_create_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_create_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
false, //is_on_update_for_timestamp
|
|
gmt_create_default_null,
|
|
gmt_create_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_modified_default;
|
|
ObObj gmt_modified_default_null;
|
|
|
|
gmt_modified_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_modified_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_modified", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
true, //is_on_update_for_timestamp
|
|
gmt_modified_default_null,
|
|
gmt_modified_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("table_name", //column_name
|
|
++column_id, //column_id
|
|
1, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("row_id", //column_name
|
|
++column_id, //column_id
|
|
2, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("column_name", //column_name
|
|
++column_id, //column_id
|
|
3, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_COLUMN_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("column_value", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_OLD_MAX_VARCHAR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
table_schema.set_index_using_type(USING_BTREE);
|
|
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
|
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
|
table_schema.set_progressive_merge_round(1);
|
|
table_schema.set_storage_format_version(3);
|
|
table_schema.set_tablet_id(OB_ALL_CORE_TABLE_TID);
|
|
|
|
table_schema.set_max_used_column_id(column_id);
|
|
return ret;
|
|
}
|
|
|
|
int ObInnerTableSchema::all_table_schema(ObTableSchema &table_schema)
|
|
{
|
|
int ret = OB_SUCCESS;
|
|
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
|
|
|
//generated fields:
|
|
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
|
table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID);
|
|
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
|
table_schema.set_table_id(OB_ALL_TABLE_TID);
|
|
table_schema.set_rowkey_split_pos(0);
|
|
table_schema.set_is_use_bloomfilter(false);
|
|
table_schema.set_progressive_merge_num(0);
|
|
table_schema.set_rowkey_column_num(2);
|
|
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
|
table_schema.set_table_type(SYSTEM_TABLE);
|
|
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
|
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_TNAME))) {
|
|
LOG_ERROR("fail to set table_name", K(ret));
|
|
}
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
|
LOG_ERROR("fail to set compress_func_name", K(ret));
|
|
}
|
|
}
|
|
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
|
table_schema.set_charset_type(ObCharset::get_default_charset());
|
|
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_create_default;
|
|
ObObj gmt_create_default_null;
|
|
|
|
gmt_create_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_create_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
false, //is_on_update_for_timestamp
|
|
gmt_create_default_null,
|
|
gmt_create_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_modified_default;
|
|
ObObj gmt_modified_default_null;
|
|
|
|
gmt_modified_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_modified_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_modified", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
true, //is_on_update_for_timestamp
|
|
gmt_modified_default_null,
|
|
gmt_modified_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("tenant_id", //column_name
|
|
++column_id, //column_id
|
|
1, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("table_id", //column_name
|
|
++column_id, //column_id
|
|
2, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj table_name_default;
|
|
table_name_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("table_name", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_TABLE_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
table_name_default,
|
|
table_name_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("database_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("table_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("load_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("def_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("rowkey_column_num", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("index_column_num", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("max_used_column_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("autoinc_column_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj auto_increment_default;
|
|
auto_increment_default.set_uint64(1);
|
|
ADD_COLUMN_SCHEMA_T("auto_increment", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObUInt64Type, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
sizeof(uint64_t), //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
auto_increment_default,
|
|
auto_increment_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("read_only", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("rowkey_split_pos", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("compress_func_name", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_COMPRESSOR_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("expire_condition", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_EXPIRE_INFO_STRING_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("is_use_bloomfilter", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj comment_default;
|
|
comment_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("comment", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
MAX_TABLE_COMMENT_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
comment_default,
|
|
comment_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("block_size", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("collation_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("data_table_id", //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
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("index_status", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("tablegroup_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("progressive_merge_num", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("index_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("part_level", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("part_func_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("part_func_expr", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_PART_FUNC_EXPR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("part_num", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("sub_part_func_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("sub_part_func_expr", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_PART_FUNC_EXPR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("sub_part_num", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("schema_version", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("view_definition", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObLongTextType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
0, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("view_check_option", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("view_is_updatable", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj index_using_type_default;
|
|
index_using_type_default.set_int(USING_BTREE);
|
|
ADD_COLUMN_SCHEMA_T("index_using_type", //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
|
|
index_using_type_default,
|
|
index_using_type_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("parser_name", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_PARSER_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj index_attributes_set_default;
|
|
index_attributes_set_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("index_attributes_set", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
index_attributes_set_default,
|
|
index_attributes_set_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj tablet_size_default;
|
|
tablet_size_default.set_int(OB_DEFAULT_TABLET_SIZE);
|
|
ADD_COLUMN_SCHEMA_T("tablet_size", //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
|
|
tablet_size_default,
|
|
tablet_size_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj pctfree_default;
|
|
pctfree_default.set_int(OB_DEFAULT_PCTFREE);
|
|
ADD_COLUMN_SCHEMA_T("pctfree", //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
|
|
pctfree_default,
|
|
pctfree_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj partition_status_default;
|
|
partition_status_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("partition_status", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
partition_status_default,
|
|
partition_status_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj partition_schema_version_default;
|
|
partition_schema_version_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("partition_schema_version", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
partition_schema_version_default,
|
|
partition_schema_version_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj session_id_default;
|
|
session_id_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("session_id", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
session_id_default,
|
|
session_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj pk_comment_default;
|
|
pk_comment_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("pk_comment", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
MAX_TABLE_COMMENT_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
pk_comment_default,
|
|
pk_comment_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj sess_active_time_default;
|
|
sess_active_time_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("sess_active_time", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
sess_active_time_default,
|
|
sess_active_time_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj row_store_type_default;
|
|
row_store_type_default.set_varchar(ObString::make_string("encoding_row_store"));
|
|
ADD_COLUMN_SCHEMA_T("row_store_type", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_STORE_FORMAT_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
row_store_type_default,
|
|
row_store_type_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj store_format_default;
|
|
store_format_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("store_format", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_STORE_FORMAT_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
store_format_default,
|
|
store_format_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj duplicate_scope_default;
|
|
duplicate_scope_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("duplicate_scope", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
duplicate_scope_default,
|
|
duplicate_scope_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj progressive_merge_round_default;
|
|
progressive_merge_round_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("progressive_merge_round", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
progressive_merge_round_default,
|
|
progressive_merge_round_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj storage_format_version_default;
|
|
storage_format_version_default.set_int(2);
|
|
ADD_COLUMN_SCHEMA_T("storage_format_version", //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
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
storage_format_version_default,
|
|
storage_format_version_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj table_mode_default;
|
|
table_mode_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("table_mode", //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_mode_default,
|
|
table_mode_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj encryption_default;
|
|
encryption_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("encryption", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_ENCRYPTION_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false, //is_autoincrement
|
|
encryption_default,
|
|
encryption_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj tablespace_id_default;
|
|
tablespace_id_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("tablespace_id", //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
|
|
tablespace_id_default,
|
|
tablespace_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj sub_part_template_flags_default;
|
|
sub_part_template_flags_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("sub_part_template_flags", //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
|
|
sub_part_template_flags_default,
|
|
sub_part_template_flags_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj dop_default;
|
|
dop_default.set_int(1);
|
|
ADD_COLUMN_SCHEMA_T("dop", //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
|
|
dop_default,
|
|
dop_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj character_set_client_default;
|
|
character_set_client_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("character_set_client", //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
|
|
character_set_client_default,
|
|
character_set_client_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj collation_connection_default;
|
|
collation_connection_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("collation_connection", //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
|
|
collation_connection_default,
|
|
collation_connection_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj auto_part_size_default;
|
|
auto_part_size_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("auto_part_size", //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
|
|
auto_part_size_default,
|
|
auto_part_size_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj auto_part_default;
|
|
auto_part_default.set_tinyint(false);
|
|
ADD_COLUMN_SCHEMA_T("auto_part", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTinyIntType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
1, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
auto_part_default,
|
|
auto_part_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj association_table_id_default;
|
|
association_table_id_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("association_table_id", //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
|
|
association_table_id_default,
|
|
association_table_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj tablet_id_default;
|
|
tablet_id_default.set_int(ObTabletID::INVALID_TABLET_ID);
|
|
ADD_COLUMN_SCHEMA_T("tablet_id", //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
|
|
20, //column_precision
|
|
0, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
tablet_id_default,
|
|
tablet_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj max_dependency_version_default;
|
|
max_dependency_version_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("max_dependency_version", //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
|
|
max_dependency_version_default,
|
|
max_dependency_version_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj define_user_id_default;
|
|
define_user_id_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("define_user_id", //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
|
|
define_user_id_default,
|
|
define_user_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("transition_point", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_PARTITION_EXPR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("b_transition_point", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_B_HIGH_BOUND_VAL_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("interval_range", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_PARTITION_EXPR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("b_interval_range", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_B_HIGH_BOUND_VAL_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj object_status_default;
|
|
object_status_default.set_int(1);
|
|
ADD_COLUMN_SCHEMA_T("object_status", //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
|
|
object_status_default,
|
|
object_status_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj table_flags_default;
|
|
table_flags_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("table_flags", //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_flags_default,
|
|
table_flags_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj truncate_version_default;
|
|
truncate_version_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("truncate_version", //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
|
|
truncate_version_default,
|
|
truncate_version_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("external_file_location", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_VARCHAR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("external_file_location_access_info", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_VARCHAR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("external_file_format", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_VARCHAR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("external_file_pattern", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_VARCHAR_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj ttl_definition_default;
|
|
ttl_definition_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("ttl_definition", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_DEFAULT_VALUE_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
ttl_definition_default,
|
|
ttl_definition_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj kv_attributes_default;
|
|
kv_attributes_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("kv_attributes", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_DEFAULT_VALUE_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
kv_attributes_default,
|
|
kv_attributes_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj name_generated_type_default;
|
|
name_generated_type_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("name_generated_type", //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
|
|
name_generated_type_default,
|
|
name_generated_type_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj lob_inrow_threshold_default;
|
|
lob_inrow_threshold_default.set_int(OB_DEFAULT_LOB_INROW_THRESHOLD);
|
|
ADD_COLUMN_SCHEMA_T("lob_inrow_threshold", //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
|
|
lob_inrow_threshold_default,
|
|
lob_inrow_threshold_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj max_used_column_group_id_default;
|
|
max_used_column_group_id_default.set_int(1000);
|
|
ADD_COLUMN_SCHEMA_T("max_used_column_group_id", //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
|
|
max_used_column_group_id_default,
|
|
max_used_column_group_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj column_store_default;
|
|
column_store_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("column_store", //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
|
|
column_store_default,
|
|
column_store_default); //default_value
|
|
}
|
|
table_schema.set_index_using_type(USING_BTREE);
|
|
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
|
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
|
table_schema.set_progressive_merge_round(1);
|
|
table_schema.set_storage_format_version(3);
|
|
table_schema.set_tablet_id(OB_ALL_TABLE_TID);
|
|
table_schema.set_aux_lob_meta_tid(OB_ALL_TABLE_AUX_LOB_META_TID);
|
|
table_schema.set_aux_lob_piece_tid(OB_ALL_TABLE_AUX_LOB_PIECE_TID);
|
|
|
|
table_schema.set_max_used_column_id(column_id);
|
|
return ret;
|
|
}
|
|
|
|
int ObInnerTableSchema::all_column_schema(ObTableSchema &table_schema)
|
|
{
|
|
int ret = OB_SUCCESS;
|
|
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
|
|
|
//generated fields:
|
|
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
|
table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID);
|
|
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
|
table_schema.set_table_id(OB_ALL_COLUMN_TID);
|
|
table_schema.set_rowkey_split_pos(0);
|
|
table_schema.set_is_use_bloomfilter(false);
|
|
table_schema.set_progressive_merge_num(0);
|
|
table_schema.set_rowkey_column_num(3);
|
|
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
|
table_schema.set_table_type(SYSTEM_TABLE);
|
|
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
|
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_TNAME))) {
|
|
LOG_ERROR("fail to set table_name", K(ret));
|
|
}
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
|
LOG_ERROR("fail to set compress_func_name", K(ret));
|
|
}
|
|
}
|
|
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
|
table_schema.set_charset_type(ObCharset::get_default_charset());
|
|
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_create_default;
|
|
ObObj gmt_create_default_null;
|
|
|
|
gmt_create_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_create_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
false, //is_on_update_for_timestamp
|
|
gmt_create_default_null,
|
|
gmt_create_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_modified_default;
|
|
ObObj gmt_modified_default_null;
|
|
|
|
gmt_modified_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_modified_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_modified", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
true, //is_on_update_for_timestamp
|
|
gmt_modified_default_null,
|
|
gmt_modified_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("tenant_id", //column_name
|
|
++column_id, //column_id
|
|
1, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("table_id", //column_name
|
|
++column_id, //column_id
|
|
2, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("column_id", //column_name
|
|
++column_id, //column_id
|
|
3, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj column_name_default;
|
|
column_name_default.set_varchar(ObString::make_string(""));
|
|
ADD_COLUMN_SCHEMA_T("column_name", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_COLUMN_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false, //is_autoincrement
|
|
column_name_default,
|
|
column_name_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj rowkey_position_default;
|
|
rowkey_position_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("rowkey_position", //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
|
|
rowkey_position_default,
|
|
rowkey_position_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("index_position", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("order_in_rowkey", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("partition_key_position", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("data_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("data_length", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("data_precision", //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
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("data_scale", //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
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("zero_fill", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("nullable", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("on_update_current_timestamp", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("autoincrement", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj is_hidden_default;
|
|
is_hidden_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("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
|
|
is_hidden_default,
|
|
is_hidden_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("collation_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("orig_default_value", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_DEFAULT_VALUE_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("cur_default_value", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_DEFAULT_VALUE_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("comment", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObLongTextType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
0, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("schema_version", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj column_flags_default;
|
|
column_flags_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("column_flags", //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
|
|
column_flags_default,
|
|
column_flags_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj prev_column_id_default;
|
|
prev_column_id_default.set_int(-1);
|
|
ADD_COLUMN_SCHEMA_T("prev_column_id", //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
|
|
prev_column_id_default,
|
|
prev_column_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("extended_type_info", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_VARBINARY_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("orig_default_value_v2", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_DEFAULT_VALUE_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("cur_default_value_v2", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_BINARY, //column_collation_type
|
|
OB_MAX_DEFAULT_VALUE_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj srs_id_default;
|
|
srs_id_default.set_int(OB_DEFAULT_COLUMN_SRS_ID);
|
|
ADD_COLUMN_SCHEMA_T("srs_id", //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
|
|
srs_id_default,
|
|
srs_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj udt_set_id_default;
|
|
udt_set_id_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("udt_set_id", //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
|
|
udt_set_id_default,
|
|
udt_set_id_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj sub_data_type_default;
|
|
sub_data_type_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("sub_data_type", //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
|
|
sub_data_type_default,
|
|
sub_data_type_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj skip_index_attr_default;
|
|
skip_index_attr_default.set_int(0);
|
|
ADD_COLUMN_SCHEMA_T("skip_index_attr", //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
|
|
skip_index_attr_default,
|
|
skip_index_attr_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj lob_chunk_size_default;
|
|
lob_chunk_size_default.set_int(OB_DEFAULT_LOB_CHUNK_SIZE);
|
|
ADD_COLUMN_SCHEMA_T("lob_chunk_size", //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
|
|
lob_chunk_size_default,
|
|
lob_chunk_size_default); //default_value
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("local_session_vars", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObLongTextType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
0, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
true, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
table_schema.set_index_using_type(USING_BTREE);
|
|
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
|
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
|
table_schema.set_progressive_merge_round(1);
|
|
table_schema.set_storage_format_version(3);
|
|
table_schema.set_tablet_id(OB_ALL_COLUMN_TID);
|
|
table_schema.set_aux_lob_meta_tid(OB_ALL_COLUMN_AUX_LOB_META_TID);
|
|
table_schema.set_aux_lob_piece_tid(OB_ALL_COLUMN_AUX_LOB_PIECE_TID);
|
|
|
|
table_schema.set_max_used_column_id(column_id);
|
|
return ret;
|
|
}
|
|
|
|
int ObInnerTableSchema::all_ddl_operation_schema(ObTableSchema &table_schema)
|
|
{
|
|
int ret = OB_SUCCESS;
|
|
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
|
|
|
//generated fields:
|
|
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
|
table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID);
|
|
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
|
table_schema.set_table_id(OB_ALL_DDL_OPERATION_TID);
|
|
table_schema.set_rowkey_split_pos(0);
|
|
table_schema.set_is_use_bloomfilter(false);
|
|
table_schema.set_progressive_merge_num(0);
|
|
table_schema.set_rowkey_column_num(1);
|
|
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
|
table_schema.set_table_type(SYSTEM_TABLE);
|
|
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
|
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_OPERATION_TNAME))) {
|
|
LOG_ERROR("fail to set table_name", K(ret));
|
|
}
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
|
LOG_ERROR("fail to set compress_func_name", K(ret));
|
|
}
|
|
}
|
|
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
|
table_schema.set_charset_type(ObCharset::get_default_charset());
|
|
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_create_default;
|
|
ObObj gmt_create_default_null;
|
|
|
|
gmt_create_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_create_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
false, //is_on_update_for_timestamp
|
|
gmt_create_default_null,
|
|
gmt_create_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj gmt_modified_default;
|
|
ObObj gmt_modified_default_null;
|
|
|
|
gmt_modified_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG);
|
|
gmt_modified_default_null.set_null();
|
|
ADD_COLUMN_SCHEMA_TS_T("gmt_modified", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObTimestampType, //column_type
|
|
CS_TYPE_BINARY,//collation_type
|
|
0, //column length
|
|
-1, //column_precision
|
|
6, //column_scale
|
|
true,//is nullable
|
|
false, //is_autoincrement
|
|
true, //is_on_update_for_timestamp
|
|
gmt_modified_default_null,
|
|
gmt_modified_default)
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("schema_version", //column_name
|
|
++column_id, //column_id
|
|
1, //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("tenant_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("user_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("database_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("database_name", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_DATABASE_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("tablegroup_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("table_id", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("table_name", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObVarcharType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("operation_type", //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
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ADD_COLUMN_SCHEMA("ddl_stmt_str", //column_name
|
|
++column_id, //column_id
|
|
0, //rowkey_id
|
|
0, //index_id
|
|
0, //part_key_pos
|
|
ObLongTextType, //column_type
|
|
CS_TYPE_INVALID, //column_collation_type
|
|
0, //column_length
|
|
-1, //column_precision
|
|
-1, //column_scale
|
|
false, //is_nullable
|
|
false); //is_autoincrement
|
|
}
|
|
|
|
if (OB_SUCC(ret)) {
|
|
ObObj exec_tenant_id_default;
|
|
exec_tenant_id_default.set_int(1);
|
|
ADD_COLUMN_SCHEMA_T("exec_tenant_id", //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
|
|
exec_tenant_id_default,
|
|
exec_tenant_id_default); //default_value
|
|
}
|
|
table_schema.set_index_using_type(USING_BTREE);
|
|
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
|
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
|
table_schema.set_progressive_merge_round(1);
|
|
table_schema.set_storage_format_version(3);
|
|
table_schema.set_tablet_id(OB_ALL_DDL_OPERATION_TID);
|
|
table_schema.set_aux_lob_meta_tid(OB_ALL_DDL_OPERATION_AUX_LOB_META_TID);
|
|
table_schema.set_aux_lob_piece_tid(OB_ALL_DDL_OPERATION_AUX_LOB_PIECE_TID);
|
|
|
|
table_schema.set_max_used_column_id(column_id);
|
|
return ret;
|
|
}
|
|
|
|
|
|
} // end namespace share
|
|
} // end namespace oceanbase
|