diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2016-06-20 15:26:05 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2016-06-20 15:26:05 +0200 |
commit | f2dded9bac48de391cdd796283769691872ba911 (patch) | |
tree | f8d7b93968d821c4c93528f299e62a52c357ed32 | |
parent | 0a96c9c4aab671ddcd1ac6af2c0bacf84405b0ff (diff) | |
parent | a80dbe068ca650ef1f4daee2263f0bc6e7aeb0e1 (diff) | |
download | mariadb-git-f2dded9bac48de391cdd796283769691872ba911.tar.gz |
Merge branch '10.0' of https://github.com/MariaDB/server into 10.0
-rw-r--r-- | mysql-test/r/contributors.result | 2 | ||||
-rw-r--r-- | mysql-test/r/func_in.result | 19 | ||||
-rw-r--r-- | mysql-test/r/information_schema_stats.result | 70 | ||||
-rw-r--r-- | mysql-test/r/status_user.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_datetime.result | 8 | ||||
-rw-r--r-- | mysql-test/t/bootstrap.test | 10 | ||||
-rw-r--r-- | mysql-test/t/func_in.test | 21 | ||||
-rw-r--r-- | mysql-test/t/information_schema_stats.test | 44 | ||||
-rw-r--r-- | mysql-test/t/type_datetime.test | 8 | ||||
-rw-r--r-- | mysys/my_context.c | 4 | ||||
-rw-r--r-- | scripts/mysql_install_db.pl.in | 2 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 2 | ||||
-rw-r--r-- | sql/contributors.h | 2 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 | ||||
-rw-r--r-- | sql/sql_show.cc | 118 | ||||
-rw-r--r-- | sql/sql_show.h | 3 | ||||
-rw-r--r-- | sql/sql_statistics.cc | 9 | ||||
-rw-r--r-- | sql/winservice.c | 13 | ||||
-rw-r--r-- | storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff | 36 | ||||
-rw-r--r-- | win/packaging/ca/CustomAction.cpp | 4 |
20 files changed, 325 insertions, 56 deletions
diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result index 1820c0a5f06..1e01ca81990 100644 --- a/mysql-test/r/contributors.result +++ b/mysql-test/r/contributors.result @@ -7,7 +7,7 @@ Visma http://visma.com Member of the MariaDB Foundation Nexedi http://www.nexedi.com Member of the MariaDB Foundation Acronis http://www.acronis.com Member of the MariaDB Foundation Verkkokauppa.com Finland Sponsor of the MariaDB Foundation -Webyog Bangalore Sponsor of the MariaDB Foundation +Virtuozzo https://virtuozzo.com/ Sponsor of the MariaDB Foundation Google USA Sponsoring encryption, parallel replication and GTID Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index fc56660ac62..210b0a9ef91 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -812,3 +812,22 @@ EXECUTE s; 1 DROP TABLE t1; # End of 5.3 tests +# +# Start of 10.0 tests +# +# +# MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL +# +CREATE TABLE t1 +( +a INT(11), +b VARCHAR(10), +KEY (b) +); +INSERT INTO t1 VALUES (1,'x'),(2,'y'),(3,'z'); +SELECT * FROM t1 WHERE b NOT IN (NULL, '', 'A'); +a b +DROP TABLE t1; +# +# End of 10.0 tests +# diff --git a/mysql-test/r/information_schema_stats.result b/mysql-test/r/information_schema_stats.result new file mode 100644 index 00000000000..cd73636879c --- /dev/null +++ b/mysql-test/r/information_schema_stats.result @@ -0,0 +1,70 @@ +set global userstat=1; +create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +alter table just_a_test add primary key (id); +alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name); +alter table just_a_test add key IND_just_a_test_state(state); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +count(*) +1 +select count(*) from just_a_test where state = 'California'; +count(*) +2 +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +test just_a_test IND_just_a_test_state 2 +test just_a_test IND_just_a_test_first_name_last_name 1 +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 18 5 5 +alter table just_a_test drop key IND_just_a_test_first_name_last_name; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +test just_a_test IND_just_a_test_state 2 +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 23 5 5 +alter table just_a_test drop column state; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 28 5 5 +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +count(*) +1 +select count(*) from just_a_test where state = 'California'; +count(*) +2 +select count(*) from just_a_test where id between 2 and 4; +count(*) +3 +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +test just_a_test first_name 1 +test just_a_test state 2 +test just_a_test PRIMARY 5 +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 8 5 15 +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +set global userstat=0; diff --git a/mysql-test/r/status_user.result b/mysql-test/r/status_user.result index 829c8abb634..c6248a85d3a 100644 --- a/mysql-test/r/status_user.result +++ b/mysql-test/r/status_user.result @@ -128,16 +128,12 @@ handler_read_key set @@global.userstat=0; select * from information_schema.index_statistics; TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ -test t1 PRIMARY 2 select * from information_schema.table_statistics; TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES -test t1 6 13 13 show table_statistics; Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes -test t1 6 13 13 show index_statistics; Table_schema Table_name Index_name Rows_read -test t1 PRIMARY 2 select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;; TOTAL_CONNECTIONS 1 CONCURRENT_CONNECTIONS 0 diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 82b64d30d96..e033fe48607 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -834,5 +834,13 @@ a b a b DEALLOCATE PREPARE stmt1; DROP TABLE t1,t2; # +# MDEV-9374 having '2015-01-01 01:00:00.000001' > coalesce(NULL) returns true +# +CREATE TABLE t1 (c1 DATETIME(0)); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1 HAVING '2015-01-01 01:00:00.000001' > COALESCE(c1); +c1 +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index e2d21c0d990..f92b7c5b148 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -89,3 +89,13 @@ drop table t1; --replace_result .dll .so select * from mysql.plugin; truncate table mysql.plugin; + + +# +# MDEV-9969 mysql_install_db error processing ignore_db_dirs. +# +--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql +use test; +EOF +--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 1e695142d90..17736ac40c6 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -606,3 +606,24 @@ EXECUTE s; DROP TABLE t1; --echo # End of 5.3 tests + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL +--echo # +CREATE TABLE t1 +( + a INT(11), + b VARCHAR(10), + KEY (b) +); +INSERT INTO t1 VALUES (1,'x'),(2,'y'),(3,'z'); +SELECT * FROM t1 WHERE b NOT IN (NULL, '', 'A'); +DROP TABLE t1; + +--echo # +--echo # End of 10.0 tests +--echo # diff --git a/mysql-test/t/information_schema_stats.test b/mysql-test/t/information_schema_stats.test new file mode 100644 index 00000000000..38248063d68 --- /dev/null +++ b/mysql-test/t/information_schema_stats.test @@ -0,0 +1,44 @@ +# +# MDEV-8633: information_schema.index_statistics doesn't delete item when drop table indexes or drop table; +# +set global userstat=1; +create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +alter table just_a_test add primary key (id); +alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name); +alter table just_a_test add key IND_just_a_test_state(state); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +select count(*) from just_a_test where state = 'California'; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +alter table just_a_test drop key IND_just_a_test_first_name_last_name; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +alter table just_a_test drop column state; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +# +# Test direct drop table +# +create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +select count(*) from just_a_test where state = 'California'; +select count(*) from just_a_test where id between 2 and 4; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +set global userstat=0; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index e44b190def0..3f96673c43f 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -611,5 +611,13 @@ DEALLOCATE PREPARE stmt1; DROP TABLE t1,t2; --echo # +--echo # MDEV-9374 having '2015-01-01 01:00:00.000001' > coalesce(NULL) returns true +--echo # +CREATE TABLE t1 (c1 DATETIME(0)); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1 HAVING '2015-01-01 01:00:00.000001' > COALESCE(c1); +DROP TABLE t1; + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysys/my_context.c b/mysys/my_context.c index 60c0014b3b9..e4ca4143baf 100644 --- a/mysys/my_context.c +++ b/mysys/my_context.c @@ -206,7 +206,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) ( "movq %%rsp, (%[save])\n\t" "movq %[stack], %%rsp\n\t" -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER) /* This emits a DWARF DW_CFA_undefined directive to make the return address undefined. This indicates that this is the top of the stack frame, and @@ -454,7 +454,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) ( "movl %%esp, (%[save])\n\t" "movl %[stack], %%esp\n\t" -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER) /* This emits a DWARF DW_CFA_undefined directive to make the return address undefined. This indicates that this is the top of the stack frame, and diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index 4d3641397d0..ede5fabd3aa 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -238,7 +238,7 @@ sub quote_options { ############################################################################## my $opt = {}; -parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV); +parse_arguments($opt, @ARGV); # ---------------------------------------------------------------------- # We can now find my_print_defaults. This script supports: diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index d08d04914ee..bdce0857d1e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -216,7 +216,7 @@ cannot_find_file() # Ok, let's go. We first need to parse arguments which are required by # my_print_defaults so that we can execute it first, then later re-parse # the command line to add any extra bits that we need. -parse_arguments PICK-ARGS-FROM-ARGV "$@" +parse_arguments "$@" # # We can now find my_print_defaults. This script supports: diff --git a/sql/contributors.h b/sql/contributors.h index 04f8b74aa65..76674d654e5 100644 --- a/sql/contributors.h +++ b/sql/contributors.h @@ -46,7 +46,7 @@ struct show_table_contributors_st show_table_contributors[]= { /* Smaller sponsors, newer per year */ {"Verkkokauppa.com", "Finland", "Sponsor of the MariaDB Foundation"}, - {"Webyog", "Bangalore", "Sponsor of the MariaDB Foundation"}, + {"Virtuozzo", "https://virtuozzo.com/", "Sponsor of the MariaDB Foundation"}, /* Sponsors of important features */ {"Google", "USA", "Sponsoring encryption, parallel replication and GTID"}, diff --git a/sql/opt_range.cc b/sql/opt_range.cc index f051ed07a7e..ae5899d8de4 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7730,7 +7730,7 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func, break; } SEL_TREE *tree2; - for (; i < func->array->count; i++) + for (; i < func->array->used_count; i++) { if (func->array->compare_elems(i, i-1)) { diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b8926b986b0..97f6b863058 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -720,12 +720,24 @@ ignore_db_dirs_process_additions() for (i= 0; i < ignore_db_dirs_array.elements; i++) { get_dynamic(&ignore_db_dirs_array, (uchar *) &dir, i); - if (my_hash_insert(&ignore_db_dirs_hash, (uchar *) dir)) + if (my_hash_insert(&ignore_db_dirs_hash, (uchar *)dir)) + { + /* ignore duplicates from the config file */ + if (my_hash_search(&ignore_db_dirs_hash, (uchar *)dir->str, dir->length)) + { + sql_print_warning("Duplicate ignore-db-dir directory name '%.*s' " + "found in the config file(s). Ignoring the duplicate.", + (int) dir->length, dir->str); + my_free(dir); + goto continue_loop; + } + return true; + } ptr= strnmov(ptr, dir->str, dir->length); - if (i + 1 < ignore_db_dirs_array.elements) - ptr= strmov(ptr, ","); + *(ptr++)= ','; +continue_loop: /* Set the transferred array element to NULL to avoid double free in case of error. @@ -734,6 +746,12 @@ ignore_db_dirs_process_additions() set_dynamic(&ignore_db_dirs_array, (uchar *) &dir, i); } + if (ptr > opt_ignore_db_dirs) + { + ptr--; + DBUG_ASSERT(*ptr == ','); + } + /* make sure the string is terminated */ DBUG_ASSERT(ptr - opt_ignore_db_dirs <= (ptrdiff_t) len); *ptr= 0; @@ -3442,6 +3460,100 @@ int fill_schema_table_stats(THD *thd, TABLE_LIST *tables, COND *cond) DBUG_RETURN(0); } +/* Remove all indexes for a given table from global index statistics */ + +static +int del_global_index_stats_for_table(THD *thd, uchar* cache_key, uint cache_key_length) +{ + int res = 0; + DBUG_ENTER("del_global_index_stats_for_table"); + + mysql_mutex_lock(&LOCK_global_index_stats); + + for (uint i= 0; i < global_index_stats.records;) + { + INDEX_STATS *index_stats = + (INDEX_STATS*) my_hash_element(&global_index_stats, i); + + /* We search correct db\0table_name\0 string */ + if (index_stats && + index_stats->index_name_length >= cache_key_length && + !memcmp(index_stats->index, cache_key, cache_key_length)) + { + res= my_hash_delete(&global_index_stats, (uchar*)index_stats); + /* + In our HASH implementation on deletion one elements + is moved into a place where a deleted element was, + and the last element is moved into the empty space. + Thus we need to re-examine the current element, but + we don't have to restart the search from the beginning. + */ + } + else + i++; + } + + mysql_mutex_unlock(&LOCK_global_index_stats); + DBUG_RETURN(res); +} + +/* Remove a table from global table statistics */ + +int del_global_table_stat(THD *thd, LEX_STRING *db, LEX_STRING *table) +{ + TABLE_STATS *table_stats; + int res = 0; + uchar *cache_key; + uint cache_key_length; + DBUG_ENTER("del_global_table_stat"); + + cache_key_length= db->length + 1 + table->length + 1; + + if(!(cache_key= (uchar *)my_malloc(cache_key_length, + MYF(MY_WME | MY_ZEROFILL)))) + { + /* Out of memory error already given */ + res = 1; + goto end; + } + + memcpy(cache_key, db->str, db->length); + memcpy(cache_key + db->length + 1, table->str, table->length); + + res= del_global_index_stats_for_table(thd, cache_key, cache_key_length); + + mysql_mutex_lock(&LOCK_global_table_stats); + + if((table_stats= (TABLE_STATS*) my_hash_search(&global_table_stats, + cache_key, + cache_key_length))) + res= my_hash_delete(&global_table_stats, (uchar*)table_stats); + + my_free(cache_key); + mysql_mutex_unlock(&LOCK_global_table_stats); + +end: + DBUG_RETURN(res); +} + +/* Remove a index from global index statistics */ + +int del_global_index_stat(THD *thd, TABLE* table, KEY* key_info) +{ + INDEX_STATS *index_stats; + uint key_length= table->s->table_cache_key.length + key_info->name_length + 1; + int res = 0; + DBUG_ENTER("del_global_index_stat"); + mysql_mutex_lock(&LOCK_global_index_stats); + + if((index_stats= (INDEX_STATS*) my_hash_search(&global_index_stats, + key_info->cache_name, + key_length))) + res= my_hash_delete(&global_index_stats, (uchar*)index_stats); + + mysql_mutex_unlock(&LOCK_global_index_stats); + DBUG_RETURN(res); +} /* Fill information schema table with index statistics */ diff --git a/sql/sql_show.h b/sql/sql_show.h index 84064ae0a05..9ca60557cc0 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -113,7 +113,8 @@ void view_store_options(THD *thd, TABLE_LIST *table, String *buff); void init_fill_schema_files_row(TABLE* table); bool schema_table_store_record(THD *thd, TABLE *table); void initialize_information_schema_acl(); - +int del_global_index_stat(THD *thd, TABLE* tab, KEY* key_info); +int del_global_table_stat(THD *thd, LEX_STRING *db, LEX_STRING *table); ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name); ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx); int make_schema_select(THD *thd, SELECT_LEX *sel, diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index e86c84040b4..47a5a40ebeb 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -29,6 +29,7 @@ #include "sql_statistics.h" #include "opt_range.h" #include "my_atomic.h" +#include "sql_show.h" /* The system variable 'use_stat_tables' can take one of the @@ -3193,6 +3194,10 @@ int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab) rc= 1; } + err= del_global_table_stat(thd, db, tab); + if (err & !rc) + rc= 1; + thd->restore_stmt_binlog_format(save_binlog_format); close_system_tables(thd, &open_tables_backup); @@ -3339,6 +3344,10 @@ int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info, } } + err= del_global_index_stat(thd, tab, key_info); + if (err && !rc) + rc= 1; + thd->restore_stmt_binlog_format(save_binlog_format); close_system_tables(thd, &open_tables_backup); diff --git a/sql/winservice.c b/sql/winservice.c index 1cf9f8d7823..74e9e56acc6 100644 --- a/sql/winservice.c +++ b/sql/winservice.c @@ -81,8 +81,10 @@ void normalize_path(char *path, size_t size) and services. We do not want to mess up with these installations. We will just ignore such services, pretending it is not MySQL. - ´@return - TRUE, if this service should be excluded from UI lists etc (OEM install) + We also exclude MySQL5.7+ since we cannot upgrade it (and it is not an upgrade anyway) + + @return + TRUE, if this service should be excluded from UI lists etc FALSE otherwise. */ BOOL exclude_service(mysqld_service_properties *props) @@ -104,7 +106,12 @@ BOOL exclude_service(mysqld_service_properties *props) if (strstr(buf, exclude_patterns[i])) return TRUE; } - + if ((props->version_major == 0) || + (props->version_major > 5 && props->version_major < 10) || + (props->version_major == 5 && props->version_minor > 6)) + { + return TRUE; + } return FALSE; } diff --git a/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff b/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff index 3a7fef61d3b..5ae99e2035c 100644 --- a/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff +++ b/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff @@ -1,41 +1,5 @@ --- suite/storage_engine/alter_table_online.result 2013-11-08 20:01:16.000000000 +0400 +++ suite/storage_engine/alter_table_online.reject 2013-11-08 20:02:03.000000000 +0400 -@@ -2,8 +2,35 @@ - CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; - INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); - ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5; -+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. -+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) -+# ------------ UNEXPECTED RESULT ------------ -+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. -+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. -+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. -+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. -+# Also, this problem may cause a chain effect (more errors of different kinds in the test). -+# ------------------------------------------- - ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>; -+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. -+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) -+# ------------ UNEXPECTED RESULT ------------ -+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. -+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. -+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. -+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. -+# Also, this problem may cause a chain effect (more errors of different kinds in the test). -+# ------------------------------------------- - ALTER ONLINE TABLE t1 COMMENT 'new comment'; -+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. -+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) -+# ------------ UNEXPECTED RESULT ------------ -+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. -+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. -+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. -+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. -+# Also, this problem may cause a chain effect (more errors of different kinds in the test). -+# ------------------------------------------- - ALTER ONLINE TABLE t1 RENAME TO t2; - ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. - DROP TABLE IF EXISTS t2; @@ -23,12 +50,30 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index 3cb8520b65d..56df4ae791e 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -886,11 +886,11 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall) (QUERY_SERVICE_CONFIGW*)(void *)config_buffer; DWORD needed; BOOL ok= QueryServiceConfigW(service, config,sizeof(config_buffer), - &needed); + &needed) && (config->dwStartType != SERVICE_DISABLED); CloseServiceHandle(service); if (ok) { - mysqld_service_properties props; + mysqld_service_properties props; if (get_mysql_service_properties(config->lpBinaryPathName, &props)) continue; /* |