Skip to content
Permalink
Browse files
Merge 10.1 into 10.2
  • Loading branch information
dr-m committed Apr 25, 2019
2 parents 1f1a61c + bfb0726 commit bc14519
Show file tree
Hide file tree
Showing 56 changed files with 1,186 additions and 114 deletions.
@@ -1,5 +1,5 @@
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2008, 2018, MariaDB Corporation
# Copyright (c) 2008, 2019, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_INSTALL_DB\" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.TH "\FBMYSQL_INSTALL_DB\FR" "1" "4 April 2019" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -198,6 +198,21 @@ Must be given as first option\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: defaults-group-suffix option
.\" defaults-group-suffix option: mysql_install_db
\fB\-\-defaults\-group\-suffix=\fR\fB\fIname\fR\fR
.sp
In addition to the given groups, also read groups with this suffix\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: force option
.\" force option: mysql_install_db
\fB\-\-force\fR
@@ -354,7 +369,7 @@ For internal use\&. This option is used for creating Windows distributions\&.
.SH "COPYRIGHT"
.br
.PP
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2019 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -505,6 +505,10 @@ GEOMETRYFROMTEXT('POINT(4599 60359)'),
) as relate_res;
relate_res
0
prepare s from 'do st_convexhull(st_aswkb(multipoint(point(-11702,15179),point(-5031,27960),point(-30557,11158),point(-27804,30314))))';
execute s;
execute s;
deallocate prepare s;
with cte1 as( select (st_symdifference(point(1,1),point(1,1))) as a1 ), cte2 as(select 1 as a2) select 1 from cte1 where cte1.a1 < '1';
1
1
@@ -786,5 +786,61 @@ t COUNT(*)
12:12:13 1
DROP TABLE t1;
#
# MDEV-17830 Server crashes in Item_null_result::field_type upon SELECT with CHARSET(date) and ROLLUP
#
# Note, different MariaDB versions can return different results
# in the two rows (such as "latin1" vs "binary"). This is wrong.
# Both lines should return equal values.
# The point in this test is to make sure it does not crash.
# As this is a minor issue, bad result will be fixed
# in a later version, presumably in 10.4.
CREATE TABLE t (d DATE) ENGINE=MyISAM;
INSERT INTO t VALUES ('2018-12-12');
SELECT CHARSET(d) AS f FROM t GROUP BY d WITH ROLLUP;
f
binary
binary
DROP TABLE t;
#
# MDEV-14041 Server crashes in String::length on queries with functions and ROLLUP
#
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT GET_LOCK( 'foo', 0 );
GET_LOCK( 'foo', 0 )
1
SELECT HEX( RELEASE_LOCK( 'foo' ) ) AS f FROM t1 GROUP BY f WITH ROLLUP;
f
NULL
1
NULL
DROP TABLE t1;
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT i FROM t1 GROUP BY i WITH ROLLUP
UNION ALL
SELECT ELT( FOUND_ROWS(), 1 ) f FROM t1 GROUP BY f WITH ROLLUP;
i
1
2
NULL
NULL
NULL
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
SELECT a FROM t1 GROUP BY NULLIF( CONVERT('', DATE), '2015-10-15' ) WITH ROLLUP;
a
1
1
Warnings:
Warning 1292 Incorrect datetime value: ''
Warning 1292 Incorrect datetime value: ''
Warning 1292 Incorrect datetime value: ''
Warning 1292 Incorrect datetime value: ''
Warning 1292 Incorrect datetime value: ''
Warning 1292 Incorrect datetime value: ''
DROP TABLE t1;
#
# End of 10.1 tests
#
@@ -7643,6 +7643,22 @@ c1 c2 count(c3)
2012-03-01 02:00:00 3 1
DROP PROCEDURE p1;
# End of 5.5 test
CREATE PROCEDURE sp() ALTER TABLE non_existing_table OPTIMIZE PARTITION p0;
CALL sp;
Table Op Msg_type Msg_text
test.non_existing_table optimize Error Table 'test.non_existing_table' doesn't exist
test.non_existing_table optimize status Operation failed
SELECT 1;
1
1
DROP PROCEDURE sp;
CREATE PROCEDURE sp() SHOW USER_STATISTICS;
CALL sp;
User Total_connections Concurrent_connections Connected_time Busy_time Cpu_time Bytes_received Bytes_sent Binlog_bytes_written 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 Total_ssl_connections Max_statement_time_exceeded
SELECT 1;
1
1
DROP PROCEDURE sp;
#
# Bug#12663165 SP DEAD CODE REMOVAL DOESN'T UNDERSTAND CONTINUE HANDLERS
#
@@ -625,6 +625,76 @@ MAX(pk)
NULL
DROP TABLE t1;
#
# MDEV-17605: SHOW INDEXES with use_stat_tables='preferably'
#
set use_stat_tables='preferably';
CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 lineitem 6005
select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_commitdate 1 2.7160
SHOW INDEXES FROM lineitem;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
lineitem 0 PRIMARY 1 l_orderkey A 1500 NULL NULL BTREE
lineitem 0 PRIMARY 2 l_linenumber A 6005 NULL NULL BTREE
lineitem 1 i_l_shipdate 1 l_shipDATE A 2266 NULL NULL YES BTREE
lineitem 1 i_l_suppkey_partkey 1 l_partkey A 200 NULL NULL YES BTREE
lineitem 1 i_l_suppkey_partkey 2 l_suppkey A 699 NULL NULL YES BTREE
lineitem 1 i_l_partkey 1 l_partkey A 200 NULL NULL YES BTREE
lineitem 1 i_l_suppkey 1 l_suppkey A 10 NULL NULL YES BTREE
lineitem 1 i_l_receiptdate 1 l_receiptDATE A 2268 NULL NULL YES BTREE
lineitem 1 i_l_orderkey 1 l_orderkey A 1500 NULL NULL BTREE
lineitem 1 i_l_orderkey_quantity 1 l_orderkey A 1500 NULL NULL BTREE
lineitem 1 i_l_orderkey_quantity 2 l_quantity A 5771 NULL NULL YES BTREE
lineitem 1 i_l_commitdate 1 l_commitDATE A 2210 NULL NULL YES BTREE
SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='lineitem';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
def dbt3_s001 lineitem 0 dbt3_s001 PRIMARY 1 l_orderkey A 1500 NULL NULL BTREE
def dbt3_s001 lineitem 0 dbt3_s001 PRIMARY 2 l_linenumber A 6005 NULL NULL BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_shipdate 1 l_shipDATE A 2266 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_suppkey_partkey 1 l_partkey A 200 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_suppkey_partkey 2 l_suppkey A 699 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_partkey 1 l_partkey A 200 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_suppkey 1 l_suppkey A 10 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_receiptdate 1 l_receiptDATE A 2268 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_orderkey 1 l_orderkey A 1500 NULL NULL BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_orderkey_quantity 1 l_orderkey A 1500 NULL NULL BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_orderkey_quantity 2 l_quantity A 5771 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_commitdate 1 l_commitDATE A 2210 NULL NULL YES BTREE
SELECT
COUNT(DISTINCT l_orderkey), COUNT(DISTINCT l_orderkey,l_linenumber),
COUNT(DISTINCT l_shipDATE),
COUNT(DISTINCT l_partkey), COUNT(DISTINCT l_partkey,l_suppkey),
COUNT(DISTINCT l_suppkey), COUNT(DISTINCT l_receiptDATE),
COUNT(DISTINCT l_orderkey, l_quantity), COUNT(DISTINCT l_commitDATE)
FROM lineitem;
COUNT(DISTINCT l_orderkey) COUNT(DISTINCT l_orderkey,l_linenumber) COUNT(DISTINCT l_shipDATE) COUNT(DISTINCT l_partkey) COUNT(DISTINCT l_partkey,l_suppkey) COUNT(DISTINCT l_suppkey) COUNT(DISTINCT l_receiptDATE) COUNT(DISTINCT l_orderkey, l_quantity) COUNT(DISTINCT l_commitDATE)
1500 6005 2266 200 700 10 2268 5772 2211
set optimizer_switch=@save_optimizer_switch;
DROP DATABASE dbt3_s001;
USE test;
delete from mysql.table_stats;
delete from mysql.column_stats;
delete from mysql.index_stats;
set @save_optimizer_switch=@@optimizer_switch;
set use_stat_tables=@save_use_stat_tables;
#
# MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value
#
set names utf8;
@@ -652,6 +652,76 @@ MAX(pk)
NULL
DROP TABLE t1;
#
# MDEV-17605: SHOW INDEXES with use_stat_tables='preferably'
#
set use_stat_tables='preferably';
CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 lineitem 6005
select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_commitdate 1 2.7160
SHOW INDEXES FROM lineitem;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
lineitem 0 PRIMARY 1 l_orderkey A 1500 NULL NULL BTREE
lineitem 0 PRIMARY 2 l_linenumber A 6005 NULL NULL BTREE
lineitem 1 i_l_shipdate 1 l_shipDATE A 2266 NULL NULL YES BTREE
lineitem 1 i_l_suppkey_partkey 1 l_partkey A 200 NULL NULL YES BTREE
lineitem 1 i_l_suppkey_partkey 2 l_suppkey A 699 NULL NULL YES BTREE
lineitem 1 i_l_partkey 1 l_partkey A 200 NULL NULL YES BTREE
lineitem 1 i_l_suppkey 1 l_suppkey A 10 NULL NULL YES BTREE
lineitem 1 i_l_receiptdate 1 l_receiptDATE A 2268 NULL NULL YES BTREE
lineitem 1 i_l_orderkey 1 l_orderkey A 1500 NULL NULL BTREE
lineitem 1 i_l_orderkey_quantity 1 l_orderkey A 1500 NULL NULL BTREE
lineitem 1 i_l_orderkey_quantity 2 l_quantity A 5771 NULL NULL YES BTREE
lineitem 1 i_l_commitdate 1 l_commitDATE A 2210 NULL NULL YES BTREE
SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='lineitem';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
def dbt3_s001 lineitem 0 dbt3_s001 PRIMARY 1 l_orderkey A 1500 NULL NULL BTREE
def dbt3_s001 lineitem 0 dbt3_s001 PRIMARY 2 l_linenumber A 6005 NULL NULL BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_shipdate 1 l_shipDATE A 2266 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_suppkey_partkey 1 l_partkey A 200 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_suppkey_partkey 2 l_suppkey A 699 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_partkey 1 l_partkey A 200 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_suppkey 1 l_suppkey A 10 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_receiptdate 1 l_receiptDATE A 2268 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_orderkey 1 l_orderkey A 1500 NULL NULL BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_orderkey_quantity 1 l_orderkey A 1500 NULL NULL BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_orderkey_quantity 2 l_quantity A 5771 NULL NULL YES BTREE
def dbt3_s001 lineitem 1 dbt3_s001 i_l_commitdate 1 l_commitDATE A 2210 NULL NULL YES BTREE
SELECT
COUNT(DISTINCT l_orderkey), COUNT(DISTINCT l_orderkey,l_linenumber),
COUNT(DISTINCT l_shipDATE),
COUNT(DISTINCT l_partkey), COUNT(DISTINCT l_partkey,l_suppkey),
COUNT(DISTINCT l_suppkey), COUNT(DISTINCT l_receiptDATE),
COUNT(DISTINCT l_orderkey, l_quantity), COUNT(DISTINCT l_commitDATE)
FROM lineitem;
COUNT(DISTINCT l_orderkey) COUNT(DISTINCT l_orderkey,l_linenumber) COUNT(DISTINCT l_shipDATE) COUNT(DISTINCT l_partkey) COUNT(DISTINCT l_partkey,l_suppkey) COUNT(DISTINCT l_suppkey) COUNT(DISTINCT l_receiptDATE) COUNT(DISTINCT l_orderkey, l_quantity) COUNT(DISTINCT l_commitDATE)
1500 6005 2266 200 700 10 2268 5772 2211
set optimizer_switch=@save_optimizer_switch;
DROP DATABASE dbt3_s001;
USE test;
delete from mysql.table_stats;
delete from mysql.column_stats;
delete from mysql.index_stats;
set @save_optimizer_switch=@@optimizer_switch;
set use_stat_tables=@save_use_stat_tables;
#
# MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value
#
set names utf8;
@@ -854,5 +854,30 @@ d COUNT(*)
NULL 2
DROP TABLE t1;
#
# MDEV-17299 Assertion `maybe_null' failed in make_sortkey
#
CREATE TABLE t1 (pk int NOT NULL, d1 date, d2 date NOT NULL);
INSERT INTO t1 values (1,'2018-06-22','2018-06-22'),(2,'2018-07-11','2018-07-11');
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
FROM v1 GROUP BY greatest(pk, 0, d2);
group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
NULL
Warnings:
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
CREATE TABLE t2 AS SELECT greatest(pk, 0, d2) AS c1 FROM t1 LIMIT 0;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.1 tests
#
@@ -65,3 +65,27 @@ SELECT * FROM t1;
a_id b_id c_id
1 NULL NULL
drop table t1,t2;
#
# MDEV-18300: ASAN error in Field_blob::get_key_image upon UPDATE with subquery
#
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
set @save_use_stat_tables= @@use_stat_tables;
set use_stat_tables=preferably;
set optimizer_use_condition_selectivity=4;
CREATE TABLE t1 (a INT, b CHAR(8)) ENGINE=InnoDB;
insert into t1 values (1,'foo'),(2, 'abc');
CREATE TABLE t2 (c CHAR(8), d BLOB) ENGINE=InnoDB;
insert into t2 values ('abc', 'foo'),('edf', 'food');
ANALYZE TABLE t1,t2;
UPDATE t1 SET a = 1 WHERE b = ( SELECT c FROM t2 WHERE d = 'foo' );
SELECT * FROM t1;
a b
1 foo
1 abc
DROP TABLE t1, t2;
create table t1 (a int not null, b int, c int) engine=InnoDB;
create table t2 (d int, e int) engine=InnoDB;
update t1, t2 set a=NULL, b=2, c=NULL where b=d and e=200;
drop table t1,t2;
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set @@use_stat_tables= @save_use_stat_tables;
@@ -0,0 +1,24 @@
drop table if exists t1;
#
# MDEV-17297: stats.records=0 for a table of Archive engine when it has rows, when we run ANALYZE command
#
CREATE TABLE t1 (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive;
INSERT INTO t1 VALUES
(101, PointFromText('POINT(10 10)')),
(102, PointFromText('POINT(20 10)')),
(103, PointFromText('POINT(20 20)')),
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
set @tmp1= @@optimizer_use_condition_selectivity;
set @tmp2= @@use_stat_tables;
set optimizer_use_condition_selectivity=4;
set use_stat_tables=PREFERABLY;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze note The storage engine for the table doesn't support analyze
select * from mysql.table_stats where table_name='t1' and db_name=database();
db_name table_name cardinality
test t1 4
drop table t1;
set optimizer_use_condition_selectivity=@tmp1;
set use_stat_tables=@tmp2;

0 comments on commit bc14519

Please sign in to comment.