diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 9ca92fe75df..46cf2d161ef 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -216,3 +216,7 @@ select * from t1; a b 0 2 drop table t1; +create table t1(f1 int, `*f2` int); +insert into t1 values (1,1); +update t1 set `*f2`=1; +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 6c7b450f763..fcd17dc75f0 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -174,3 +174,11 @@ insert into t1 values (0, '1'); update t1 set b = b + 1 where a = 0; select * from t1; drop table t1; + +# +# Bug #16510 Updating field named like '*name' caused server crash +# +create table t1(f1 int, `*f2` int); +insert into t1 values (1,1); +update t1 set `*f2`=1; +drop table t1; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 4f52904a61e..42a2e692d21 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1983,6 +1983,7 @@ int setup_fields(THD *thd, TABLE_LIST *tables, List &fields, */ if (item->type() == Item::FIELD_ITEM && ((Item_field*) item)->field_name[0] == '*' && + ((Item_field*) item)->field_name[1] == 0 && !((Item_field*) item)->field) { uint elem=fields.elements;