Skip to content

Commit

Permalink
[CBRD-24571] assert() occurs when using DELETE/UPDATE including DBLINK (
Browse files Browse the repository at this point in the history
#3978)

http://jira.cubrid.org/browse/CBRD-24571

* change the call location for pt_resolve_dblink_server_name()
  • Loading branch information
ctshim authored Feb 9, 2023
1 parent 2c87b38 commit 679eca4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/parser/name_resolution.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,13 +1007,7 @@ pt_bind_scope (PARSER_CONTEXT * parser, PT_BIND_NAMES_ARG * bind_arg)
else if (table->node_type == PT_DBLINK_TABLE)
{
assert (spec->info.spec.derived_table_type == PT_DERIVED_DBLINK_TABLE);
if (table->info.dblink_table.is_name)
{
if (pt_resolve_dblink_server_name (parser, table) != NO_ERROR)
{
return;
}
}
assert (table->info.dblink_table.is_name == false || table->info.dblink_table.url != NULL);

table->info.dblink_table.cols =
parser_walk_tree (parser, table->info.dblink_table.cols, pt_bind_name_to_spec, spec, NULL, NULL);
Expand Down Expand Up @@ -4282,6 +4276,18 @@ pt_flat_spec_pre (PARSER_CONTEXT * parser, PT_NODE * node, void *arg, int *conti
node->info.spec.id = (UINTPTR) node;
}

if (derived_table->node_type == PT_DBLINK_TABLE)
{
assert (node->info.spec.derived_table_type == PT_DERIVED_DBLINK_TABLE);
if (derived_table->info.dblink_table.is_name && derived_table->info.dblink_table.url == NULL)
{
if (pt_resolve_dblink_server_name (parser, derived_table) != NO_ERROR)
{
return NULL;
}
}
}

parser_walk_tree (parser, derived_table, pt_flat_spec_pre, info, pt_continue_walk, NULL);
}
else
Expand Down

0 comments on commit 679eca4

Please sign in to comment.