Skip to content

Commit

Permalink
[CBRD-24638] The problem of the default value of column when altering…
Browse files Browse the repository at this point in the history
… the type of column.
  • Loading branch information
beyondykk9 committed Jan 26, 2023
1 parent a6e638b commit 6270c21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/query/execute_schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -13873,6 +13873,14 @@ check_change_attribute (PARSER_CONTEXT * parser, DB_CTMPL * ctemplate, PT_NODE *
}
}

if (is_att_prop_set (attr_chg_prop->p[P_DEFAULT_VALUE], ATT_CHG_PROPERTY_PRESENT_OLD) &&
(is_att_prop_set (attr_chg_prop->p[P_TYPE], ATT_CHG_TYPE_NEED_ROW_CHECK)
|| is_att_prop_set (attr_chg_prop->p[P_TYPE], ATT_CHG_TYPE_PSEUDO_UPGRADE)))
{
error = ER_ALTER_CHANGE_CAST_FAILED_SET_DEFAULT;
er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, error, 0);
}

exit:
db_value_clear (&def_value);
return error;
Expand Down

0 comments on commit 6270c21

Please sign in to comment.