From 62dd7e5183b6c01b7ba996a5f09af2cffdbd8a25 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Sep 2006 14:50:46 +0500 Subject: Bug#20922 mysql removes a name of first column in a table 0xFF is internal separator for SET|ENUM names. If this symbol is present in SET|ENUM names then we replace it with ','(deprecated symbol for SET|ENUM names) during frm creation and restore to 0xFF during frm opening mysql-test/r/type_enum.result: Bug#20922 mysql removes a name of first column in a table test case mysql-test/t/type_enum.test: Bug#20922 mysql removes a name of first column in a table test case sql/table.cc: Bug#20922 mysql removes a name of first column in a table Replace all ',' symbols with NAMES_SEP_CHAR in interval names. sql/unireg.cc: Bug#20922 mysql removes a name of first column in a table if NAMES_SEP_CHAR symbols are present in interval name then replace all NAMES_SEP_CHAR symbols with ',' --- sql/table.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sql/table.cc') diff --git a/sql/table.cc b/sql/table.cc index 7587531b2f9..f22caf36679 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -387,7 +387,21 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, count))) goto err_not_open; for (count= 0; count < interval->count; count++) - interval->type_lengths[count]= strlen(interval->type_names[count]); + { + char *val= (char*) interval->type_names[count]; + interval->type_lengths[count]= strlen(val); + /* + Replace all ',' symbols with NAMES_SEP_CHAR. + See the comment in unireg.cc, pack_fields() function + for details. + */ + for (uint cnt= 0 ; cnt < interval->type_lengths[count] ; cnt++) + { + char c= val[cnt]; + if (c == ',') + val[cnt]= NAMES_SEP_CHAR; + } + } interval->type_lengths[count]= 0; } } -- cgit v1.2.1 From 5389cc169abd3853145d7bb1d0f6dbce214eacea Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Sep 2006 12:16:07 +0500 Subject: bug #16813 (WITH CHECK OPTION fails with UPDATE) We use the condition from CHECK OPTION twice handling UPDATE command. First we construnct 'update_cond' AND 'option_cond' condition to select records to be updated, then we check the 'option_cond' for the updated row. The problem is that first 'AND' condition is optimized during the 'select' which can break 'option_cond' structure, so it will be unusable for the sectond use - to check the updated row. Possible soultion is either use copy of the condition in the first use or to make optimization less traumatic for the operands. I picked the first one. mysql-test/r/view.result: result fixed mysql-test/t/view.test: testcase sql/table.cc: now we use the copy of the CHECK OPTION condition to construct the select's condition --- sql/table.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/table.cc') diff --git a/sql/table.cc b/sql/table.cc index 054736401ff..d7b474eca02 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1965,12 +1965,13 @@ bool st_table_list::prep_where(THD *thd, Item **conds, this expression will not be moved to WHERE condition (i.e. will be clean correctly for PS/SP) */ - tbl->on_expr= and_conds(tbl->on_expr, where); + tbl->on_expr= and_conds(tbl->on_expr, + where->copy_andor_structure(thd)); break; } } if (tbl == 0) - *conds= and_conds(*conds, where); + *conds= and_conds(*conds, where->copy_andor_structure(thd)); if (arena) thd->restore_active_arena(arena, &backup); where_processed= TRUE; -- cgit v1.2.1