summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-11-23 19:40:47 +0100
committerSergei Golubchik <serg@mariadb.org>2020-11-25 22:19:59 +0100
commit00f54b56b1eca3e4daf737107dd9097d9634f9ac (patch)
tree16cb53938925139c960d3186bf620219efd33285 /sql/unireg.cc
parent08b0b70daa43a539d911238e25998f7450bab9e6 (diff)
downloadmariadb-git-00f54b56b1eca3e4daf737107dd9097d9634f9ac.tar.gz
cleanup: RAII helper for changing thd->count_cuted_rows
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 3e5403ab878..b31e3542463 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -1032,7 +1032,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
TABLE table;
TABLE_SHARE share;
Create_field *field;
- enum_check_fields old_count_cuted_fields= thd->count_cuted_fields;
DBUG_ENTER("make_empty_rec");
/* We need a table to generate columns for default values */
@@ -1051,7 +1050,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
null_pos= buff;
List_iterator<Create_field> it(create_fields);
- thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values
+ Check_level_instant_set check_level_save(thd, CHECK_FIELD_WARN);
while ((field=it++))
{
/* regfield don't have to be deleted as it's allocated on THD::mem_root */
@@ -1131,6 +1130,5 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
*(null_pos + null_count / 8)|= ~(((uchar) 1 << (null_count & 7)) - 1);
err:
- thd->count_cuted_fields= old_count_cuted_fields;
DBUG_RETURN(error);
} /* make_empty_rec */