summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/myisam.h2
-rw-r--r--myisam/myisamchk.c5
-rw-r--r--mysql-test/r/innodb.result2
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/sql_parse.cc7
5 files changed, 11 insertions, 8 deletions
diff --git a/include/myisam.h b/include/myisam.h
index 6cc219de6e8..39cc61ad204 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -390,7 +390,7 @@ typedef struct st_sort_key_blocks /* Used when sorting */
typedef enum
{
/* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
- MI_STATS_METHOD_NULLS_NOT_EQUAL=1,
+ MI_STATS_METHOD_NULLS_NOT_EQUAL,
/* Treat NULLs as equal when collecting statistics (like 4.0 did) */
MI_STATS_METHOD_NULLS_EQUAL
} enum_mi_stats_method;
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index cfc3930779f..10308408b1f 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -698,15 +698,14 @@ get_one_option(int optid,
break;
case OPT_STATS_METHOD:
{
- myisam_stats_method_str= argument;
int method;
+ myisam_stats_method_str= argument;
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
{
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
exit(1);
}
- check_param.stats_method= test(method-1)? MI_STATS_METHOD_NULLS_EQUAL :
- MI_STATS_METHOD_NULLS_NOT_EQUAL;
+ check_param.stats_method= method-1;
break;
}
#ifdef DEBUG /* Only useful if debugging */
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 4dd1d694401..ffc4ab08ab4 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1785,7 +1785,7 @@ Variable_name Value
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 31725
+Innodb_rows_inserted 31727
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29530
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ad2b6c5fd68..e00c0254661 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -6767,6 +6767,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Unknown option to tc-heuristic-recover: %s\n",argument);
exit(1);
}
+ }
case OPT_MYISAM_STATS_METHOD:
{
myisam_stats_method_str= argument;
@@ -6776,7 +6777,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument);
exit(1);
}
- global_system_variables.myisam_stats_method= method;
+ global_system_variables.myisam_stats_method= method-1;
break;
}
case OPT_SQL_MODE:
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 8c3f9090529..d90fb0b0c99 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -7175,8 +7175,11 @@ bool multi_delete_set_locks_and_link_aux_tables(LEX *lex)
target_tbl->table_name, "MULTI DELETE");
DBUG_RETURN(TRUE);
}
- target_tbl->table_name= walk->table_name;
- target_tbl->table_name_length= walk->table_name_length;
+ if (!walk->derived)
+ {
+ target_tbl->table_name= walk->table_name;
+ target_tbl->table_name_length= walk->table_name_length;
+ }
walk->updating= target_tbl->updating;
walk->lock_type= target_tbl->lock_type;
target_tbl->correspondent_table= walk; // Remember corresponding table