Commit 9e78a031 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Update upstream source from tag 'upstream/5.5.63'

Update to upstream version '5.5.63'
with Debian dir fc4032dc747eef4e5be3af715bcfbdd82284a3e4
parents 696c5f5d 15f2dedb
......@@ -23,7 +23,7 @@
# Tool used for executing a suite of .test file
#
# See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html
# https://mariadb.com/kb/en/library/mysqltest/
#
# Please keep the test framework tools identical in all versions!
#
......
......@@ -25,7 +25,7 @@
# Tool used for executing a suite of .test files
#
# See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html
# https://mariadb.com/kb/en/library/mysqltest/
#
#
##############################################################################
......@@ -1140,7 +1140,7 @@ sub command_line_setup {
'debug' => \$opt_debug,
'debug-common' => \$opt_debug_common,
'debug-server' => \$opt_debug_server,
'gdb' => \$opt_gdb,
'gdb=s' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
'manual-lldb' => \$opt_manual_lldb,
......@@ -1234,6 +1234,9 @@ sub command_line_setup {
'skip-test-list=s' => \@opt_skip_test_list
);
# fix options (that take an optional argument and *only* after = sign
my %fixopt = ( '--gdb' => '--gdb=#' );
@ARGV = map { $fixopt{$_} or $_ } @ARGV;
GetOptions(%options) or usage("Can't read options");
usage("") if $opt_usage;
list_options(\%options) if $opt_list_options;
......@@ -1457,7 +1460,7 @@ sub command_line_setup {
foreach my $fs (@tmpfs_locations)
{
if ( -d $fs )
if ( -d $fs && -w $fs )
{
my $template= "var_${opt_build_thread}_XXXX";
$opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
......@@ -5992,7 +5995,9 @@ sub gdb_arguments {
# Put $args into a single string
$input = $input ? "< $input" : "";
if ($type ne 'client' and $opt_valgrind_mysqld) {
if ($type eq 'client') {
mtr_tofile($gdb_init_file, "set args @$$args $input");
} elsif ($opt_valgrind_mysqld) {
my $v = $$exe;
my $vargs = [];
valgrind_arguments($vargs, \$v);
......@@ -6002,7 +6007,11 @@ shell sleep 1
target remote | /usr/lib64/valgrind/../../bin/vgdb
EOF
} else {
mtr_tofile($gdb_init_file, "set args @$$args $input\n");
mtr_tofile($gdb_init_file,
join("\n",
"set args @$$args $input",
split /;/, $opt_gdb || ""
));
}
if ( $opt_manual_gdb )
......
......@@ -1392,3 +1392,53 @@ 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;
......@@ -264,3 +264,17 @@ delete from t1 where a=32767;
insert into t1 values(NULL);
ERROR 22003: Out of range value for column 'a' at row 1
drop table t1;
create table t1 (pk int auto_increment primary key, f varchar(20));
insert t1 (f) values ('a'), ('b'), ('c'), ('d');
select null, f into outfile 'load.data' from t1 limit 1;
load data infile 'load.data' into table t1;
insert t1 (f) values ('<===');
select * from t1;
pk f
1 a
2 b
3 c
4 d
5 a
6 <===
drop table t1;
......@@ -508,3 +508,14 @@ DROP TABLE t1;
SELECT 100 BETWEEN 1 AND 9223372036854775808;
100 BETWEEN 1 AND 9223372036854775808
1
#
# MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615
#
CREATE TABLE t1 (c1 bigint(20) unsigned NOT NULL);
INSERT INTO t1 VALUES (0),(101),(255);
SELECT * FROM t1 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1;
c1
0
101
255
DROP TABLE t1;
......@@ -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;
......@@ -1101,7 +1101,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
......@@ -1115,7 +1115,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
......@@ -1129,7 +1129,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
#
......@@ -2657,6 +2657,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
#
......@@ -2581,3 +2581,24 @@ 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;
ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
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'
rename table mysql.procs_priv1 to mysql.procs_priv;
drop user foo@localhost;
drop procedure fooproc;
drop database foodb;
......@@ -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;
......
......@@ -1514,11 +1514,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);
......
......@@ -63,3 +63,44 @@ CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
RENAME TABLE t1 TO T1;
ALTER TABLE T1 RENAME t1;
DROP TABLE t1;
create database TEST;
create procedure TEST.pr() begin end;
create procedure test.pr() begin end;
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
TEST
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
drop procedure test.pr;
drop database TEST;
......@@ -587,3 +587,29 @@ a
2
drop table "a1\""b1";
set sql_mode=default;
create table t1 (a text);
select count(*) from t1;
count(*)
41
truncate table t1;
select count(*) from t1;
count(*)
41
truncate table t1;
select count(*) from t1;
count(*)
0
truncate table t1;
select count(*) from t1;
count(*)
0
truncate table t1;
select count(*) from t1;
count(*)
41
truncate table t1;
select count(*) from t1;
count(*)
0
truncate table t1;
drop table t1;
......@@ -4317,12 +4317,12 @@ second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL E
show create event ee1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
create event ee2 on schedule at '2030-12-31 21:01:22' do set @a=5;
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
second ee2 root@localhost UTC ONE TIME 2030-12-31 21:01:22 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
drop database second;
create database third;
......@@ -4330,7 +4330,7 @@ use third;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
third ee2 root@localhost UTC ONE TIME 2030-12-31 21:01:22 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
drop database third;
set time_zone = 'SYSTEM';
......
......@@ -162,3 +162,14 @@ delete from mysql.columns_priv where User like 'mysqltest_%';
flush privileges;
drop database mysqltest_db1;
set global read_only= @start_read_only;
#
# MDEV-16987 - ALTER DATABASE possible in read-only mode
#
GRANT ALTER ON test1.* TO user1@localhost;
CREATE DATABASE test1;
SET GLOBAL read_only=1;
ALTER DATABASE test1 CHARACTER SET utf8;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
SET GLOBAL read_only=0;
DROP DATABASE test1;
DROP USER user1@localhost;
......@@ -85,3 +85,19 @@ checksum table t1 extended;
Table Checksum
test.t1 4108368782
drop table t1;
#
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
#
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
# Important is that checksum is different from following
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 2514025256
UPDATE t1 SET c21='cat' WHERE c1=5;
# Important is that checksum is different from above
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 2326430205
drop table t1;
# End of 5.5 tests
......@@ -85,3 +85,19 @@ checksum table t1 extended;
Table Checksum
test.t1 3885665021
drop table t1;
#
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
#
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
# Important is that checksum is different from following
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 2514025256
UPDATE t1 SET c21='cat' WHERE c1=5;
# Important is that checksum is different from above
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 2326430205
drop table t1;
# End of 5.5 tests
......@@ -617,3 +617,24 @@ 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` identified by 'nevermore';
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;
......@@ -8055,4 +8055,21 @@ SET S.CLOSE_YN = ''
where 1=1;
drop function if exists f1;
drop table t1,t2;
#
# MDEV-16957: Server crashes in Field_iterator_natural_join::next
# upon 2nd execution of SP
#
CREATE TABLE t1 (a INT, b VARCHAR(32));
CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c);
CALL sp;
ERROR 42S22: Unknown column 'c' in 'from clause'
CALL sp;
ERROR 42S22: Unknown column 'c' in 'from clause'
CALL sp;
ERROR 42S22: Unknown column 'c' in 'from clause'
alter table t1 add column c int;
CALL sp;
c a b a b
DROP PROCEDURE sp;
DROP TABLE t1;
# End of 5.5 test
Supports Markdown
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