spatial index generated column bugfix && oms_view_bugfix
This commit is contained in:
parent
83a2af8369
commit
2e480d891a
@ -4509,41 +4509,10 @@ int ObDDLService::check_convert_to_character(obrpc::ObAlterTableArg &alter_table
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObDDLService::update_spatial_generated_column_info(const share::schema::ObTableSchema &orig_table_schema,
|
||||
schema::ObTableSchema &hidden_table_schema)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObTableSchema::const_column_iterator hidden_iter = hidden_table_schema.column_begin();
|
||||
ObTableSchema::const_column_iterator hidden_end = hidden_table_schema.column_end();
|
||||
for (; OB_SUCC(ret) && hidden_iter != hidden_end; ++hidden_iter) {
|
||||
ObColumnSchemaV2 *column = *hidden_iter;
|
||||
if (OB_ISNULL(column)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid column schema", K(column));
|
||||
} else if (column->is_spatial_generated_column()) {
|
||||
uint64_t old_geo_column_id = column->get_geo_col_id();
|
||||
const ObColumnSchemaV2 *old_geo_column = orig_table_schema.get_column_schema(old_geo_column_id);
|
||||
if (OB_ISNULL(old_geo_column)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid column schema", K(old_geo_column_id), KPC(old_geo_column));
|
||||
} else {
|
||||
const ObColumnSchemaV2 *new_geo_column = hidden_table_schema.get_column_schema(old_geo_column->get_column_name());
|
||||
if (OB_NOT_NULL(new_geo_column)) {
|
||||
column->set_geo_col_id(new_geo_column->get_column_id());
|
||||
} else {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid column schema", KPC(new_geo_column));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObDDLService::check_add_identity_and_spatial_generated_column(const share::schema::ObTableSchema &orig_table_schema,
|
||||
const share::schema::ObTableSchema &hidden_table_schema,
|
||||
bool &is_add_identity_column,
|
||||
bool &have_spatial_generated_column)
|
||||
int ObDDLService::check_is_add_identity_column(const share::schema::ObTableSchema &orig_table_schema,
|
||||
const share::schema::ObTableSchema &hidden_table_schema,
|
||||
bool &is_add_identity_column)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObTableSchema::const_column_iterator iter = orig_table_schema.column_begin();
|
||||
@ -4564,8 +4533,6 @@ int ObDDLService::check_add_identity_and_spatial_generated_column(const share::s
|
||||
} else {
|
||||
is_add_identity_column = true;
|
||||
}
|
||||
} else if (!have_spatial_generated_column && column->is_spatial_generated_column()) {
|
||||
have_spatial_generated_column = true;
|
||||
}
|
||||
}
|
||||
for (; OB_SUCC(ret) && iter != end; ++iter) {
|
||||
@ -17668,11 +17635,8 @@ int ObDDLService::create_user_hidden_table(const ObTableSchema &orig_table_schem
|
||||
LOG_WARN("invalid arg", K(ret), K(tenant_data_version));
|
||||
} else if (OB_FAIL(ObMajorFreezeHelper::get_frozen_scn(tenant_id, frozen_scn))) {
|
||||
LOG_WARN("failed to get frozen status for create tablet", KR(ret), K(tenant_id));
|
||||
} else if (OB_FAIL(check_add_identity_and_spatial_generated_column(orig_table_schema, hidden_table_schema, is_add_identity_column, have_spatial_generated_column))) {
|
||||
} else if (OB_FAIL(check_is_add_identity_column(orig_table_schema, hidden_table_schema, is_add_identity_column))) {
|
||||
LOG_WARN("failed to check is add identity column", K(ret));
|
||||
} else if (have_spatial_generated_column
|
||||
&& OB_FAIL(update_spatial_generated_column_info(orig_table_schema,hidden_table_schema))) {
|
||||
LOG_WARN("failed to update spatial generated column info", K(ret));
|
||||
} else if (OB_FAIL(prepare_hidden_table_schema(orig_table_schema,
|
||||
allocator,
|
||||
hidden_table_schema,
|
||||
|
@ -1658,12 +1658,9 @@ private:
|
||||
int check_convert_to_character(obrpc::ObAlterTableArg &alter_table_arg,
|
||||
const share::schema::ObTableSchema &orig_table_schema,
|
||||
share::ObDDLType &ddl_type);
|
||||
int check_add_identity_and_spatial_generated_column(const share::schema::ObTableSchema &orig_table_schema,
|
||||
const share::schema::ObTableSchema &hidden_table_schema,
|
||||
bool &is_add_identity_column,
|
||||
bool &have_spatial_generated_column);
|
||||
int update_spatial_generated_column_info(const share::schema::ObTableSchema &orig_table_schema,
|
||||
share::schema::ObTableSchema &hidden_table_schema);
|
||||
int check_is_add_identity_column(const share::schema::ObTableSchema &orig_table_schema,
|
||||
const share::schema::ObTableSchema &hidden_table_schema,
|
||||
bool &is_add_identity_column);
|
||||
int alter_table_primary_key(obrpc::ObAlterTableArg &alter_table_arg,
|
||||
const share::schema::ObTableSchema &orgin_table_schema,
|
||||
share::schema::ObTableSchema &new_table_schema,
|
||||
|
@ -810,7 +810,7 @@ int ObInnerTableSchema::dba_ob_spatial_columns_ora_schema(ObTableSchema &table_s
|
||||
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_view_definition(R"__( select G.TABLE_SCHEMA AS TABLE_SCHEMA, G.TABLE_NAME AS TABLE_NAME, G.COLUMN_NAME AS COLUMN_NAME, G.SRS_NAME AS SRS_NAME, G.SRS_ID AS SRS_ID, G.GEOMETRY_TYPE_NAME AS GEOMETRY_TYPE_NAME, CAST('SDO_DIM_ARRAY(SDO_DIM_ELEMENT(NULL, -180, 180, 0.5), SDO_DIM_ELEMENT(NULL, -90, 90, 0.5))' AS VARCHAR2(512)) AS DIMINFO, D.INDEX_NAME AS INDEX_NAME from (select CAST(db.database_name AS VARCHAR2(128)) as TABLE_SCHEMA, CAST(tbl.table_name AS VARCHAR2(256)) as TABLE_NAME, CAST(col.column_name AS VARCHAR2(128)) as COLUMN_NAME, CAST(srs.srs_name AS VARCHAR2(128)) as SRS_NAME, CAST( CASE WHEN TRUNC(col.srs_id / POWER(2, 32)) = 4294967295 THEN NULL ELSE TRUNC(col.srs_id / POWER(2, 32)) END AS NUMBER(10)) AS SRS_ID, CAST( CASE WHEN (BITAND(col.srs_id, 31) IN (0, 1, 2, 3, 4, 5, 6, 7)) THEN 'SDO_GEOMETRY' ELSE 'invalid' END AS VARCHAR2(128)) AS GEOMETRY_TYPE_NAME, db.tenant_id as TENANT_ID, tbl.table_id AS TABLE_ID, tbl.database_id AS DATABASE_ID from SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT col left join SYS.ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT srs on TRUNC(col.srs_id / POWER(2, 32)) = srs.srs_id join SYS.ALL_VIRTUAL_TABLE_REAL_AGENT tbl on (tbl.table_id = col.table_id and tbl.tenant_id = col.tenant_id) join SYS.ALL_VIRTUAL_DATABASE_REAL_AGENT db on (db.database_id = tbl.database_id and db.tenant_id = tbl.tenant_id) and db.database_name != '__recyclebin' where col.data_type = 48 AND BITAND(TRUNC(tbl.table_mode / POWER(2, 12)), 15) IN (0, 1)) G left join (select T.TABLE_NAME AS TABLE_NAME, T.INDEX_NAME AS INDEX_NAME, C.COLUMN_NAME AS COLUMN_NAME, C.COLUMN_ID AS COLUMN_ID, T.DATABASE_ID AS DATABASE_ID, T.TENANT_ID AS TENANT_ID, C.TABLE_ID AS TABLE_ID from (select A.TABLE_NAME AS TABLE_NAME, A.INDEX_NAME AS INDEX_NAME, A.COLUMN_NAME AS COLUMN_NAME, B.COLUMN_ID AS COLUMN_ID, B.TENANT_ID as TENANT_ID, B.TABLE_ID as TABLE_ID, B.DATABASE_ID AS DATABASE_ID, B.SRS_ID AS SRS_ID from (select TABLE_NAME, INDEX_NAME, COLUMN_NAME from ALL_IND_COLUMNS idx_col) A join (select cl.COLUMN_ID as COLUMN_ID, cl.COLUMN_NAME as COLUMN_NAME, cl.TENANT_ID as TENANT_ID, cl.TABLE_ID as TABLE_ID, tb.TABLE_NAME as TABLE_NAME, cl.IS_HIDDEN as IS_HIDDEN, cl.SRS_ID as SRS_ID, tb.DATABASE_ID as DATABASE_ID from SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT cl join SYS.ALL_VIRTUAL_TABLE_REAL_AGENT tb on (tb.table_id = cl.table_id and tb.tenant_id = cl.tenant_id)) B on (B.COLUMN_NAME = A.COLUMN_NAME AND B.TABLE_NAME = A.TABLE_NAME) where b.IS_HIDDEN = 1 and SUBSTR(A.COLUMN_NAME, 1, 5) = '__mbr') T join SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT C on (T.SRS_ID = C.COLUMN_ID and T.TENANT_ID = C.TENANT_ID) where C.DATA_TYPE = 48) D ON D.TABLE_ID = G.TABLE_ID and D.TENANT_ID = G.TENANT_ID and D.DATABASE_ID = G.DATABASE_ID and D.COLUMN_NAME = G.COLUMN_NAME ORDER BY 1, 2, 3 )__"))) {
|
||||
if (OB_FAIL(table_schema.set_view_definition(R"__( select G.TABLE_SCHEMA AS TABLE_SCHEMA, G.TABLE_NAME AS TABLE_NAME, G.COLUMN_NAME AS COLUMN_NAME, G.SRS_NAME AS SRS_NAME, G.SRS_ID AS SRS_ID, G.GEOMETRY_TYPE_NAME AS GEOMETRY_TYPE_NAME, CAST('SDO_DIM_ARRAY(SDO_DIM_ELEMENT(NULL, -180, 180, 0.5), SDO_DIM_ELEMENT(NULL, -90, 90, 0.5))' AS VARCHAR2(512)) AS DIMINFO, D.INDEX_NAME AS INDEX_NAME from (select CAST(db.database_name AS VARCHAR2(128)) as TABLE_SCHEMA, CAST(tbl.table_name AS VARCHAR2(256)) as TABLE_NAME, CAST(col.column_name AS VARCHAR2(128)) as COLUMN_NAME, CAST(srs.srs_name AS VARCHAR2(128)) as SRS_NAME, CAST( CASE WHEN TRUNC(col.new_srs_id / POWER(2, 32)) = 4294967295 THEN NULL ELSE TRUNC(col.new_srs_id / POWER(2, 32)) END AS NUMBER(10)) AS SRS_ID, CAST( CASE WHEN (BITAND(col.srs_id, 31) IN (0, 1, 2, 3, 4, 5, 6, 7)) THEN 'SDO_GEOMETRY' ELSE 'invalid' END AS VARCHAR2(128)) AS GEOMETRY_TYPE_NAME, db.tenant_id as TENANT_ID, tbl.table_id AS TABLE_ID, tbl.database_id AS DATABASE_ID from (select col1.*, CASE WHEN col1.srs_id < 0 THEN col1.srs_id + POWER(2, 64) ELSE col1.srs_id END AS new_srs_id from SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT col1) col left join SYS.ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT srs on TRUNC(col.new_srs_id / POWER(2, 32)) = srs.srs_id join SYS.ALL_VIRTUAL_TABLE_REAL_AGENT tbl on (tbl.table_id = col.table_id and tbl.tenant_id = col.tenant_id) join SYS.ALL_VIRTUAL_DATABASE_REAL_AGENT db on (db.database_id = tbl.database_id and db.tenant_id = tbl.tenant_id) and db.database_name != '__recyclebin' where col.data_type = 48 AND BITAND(TRUNC(tbl.table_mode / POWER(2, 12)), 15) IN (0, 1)) G left join (select T.TABLE_NAME AS TABLE_NAME, T.INDEX_NAME AS INDEX_NAME, C.COLUMN_NAME AS COLUMN_NAME, C.COLUMN_ID AS COLUMN_ID, T.DATABASE_ID AS DATABASE_ID, T.TENANT_ID AS TENANT_ID, C.TABLE_ID AS TABLE_ID from (select A.TABLE_NAME AS TABLE_NAME, A.INDEX_NAME AS INDEX_NAME, A.COLUMN_NAME AS COLUMN_NAME, B.COLUMN_ID AS COLUMN_ID, B.TENANT_ID as TENANT_ID, B.TABLE_ID as TABLE_ID, B.DATABASE_ID AS DATABASE_ID, B.SRS_ID AS SRS_ID from (select TABLE_NAME, INDEX_NAME, COLUMN_NAME from ALL_IND_COLUMNS idx_col) A join (select cl.COLUMN_ID as COLUMN_ID, cl.COLUMN_NAME as COLUMN_NAME, cl.TENANT_ID as TENANT_ID, cl.TABLE_ID as TABLE_ID, tb.TABLE_NAME as TABLE_NAME, cl.IS_HIDDEN as IS_HIDDEN, cl.SRS_ID as SRS_ID, tb.DATABASE_ID as DATABASE_ID from SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT cl join SYS.ALL_VIRTUAL_TABLE_REAL_AGENT tb on (tb.table_id = cl.table_id and tb.tenant_id = cl.tenant_id)) B on (B.COLUMN_NAME = A.COLUMN_NAME AND B.TABLE_NAME = A.TABLE_NAME) where b.IS_HIDDEN = 1 and SUBSTR(A.COLUMN_NAME, 1, 5) = '__mbr') T join SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT C on (T.SRS_ID = C.COLUMN_ID and T.TENANT_ID = C.TENANT_ID) where C.DATA_TYPE = 48) D ON D.TABLE_ID = G.TABLE_ID and D.TENANT_ID = G.TENANT_ID and D.DATABASE_ID = G.DATABASE_ID and D.COLUMN_NAME = G.COLUMN_NAME ORDER BY 1, 2, 3 )__"))) {
|
||||
LOG_ERROR("fail to set view_definition", K(ret));
|
||||
}
|
||||
}
|
||||
|
@ -63089,8 +63089,8 @@ from
|
||||
CAST(srs.srs_name AS VARCHAR2(128)) as SRS_NAME,
|
||||
CAST(
|
||||
CASE
|
||||
WHEN TRUNC(col.srs_id / POWER(2, 32)) = 4294967295 THEN NULL
|
||||
ELSE TRUNC(col.srs_id / POWER(2, 32))
|
||||
WHEN TRUNC(col.new_srs_id / POWER(2, 32)) = 4294967295 THEN NULL
|
||||
ELSE TRUNC(col.new_srs_id / POWER(2, 32))
|
||||
END
|
||||
AS NUMBER(10)) AS SRS_ID,
|
||||
CAST(
|
||||
@ -63103,7 +63103,13 @@ from
|
||||
tbl.table_id AS TABLE_ID,
|
||||
tbl.database_id AS DATABASE_ID
|
||||
from
|
||||
SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT col left join SYS.ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT srs on TRUNC(col.srs_id / POWER(2, 32)) = srs.srs_id
|
||||
(select col1.*,
|
||||
CASE
|
||||
WHEN col1.srs_id < 0 THEN
|
||||
col1.srs_id + POWER(2, 64)
|
||||
ELSE
|
||||
col1.srs_id
|
||||
END AS new_srs_id from SYS.ALL_VIRTUAL_COLUMN_REAL_AGENT col1) col left join SYS.ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT srs on TRUNC(col.new_srs_id / POWER(2, 32)) = srs.srs_id
|
||||
join SYS.ALL_VIRTUAL_TABLE_REAL_AGENT tbl on (tbl.table_id = col.table_id and tbl.tenant_id = col.tenant_id)
|
||||
join SYS.ALL_VIRTUAL_DATABASE_REAL_AGENT db on (db.database_id = tbl.database_id and db.tenant_id = tbl.tenant_id)
|
||||
and db.database_name != '__recyclebin'
|
||||
|
@ -3796,6 +3796,8 @@ int ObTableSchema::convert_column_ids_for_ddl(const ObHashMap<uint64_t, uint64_t
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(convert_column_udt_set_ids(column_id_map))) {
|
||||
LOG_WARN("failed to convert column udt set id", K(ret));
|
||||
} else if (OB_FAIL(convert_geo_generated_col_ids(column_id_map))) {
|
||||
LOG_WARN("failed to convert column id in geo generated columns", K(ret));
|
||||
} else if (OB_FAIL(convert_basic_column_ids(column_id_map))) {
|
||||
LOG_WARN("failed to convert column id in column array and id hash array", K(ret));
|
||||
} else if (OB_FAIL(convert_column_ids_in_generated_columns(column_id_map))) {
|
||||
@ -9119,6 +9121,31 @@ int ObTableSchema::convert_column_udt_set_ids(const ObHashMap<uint64_t, uint64_t
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTableSchema::convert_geo_generated_col_ids(const ObHashMap<uint64_t, uint64_t> &column_id_map)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
// generate new column udt id
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < column_cnt_; i++) {
|
||||
ObColumnSchemaV2 *column = column_array_[i];
|
||||
if (OB_ISNULL(column)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("invalid column schema", K(ret));
|
||||
} else if (column->is_spatial_generated_column()) {
|
||||
uint64_t new_column_id = 0;
|
||||
uint64_t old_geo_column_id = column->get_geo_col_id();
|
||||
if (OB_FAIL(column_id_map.get_refactored(old_geo_column_id, new_column_id))) {
|
||||
LOG_WARN("failed to get column id", K(ret), K(new_column_id));
|
||||
} else if (OB_UNLIKELY(new_column_id < OB_APP_MIN_COLUMN_ID)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("new column id too small", K(ret), K(new_column_id));
|
||||
} else {
|
||||
column->set_geo_col_id(new_column_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTableSchema::get_is_row_store(bool &is_row_store) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
@ -1860,6 +1860,8 @@ private:
|
||||
const common::hash::ObHashMap<uint64_t, uint64_t> &column_id_map);
|
||||
int convert_column_udt_set_ids(
|
||||
const common::hash::ObHashMap<uint64_t, uint64_t> &column_id_map);
|
||||
int convert_geo_generated_col_ids(
|
||||
const common::hash::ObHashMap<uint64_t, uint64_t> &column_id_map);
|
||||
static int convert_column_ids_in_info(
|
||||
const common::hash::ObHashMap<uint64_t, uint64_t> &column_id_map,
|
||||
ObRowkeyInfo &rowkey_info);
|
||||
|
@ -122,39 +122,46 @@ int ObExprObjectConstruct::newx(ObEvalCtx &ctx, ObObj &result, uint64_t udt_id)
|
||||
ObExecContext &exec_ctx = ctx.exec_ctx_;
|
||||
ObIAllocator &alloc = ctx.exec_ctx_.get_allocator();
|
||||
pl::ObPLPackageGuard package_guard(session->get_effective_tenant_id());
|
||||
ObSchemaGetterGuard *schema_guard = NULL;
|
||||
ObSchemaGetterGuard *schema_guard_ptr = NULL;
|
||||
ObSchemaGetterGuard schema_guard;
|
||||
// if called by check_default_value in ddl resolver, no sql ctx, get guard from session cache
|
||||
if (OB_ISNULL(exec_ctx.get_sql_ctx()) || OB_ISNULL(exec_ctx.get_sql_ctx()->schema_guard_)) {
|
||||
schema_guard = &session->get_cached_schema_guard_info().get_schema_guard();
|
||||
if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(session->get_effective_tenant_id(), schema_guard))) {
|
||||
LOG_WARN("fail to get schema guard", K(ret));
|
||||
} else {
|
||||
schema_guard_ptr = &schema_guard;
|
||||
}
|
||||
} else {
|
||||
schema_guard = exec_ctx.get_sql_ctx()->schema_guard_;
|
||||
}
|
||||
pl::ObPLResolveCtx resolve_ctx(alloc,
|
||||
*session,
|
||||
*(schema_guard),
|
||||
package_guard,
|
||||
*(exec_ctx.get_sql_proxy()),
|
||||
false);
|
||||
pl::ObPLINS *ns = NULL;
|
||||
if (NULL == session->get_pl_context()) {
|
||||
OZ (package_guard.init());
|
||||
OX (ns = &resolve_ctx);
|
||||
} else {
|
||||
ns = session->get_pl_context()->get_current_ctx();
|
||||
schema_guard_ptr = exec_ctx.get_sql_ctx()->schema_guard_;
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj new_composite;
|
||||
int64_t ptr = 0;
|
||||
int64_t init_size = OB_INVALID_SIZE;
|
||||
ObArenaAllocator tmp_alloc;
|
||||
const pl::ObUserDefinedType *user_type = NULL;
|
||||
CK (OB_NOT_NULL(ns));
|
||||
OZ (ns->get_user_type(udt_id, user_type, &tmp_alloc));
|
||||
CK (OB_NOT_NULL(user_type));
|
||||
OZ (user_type->newx(alloc, ns, ptr));
|
||||
OZ (user_type->get_size(pl::PL_TYPE_INIT_SIZE, init_size));
|
||||
OX (new_composite.set_extend(ptr, user_type->get_type(), init_size));
|
||||
OX (result = new_composite);
|
||||
pl::ObPLResolveCtx resolve_ctx(alloc,
|
||||
*session,
|
||||
*(schema_guard_ptr),
|
||||
package_guard,
|
||||
*(exec_ctx.get_sql_proxy()),
|
||||
false);
|
||||
pl::ObPLINS *ns = NULL;
|
||||
if (NULL == session->get_pl_context()) {
|
||||
OZ (package_guard.init());
|
||||
OX (ns = &resolve_ctx);
|
||||
} else {
|
||||
ns = session->get_pl_context()->get_current_ctx();
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj new_composite;
|
||||
int64_t ptr = 0;
|
||||
int64_t init_size = OB_INVALID_SIZE;
|
||||
ObArenaAllocator tmp_alloc;
|
||||
const pl::ObUserDefinedType *user_type = NULL;
|
||||
CK (OB_NOT_NULL(ns));
|
||||
OZ (ns->get_user_type(udt_id, user_type, &tmp_alloc));
|
||||
CK (OB_NOT_NULL(user_type));
|
||||
OZ (user_type->newx(alloc, ns, ptr));
|
||||
OZ (user_type->get_size(pl::PL_TYPE_INIT_SIZE, init_size));
|
||||
OX (new_composite.set_extend(ptr, user_type->get_type(), init_size));
|
||||
OX (result = new_composite);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -314,4 +314,61 @@ Outputs & filters:
|
||||
(384213343210045440,MIN,MIN ; 384213343210045440,MAX,MAX), (383931868233334784,MIN,MIN ; 383931868233334784,MAX,MAX), (382805968326492160,MIN,MIN ; 382805968326492160,
|
||||
MAX,MAX), (378302368699121664,MIN,MIN ; 378302368699121664,MAX,MAX), (360287970189639680,MIN,MIN ; 360287970189639680,MAX,MAX), (288230376151711744,MIN,
|
||||
MIN ; 288230376151711744,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (383950835169648257,MIN,MIN ; 383950835169648257,MAX,MAX)
|
||||
alter table t1 add c0 char(20) before g;
|
||||
explain SELECT /*+ index(t1 g) */ * from t1 where ST_INTERSECTS(g,ST_GeomFromText('POINT(-1 -1)', 4326));
|
||||
Query Plan
|
||||
================================================
|
||||
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
||||
------------------------------------------------
|
||||
|0 |TABLE FULL SCAN|t1(g)|1 |159 |
|
||||
================================================
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c0], [t1.g]), filter([ST_INTERSECTS(t1.g, ST_GeomFromText('POINT(-1 -1)', 4326))])
|
||||
access([t1.c1], [t1.g], [t1.c0]), partitions(p0)
|
||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||
range_key([t1.__cellid_18], [t1.__mbr_18], [t1.c1]), range(383950835169648260,MIN,MIN ; 383950835169648260,MAX,MAX), (383950835169648272,MIN,MIN ;
|
||||
383950835169648272,MAX,MAX), (383950835169648320,MIN,MIN ; 383950835169648320,MAX,MAX), (383950835169648384,MIN,MIN ; 383950835169648384,MAX,MAX), (383950835169647616,
|
||||
MIN,MIN ; 383950835169647616,MAX,MAX), (383950835169644544,MIN,MIN ; 383950835169644544,MAX,MAX), (383950835169640448,MIN,MIN ; 383950835169640448,MAX,MAX),
|
||||
(383950835169689600,MIN,MIN ; 383950835169689600,MAX,MAX), (383950835169886208,MIN,MIN ; 383950835169886208,MAX,MAX), (383950835170672640,MIN,MIN ; 383950835170672640,
|
||||
MAX,MAX), (383950835173818368,MIN,MIN ; 383950835173818368,MAX,MAX), (383950835161235456,MIN,MIN ; 383950835161235456,MAX,MAX), (383950835144458240,MIN,
|
||||
MIN ; 383950835144458240,MAX,MAX), (383950835077349376,MIN,MIN ; 383950835077349376,MAX,MAX), (383950835882655744,MIN,MIN ; 383950835882655744,MAX,MAX),
|
||||
(383950839103881216,MIN,MIN ; 383950839103881216,MAX,MAX), (383950851988783104,MIN,MIN ; 383950851988783104,MAX,MAX), (383950903528390656,MIN,MIN ; 383950903528390656,
|
||||
MAX,MAX), (383950834808913920,MIN,MIN ; 383950834808913920,MAX,MAX), (383950559931006976,MIN,MIN ; 383950559931006976,MAX,MAX), (383953858465890304,MIN,
|
||||
MIN ; 383953858465890304,MAX,MAX), (383949460419379200,MIN,MIN ; 383949460419379200,MAX,MAX), (384002236977512448,MIN,MIN ; 384002236977512448,MAX,MAX),
|
||||
(384213343210045440,MIN,MIN ; 384213343210045440,MAX,MAX), (383931868233334784,MIN,MIN ; 383931868233334784,MAX,MAX), (382805968326492160,MIN,MIN ; 382805968326492160,
|
||||
MAX,MAX), (378302368699121664,MIN,MIN ; 378302368699121664,MAX,MAX), (360287970189639680,MIN,MIN ; 360287970189639680,MAX,MAX), (288230376151711744,MIN,
|
||||
MIN ; 288230376151711744,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (383950835169648257,MIN,MIN ; 383950835169648257,MAX,MAX)
|
||||
alter table t1 modify c0 varchar(20);
|
||||
explain SELECT /*+ index(t1 g) */ * from t1 where ST_INTERSECTS(g,ST_GeomFromText('POINT(-1 -1)', 4326));
|
||||
Query Plan
|
||||
================================================
|
||||
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
|
||||
------------------------------------------------
|
||||
|0 |TABLE FULL SCAN|t1(g)|1 |159 |
|
||||
================================================
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c0], [t1.g]), filter([ST_INTERSECTS(t1.g, ST_GeomFromText('POINT(-1 -1)', 4326))])
|
||||
access([t1.c1], [t1.g], [t1.c0]), partitions(p0)
|
||||
is_index_back=true, is_global_index=false, filter_before_indexback[false],
|
||||
range_key([t1.__cellid_18], [t1.__mbr_18], [t1.c1]), range(383950835169648260,MIN,MIN ; 383950835169648260,MAX,MAX), (383950835169648272,MIN,MIN ;
|
||||
383950835169648272,MAX,MAX), (383950835169648320,MIN,MIN ; 383950835169648320,MAX,MAX), (383950835169648384,MIN,MIN ; 383950835169648384,MAX,MAX), (383950835169647616,
|
||||
MIN,MIN ; 383950835169647616,MAX,MAX), (383950835169644544,MIN,MIN ; 383950835169644544,MAX,MAX), (383950835169640448,MIN,MIN ; 383950835169640448,MAX,MAX),
|
||||
(383950835169689600,MIN,MIN ; 383950835169689600,MAX,MAX), (383950835169886208,MIN,MIN ; 383950835169886208,MAX,MAX), (383950835170672640,MIN,MIN ; 383950835170672640,
|
||||
MAX,MAX), (383950835173818368,MIN,MIN ; 383950835173818368,MAX,MAX), (383950835161235456,MIN,MIN ; 383950835161235456,MAX,MAX), (383950835144458240,MIN,
|
||||
MIN ; 383950835144458240,MAX,MAX), (383950835077349376,MIN,MIN ; 383950835077349376,MAX,MAX), (383950835882655744,MIN,MIN ; 383950835882655744,MAX,MAX),
|
||||
(383950839103881216,MIN,MIN ; 383950839103881216,MAX,MAX), (383950851988783104,MIN,MIN ; 383950851988783104,MAX,MAX), (383950903528390656,MIN,MIN ; 383950903528390656,
|
||||
MAX,MAX), (383950834808913920,MIN,MIN ; 383950834808913920,MAX,MAX), (383950559931006976,MIN,MIN ; 383950559931006976,MAX,MAX), (383953858465890304,MIN,
|
||||
MIN ; 383953858465890304,MAX,MAX), (383949460419379200,MIN,MIN ; 383949460419379200,MAX,MAX), (384002236977512448,MIN,MIN ; 384002236977512448,MAX,MAX),
|
||||
(384213343210045440,MIN,MIN ; 384213343210045440,MAX,MAX), (383931868233334784,MIN,MIN ; 383931868233334784,MAX,MAX), (382805968326492160,MIN,MIN ; 382805968326492160,
|
||||
MAX,MAX), (378302368699121664,MIN,MIN ; 378302368699121664,MAX,MAX), (360287970189639680,MIN,MIN ; 360287970189639680,MAX,MAX), (288230376151711744,MIN,
|
||||
MIN ; 288230376151711744,MAX,MAX), (1152921504606846976,MIN,MIN ; 1152921504606846976,MAX,MAX), (383950835169648257,MIN,MIN ; 383950835169648257,MAX,MAX)
|
||||
drop table t1;
|
||||
drop table if exists tab;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'test.tab'
|
||||
CREATE TABLE tab(c1 int NOT NULL PRIMARY KEY,c2 POINT NOT NULL,c3 LINESTRING NOT NULL,c4 POLYGON NOT NULL,c5 GEOMETRY NOT NULL);
|
||||
CREATE INDEX index3 ON tab(c3) ;
|
||||
ALTER TABLE tab CHANGE COLUMN c3 c33 LINESTRING;
|
||||
drop table tab;
|
||||
|
@ -284,4 +284,15 @@ insert into t1 values (8,'{"b":2}', ST_GeomFromText('POLYGON((0 0, 0 2, 2 2, 2
|
||||
explain SELECT /*+ index(t1 g) */ * from t1 where ST_INTERSECTS(g,ST_GeomFromText('POINT(-1 -1)', 4326));
|
||||
alter table t1 drop column j;
|
||||
explain SELECT /*+ index(t1 g) */ * from t1 where ST_INTERSECTS(g,ST_GeomFromText('POINT(-1 -1)', 4326));
|
||||
drop table t1;
|
||||
alter table t1 add c0 char(20) before g;
|
||||
explain SELECT /*+ index(t1 g) */ * from t1 where ST_INTERSECTS(g,ST_GeomFromText('POINT(-1 -1)', 4326));
|
||||
alter table t1 modify c0 varchar(20);
|
||||
explain SELECT /*+ index(t1 g) */ * from t1 where ST_INTERSECTS(g,ST_GeomFromText('POINT(-1 -1)', 4326));
|
||||
drop table t1;
|
||||
|
||||
# bugfix:58073834
|
||||
drop table if exists tab;
|
||||
CREATE TABLE tab(c1 int NOT NULL PRIMARY KEY,c2 POINT NOT NULL,c3 LINESTRING NOT NULL,c4 POLYGON NOT NULL,c5 GEOMETRY NOT NULL);
|
||||
CREATE INDEX index3 ON tab(c3) ;
|
||||
ALTER TABLE tab CHANGE COLUMN c3 c33 LINESTRING;
|
||||
drop table tab;
|
Loading…
x
Reference in New Issue
Block a user