1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-14576 Include full name of object in message about incorrect value for column.

The error message modified.
Then the TABLE_SHARE::error_table_name() implementation taken from 10.3,
          to be used as a name of the table in this message.
This commit is contained in:
Alexey Botchkov
2018-12-16 02:21:41 +04:00
parent 0a2edddbf4
commit c4ab352b67
100 changed files with 1494 additions and 1422 deletions

View File

@@ -9546,6 +9546,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err_new_table_cleanup;
}
}
new_table->s->orig_table_name= table->s->table_name.str;
/*
Note: In case of MERGE table, we do not attach children. We do not
copy data for MERGE tables. Only the children have data.
@@ -9768,16 +9770,6 @@ end_temporary:
err_new_table_cleanup:
my_free(const_cast<uchar*>(frm.str));
if (new_table)
{
thd->drop_temporary_table(new_table, NULL, true);
}
else
(void) quick_rm_table(thd, new_db_type,
alter_ctx.new_db, alter_ctx.tmp_name,
(FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)),
alter_ctx.get_tmp_path());
/*
No default value was provided for a DATE/DATETIME field, the
current sql_mode doesn't allow the '0000-00-00' value and
@@ -9809,10 +9801,22 @@ err_new_table_cleanup:
thd->abort_on_warning= true;
make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN,
f_val, strlength(f_val), t_type,
new_table->s,
alter_ctx.datetime_field->field_name);
thd->abort_on_warning= save_abort_on_warning;
}
if (new_table)
{
thd->drop_temporary_table(new_table, NULL, true);
}
else
(void) quick_rm_table(thd, new_db_type,
alter_ctx.new_db, alter_ctx.tmp_name,
(FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)),
alter_ctx.get_tmp_path());
DBUG_RETURN(true);
err_with_mdl_after_alter: