mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.6' into 10.9
This commit is contained in:
@@ -256,6 +256,43 @@ Alter_info::algorithm(const THD *thd) const
|
||||
}
|
||||
|
||||
|
||||
uint Alter_info::check_vcol_field(Item_field *item) const
|
||||
{
|
||||
if (!item->field &&
|
||||
((item->db_name.length && !db.streq(item->db_name)) ||
|
||||
(item->table_name.length && !table_name.streq(item->table_name))))
|
||||
{
|
||||
char *ptr= (char*)current_thd->alloc(item->db_name.length +
|
||||
item->table_name.length +
|
||||
item->field_name.length + 3);
|
||||
strxmov(ptr, safe_str(item->db_name.str), item->db_name.length ? "." : "",
|
||||
item->table_name.str, ".", item->field_name.str, NullS);
|
||||
item->field_name.str= ptr;
|
||||
return VCOL_IMPOSSIBLE;
|
||||
}
|
||||
for (Key &k: key_list)
|
||||
{
|
||||
if (k.type != Key::FOREIGN_KEY)
|
||||
continue;
|
||||
Foreign_key *fk= (Foreign_key*) &k;
|
||||
if (fk->update_opt < FK_OPTION_CASCADE &&
|
||||
fk->delete_opt < FK_OPTION_SET_NULL)
|
||||
continue;
|
||||
for (Key_part_spec& kp: fk->columns)
|
||||
{
|
||||
if (item->field_name.streq(kp.field_name))
|
||||
return VCOL_NON_DETERMINISTIC;
|
||||
}
|
||||
}
|
||||
for (Create_field &cf: create_list)
|
||||
{
|
||||
if (item->field_name.streq(cf.field_name))
|
||||
return cf.vcol_info ? cf.vcol_info->flags : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Alter_table_ctx::Alter_table_ctx()
|
||||
: db(null_clex_str), table_name(null_clex_str), alias(null_clex_str),
|
||||
new_db(null_clex_str), new_name(null_clex_str), new_alias(null_clex_str)
|
||||
|
Reference in New Issue
Block a user