{
rows_hint = current_hint->rows_hints[i];
+ /*
+ * This Rows hint specifies aliasname is error, or does not exist in
+ * query.
+ */
+ if (!rows_hint->joinrelids ||
+ rows_hint->base.state == HINT_STATE_ERROR)
+ continue;
if (bms_equal(joinrelids, rows_hint->joinrelids))
{
/*
if (relid == -1)
base->state = HINT_STATE_ERROR;
+ /*
+ * the aliasname is not found(relid == 0) or same aliasname was used
+ * multiple times in a query(relid == -1)
+ */
if (relid <= 0)
+ {
+ relids = NULL;
break;
-
+ }
if (bms_is_member(relid, relids))
{
hint_ereport(base->hint_str,
hint->joinrelids = create_bms_of_relids(&(hint->base), root,
initial_rels, hint->nrels, hint->relnames);
-
- if (hint->joinrelids == NULL || hint->base.state == HINT_STATE_ERROR)
- continue;
}
/* Do nothing if no Leading hint was supplied. */