diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-25 10:18:22 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-25 10:18:22 +0300 |
commit | fba9883bc4ee4e35ed6aa095056981acbfe9f6b2 (patch) | |
tree | beb5d354218d58c6f40e7506ea74102b4be0bb83 | |
parent | 8e92d5e5e3842fbb805304f1d0e4f5b1def9a145 (diff) | |
parent | d3350c160a7a884e97a5e4a696432230c13d53e0 (diff) | |
download | mariadb-git-fba9883bc4ee4e35ed6aa095056981acbfe9f6b2.tar.gz |
Merge 10.4 into 10.5
43 files changed, 279 insertions, 141 deletions
diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake index 50a2b21c838..6fde915165f 100644 --- a/cmake/os/Linux.cmake +++ b/cmake/os/Linux.cmake @@ -26,9 +26,9 @@ SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE=1) # Fix CMake (< 2.8) flags. -rdynamic exports too many symbols. FOREACH(LANG C CXX) - STRING(REPLACE "-rdynamic" "" + STRING(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS - ${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS} + "${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}" ) ENDFOREACH() diff --git a/mysql-test/main/ctype_binary.result b/mysql-test/main/ctype_binary.result index 758c456754c..b736589199b 100644 --- a/mysql-test/main/ctype_binary.result +++ b/mysql-test/main/ctype_binary.result @@ -102,7 +102,7 @@ create table t1 as select concat(1 % 2) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varbinary(1) DEFAULT NULL + `c1` varbinary(2) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(-1)); diff --git a/mysql-test/main/ctype_cp1251.result b/mysql-test/main/ctype_cp1251.result index 548335af8ae..03a0d413023 100644 --- a/mysql-test/main/ctype_cp1251.result +++ b/mysql-test/main/ctype_cp1251.result @@ -511,7 +511,7 @@ create table t1 as select concat(1 % 2) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL + `c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(-1)); diff --git a/mysql-test/main/ctype_latin1.result b/mysql-test/main/ctype_latin1.result index 62ab83a70a2..a4925af69ae 100644 --- a/mysql-test/main/ctype_latin1.result +++ b/mysql-test/main/ctype_latin1.result @@ -820,7 +820,7 @@ create table t1 as select concat(1 % 2) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(1) DEFAULT NULL + `c1` varchar(2) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(-1)); diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result index 5a4119bbe51..fba779f5881 100644 --- a/mysql-test/main/ctype_ucs.result +++ b/mysql-test/main/ctype_ucs.result @@ -1704,7 +1704,7 @@ create table t1 as select concat(1 % 2) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL + `c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(-1)); diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result index 63336fc03ea..9cb7fc0ad76 100644 --- a/mysql-test/main/ctype_utf8.result +++ b/mysql-test/main/ctype_utf8.result @@ -2571,7 +2571,7 @@ create table t1 as select concat(1 % 2) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(-1)); diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result index 44c8622b522..968d394117a 100644 --- a/mysql-test/main/func_math.result +++ b/mysql-test/main/func_math.result @@ -817,6 +817,64 @@ STDDEV_SAMP(ROUND('0', 309)) 0 DROP TABLE t1; # +# MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal +# +# Testing that dyadic arithmetic operations are symmetric +# for (+1) and (-1) and produce the same length in CONCAT(), +# because (+1) and (-1) have the same data type: signed int. +CREATE TABLE t1 AS SELECT +CONCAT(+1%2.0), +CONCAT(-1%2.0), +CONCAT(+1/2.0), +CONCAT(-1/2.0), +CONCAT(+1*2.0), +CONCAT(-1*2.0), +CONCAT(+1+2.0), +CONCAT(-1+2.0), +CONCAT(+1-2.0), +CONCAT(-1-2.0); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CONCAT(+1%2.0)` varchar(4) DEFAULT NULL, + `CONCAT(-1%2.0)` varchar(4) DEFAULT NULL, + `CONCAT(+1/2.0)` varchar(8) DEFAULT NULL, + `CONCAT(-1/2.0)` varchar(8) DEFAULT NULL, + `CONCAT(+1*2.0)` varchar(5) DEFAULT NULL, + `CONCAT(-1*2.0)` varchar(5) DEFAULT NULL, + `CONCAT(+1+2.0)` varchar(5) DEFAULT NULL, + `CONCAT(-1+2.0)` varchar(5) DEFAULT NULL, + `CONCAT(+1-2.0)` varchar(5) DEFAULT NULL, + `CONCAT(-1-2.0)` varchar(5) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT +CONCAT(+1%2), +CONCAT(-1%2), +CONCAT(+1/2), +CONCAT(-1/2), +CONCAT(+1*2), +CONCAT(-1*2), +CONCAT(+1+2), +CONCAT(-1+2), +CONCAT(+1-2), +CONCAT(-1-2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CONCAT(+1%2)` varchar(2) DEFAULT NULL, + `CONCAT(-1%2)` varchar(2) DEFAULT NULL, + `CONCAT(+1/2)` varchar(7) DEFAULT NULL, + `CONCAT(-1/2)` varchar(7) DEFAULT NULL, + `CONCAT(+1*2)` varchar(3) DEFAULT NULL, + `CONCAT(-1*2)` varchar(3) DEFAULT NULL, + `CONCAT(+1+2)` varchar(3) DEFAULT NULL, + `CONCAT(-1+2)` varchar(3) DEFAULT NULL, + `CONCAT(+1-2)` varchar(3) DEFAULT NULL, + `CONCAT(-1-2)` varchar(3) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# # End of 5.5 tests # # diff --git a/mysql-test/main/func_math.test b/mysql-test/main/func_math.test index 6d28d99006a..4d65f5e00b0 100644 --- a/mysql-test/main/func_math.test +++ b/mysql-test/main/func_math.test @@ -589,6 +589,44 @@ INSERT INTO t1 VALUES (1),(2); SELECT STDDEV_SAMP(ROUND('0', 309)) FROM t1; DROP TABLE t1; + +--echo # +--echo # MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal +--echo # + +--echo # Testing that dyadic arithmetic operations are symmetric +--echo # for (+1) and (-1) and produce the same length in CONCAT(), +--echo # because (+1) and (-1) have the same data type: signed int. + +CREATE TABLE t1 AS SELECT + CONCAT(+1%2.0), + CONCAT(-1%2.0), + CONCAT(+1/2.0), + CONCAT(-1/2.0), + CONCAT(+1*2.0), + CONCAT(-1*2.0), + CONCAT(+1+2.0), + CONCAT(-1+2.0), + CONCAT(+1-2.0), + CONCAT(-1-2.0); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT + CONCAT(+1%2), + CONCAT(-1%2), + CONCAT(+1/2), + CONCAT(-1/2), + CONCAT(+1*2), + CONCAT(-1*2), + CONCAT(+1+2), + CONCAT(-1+2), + CONCAT(+1-2), + CONCAT(-1-2); +SHOW CREATE TABLE t1; +DROP TABLE t1; + + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result index a85b8c965ba..4faf9731a29 100644 --- a/mysql-test/main/func_time.result +++ b/mysql-test/main/func_time.result @@ -2158,7 +2158,7 @@ Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `f2` varchar(26) DEFAULT NULL + `f2` varchar(22) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; f2 diff --git a/mysql-test/main/metadata.result b/mysql-test/main/metadata.result index 7848390b62e..1f917bfe5ab 100644 --- a/mysql-test/main/metadata.result +++ b/mysql-test/main/metadata.result @@ -647,17 +647,17 @@ SELECT 1111111111 MOD 1, 11111111111 MOD 1 LIMIT 0; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def 1 MOD 1 3 1 0 Y 32896 0 63 -def 11 MOD 1 3 2 0 Y 32896 0 63 -def 111 MOD 1 3 3 0 Y 32896 0 63 -def 1111 MOD 1 3 4 0 Y 32896 0 63 -def 11111 MOD 1 3 5 0 Y 32896 0 63 -def 111111 MOD 1 3 6 0 Y 32896 0 63 -def 1111111 MOD 1 3 7 0 Y 32896 0 63 -def 11111111 MOD 1 3 8 0 Y 32896 0 63 -def 111111111 MOD 1 3 9 0 Y 32896 0 63 -def 1111111111 MOD 1 8 10 0 Y 32896 0 63 -def 11111111111 MOD 1 8 11 0 Y 32896 0 63 +def 1 MOD 1 3 2 0 Y 32896 0 63 +def 11 MOD 1 3 3 0 Y 32896 0 63 +def 111 MOD 1 3 4 0 Y 32896 0 63 +def 1111 MOD 1 3 5 0 Y 32896 0 63 +def 11111 MOD 1 3 6 0 Y 32896 0 63 +def 111111 MOD 1 3 7 0 Y 32896 0 63 +def 1111111 MOD 1 3 8 0 Y 32896 0 63 +def 11111111 MOD 1 3 9 0 Y 32896 0 63 +def 111111111 MOD 1 8 10 0 Y 32896 0 63 +def 1111111111 MOD 1 8 11 0 Y 32896 0 63 +def 11111111111 MOD 1 8 12 0 Y 32896 0 63 1 MOD 1 11 MOD 1 111 MOD 1 1111 MOD 1 11111 MOD 1 111111 MOD 1 1111111 MOD 1 11111111 MOD 1 111111111 MOD 1 1111111111 MOD 1 11111111111 MOD 1 SELECT -(1), diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result index 44f200c229b..d5fc6db107b 100644 --- a/mysql-test/main/type_newdecimal.result +++ b/mysql-test/main/type_newdecimal.result @@ -2038,6 +2038,70 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # +# MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal +# +CREATE TABLE t1 (d DECIMAL(1,0) ZEROFILL); +CREATE TABLE t2 AS SELECT 0 MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f` decimal(1,0) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED); +CREATE TABLE t2 AS SELECT 0 MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f` decimal(1,0) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (d DECIMAL(1,0) ZEROFILL); +CREATE TABLE t2 AS SELECT CAST(0 AS UNSIGNED) MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f` decimal(1,0) unsigned DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED); +CREATE TABLE t2 AS SELECT CAST(0 AS UNSIGNED) MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f` decimal(1,0) unsigned DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1,t2; +# +# MDEV-20560 Assertion `precision > 0' failed in decimal_bin_size upon SELECT with MOD short unsigned decimal +# +CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED); +INSERT INTO t1 VALUES (1.0),(2.0); +SELECT DISTINCT 1 MOD a FROM t1; +1 MOD a +0 +1 +CREATE TABLE t2 AS SELECT DISTINCT 1 MOD a AS f FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f` decimal(1,0) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED); +INSERT INTO t1 VALUES (1.0),(2.0); +SELECT DISTINCT 1 MOD a FROM t1; +1 MOD a +0 +1 +CREATE TABLE t2 AS SELECT DISTINCT CAST(1 AS UNSIGNED) MOD a AS f FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f` decimal(1,0) unsigned DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +# # End of 5.5 tests # # diff --git a/mysql-test/main/type_newdecimal.test b/mysql-test/main/type_newdecimal.test index 56273a47b44..2f3409f56e9 100644 --- a/mysql-test/main/type_newdecimal.test +++ b/mysql-test/main/type_newdecimal.test @@ -1628,6 +1628,49 @@ SHOW CREATE TABLE t1; DROP TABLE t1; --echo # +--echo # MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal +--echo # + +CREATE TABLE t1 (d DECIMAL(1,0) ZEROFILL); +CREATE TABLE t2 AS SELECT 0 MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; + +CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED); +CREATE TABLE t2 AS SELECT 0 MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE IF EXISTS t1,t2; + +CREATE TABLE t1 (d DECIMAL(1,0) ZEROFILL); +CREATE TABLE t2 AS SELECT CAST(0 AS UNSIGNED) MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; + +CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED); +CREATE TABLE t2 AS SELECT CAST(0 AS UNSIGNED) MOD d AS f FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-20560 Assertion `precision > 0' failed in decimal_bin_size upon SELECT with MOD short unsigned decimal +--echo # + +CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED); +INSERT INTO t1 VALUES (1.0),(2.0); +SELECT DISTINCT 1 MOD a FROM t1; +CREATE TABLE t2 AS SELECT DISTINCT 1 MOD a AS f FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; + +CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED); +INSERT INTO t1 VALUES (1.0),(2.0); +SELECT DISTINCT 1 MOD a FROM t1; +CREATE TABLE t2 AS SELECT DISTINCT CAST(1 AS UNSIGNED) MOD a AS f FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; + + +--echo # --echo # End of 5.5 tests --echo # diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index b8730e2624a..bdc03d305a3 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -349,7 +349,7 @@ sub start_mysqlds() $options[$j]= quote_shell_word($options[$j]); $tmp.= " $options[$j]"; } - elseif ("--defaults-group-suffix=" eq substr($options[$j], 0, 24)) + elsif ("--defaults-group-suffix=" eq substr($options[$j], 0, 24)) { $suffix_found= 1; } diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 7612d2b83a6..ef72737766d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -22,6 +22,7 @@ flush_caches=0 numa_interleave=0 wsrep_on=0 dry_run=0 +defaults_group_suffix= # Initial logging status: error log is not open, and not using syslog logging=init @@ -358,6 +359,8 @@ parse_arguments() { append_arg_to_args "$arg" ;; + --defaults-group-suffix=*) defaults_group_suffix="$arg" ;; + --help) usage ;; *) @@ -932,7 +935,7 @@ then exit 1 fi -for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ +for i in "$ledir/$MYSQLD" "$defaults_group_suffix" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" do cmd="$cmd "`shell_quote_string "$i"` diff --git a/sql/field.cc b/sql/field.cc index 200e3e899d6..8f2312a0ca6 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1786,8 +1786,7 @@ Field::Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, flags=null_ptr ? 0: NOT_NULL_FLAG; comment.str= (char*) ""; comment.length=0; - field_index= 0; - is_stat_field= FALSE; + field_index= 0; cond_selectivity= 1.0; next_equal_field= NULL; } @@ -10938,8 +10937,8 @@ void Field::set_warning_truncated_wrong_value(const char *type_arg, DBUG_ASSERT(table); db_name= (table && table->s->db.str) ? table->s->db.str : ""; - table_name= ((table && table->s->table_name.str) ? table->s->table_name.str : - ""); + table_name= (table && table->s->table_name.str) ? + table->s->table_name.str : ""; push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, diff --git a/sql/field.h b/sql/field.h index 4fcfbe25aca..1ac2c4a7616 100644 --- a/sql/field.h +++ b/sql/field.h @@ -827,9 +827,6 @@ public: */ bool is_created_from_null_item; - /* TRUE in Field objects created for column min/max values */ - bool is_stat_field; - /* Selectivity of the range condition over this field. When calculating this selectivity a range predicate diff --git a/sql/item_func.cc b/sql/item_func.cc index 2eb7250ebc7..b7b1dbb7432 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1723,8 +1723,11 @@ my_decimal *Item_func_mod::decimal_op(my_decimal *decimal_value) void Item_func_mod::result_precision() { + unsigned_flag= args[0]->unsigned_flag; decimals= MY_MAX(args[0]->decimal_scale(), args[1]->decimal_scale()); - max_length= MY_MAX(args[0]->max_length, args[1]->max_length); + uint prec= MY_MAX(args[0]->decimal_precision(), args[1]->decimal_precision()); + fix_char_length(my_decimal_precision_to_length_no_truncation(prec, decimals, + unsigned_flag)); } diff --git a/sql/item_func.h b/sql/item_func.h index 51ade5a9068..6226b741e91 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1456,14 +1456,13 @@ public: } void fix_length_and_dec_decimal() { - Item_num_op::fix_length_and_dec_decimal(); - unsigned_flag= args[0]->unsigned_flag; + result_precision(); + fix_decimals(); } void fix_length_and_dec_int() { - max_length= MY_MAX(args[0]->max_length, args[1]->max_length); - decimals= 0; - unsigned_flag= args[0]->unsigned_flag; + result_precision(); + DBUG_ASSERT(decimals == 0); set_handler(type_handler_long_or_longlong()); } bool check_partition_func_processor(void *int_arg) {return FALSE;} diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 1222d0e0d5f..aa95002bed3 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1136,18 +1136,12 @@ public: case COLUMN_STAT_MIN_VALUE: table_field->read_stats->min_value->set_notnull(); stat_field->val_str(&val); -#if 0 /* MDEV-20589 FIXME: This fails! */ - DBUG_ASSERT(table_field->read_stats->min_value->is_stat_field); -#endif table_field->read_stats->min_value->store(val.ptr(), val.length(), &my_charset_bin); break; case COLUMN_STAT_MAX_VALUE: table_field->read_stats->max_value->set_notnull(); stat_field->val_str(&val); -#if 0 /* MDEV-20589 FIXME: This fails! */ - DBUG_ASSERT(table_field->read_stats->min_value->is_stat_field); -#endif table_field->read_stats->max_value->store(val.ptr(), val.length(), &my_charset_bin); break; @@ -3057,6 +3051,7 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables) TABLE_SHARE *table_share= table->s; Table_statistics *read_stats= table_share->stats_cb.table_stats; enum_check_fields old_check_level= thd->count_cuted_fields; + DBUG_ENTER("read_statistics_for_table"); /* Don't write warnings for internal field conversions */ diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 2644a3c115a..1ec2eee9a77 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -238,7 +238,6 @@ btr_block_get_func( dict_index_t* index, mtr_t* mtr); -# ifdef UNIV_DEBUG /** Gets a buffer page and declares its latching order level. @param page_id tablespace/page identifier @param zip_size ROW_FORMAT=COMPRESSED page size, or 0 @@ -246,36 +245,9 @@ btr_block_get_func( @param index index tree, may be NULL if not the insert buffer tree @param mtr mini-transaction handle @return the block descriptor */ -# define btr_block_get(page_id, zip_size, mode, index, mtr) \ +# define btr_block_get(page_id, zip_size, mode, index, mtr) \ btr_block_get_func(page_id, zip_size, mode, \ __FILE__, __LINE__, (dict_index_t*)index, mtr) -# else /* UNIV_DEBUG */ -/** Gets a buffer page and declares its latching order level. -@param page_id tablespace/page identifier -@param zip_size ROW_FORMAT=COMPRESSED page size, or 0 -@param mode latch mode -@param index index tree, may be NULL if not the insert buffer tree -@param mtr mini-transaction handle -@return the block descriptor */ -# define btr_block_get(page_id, zip_size, mode, index, mtr) \ - btr_block_get_func(page_id, zip_size, mode, __FILE__, __LINE__, (dict_index_t*)index, mtr) -# endif /* UNIV_DEBUG */ -/** Gets a buffer page and declares its latching order level. -@param page_id tablespace/page identifier -@param zip_size compressed page size in bytes or 0 for uncompressed pages -@param mode latch mode -@param index index tree, may be NULL if not the insert buffer tree -@param mtr mini-transaction handle -@return the uncompressed page frame */ -UNIV_INLINE -page_t* -btr_page_get( - const page_id_t page_id, - ulint zip_size, - ulint mode, - dict_index_t* index, - mtr_t* mtr) - MY_ATTRIBUTE((warn_unused_result)); /**************************************************************//** Gets the index id field of a page. @return index id */ diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic index f6d5f5b84fc..247e25492a2 100644 --- a/storage/innobase/include/btr0btr.ic +++ b/storage/innobase/include/btr0btr.ic @@ -96,35 +96,6 @@ btr_page_set_index_id( } } -/** Gets a buffer page and declares its latching order level. -@param page_id tablespace/page identifier -@param zip_size compressed page size in bytes or 0 for uncompressed pages -@param page_no page number -@param mode latch mode -@param idx index tree, may be NULL if not the insert buffer tree -@param mtr mini-transaction handle -@return the uncompressed page frame */ -UNIV_INLINE -page_t* -btr_page_get( - const page_id_t page_id, - ulint zip_size, - ulint mode, - dict_index_t* index, - mtr_t* mtr) -{ - buf_block_t* block=NULL; - buf_frame_t* frame=NULL; - - block = btr_block_get(page_id, zip_size, mode, index, mtr); - - if (block) { - frame = buf_block_get_frame(block); - } - - return ((page_t*)frame); -} - /**************************************************************//** Gets the index id field of a page. @return index id */ diff --git a/storage/myisam/NEWS b/storage/myisam/NEWS index a564110bffb..942926a0fa2 100644 --- a/storage/myisam/NEWS +++ b/storage/myisam/NEWS @@ -26,7 +26,7 @@ New features compared to NISAM: - Index on BLOB and VARCHAR. - One can now have NULL in an index. This takes 0-1 bytes / key. - MYISAM will allow one to specify one AUTO_INCREMENT column; MYISAM will - automaticly update this on INSERT/UPDATE. The AUTO_INCREMENT value can be + automatically update this on INSERT/UPDATE. The AUTO_INCREMENT value can be reset with myisamchk. - Max key length will be 500 by default; In cases of longer keys than 250, a bigger key block size than the default of 1024 byes is used for this key. @@ -39,7 +39,7 @@ New features compared to NISAM: - 'myisamchk -a' stores statistic for key parts (and not only for whole keys as in NISAM). - Dynamic size rows will now be much less fragmented when mixing deletes with - update and insert. This is done by automaticly combine adjacent deleted + update and insert. This is done by automatically combining adjacent deleted blocks and by extending blocks if the next block is deleted. - For dynamic size rows, the delete link contains a pointer to itself (to make repairs easier). diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 62f8a4efac8..406a9bbc951 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -335,7 +335,7 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)), When performing prefix search (a word with truncation operator), we must preserve original prefix to ensure that characters which may be expanded/contracted do not break the prefix. This is done by storing - newly found key immediatly after the original word in ftbw->word + newly found key immediately after the original word in ftbw->word buffer. ftbw->word= LENGTH WORD [ LENGTH1 WORD1 ] WEIGHT REFERENCE diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index aaf0217aefb..78c5e58de76 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -793,8 +793,8 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) growing files. Using an open_flag instead of calling mi_extra(... HA_EXTRA_MMAP ...) after mi_open() has the advantage that the mapping is not repeated for every open, but just done on the initial - open, when the MyISAM share is created. Everytime the server - requires to open a new instance of a table it calls this method. We + open, when the MyISAM share is created. Every time the server + requires opening a new instance of a table it calls this method. We will always supply HA_OPEN_MMAP for a permanent table. However, the MyISAM storage engine will ignore this flag if this is a secondary open of a table that is in use by other threads already (if the diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 869e86b7495..22eb97b24f3 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -286,7 +286,7 @@ static int check_k_link(HA_CHECK *param, register MI_INFO *info, uint nr) /* Read the key block with MI_MIN_KEY_BLOCK_LENGTH to find next link. If the key cache block size is smaller than block_size, we can so - avoid unecessary eviction of cache block. + avoid unnecessary eviction of cache block. */ if (!(buff=key_cache_read(info->s->key_cache, info->s->kfile, next_link, DFLT_INIT_HITS, @@ -1900,7 +1900,7 @@ int flush_blocks(HA_CHECK *param, KEY_CACHE *key_cache, File file, } /* flush_blocks */ - /* Sort index for more efficent reads */ + /* Sort index for more efficient reads */ int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name) { @@ -3055,13 +3055,13 @@ err: /* Destroy the write cache. The master thread did already detach from the share by remove_io_thread() or it was not yet started (if the - error happend before creating the thread). + error happened before creating the thread). */ (void) end_io_cache(&info->rec_cache); /* Destroy the new data cache in case of non-quick repair. All slave threads did either detach from the share by remove_io_thread() - already or they were not yet started (if the error happend before + already or they were not yet started (if the error happened before creating the threads). */ if (!rep_quick && my_b_inited(&new_data_cache)) @@ -4602,7 +4602,7 @@ void update_auto_increment_key(HA_CHECK *param, MI_INFO *info, keypart_k=c_k for arbitrary constants c_1 ... c_k) = {assuming that values have uniform distribution and index contains all - tuples from the domain (or that {c_1, ..., c_k} tuple is choosen from + tuples from the domain (or that {c_1, ..., c_k} tuple is chosen from index tuples} = #tuples-in-the-index / #distinct-tuples-in-the-index. diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 8ca100ed45f..c91c1af5f60 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -611,7 +611,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, klinkname_ptr= klinkname; /* Don't create the table if the link or file exists to ensure that one - doesn't accidently destroy another table. + doesn't accidentally destroy another table. */ create_flag=0; } diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c index d8a8e101c23..2c829fa9860 100644 --- a/storage/myisam/mi_delete.c +++ b/storage/myisam/mi_delete.c @@ -326,7 +326,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, { DBUG_PRINT("error",("Didn't find key")); mi_print_error(info->s, HA_ERR_CRASHED); - my_errno=HA_ERR_CRASHED; /* This should never happend */ + my_errno=HA_ERR_CRASHED; /* This should never happen */ goto err; } save_flag=0; diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 65c1953e5fc..69c13ab96cf 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -885,8 +885,8 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *record, /* Check if next block is a deleted block Above we have MI_MIN_BLOCK_LENGTH to avoid the problem where - the next block is so small it can't be splited which could - casue problems + the next block is so small it can't be split which could + cause problems */ MI_BLOCK_INFO del_block; diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index 7cf62263e58..6c7144a949d 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -211,7 +211,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) info->read_record= share->read_record; info->opt_flag&= ~(KEY_READ_USED | REMEMBER_OLD_POS); break; - case HA_EXTRA_NO_USER_CHANGE: /* Database is somehow locked agains changes */ + case HA_EXTRA_NO_USER_CHANGE: /* Database is somehow locked against changes */ info->lock_type= F_EXTRA_LCK; /* Simulate as locked */ break; case HA_EXTRA_WAIT_LOCK: @@ -357,7 +357,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) mi_alloc_rec_buff(info, -1, &info->rec_buff); mysql_mutex_unlock(&share->intern_lock); break; - case HA_EXTRA_NORMAL: /* Theese isn't in use */ + case HA_EXTRA_NORMAL: /* These aren't in use */ info->quick_mode=0; break; case HA_EXTRA_QUICK: diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index dfbf01b218e..dd838a05ada 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -616,7 +616,7 @@ ulonglong retrieve_auto_increment(MI_INFO *info,const uchar *record) } /* - The following code works becasue if s_value < 0 then value is 0 + The following code works because if s_value < 0 then value is 0 and if s_value == 0 then value will contain either s_value or the correct value. */ diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index 3e72726ff25..713ba0a3851 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -448,7 +448,7 @@ my_bool mi_check_status(void *param) @param org_table @param new_table that should point on org_lock. new_table is 0 - in case this is the first occurence of the table in the lock + in case this is the first occurrence of the table in the lock structure. */ diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 03a3b22e58e..72ce17b6a78 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -810,7 +810,7 @@ static void (*get_unpack_function(MI_COLUMNDEF *rec)) return &uf_varchar2; case FIELD_LAST: default: - return 0; /* This should never happend */ + return 0; /* This should never happen */ } } diff --git a/storage/myisam/mi_rfirst.c b/storage/myisam/mi_rfirst.c index 7bfe87867ee..26f6921bdf9 100644 --- a/storage/myisam/mi_rfirst.c +++ b/storage/myisam/mi_rfirst.c @@ -16,7 +16,7 @@ #include "myisamdef.h" - /* Read first row through a specfic key */ + /* Read first row through a specific key */ int mi_rfirst(MI_INFO *info, uchar *buf, int inx) { diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 5ec7ec935f0..14286e3591d 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -432,7 +432,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, /* If prefix_len > cmplen then we are in the end-space comparison - phase. Do not try to acces the key any more ==> left= 0. + phase. Do not try to access the key any more ==> left= 0. */ left= ((len <= cmplen) ? suffix_len : ((prefix_len < cmplen) ? cmplen - prefix_len : 0)); diff --git a/storage/myisam/mi_test_all.sh b/storage/myisam/mi_test_all.sh index 4d69051eaae..9b385bb96fe 100755 --- a/storage/myisam/mi_test_all.sh +++ b/storage/myisam/mi_test_all.sh @@ -19,8 +19,8 @@ # MA 02110-1335 USA # -# Execute some simple basic test on MyISAM libary to check if things -# works at all. +# Execute some simple basic tests on the MyISAM library to check if +# things work at all. valgrind="valgrind --alignment=8 --leak-check=yes" silent="-s" diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 9621512a9db..a3021ed72a7 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -378,7 +378,7 @@ static void usage(void) puts("Check options (check is the default action for myisamchk):\n\ -c, --check Check table for errors.\n\ - -e, --extend-check Check the table VERY throughly. Only use this in\n\ + -e, --extend-check Check the table VERY thoroughly. Only use this in\n\ extreme cases as myisamchk should normally be able to\n\ find out if the table is ok even without this switch.\n\ -F, --fast Check only tables that haven't been closed properly.\n\ diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 06dd864fcfd..3b036b5f4a4 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -197,7 +197,7 @@ typedef struct st_mi_isam_share ulong last_process; /* For table-change-check */ ulong last_version; /* Version on start */ ulong options; /* Options used */ - ulong min_pack_length; /* Theese are used by packed data */ + ulong min_pack_length; /* These are used by packed data */ ulong max_pack_length; ulong state_diff_length; uint rec_reflength; /* rec_reflength in use now */ diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c index 05126ff42aa..8e8b75817c0 100644 --- a/storage/myisam/myisamlog.c +++ b/storage/myisam/myisamlog.c @@ -415,7 +415,7 @@ static int examine_log(char * file_name, char **table_names) left_root_right); file_info.id=open_param.max_id+1; /* - * In the line below +10 is added to accomodate '<' and '>' chars + * In the line below +10 is added to accommodate '<' and '>' chars * plus '\0' at the end, so that there is place for 7 digits. * It is improbable that same table can have that many entries in * the table cache. diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 7f3d5275ae1..ba6744ae815 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -110,7 +110,7 @@ typedef struct st_isam_mrg { MI_INFO **file,**current,**end; uint free_file; uint count; - uint min_pack_length; /* Theese is used by packed data */ + uint min_pack_length; /* These are used by packed data */ uint max_pack_length; uint ref_length; uint max_blob_length; @@ -1237,7 +1237,7 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees, huff_counts->counts[0]=0; goto found_pack; } - /* Remeber the number of significant spaces. */ + /* Remember the number of significant spaces. */ old_space_count=huff_counts->counts[' ']; /* Add all leading and trailing spaces. */ huff_counts->counts[' ']+= (huff_counts->tot_end_space + diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 72044400c25..e586543363b 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -857,7 +857,7 @@ cleanup: buffpek Where to read from sort_length max length to read RESULT - > 0 Ammount of bytes read + > 0 Number of bytes read -1 Error */ diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index b1371fafa71..8d2e57b8290 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -91,9 +91,7 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ # Use the [Service] section and Environment="MYSQLD_OPTS=...". # This isn't a replacement for my.cnf. # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster -# Note: we set --basedir to prevent probes that might trigger SELinux alarms, -# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485 -ExecStart=@sbindir@/mysqld $MYSQLD_OPTS --basedir=@prefix@ $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION +ExecStart=@sbindir@/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION # Unset _WSREP_START_POSITION environment variable. ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index c66f5a776eb..4a49bd48766 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -244,12 +244,10 @@ UMask=007 PrivateTmp=false # Controlling how multiple instances are separated. See top of this file. -# Note 1: This service isn't User=mysql by default so we need to be explicit. -# Note 2: we set --basedir to prevent probes that might trigger SELinux alarms, -# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485. Its as an option -# here as a user may want to use the MYSQLD_MULTI_INSTANCE to run multiple -# versions. -Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=@prefix@' +# Note: This service isn't User=mysql by default so we need to be explicit. +# It is as an option here as a user may want to use the MYSQLD_MULTI_INSTANCE +# to run multiple versions. +Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I' # While you can override these, you shouldn't leave them empty as that # will default to root. diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh index 5d1b30b208e..293229d8482 100644 --- a/support-files/mysql-log-rotate.sh +++ b/support-files/mysql-log-rotate.sh @@ -1,9 +1,9 @@ # This logname can be set in /etc/my.cnf -# by setting the variable "err-log" -# in the [safe_mysqld] section as follows: +# by setting the variable "log-error" +# in the [mysqld] section as follows: # -# [safe_mysqld] -# err-log=@localstatedir@/mysqld.log +# [mysqld] +# log-error=@localstatedir@/mysqld.log # # If the root user has a password you have to create a # /root/.my.cnf configuration file with the following @@ -21,7 +21,7 @@ @localstatedir@/mysqld.log { # create 600 mysql mysql notifempty - daily + daily rotate 3 missingok compress |