Commit b0fe082b authored by Jan Lindström's avatar Jan Lindström

Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galera

parents 93ff64eb 2ee9343c
......@@ -232,6 +232,7 @@ storage/mroonga/vendor/groonga/src/groonga-benchmark
storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset
storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result
storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
zlib/zconf.h
# C and C++
# Compiled Object files
......
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
# Copyright (c) 2008, 2017, MariaDB
# Copyright (c) 2008, 2018, 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
......
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2008, 2018, 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
......
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2017, MariaDB
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 2018, 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
......@@ -1493,7 +1493,7 @@ static struct my_option my_long_options[] =
{"batch", 'B',
"Don't use history file. Disable interactive behavior. (Enables --silent.)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"binary-as-hex", 'b', "Print binary data as hex", &opt_binhex, &opt_binhex,
{"binary-as-hex", 0, "Print binary data as hex", &opt_binhex, &opt_binhex,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
......
......@@ -136,6 +136,10 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c)
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
IF(NOT _SKIP_PIC)
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS
"${CMAKE_SHARED_LIBRARY_C_FLAGS}")
ENDIF()
SET(OSLIBS)
FOREACH(LIB ${LIBS_TO_MERGE})
......@@ -240,11 +244,11 @@ MACRO(MERGE_LIBRARIES)
# check for non-PIC libraries
IF(NOT _SKIP_PIC)
FOREACH(LIB ${LIBS})
GET_TARGET_PROPERTY(${LIB} TYPE LIBTYPE)
IF(LIBTYPE STREQUAL "STATIC_LIBRARY")
GET_TARGET_PROPERTY(LIB COMPILE_FLAGS LIB_COMPILE_FLAGS)
GET_TARGET_PROPERTY(LTYPE ${LIB} TYPE)
IF(LTYPE STREQUAL "STATIC_LIBRARY")
GET_TARGET_PROPERTY(LIB_COMPILE_FLAGS ${LIB} COMPILE_FLAGS)
STRING(REPLACE "${CMAKE_SHARED_LIBRARY_C_FLAGS}"
"<PIC_FLAG>" LIB_COMPILE_FLAGS ${LIB_COMPILE_FLAG})
"<PIC_FLAG>" LIB_COMPILE_FLAGS "${LIB_COMPILE_FLAGS}")
IF(NOT LIB_COMPILE_FLAGS MATCHES "<PIC_FLAG>")
MESSAGE(FATAL_ERROR
"Attempted to link non-PIC static library ${LIB} to shared library ${TARGET}\n"
......
......@@ -128,9 +128,8 @@ IF(MSVC)
ENDIF()
# Always link with socket library
LINK_LIBRARIES(ws2_32)
# ..also for tests
SET(CMAKE_REQUIRED_LIBRARIES ws2_32)
STRING(APPEND CMAKE_C_STANDARD_LIBRARIES " ws2_32.lib")
STRING(APPEND CMAKE_CXX_STANDARD_LIBRARIES " ws2_32.lib")
# System checks
SET(SIGNAL_WITH_VIO_CLOSE 1) # Something that runtime team needs
......
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2018, Oracle and/or its affiliates.
# Copyright (c) 2011, 2018, 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
......
......@@ -18,7 +18,7 @@
# so WSREP_VERSION is produced regardless
# Set the patch version
SET(WSREP_PATCH_VERSION "23")
SET(WSREP_PATCH_VERSION "24")
# MariaDB addition: Revision number of the last revision merged from
# codership branch visible in @@visible_comment.
......
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
#
# 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
......@@ -14,15 +14,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO (MYSQL_USE_BUNDLED_ZLIB)
SET(ZLIB_LIBRARY zlib)
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib)
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_BINARY_DIR}/zlib)
SET(BUILD_BUNDLED_ZLIB 1)
SET(ZLIB_LIBRARY zlib CACHE INTERNAL "Bundled zlib library")
SET(ZLIB_FOUND TRUE)
SET(WITH_ZLIB "bundled" CACHE STRING "Use bundled zlib")
ADD_SUBDIRECTORY(zlib)
GET_TARGET_PROPERTY(src zlib SOURCES)
FOREACH(file ${src})
SET(ZLIB_SOURCES ${ZLIB_SOURCES} ${CMAKE_SOURCE_DIR}/zlib/${file})
ENDFOREACH()
ENDMACRO()
# MYSQL_CHECK_ZLIB_WITH_COMPRESS
......@@ -37,15 +34,10 @@ ENDMACRO()
MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
IF(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Use bundled zlib on some platforms by default (system one is too
# old or not existent)
# For NDBCLUSTER: Use bundled zlib by default
IF (NOT WITH_ZLIB)
SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform")
ENDIF()
ENDIF()
IF(WITH_ZLIB STREQUAL "bundled")
MYSQL_USE_BUNDLED_ZLIB()
......
# Copyright (c) 2006, 2011, Oracle and/or its affiliates.
# Copyright (c) 2009, 2018, 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
......@@ -184,4 +185,3 @@ IF(NOT DISABLE_SHARED)
ENDIF()
ENDIF()
ENDIF()
# BUG#37656
#
# This test aims at checking whether lower_case_table_names=1 option works
# for database names and table names.
#
# This test checks the following (when lower_case_table_names=1 is set on slave):
# (i) creating a database on upper case on master results in lower case
# database name on slave
# (ii) creating tables with upper case names on master results in lower case
# table names on slave
# (iii) loading data infile into capitalized table name on master replicates to
# lower case table name on slave
# (iv) Propagating changes from upper case table names on into correspondent
# lower case table names on slave works.
# setup: create database and tables
-- echo ******** [ MASTER ] ********
-- let $dbname_upper= BUG_37656
-- let $dbname_lower= `SELECT LOWER('$dbname_upper')`
-- eval CREATE DATABASE $dbname_upper
-- eval use $dbname_upper
# assert: database names are in upper case in master and lower
# case in slave
-- eval show databases like '$dbname_upper'
sync_slave_with_master;
-- echo ******** [ SLAVE ] ********
--eval show databases like '$dbname_lower'
-- connection master
-- echo ******** [ MASTER ] ********
CREATE TABLE T1 (a int);
-- eval CREATE TABLE T2 (b int) ENGINE=$engine
CREATE TABLE T3 (txt TEXT);
# assert: that tables exist on master with upper case names
show tables;
# assert: that tables exist on slave but with lower case names
-- sync_slave_with_master
-- echo ******** [ SLAVE ] ********
-- eval use $dbname_lower
show tables;
# action: lets create t1 for asserting below that t1 does not get changes
# from master (slave configured with --replicate-ignore-db=$dbname_lower.t1)
CREATE TABLE t1 (a INT);
# action: fill data into tables
-- connection master
-- echo ******** [ MASTER ] ********
-- eval use $dbname_upper
INSERT INTO T1 VALUES (1);
INSERT INTO T2 VALUES (1);
if (`SELECT @@session.binlog_format != 'ROW'`)
{
-- eval LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE $dbname_upper.T3
}
if (`SELECT @@session.binlog_format = 'ROW'`)
{
use test;
-- eval INSERT INTO $dbname_upper.T1 VALUES (2)
-- eval INSERT INTO $dbname_upper.T2 VALUES (2)
-- eval LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE $dbname_upper.T3
}
# assert: lower case tables on lower case database on slave
# get updates from upper case tables on upper case
# database on master
-- sync_slave_with_master
-- echo ******** [ SLAVE ] ********
# assert: changes for slave's t1 were filterd out
if (`SELECT count(*) != 0 FROM t1`)
{
-- echo UNEXPECTED DATA on $dbname_lower.t1 as table is filtered by replicate-ignore-table rules
}
-- let $diff_tables=master:$dbname_upper.T2, slave:$dbname_lower.t2
-- source include/diff_tables.inc
-- let $diff_tables=master:$dbname_upper.T3, slave:$dbname_lower.t3
-- source include/diff_tables.inc
# clean up
-- connection master
-- echo ******** [ MASTER ] ********
-- eval DROP DATABASE $dbname_upper
-- sync_slave_with_master
#
# BUG#50653: drop procedure implicitely treats db name in a case sensitive way
#
-- connection master
-- let $dbname= B50653
-- let $procname= b50653_proc
-- eval CREATE DATABASE $dbname
-- eval USE $dbname
-- eval CREATE PROCEDURE $procname() BEGIN SELECT 1; END
if (`SELECT count(*) = 1 FROM mysql.proc WHERE name like '$dbname'`)
{
-- die Procedure not created on MASTER
}
-- sync_slave_with_master
if (`SELECT count(*) = 1 FROM mysql.proc WHERE name like '$dbname'`)
{
-- die Procedure not created on SLAVE
}
-- connection master
-- eval DROP PROCEDURE $procname
if (`SELECT count(*) FROM mysql.proc WHERE name like '$dbname'`)
{
-- die Procedure not dropped on MASTER
}
-- sync_slave_with_master
if (`SELECT count(*) FROM mysql.proc WHERE name like '$dbname'`)
{
-- die Procedure not dropped on SLAVE
}
-- let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
if ($last_error)
{
-- die UNEXPECTED SLAVE SQL error: $last_error
}
-- connection master
-- eval DROP DATABASE $dbname
-- sync_slave_with_master
-- source include/rpl_end.inc
......@@ -195,14 +195,10 @@ sub value {
my ($self, $option_name)= @_;
my $option= $self->option($option_name);
if (! defined($option) and defined $ENV{$option_name}) {
if (! defined($option)) {
my $value= $ENV{$option_name};
$option= My::Config::Option->new($option_name, $value);
}
croak "No option named '$option_name' in group '$self->{name}'"
if ! defined($option);
return $option->value();
}
......
......@@ -137,8 +137,6 @@ my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
our @global_suppressions;
END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
{
......@@ -190,8 +188,6 @@ my @DEFAULT_SUITES= qw(
sys_vars-
unit-
vcol-
wsrep-
galera-
);
my $opt_suites;
......@@ -363,7 +359,6 @@ my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
my $opt_core_on_failure= 0;
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 20;
# lock file to stop tests
my $opt_stop_file= $ENV{MTR_STOP_FILE};
......@@ -1140,7 +1135,6 @@ sub command_line_setup {
# Specify ports
'build-thread|mtr-build-thread=i' => \$opt_build_thread,
'port-base|mtr-port-base=i' => \$opt_port_base,
'port-group-size=s' => \$opt_port_group_size,
# Test case authoring
'record' => \$opt_record,
......@@ -1469,7 +1463,7 @@ sub command_line_setup {
foreach my $fs (@tmpfs_locations)
{
if ( -d $fs && ! -l $fs )
if ( -d $fs && ! -l $fs && -w $fs )
{
my $template= "var_${opt_build_thread}_XXXX";
$opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
......@@ -1833,16 +1827,16 @@ sub set_build_thread_ports($) {
$ENV{MTR_BUILD_THREAD}= $build_thread;
# Calculate baseport
$baseport= $build_thread * $opt_port_group_size + 10000;
if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 )
$baseport= $build_thread * 20 + 10000;
if ( $baseport < 5001 or $baseport + 19 >= 32767 )
{
mtr_error("MTR_BUILD_THREAD number results in a port",
"outside 5001 - 32767",
"($baseport - $baseport + $opt_port_group_size)");
"($baseport - $baseport + 19)");
}
mtr_report("Using MTR_BUILD_THREAD $build_thread,",
"with reserved ports $baseport..".($baseport+($opt_port_group_size-1)));
"with reserved ports $baseport..".($baseport+19));
}
......@@ -3190,6 +3184,7 @@ sub ndbcluster_start ($) {
return 0;
}
sub mysql_server_start($) {
my ($mysqld, $tinfo) = @_;
......@@ -3394,8 +3389,8 @@ sub kill_leftovers ($) {
sub check_ports_free ($)
{
my $bthread= shift;
my $portbase = $bthread * $opt_port_group_size + 10000;
for ($portbase..$portbase+($opt_port_group_size-1)){
my $portbase = $bthread * 10 + 10000;
for ($portbase..$portbase+9){
if (mtr_ping_port($_)){
mtr_report(" - 'localhost:$_' was not free");
return 0; # One port was not free
......@@ -4817,7 +4812,6 @@ sub extract_warning_lines ($$) {
# Perl code.
my @antipatterns =
(
@global_suppressions,
qr/error .*connecting to master/,
qr/Plugin 'ndbcluster' will be forced to shutdown/,
qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
......@@ -6531,8 +6525,6 @@ Options that specify ports
build-thread=# Can be set in environment variable MTR_BUILD_THREAD.
Set MTR_BUILD_THREAD="auto" to automatically aquire
a build thread id that is unique to current host
port-group-size=N Reserve groups of TCP ports of size N for each MTR thread
Options for test case authoring
......
......@@ -1402,6 +1402,56 @@ t1 CREATE TABLE `t1` (
`consultant_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
#
# BUG#27788685: NO WARNING WHEN TRUNCATING A STRING WITH DATA LOSS
#
SET GLOBAL max_allowed_packet=17825792;
CREATE TABLE t1 (t1_fld1 TEXT);
CREATE TABLE t2 (t2_fld1 MEDIUMTEXT);
CREATE TABLE t3 (t3_fld1 LONGTEXT);
INSERT INTO t1 VALUES (REPEAT('a',300));
INSERT INTO t2 VALUES (REPEAT('b',65680));
INSERT INTO t3 VALUES (REPEAT('c',16777300));
SELECT LENGTH(t1_fld1) FROM t1;
LENGTH(t1_fld1)
300
SELECT LENGTH(t2_fld1) FROM t2;
LENGTH(t2_fld1)
65680
SELECT LENGTH(t3_fld1) FROM t3;
LENGTH(t3_fld1)
16777300
# With strict mode
SET SQL_MODE='STRICT_ALL_TABLES';
ALTER TABLE t1 CHANGE `t1_fld1` `my_t1_fld1` TINYTEXT;
ERROR 22001: Data too long for column 'my_t1_fld1' at row 1
ALTER TABLE t2 CHANGE `t2_fld1` `my_t2_fld1` TEXT;
ERROR 22001: Data too long for column 'my_t2_fld1' at row 1
ALTER TABLE t3 CHANGE `t3_fld1` `my_t3_fld1` MEDIUMTEXT;
ERROR 22001: Data too long for column 'my_t3_fld1' at row 1
# With non-strict mode
SET SQL_MODE='';
ALTER TABLE t1 CHANGE `t1_fld1` `my_t1_fld1` TINYTEXT;
Warnings:
Warning 1265 Data truncated for column 'my_t1_fld1' at row 1
ALTER TABLE t2 CHANGE `t2_fld1` `my_t2_fld1` TEXT;
Warnings:
Warning 1265 Data truncated for column 'my_t2_fld1' at row 1
ALTER TABLE t3 CHANGE `t3_fld1` `my_t3_fld1` MEDIUMTEXT;
Warnings:
Warning 1265 Data truncated for column 'my_t3_fld1' at row 1
SELECT LENGTH(my_t1_fld1) FROM t1;
LENGTH(my_t1_fld1)
255
SELECT LENGTH(my_t2_fld1) FROM t2;
LENGTH(my_t2_fld1)
65535
SELECT LENGTH(my_t3_fld1) FROM t3;
LENGTH(my_t3_fld1)
16777215
DROP TABLE t1, t2, t3;
SET SQL_MODE=default;
SET GLOBAL max_allowed_packet=default;
CREATE TABLE t1 (
id INT(11) NOT NULL,
x_param INT(11) DEFAULT NULL,
......
This diff is collapsed.
......@@ -499,9 +499,42 @@ where
D1.a= t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where
1 PRIMARY <derived2> hash_ALL key0 #hash#key0 5 test.t1.a 100 Using join buffer (flat, BNLH join)
1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 10
2 DERIVED t2 ALL NULL NULL NULL NULL 100 Using filesort
set join_cache_level=@tmp_jcl;
set optimizer_switch=@tmp_os;
drop table t1, t2;
#
# Bug mdev-17382: equi-join of derived table with join_cache_level=4
#
CREATE TABLE t1 (
id int NOT NULL,
amount decimal DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE t2 (
id int NOT NULL,
name varchar(50) DEFAULT NULL,
PRIMARY KEY (id)
);
INSERT INTO t1 VALUES
(1, 10.0000), (2, 20.0000), (3, 30.0000), (4, 40.0000),
(5, NULL), (6, NULL), (7, 70.0000), (8, 80.0000);
INSERT INTO t2 VALUES
(1,'A'), (2,'B'), (3,'C'), (4,'D'), (5, NULL), (6, NULL),
(7,'E'), (8,'F'), (9,'G'), (10,'H'), (11, NULL), (12, NULL);
set join_cache_level=4;
EXPLAIN
SELECT t2.id,t2.name,t.total_amt
FROM t2
LEFT JOIN
(SELECT id, sum(amount) total_amt FROM t1 GROUP BY id) AS t
ON t2.id=t.id
WHERE t2.id < 3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 3 Using index condition
1 PRIMARY <derived2> ref key0 key0 5 test.t2.id 2
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
set join_cache_level=default;
DROP TABLE t1,t2;
set optimizer_switch=@exit_optimizer_switch;
......@@ -1111,7 +1111,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(7))) and trigcond(((<cache>(5) = 5) or isnull(5))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(/*always not null*/ 1))) and trigcond(((<cache>(5) = 5) or isnull(/*always not null*/ 1))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
SELECT t.a,t.b FROM t3 RIGHT JOIN ((SELECT * FROM t1) AS t, t2) ON t2.b != 0
WHERE (t.a,t.b) NOT IN (SELECT 7, 5);
a b
......@@ -1125,7 +1125,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(7))) and trigcond(((<cache>(5) = 5) or isnull(5))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(/*always not null*/ 1))) and trigcond(((<cache>(5) = 5) or isnull(/*always not null*/ 1))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
SELECT t.a,t.b FROM t3 RIGHT JOIN (v1 AS t, t2) ON t2.b != 0
WHERE (t.a,t.b) NOT IN (SELECT 7, 5);
a b
......@@ -1139,7 +1139,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(7))) and trigcond(((<cache>(5) = 5) or isnull(5))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<expr_cache><6,5>(<in_optimizer>((6,5),<exists>(select 7,5 having (trigcond(((<cache>(6) = 7) or isnull(/*always not null*/ 1))) and trigcond(((<cache>(5) = 5) or isnull(/*always not null*/ 1))) and trigcond(<is_not_null_test>(7)) and trigcond(<is_not_null_test>(5))))))))
DROP VIEW v1;
DROP TABLE t1,t2,t3;
#
......
......@@ -106,5 +106,25 @@ Note 1003 select `test`.`t2`.`d1` AS `d1`,`test`.`t1`.`d1` AS `d1` from `test`.`
DROP VIEW v1;
DROP TABLE t1,t2;
#
# MDEV-15475: Assertion `!table || (!table->read_set ||
# bitmap_is_set(table->read_set, field_index))'
# failed on EXPLAIN EXTENDED with constant table and view
#
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1);
EXPLAIN EXTENDED SELECT ISNULL(pk) FROM v1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 select isnull(/*always not null*/ 1) AS `ISNULL(pk)` from dual
EXPLAIN EXTENDED SELECT IFNULL(pk,0) FROM v1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 select ifnull(1,0) AS `IFNULL(pk,0)` from dual
DROP VIEW v1;
DROP TABLE t1;
#
# End of 5.5 tests
#
......@@ -2770,6 +2770,167 @@ SEC_TO_TIME(MAKEDATE(0,RAND(~0)))
838:59:59
Warnings:
Warning 1292 Truncated incorrect time value: '20000101'
SELECT PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'));
PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'))
24257
#
# MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
#
SELECT
MAKETIME(1e10,0,0),
MAKETIME(-1e10,0,0),
MAKETIME(1e50,0,0),
MAKETIME(-1e50,0,0),
MAKETIME(COALESCE(1e50),0,0),
MAKETIME(COALESCE(-1e50),0,0);
MAKETIME(1e10,0,0) 838:59:59
MAKETIME(-1e10,0,0) -838:59:59
MAKETIME(1e50,0,0) 838:59:59
MAKETIME(-1e50,0,0) -838:59:59
MAKETIME(COALESCE(1e50),0,0) 838:59:59
MAKETIME(COALESCE(-1e50),0,0) -838:59:59
Warnings:
Level Warning
Code 1292
Message Truncated incorrect time value: '10000000000:00:00'
Level Warning
Code 1292
Message Truncated incorrect time value: '-10000000000:00:00'
Level Warning
Code 1292
Message Truncated incorrect time value: '9223372036854775807:00:00'
Level Warning
Code 1292
Message Truncated incorrect time value: '-9223372036854775808:00:00'
Level Warning
Code 1292
Message Truncated incorrect time value: '9223372036854775807:00:00'
Level Warning
Code 1292
Message Truncated incorrect time value: '-9223372036854775808:00:00'
CREATE TABLE t1 (a FLOAT);
INSERT INTO t1 VALUES (1e30),(-1e30);
SELECT MAKETIME(a,0,0) FROM t1;
MAKETIME(a,0,0)
838:59:59
-838:59:59
Warnings:
Warning 1292 Truncated incorrect time value: '9223372036854775807:00:00'
Warning 1292 Truncated incorrect time value: '-9223372036854775808:00:00'
DROP TABLE t1;
#
# MDEV-17244 MAKETIME(900,0,0.111) returns a wrong result
#
SELECT MAKETIME(900,0,0);
MAKETIME(900,0,0)
838:59:59
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.1);
MAKETIME(900,0,0.1)
838:59:59.9
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.11);
MAKETIME(900,0,0.11)
838:59:59.99
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.111);
MAKETIME(900,0,0.111)
838:59:59.999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.1111);
MAKETIME(900,0,0.1111)
838:59:59.9999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.11111);
MAKETIME(900,0,0.11111)
838:59:59.99999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.111111);
MAKETIME(900,0,0.111111)
838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.1111111);
MAKETIME(900,0,0.1111111)
838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.11111111);
MAKETIME(900,0,0.11111111)
838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,0.111111111);
MAKETIME(900,0,0.111111111)
838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:00'
SELECT MAKETIME(900,0,EXP(1));
MAKETIME(900,0,EXP(1))
838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '900:00:02'
SELECT MAKETIME(-900,0,0);
MAKETIME(-900,0,0)
-838:59:59
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.1);
MAKETIME(-900,0,0.1)
-838:59:59.9
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.11);
MAKETIME(-900,0,0.11)
-838:59:59.99
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.111);
MAKETIME(-900,0,0.111)
-838:59:59.999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.1111);
MAKETIME(-900,0,0.1111)
-838:59:59.9999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.11111);
MAKETIME(-900,0,0.11111)
-838:59:59.99999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.111111);
MAKETIME(-900,0,0.111111)
-838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.1111111);
MAKETIME(-900,0,0.1111111)
-838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.11111111);
MAKETIME(-900,0,0.11111111)
-838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,0.111111111);
MAKETIME(-900,0,0.111111111)
-838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:00'
SELECT MAKETIME(-900,0,EXP(1));
MAKETIME(-900,0,EXP(1))
-838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '-900:00:02'
#
# End of 5.5 tests
#
......
......@@ -2569,6 +2569,35 @@ foo@localhost foo@127.0.0.1
# Clean-up
DROP USER foo@'127.0.0.1';
# End of Bug#12766319
create user foo@localhost;
create database foodb;
grant create routine on foodb.* to foo@localhost;
create procedure fooproc() select 'i am fooproc';
show grants;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost'
rename table mysql.procs_priv to mysql.procs_priv1;
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
rename table mysql.procs_priv1 to mysql.procs_priv;
show grants for foo@localhost;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost'
drop user foo@localhost;
drop procedure fooproc;
drop database foodb;
#
# Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS
# DATABASE SECURITY
......
This diff is collapsed.
......@@ -226,7 +226,7 @@ set join_cache_level=3;
explain SELECT 1 FROM (SELECT url, id FROM t2 LIMIT 1 OFFSET 20) derived RIGHT JOIN t1 ON t1.id = derived.id;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL #
1 PRIMARY <derived2> hash_ALL key0 #hash#key0 25 test.t1.id # Using join buffer (flat, BNLH join)
1 PRIMARY <derived2> ref key0 key0 25 test.t1.id #
2 DERIVED t2 ALL NULL NULL NULL NULL #
set join_cache_level= @tmp_mdev5037;
drop table t0,t1,t2;
......
......@@ -1516,11 +1516,13 @@ ERROR 42S22: Unknown column 'f' in 'from clause'
DROP TABLE t;
CREATE TABLE t (f INT);
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
f
DROP TABLE t;
CREATE TABLE t (i INT);
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
ERROR 42S22: Unknown column 't1.f' in 'field list'
CALL p;
ERROR 42S22: Unknown column 't1.f' in 'field list'
DROP PROCEDURE p;
DROP TABLE t;
CREATE TABLE t1 (a INT, b INT);
......
This diff is collapsed.
This diff is collapsed.
......@@ -1067,6 +1067,12 @@ The following specify which files/extra groups are read (specified before remain
--wsrep-causal-reads
(DEPRECATED) Setting this variable is equivalent to
setting wsrep_sync_wait READ flag
--wsrep-certification-rules=name
Certification rules to use in the cluster. Possible
values are: "strict": stricter rules that could result in
more certification failures. "optimized": relaxed rules
that allow more concurrency and cause less certification
failures.
--wsrep-certify-nonPK
Certify tables with no primary key
(Defaults to on; use --skip-wsrep-certify-nonPK to disable.)
......@@ -1451,6 +1457,7 @@ wait-timeout 28800
wsrep-OSU-method TOI
wsrep-auto-increment-control TRUE
wsrep-causal-reads FALSE
wsrep-certification-rules strict
wsrep-certify-nonPK TRUE
wsrep-cluster-address
wsrep-cluster-name my_wsrep_cluster
......
......@@ -617,6 +617,29 @@ SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
# Connection default
DROP USER user2@localhost;
DROP DATABASE db1;
create user foo@local_ost;
create user foo@`local\_ost`;
update mysql.user set plugin='foobar' where host='local\\_ost';
flush privileges;
create database foodb;
grant create routine on foodb.* to foo@local_ost;
select user(), current_user();
user() current_user()
foo@localhost foo@local_ost
show grants;
Grants for foo@local_ost
GRANT USAGE ON *.* TO 'foo'@'local_ost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
create procedure fooproc() select 'i am fooproc';
show grants;
Grants for foo@local_ost
GRANT USAGE ON *.* TO 'foo'@'local_ost'
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'local_ost'
drop user foo@local_ost;
drop user foo@`local\_ost`;
drop procedure fooproc;
drop database foodb;
#
# Test for bug#12602983 - User without privilege on routine can discover
# its existence by executing "select non_existing_func();" or by
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment