159 changed files with 2564 additions and 454 deletions
-
41CMakeLists.txt
-
5client/mysqlbinlog.cc
-
19cmake/build_configurations/mysql_release.cmake
-
44cmake/compile_flags.cmake
-
1cmake/cpack_rpm.cmake
-
93cmake/maintainer.cmake
-
21cmake/os/Darwin.cmake
-
6cmake/os/WindowsCache.cmake
-
10configure.cmake
-
4extra/replace.c
-
9extra/yassl/README
-
2extra/yassl/include/openssl/ssl.h
-
2extra/yassl/taocrypt/src/rsa.cpp
-
8include/my_check_opt.h
-
18include/my_pthread.h
-
1include/mysql.h
-
1include/mysql.h.pp
-
3libmysql/CMakeLists.txt
-
3libmysql/libmysql.c
-
3libmysqld/lib_sql.cc
-
1mysql-test/lib/My/SafeProcess/Base.pm
-
3mysql-test/lib/My/SafeProcess/safe_process.cc
-
58mysql-test/mysql-test-run.pl
-
14mysql-test/r/frm_bad_row_type-7333.result
-
24mysql-test/r/func_time.result
-
14mysql-test/r/group_by.result
-
9mysql-test/r/insert_update_autoinc-7150.result
-
10mysql-test/r/kill-2.result
-
49mysql-test/r/mdev6830.result
-
5mysql-test/r/processlist.result
-
32mysql-test/r/sp-innodb.result
-
2mysql-test/r/view.result
-
5mysql-test/r/windows.result
-
0mysql-test/std_data/bad_row_type.MYD
-
BINmysql-test/std_data/bad_row_type.MYI
-
BINmysql-test/std_data/bad_row_type.frm
-
8mysql-test/suite/binlog/r/binlog_switch_inside_trans.result
-
2mysql-test/suite/binlog/t/binlog_grant.test
-
6mysql-test/suite/binlog/t/binlog_switch_inside_trans.test
-
1mysql-test/suite/innodb/r/innodb_corrupt_bit.result
-
11mysql-test/suite/innodb/r/insert_debug.result
-
21mysql-test/suite/innodb/r/multi_repair-7404.result
-
253mysql-test/suite/innodb/r/sp_temp_table.result
-
240mysql-test/suite/innodb/r/strict_mode.result
-
2mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
-
2mysql-test/suite/innodb/t/innodb_bug12400341.test
-
17mysql-test/suite/innodb/t/innodb_corrupt_bit.test
-
17mysql-test/suite/innodb/t/insert_debug.test
-
18mysql-test/suite/innodb/t/multi_repair-7404.test
-
103mysql-test/suite/innodb/t/sp_temp_table.test
-
251mysql-test/suite/innodb/t/strict_mode.test
-
17mysql-test/suite/maria/insert_select-7314.result
-
27mysql-test/suite/maria/insert_select-7314.test
-
13mysql-test/suite/maria/insert_select.result
-
20mysql-test/suite/maria/insert_select.test
-
12mysql-test/suite/rpl/r/myisam_external_lock.result
-
2mysql-test/suite/rpl/t/myisam_external_lock-slave.opt
-
24mysql-test/suite/rpl/t/myisam_external_lock.test
-
7mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
-
6mysql-test/suite/sys_vars/r/stored_program_cache_basic.result
-
52mysql-test/suite/sys_vars/r/stored_program_cache_func.result
-
6mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
-
43mysql-test/suite/sys_vars/t/stored_program_cache_func.test
-
14mysql-test/t/frm_bad_row_type-7333.test
-
18mysql-test/t/func_time.test
-
15mysql-test/t/group_by.test
-
8mysql-test/t/insert_update_autoinc-7150.test
-
1mysql-test/t/kill-2-master.opt
-
29mysql-test/t/kill-2.test
-
1mysql-test/t/lock_sync.test
-
1mysql-test/t/mdev6830-master.opt
-
63mysql-test/t/mdev6830.test
-
18mysql-test/t/processlist.test
-
45mysql-test/t/sp-innodb.test
-
10mysql-test/t/view.test
-
16mysql-test/t/windows.test
-
13mysys/my_context.c
-
24mysys/my_wincond.c
-
16mysys/thr_lock.c
-
22packaging/rpm-oel/mysql-systemd-start
-
8packaging/rpm-oel/mysql.init
-
7scripts/CMakeLists.txt
-
6scripts/mysql_setpermission.sh
-
1scripts/mysqld_safe.sh
-
2sql-bench/test-table-elimination.sh
-
2sql-common/client.c
-
5sql-common/client_plugin.c
-
4sql/handler.cc
-
11sql/handler.h
-
18sql/item.cc
-
2sql/item.h
-
5sql/item_func.cc
-
7sql/item_func.h
-
7sql/item_timefunc.cc
-
16sql/log_event.cc
-
4sql/log_event.h
-
30sql/opt_range.cc
-
2sql/sql_insert.cc
-
117sql/sql_parse.cc
-
3sql/sql_parse.h
@ -0,0 +1,44 @@ |
|||
# Copyright (c) 2014, 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 |
|||
# the Free Software Foundation; version 2 of the License. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program; if not, write to the Free Software |
|||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|||
|
|||
|
|||
## ADD_COMPILE_FLAGS(<source files> COMPILE_FLAGS <flags>) |
|||
MACRO(ADD_COMPILE_FLAGS) |
|||
SET(FILES "") |
|||
SET(FLAGS "") |
|||
SET(COMPILE_FLAGS) |
|||
FOREACH(ARG ${ARGV}) |
|||
IF(ARG STREQUAL "COMPILE_FLAGS") |
|||
SET(COMPILE_FLAGS "COMPILE_FLAGS") |
|||
ELSEIF(COMPILE_FLAGS) |
|||
LIST(APPEND FLAGS ${ARG}) |
|||
ELSE() |
|||
LIST(APPEND FILES ${ARG}) |
|||
ENDIF() |
|||
ENDFOREACH() |
|||
FOREACH(FILE ${FILES}) |
|||
FOREACH(FLAG ${FLAGS}) |
|||
GET_SOURCE_FILE_PROPERTY(PROP ${FILE} COMPILE_FLAGS) |
|||
IF(NOT PROP) |
|||
SET(PROP ${FLAG}) |
|||
ELSE() |
|||
SET(PROP "${PROP} ${FLAG}") |
|||
ENDIF() |
|||
SET_SOURCE_FILES_PROPERTIES( |
|||
${FILE} PROPERTIES COMPILE_FLAGS "${PROP}" |
|||
) |
|||
ENDFOREACH() |
|||
ENDFOREACH() |
|||
ENDMACRO() |
|||
@ -0,0 +1,14 @@ |
|||
call mtr.add_suppression("bad_row_type.frm: invalid value 11 for the field row_format"); |
|||
select * from bad_row_type; |
|||
category_id category_name |
|||
show create table bad_row_type; |
|||
Table Create Table |
|||
bad_row_type CREATE TABLE `bad_row_type` ( |
|||
`category_id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`category_name` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`category_id`) |
|||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 /* `compression`='tokudb_zlib' */ |
|||
show table status like 'bad_row_type'; |
|||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment |
|||
bad_row_type MyISAM 10 Dynamic 0 0 0 281474976710655 1024 0 1 x x NULL utf8_general_ci NULL `compression`='tokudb_zlib' |
|||
drop table bad_row_type; |
|||
@ -0,0 +1,9 @@ |
|||
create table t1 (a int(10) auto_increment primary key, b int(11)); |
|||
insert t1 values (null,1); |
|||
insert t1 values (null,2), (1,-1), (null,3) on duplicate key update b=values(b); |
|||
select * from t1; |
|||
a b |
|||
1 -1 |
|||
2 2 |
|||
3 3 |
|||
drop table t1; |
|||
@ -0,0 +1,10 @@ |
|||
# |
|||
# MDEV-6896 kill user command cause MariaDB crash! |
|||
# |
|||
create user foo@'127.0.0.1'; |
|||
select user from information_schema.processlist; |
|||
user |
|||
foo |
|||
root |
|||
kill user foo@'127.0.0.1'; |
|||
drop user foo@'127.0.0.1'; |
|||
@ -0,0 +1,49 @@ |
|||
drop table if exists t1,t2,t3; |
|||
drop view if exists v2,v3; |
|||
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM; |
|||
CREATE TABLE t2 ( |
|||
f1 DATE, |
|||
f2 VARCHAR(1024), |
|||
f3 VARCHAR(10), |
|||
f4 DATE, |
|||
f5 VARCHAR(10), |
|||
f6 VARCHAR(10), |
|||
f7 VARCHAR(10), |
|||
f8 DATETIME, |
|||
f9 INT, |
|||
f10 VARCHAR(1024), |
|||
f11 VARCHAR(1024), |
|||
f12 INT, |
|||
f13 VARCHAR(1024) |
|||
) ENGINE=MyISAM; |
|||
CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2; |
|||
CREATE TABLE t3 ( |
|||
f1 VARCHAR(1024), |
|||
f2 VARCHAR(1024), |
|||
f3 DATETIME, |
|||
f4 VARCHAR(10), |
|||
f5 INT, |
|||
f6 VARCHAR(10), |
|||
f7 VARCHAR(1024), |
|||
f8 VARCHAR(10), |
|||
f9 INT, |
|||
f10 DATE, |
|||
f11 INT, |
|||
f12 VARCHAR(1024), |
|||
f13 VARCHAR(10), |
|||
f14 DATE, |
|||
f15 DATETIME |
|||
) ENGINE=MyISAM; |
|||
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3; |
|||
INSERT INTO t3 VALUES |
|||
('FOO','foo','2000-08-04 00:00:00','one',1,'1','FOO','foo',1,'2004-05-09',1,'one','one','2001-12-07','2001-10-17 08:25:04'), |
|||
('BAR','bar','2001-01-01 04:52:37','two',2,'2','BAR','bar',2,'2008-01-01',2,'two','two','2006-06-19','2002-01-01 08:22:49'); |
|||
CREATE TABLE t4 (f1 VARCHAR(10), f2 INT) ENGINE=MyISAM; |
|||
SELECT * FROM t1; |
|||
pk |
|||
SELECT non_existing FROM v2; |
|||
ERROR 42S22: Unknown column 'non_existing' in 'field list' |
|||
SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5; |
|||
pk f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f1 f2 |
|||
drop table t1,t2,t3,t4; |
|||
drop view v2,v3; |
|||
@ -0,0 +1,32 @@ |
|||
drop table if exists t1,t2; |
|||
drop procedure if exists p1; |
|||
# |
|||
#MDEV-6985: MariaDB crashes on stored procedure call |
|||
# |
|||
CREATE TABLE `t1` ( |
|||
`ID` int(11) NOT NULL, |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB; |
|||
CREATE TABLE `t2` ( |
|||
`ID` int(11) NOT NULL, |
|||
`DATE` datetime DEFAULT NULL, |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB; |
|||
CREATE PROCEDURE `p1`() |
|||
BEGIN |
|||
DECLARE _mySelect CURSOR FOR |
|||
SELECT DISTINCT t1.ID |
|||
FROM t1 |
|||
LEFT JOIN t2 AS t2 ON |
|||
t2.ID = t1.ID |
|||
AND t2.DATE = ( |
|||
SELECT MAX(T3.DATE) FROM t2 AS T3 WHERE T3.ID = t2.ID AND T3.DATE<=NOW() |
|||
) |
|||
WHERE t1.ID = 1; |
|||
OPEN _mySelect; |
|||
CLOSE _mySelect; |
|||
END ;; |
|||
CALL p1(); |
|||
CALL p1(); |
|||
drop procedure p1; |
|||
drop table t1,t2; |
|||
@ -0,0 +1,11 @@ |
|||
# |
|||
# Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 |
|||
# CAUSES INFINITE PAGE SPLIT |
|||
# |
|||
SET GLOBAL innodb_change_buffering_debug=1; |
|||
SET GLOBAL innodb_limit_optimistic_insert_debug=1; |
|||
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB |
|||
PARTITION BY HASH (c1) PARTITIONS 15; |
|||
DROP TABLE t1; |
|||
SET GLOBAL innodb_change_buffering_debug=0; |
|||
SET GLOBAL innodb_limit_optimistic_insert_debug=0; |
|||
@ -0,0 +1,21 @@ |
|||
create table `t1`(`a` int) engine=innodb partition by key (`a`); |
|||
create table `t2`(`b` int) engine=innodb; |
|||
create table `t3`(`c` int) engine=innodb; |
|||
insert t1 values (1); |
|||
insert t2 values (2); |
|||
insert t3 values (3); |
|||
repair table `t1`,`t2`,`t3`; |
|||
Table Op Msg_type Msg_text |
|||
test.t1 repair status OK |
|||
test.t2 repair status OK |
|||
test.t3 repair status OK |
|||
select * from t1; |
|||
a |
|||
1 |
|||
select * from t2; |
|||
b |
|||
2 |
|||
select * from t3; |
|||
c |
|||
3 |
|||
drop table t1, t2, t3; |
|||
@ -0,0 +1,253 @@ |
|||
# |
|||
# Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE |
|||
# CALLED FROM A FUNCTION |
|||
# |
|||
call mtr.add_suppression("MySQL is trying to drop table"); |
|||
CREATE PROCEDURE cachedata( |
|||
IN obj_id BIGINT UNSIGNED, |
|||
IN start DATETIME, |
|||
IN end DATETIME |
|||
) |
|||
cachedata:BEGIN |
|||
DECLARE cache_count BIGINT; |
|||
SET @timestamp := NOW(); |
|||
CREATE TEMPORARY TABLE IF NOT EXISTS cachedata ( |
|||
timestamp DATETIME, |
|||
object_id BIGINT UNSIGNED NOT NULL, |
|||
start DATETIME, |
|||
end DATETIME, |
|||
seqno BIGINT AUTO_INCREMENT, |
|||
value FLOAT, |
|||
PRIMARY KEY (seqno), |
|||
INDEX (timestamp), |
|||
INDEX (object_id, start, end) |
|||
) ENGINE=INNODB; |
|||
DELETE FROM cachedata WHERE |
|||
timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND); |
|||
SELECT count(*) INTO cache_count FROM cachedata WHERE |
|||
object_id = obj_id |
|||
AND start = start |
|||
AND end = end; |
|||
IF cache_count > 0 THEN LEAVE cachedata; |
|||
END IF; |
|||
INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 2345), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 2345), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 2345); |
|||
END$$ |
|||
CREATE FUNCTION get_cache( |
|||
obj_id BIGINT UNSIGNED, |
|||
start DATETIME, |
|||
end DATETIME |
|||
) |
|||
RETURNS FLOAT |
|||
READS SQL DATA |
|||
BEGIN |
|||
DECLARE result FLOAT; |
|||
CALL cachedata(obj_id, start, end); |
|||
SELECT SUM(value) INTO result FROM cachedata WHERE |
|||
object_id = obj_id |
|||
AND start = start |
|||
AND end = end; |
|||
RETURN result; |
|||
END$$ |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
get_cache(1, '2014-01-01', '2014-02-01') |
|||
95247 |
|||
select sleep(1); |
|||
sleep(1) |
|||
0 |
|||
DROP FUNCTION get_cache; |
|||
DROP PROCEDURE cachedata; |
|||
@ -0,0 +1,240 @@ |
|||
# |
|||
# Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN |
|||
# INNODB_STRICT_MODE = 1 |
|||
# |
|||
set innodb_strict_mode = 0; |
|||
create table t1 (id int auto_increment primary key, |
|||
v varchar(32), |
|||
col1 text, |
|||
col2 text, |
|||
col3 text, |
|||
col4 text, |
|||
col5 text, |
|||
col6 text, |
|||
col7 text, |
|||
col8 text, |
|||
col9 text, |
|||
col10 text, |
|||
col11 text, |
|||
col12 text, |
|||
col13 text, |
|||
col14 text, |
|||
col15 text, |
|||
col16 text, |
|||
col17 text, |
|||
col18 text, |
|||
col19 text, |
|||
col20 text, |
|||
col21 text, |
|||
col22 text, |
|||
col23 text, |
|||
col24 text, |
|||
col25 text, |
|||
col26 text, |
|||
col27 text, |
|||
col28 text, |
|||
col29 text, |
|||
col30 text, |
|||
col31 text, |
|||
col32 text, |
|||
col33 text, |
|||
col34 text, |
|||
col35 text, |
|||
col36 text, |
|||
col37 text, |
|||
col38 text, |
|||
col39 text, |
|||
col40 text, |
|||
col41 text, |
|||
col42 text, |
|||
col43 text, |
|||
col44 text, |
|||
col45 text , |
|||
col46 text, |
|||
col47 text, |
|||
col48 text, |
|||
col49 text, |
|||
col50 text, |
|||
col51 text, |
|||
col52 text, |
|||
col53 text, |
|||
col54 text, |
|||
col55 text, |
|||
col56 text, |
|||
col57 text, |
|||
col58 text, |
|||
col59 text, |
|||
col60 text, |
|||
col61 text, |
|||
col62 text, |
|||
col63 text, |
|||
col64 text, |
|||
col65 text, |
|||
col66 text, |
|||
col67 text, |
|||
col68 text , |
|||
col69 text, |
|||
col70 text, |
|||
col71 text, |
|||
col72 text, |
|||
col73 text, |
|||
col74 text, |
|||
col75 text, |
|||
col76 text, |
|||
col77 text, |
|||
col78 text, |
|||
col79 text, |
|||
col80 text, |
|||
col81 text, |
|||
col82 text, |
|||
col83 text, |
|||
col84 text, |
|||
col85 text, |
|||
col86 text, |
|||
col87 text, |
|||
col88 text, |
|||
col89 text, |
|||
col90 text, |
|||
col91 text, |
|||
col92 text, |
|||
col93 text, |
|||
col94 text, |
|||
col95 text, |
|||
col96 text, |
|||
col97 text, |
|||
col98 text, |
|||
col99 text, |
|||
col100 text, |
|||
col101 text, |
|||
col102 text, |
|||
col103 text, |
|||
col104 text, |
|||
col105 text, |
|||
col106 text, |
|||
col107 text, |
|||
col108 text, |
|||
col109 text, |
|||
col110 text, |
|||
col111 text, |
|||
col112 text, |
|||
col113 text, |
|||
col114 text, |
|||
col115 text, |
|||
col116 text, |
|||
col117 text, |
|||
col118 text, |
|||
col119 text, |
|||
col120 text, |
|||
col121 text, |
|||
col122 text, |
|||
col123 text, |
|||
col124 text, |
|||
col125 text, |
|||
col126 text , |
|||
col127 text, |
|||
col128 text, |
|||
col129 text, |
|||
col130 text, |
|||
col131 text, |
|||
col132 text, |
|||
col133 text, |
|||
col134 text, |
|||
col135 text, |
|||
col136 text, |
|||
col137 text, |
|||
col138 text, |
|||
col139 text, |
|||
col140 text, |
|||
col141 text, |
|||
col142 text, |
|||
col143 text, |
|||
col144 text, |
|||
col145 text, |
|||
col146 text, |
|||
col147 text , |
|||
col148 text, |
|||
col149 text, |
|||
col150 text, |
|||
col151 text, |
|||
col152 text, |
|||
col153 text, |
|||
col154 text, |
|||
col155 text, |
|||
col156 text, |
|||
col157 text, |
|||
col158 text, |
|||
col159 text, |
|||
col160 text, |
|||
col161 text, |
|||
col162 text, |
|||
col163 text, |
|||
col164 text, |
|||
col165 text, |
|||
col166 text, |
|||
col167 text, |
|||
col168 text, |
|||
col169 text, |
|||
col170 text, |
|||
col171 text, |
|||
col172 text , |
|||
col173 text, |
|||
col174 text, |
|||
col175 text, |
|||
col176 text, |
|||
col177 text, |
|||
col178 text, |
|||
col179 text, |
|||
col180 text, |
|||
col181 text, |
|||
col182 text, |
|||
col183 text, |
|||
col184 text, |
|||
col185 text, |
|||
col186 text, |
|||
col187 text, |
|||
col188 text, |
|||
col189 text, |
|||
col190 text, |
|||
col191 text, |
|||
col192 text, |
|||
col193 text, |
|||
col194 text, |
|||
col195 text, |
|||
col196 text, |
|||
col197 text, |
|||
col198 text, |
|||
col199 text, |
|||
col200 text, |
|||
col201 text, |
|||
col202 text, |
|||
col203 text, |
|||
col204 text, |
|||
col205 text, |
|||
col206 text, |
|||
col207 text, |
|||
col208 text, |
|||
col209 text, |
|||
col210 text, |
|||
col211 text, |
|||
col212 text, |
|||
col213 text, |
|||
col214 text, |
|||
col215 text, |
|||
col216 text, |
|||
col217 text, |
|||
col218 text, |
|||
col219 text, |
|||
col220 text, |
|||
col221 text, |
|||
col222 text, |
|||
col223 text, |
|||
col224 text, |
|||
col225 text, |
|||
col226 text, |
|||
col227 text, |
|||
col228 text |
|||
) ENGINE=InnoDB; |
|||
set innodb_strict_mode = 1; |
|||
alter table t1 engine=InnoDB; |
|||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs |
|||
drop table t1; |
|||
@ -0,0 +1,17 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_partition.inc |
|||
|
|||
--echo # |
|||
--echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 |
|||
--echo # CAUSES INFINITE PAGE SPLIT |
|||
--echo # |
|||
|
|||
SET GLOBAL innodb_change_buffering_debug=1; |
|||
SET GLOBAL innodb_limit_optimistic_insert_debug=1; |
|||
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB |
|||
PARTITION BY HASH (c1) PARTITIONS 15; |
|||
DROP TABLE t1; |
|||
|
|||
SET GLOBAL innodb_change_buffering_debug=0; |
|||
SET GLOBAL innodb_limit_optimistic_insert_debug=0; |
|||
@ -0,0 +1,18 @@ |
|||
# |
|||
# MDEV-7404 REPAIR multiple tables crash in MDL_ticket::has_stronger_or_equal_type |
|||
# |
|||
|
|||
--source include/have_partition.inc |
|||
--source include/have_innodb.inc |
|||
create table `t1`(`a` int) engine=innodb partition by key (`a`); |
|||
create table `t2`(`b` int) engine=innodb; |
|||
create table `t3`(`c` int) engine=innodb; |
|||
insert t1 values (1); |
|||
insert t2 values (2); |
|||
insert t3 values (3); |
|||
repair table `t1`,`t2`,`t3`; |
|||
select * from t1; |
|||
select * from t2; |
|||
select * from t3; |
|||
drop table t1, t2, t3; |
|||
|
|||
@ -0,0 +1,103 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/big_test.inc |
|||
|
|||
--echo # |
|||
--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE |
|||
--echo # CALLED FROM A FUNCTION |
|||
--echo # |
|||
|
|||
call mtr.add_suppression("MySQL is trying to drop table"); |
|||
|
|||
DELIMITER $$; |
|||
CREATE PROCEDURE cachedata( |
|||
IN obj_id BIGINT UNSIGNED, |
|||
IN start DATETIME, |
|||
IN end DATETIME |
|||
) |
|||
|
|||
cachedata:BEGIN |
|||
DECLARE cache_count BIGINT; |
|||
|
|||
SET @timestamp := NOW(); |
|||
|
|||
CREATE TEMPORARY TABLE IF NOT EXISTS cachedata ( |
|||
timestamp DATETIME, |
|||
object_id BIGINT UNSIGNED NOT NULL, |
|||
start DATETIME, |
|||
end DATETIME, |
|||
seqno BIGINT AUTO_INCREMENT, |
|||
value FLOAT, |
|||
PRIMARY KEY (seqno), |
|||
INDEX (timestamp), |
|||
INDEX (object_id, start, end) |
|||
) ENGINE=INNODB; |
|||
|
|||
DELETE FROM cachedata WHERE |
|||
timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND); |
|||
|
|||
SELECT count(*) INTO cache_count FROM cachedata WHERE |
|||
object_id = obj_id |
|||
AND start = start |
|||
AND end = end; |
|||
|
|||
IF cache_count > 0 THEN LEAVE cachedata; |
|||
END IF; |
|||
|
|||
INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 2345), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 2345), |
|||
(@timestamp, obj_id, start, end, 1234), |
|||
(@timestamp, obj_id, start, end, 4567), |
|||
(@timestamp, obj_id, start, end, 8901), |
|||
(@timestamp, obj_id, start, end, 2345); |
|||
|
|||
END$$ |
|||
|
|||
|
|||
CREATE FUNCTION get_cache( |
|||
obj_id BIGINT UNSIGNED, |
|||
start DATETIME, |
|||
end DATETIME |
|||
) |
|||
RETURNS FLOAT |
|||
READS SQL DATA |
|||
BEGIN |
|||
DECLARE result FLOAT; |
|||
|
|||
CALL cachedata(obj_id, start, end); |
|||
|
|||
SELECT SUM(value) INTO result FROM cachedata WHERE |
|||
object_id = obj_id |
|||
AND start = start |
|||
AND end = end; |
|||
|
|||
RETURN result; |
|||
END$$ |
|||
|
|||
DELIMITER ;$$ |
|||
|
|||
let $i = 30; |
|||
while ($i) |
|||
{ |
|||
SELECT get_cache(1, '2014-01-01', '2014-02-01'); |
|||
select sleep(1); |
|||
dec $i; |
|||
} |
|||
|
|||
DROP FUNCTION get_cache; |
|||
DROP PROCEDURE cachedata; |
|||
@ -0,0 +1,251 @@ |
|||
--source include/have_innodb.inc |
|||
|
|||
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`) |
|||
{ |
|||
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier |
|||
} |
|||
|
|||
--echo # |
|||
--echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN |
|||
--echo # INNODB_STRICT_MODE = 1 |
|||
--echo # |
|||
|
|||
set innodb_strict_mode = 0; |
|||
|
|||
create table t1 (id int auto_increment primary key, |
|||
v varchar(32), |
|||
col1 text, |
|||
col2 text, |
|||
col3 text, |
|||
col4 text, |
|||
col5 text, |
|||
col6 text, |
|||
col7 text, |
|||
col8 text, |
|||
col9 text, |
|||
col10 text, |
|||
col11 text, |
|||
col12 text, |
|||
col13 text, |
|||
col14 text, |
|||
col15 text, |
|||
col16 text, |
|||
col17 text, |
|||
col18 text, |
|||
col19 text, |
|||
col20 text, |
|||
col21 text, |
|||
col22 text, |
|||
col23 text, |
|||
col24 text, |
|||
col25 text, |
|||
col26 text, |
|||
col27 text, |
|||
col28 text, |
|||
col29 text, |
|||
col30 text, |
|||
col31 text, |
|||
col32 text, |
|||
col33 text, |
|||
col34 text, |
|||
col35 text, |
|||
col36 text, |
|||
col37 text, |
|||
col38 text, |
|||
col39 text, |
|||
col40 text, |
|||
col41 text, |
|||
col42 text, |
|||
col43 text, |
|||
col44 text, |
|||
col45 text , |
|||
col46 text, |
|||
col47 text, |
|||
col48 text, |
|||
col49 text, |
|||
col50 text, |
|||
col51 text, |
|||
col52 text, |
|||
col53 text, |
|||
col54 text, |
|||
col55 text, |
|||
col56 text, |
|||
col57 text, |
|||
col58 text, |
|||
col59 text, |
|||
col60 text, |
|||
col61 text, |
|||
col62 text, |
|||
col63 text, |
|||
col64 text, |
|||
col65 text, |
|||
col66 text, |
|||
col67 text, |
|||
col68 text , |
|||
col69 text, |
|||
col70 text, |
|||
col71 text, |
|||
col72 text, |
|||
col73 text, |
|||
col74 text, |
|||
col75 text, |
|||
col76 text, |
|||
col77 text, |
|||
col78 text, |
|||
col79 text, |
|||
col80 text, |
|||
col81 text, |
|||
col82 text, |
|||
col83 text, |
|||
col84 text, |
|||
col85 text, |
|||
col86 text, |
|||
col87 text, |
|||
col88 text, |
|||
col89 text, |
|||
col90 text, |
|||
col91 text, |
|||
col92 text, |
|||
col93 text, |
|||
col94 text, |
|||
col95 text, |
|||
col96 text, |
|||
col97 text, |
|||
col98 text, |
|||
col99 text, |
|||
col100 text, |
|||
col101 text, |
|||
col102 text, |
|||
col103 text, |
|||
col104 text, |
|||
col105 text, |
|||
col106 text, |
|||
col107 text, |
|||
col108 text, |
|||
col109 text, |
|||
col110 text, |
|||
col111 text, |
|||
col112 text, |
|||
col113 text, |
|||
col114 text, |
|||
col115 text, |
|||
col116 text, |
|||
col117 text, |
|||
col118 text, |
|||
col119 text, |
|||
col120 text, |
|||
col121 text, |
|||
col122 text, |
|||
col123 text, |
|||
col124 text, |
|||
col125 text, |
|||
col126 text , |
|||
col127 text, |
|||
col128 text, |
|||
col129 text, |
|||
col130 text, |
|||
col131 text, |
|||
col132 text, |
|||
col133 text, |
|||
col134 text, |
|||
col135 text, |
|||
col136 text, |
|||
col137 text, |
|||
col138 text, |
|||
col139 text, |
|||
col140 text, |
|||
col141 text, |
|||
col142 text, |
|||
col143 text, |
|||
col144 text, |
|||
col145 text, |
|||
col146 text, |
|||
col147 text , |
|||
col148 text, |
|||
col149 text, |
|||
col150 text, |
|||
col151 text, |
|||
col152 text, |
|||
col153 text, |
|||
col154 text, |
|||
col155 text, |
|||
col156 text, |
|||
col157 text, |
|||
col158 text, |
|||
col159 text, |
|||
col160 text, |
|||
col161 text, |
|||
col162 text, |
|||
col163 text, |
|||
col164 text, |
|||
col165 text, |
|||
col166 text, |
|||
col167 text, |
|||
col168 text, |
|||
col169 text, |
|||
col170 text, |
|||
col171 text, |
|||
col172 text , |
|||
col173 text, |
|||
col174 text, |
|||
col175 text, |
|||
col176 text, |
|||
col177 text, |
|||
col178 text, |
|||
col179 text, |
|||
col180 text, |
|||
col181 text, |
|||
col182 text, |
|||
col183 text, |
|||
col184 text, |
|||
col185 text, |
|||
col186 text, |
|||
col187 text, |
|||
col188 text, |
|||
col189 text, |
|||
col190 text, |
|||
col191 text, |
|||
col192 text, |
|||
col193 text, |
|||
col194 text, |
|||
col195 text, |
|||
col196 text, |
|||
col197 text, |
|||
col198 text, |
|||
col199 text, |
|||
col200 text, |
|||
col201 text, |
|||
col202 text, |
|||
col203 text, |
|||
col204 text, |
|||
col205 text, |
|||
col206 text, |
|||
col207 text, |
|||
col208 text, |
|||
col209 text, |
|||
col210 text, |
|||
col211 text, |
|||
col212 text, |
|||
col213 text, |
|||
col214 text, |
|||
col215 text, |
|||
col216 text, |
|||
col217 text, |
|||
col218 text, |
|||
col219 text, |
|||
col220 text, |
|||
col221 text, |
|||
col222 text, |
|||
col223 text, |
|||
col224 text, |
|||
col225 text, |
|||
col226 text, |
|||
col227 text, |
|||
col228 text |
|||
) ENGINE=InnoDB; |
|||
|
|||
set innodb_strict_mode = 1; |
|||
--error ER_TOO_BIG_ROWSIZE |
|||
alter table t1 engine=InnoDB; |
|||
|
|||
drop table t1; |
|||
@ -0,0 +1,17 @@ |
|||
drop table if exists t1; |
|||
Warnings: |
|||
Note 1051 Unknown table 'test.t1' |
|||
# |
|||
# MDEV-7314 |
|||
# Concurrent "INSERT INTO table SELECT MAX(id)+1 FROM table" are |
|||
# hitting deadlocks on Aria tables using ROW_FORMAT=PAGE |
|||
# |
|||
create table t1 (pk int primary key) engine=Aria; |
|||
insert into t1 values (1); |
|||
insert into t1 select sleep(2)+1 from t1; |
|||
insert into t1 select 2 from t1; |
|||
select * from t1; |
|||
pk |
|||
1 |
|||
2 |
|||
drop table t1; |
|||
@ -0,0 +1,27 @@ |
|||
-- source include/have_maria.inc |
|||
--source include/have_binlog_format_statement.inc |
|||
|
|||
drop table if exists t1; |
|||
|
|||
--echo # |
|||
--echo # MDEV-7314 |
|||
--echo # Concurrent "INSERT INTO table SELECT MAX(id)+1 FROM table" are |
|||
--echo # hitting deadlocks on Aria tables using ROW_FORMAT=PAGE |
|||
--echo # |
|||
|
|||
create table t1 (pk int primary key) engine=Aria; |
|||
insert into t1 values (1); |
|||
|
|||
send insert into t1 select sleep(2)+1 from t1; |
|||
|
|||
--connect (con1,localhost,root,,) |
|||
|
|||
--error 0,1062 |
|||
insert into t1 select 2 from t1; |
|||
|
|||
--connection default |
|||
--error 0,1062 |
|||
--reap |
|||
|
|||
select * from t1; |
|||
drop table t1; |
|||
@ -1,17 +1,6 @@ |
|||
drop table if exists t1; |
|||
Warnings: |
|||
Note 1051 Unknown table 'test.t1' |
|||
# |
|||
# MDEV-7314 |
|||
# Concurrent "INSERT INTO table SELECT MAX(id)+1 FROM table" are |
|||
# hitting deadlocks on Aria tables using ROW_FORMAT=PAGE |
|||
# |
|||
create table t1 (pk int primary key) engine=Aria; |
|||
insert into t1 values (1); |
|||
insert into t1 select sleep(2)+1 from t1; |
|||
insert into t1 select 2 from t1; |
|||
select * from t1; |
|||
pk |
|||
1 |
|||
2 |
|||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
|||
drop table t1; |
|||
12
mysql-test/suite/rpl/r/myisam_external_lock.result
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,2 @@ |
|||
--log-slave-updates=0 |
|||
--skip_external_locking=0 |
|||
24
mysql-test/suite/rpl/t/myisam_external_lock.test
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,52 @@ |
|||
create procedure p1() select 1; |
|||
flush status; |
|||
show status like 'handler_read_key'; |
|||
Variable_name Value |
|||
Handler_read_key 0 |
|||
call p1; |
|||
1 |
|||
1 |
|||
show status like 'handler_read_key'; |
|||
Variable_name Value |
|||
Handler_read_key 1 |
|||
call p1; |
|||
1 |
|||
1 |
|||
show status like 'handler_read_key'; |
|||
Variable_name Value |
|||
Handler_read_key 1 |
|||
set global stored_program_cache=0; |
|||
call p1; |
|||
1 |
|||
1 |
|||
show status like 'handler_read_key'; |
|||
Variable_name Value |
|||
Handler_read_key 2 |
|||
call p1; |
|||
1 |
|||
1 |
|||
show status like 'handler_read_key'; |
|||
Variable_name Value |
|||
Handler_read_key 3 |
|||
drop procedure p1; |
|||
set global stored_program_cache=default; |
|||
create procedure pr(i int) begin |
|||
create table t1 (a int, b int); |
|||
if (i = 1) then alter table t1 drop a; |
|||
else alter table t1 drop b; |
|||
end if; |
|||
select * from t1; |
|||
drop table t1; |
|||
end | |
|||
call pr(1); |
|||
b |
|||
call pr(2); |
|||
ERROR 42S22: Unknown column 'test.t1.b' in 'field list' |
|||
drop table t1; |
|||
set global stored_program_cache=0; |
|||
call pr(1); |
|||
b |
|||
call pr(2); |
|||
a |
|||
drop procedure pr; |
|||
set global stored_program_cache=default; |
|||
@ -0,0 +1,43 @@ |
|||
create procedure p1() select 1; |
|||
|
|||
flush status; |
|||
show status like 'handler_read_key'; |
|||
call p1; |
|||
show status like 'handler_read_key'; |
|||
call p1; |
|||
show status like 'handler_read_key'; |
|||
|
|||
set global stored_program_cache=0; |
|||
|
|||
call p1; |
|||
show status like 'handler_read_key'; |
|||
call p1; |
|||
show status like 'handler_read_key'; |
|||
|
|||
drop procedure p1; |
|||
set global stored_program_cache=default; |
|||
|
|||
# Test for missing SP automatic reparsing. |
|||
# when MDEV-5816 is implemented, it should be removed. |
|||
|
|||
--delimiter | |
|||
create procedure pr(i int) begin |
|||
create table t1 (a int, b int); |
|||
if (i = 1) then alter table t1 drop a; |
|||
else alter table t1 drop b; |
|||
end if; |
|||
select * from t1; |
|||
drop table t1; |
|||
end | |
|||
--delimiter ; |
|||
call pr(1); |
|||
--error ER_BAD_FIELD_ERROR |
|||
call pr(2); |
|||
drop table t1; |
|||
|
|||
set global stored_program_cache=0; |
|||
call pr(1); |
|||
call pr(2); |
|||
drop procedure pr; |
|||
set global stored_program_cache=default; |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
# |
|||
# MDEV-7333 "'show table status like 'table_name'" on tokudb table lead to MariaDB crash |
|||
# |
|||
let $datadir= `select @@datadir`; |
|||
call mtr.add_suppression("bad_row_type.frm: invalid value 11 for the field row_format"); |
|||
copy_file std_data/bad_row_type.MYD $datadir/test/bad_row_type.MYD; |
|||
copy_file std_data/bad_row_type.MYI $datadir/test/bad_row_type.MYI; |
|||
copy_file std_data/bad_row_type.frm $datadir/test/bad_row_type.frm; |
|||
|
|||
select * from bad_row_type; |
|||
show create table bad_row_type; |
|||
replace_column 12 x 13 x; |
|||
show table status like 'bad_row_type'; |
|||
drop table bad_row_type; |
|||
@ -0,0 +1,8 @@ |
|||
# |
|||
# MDEV-7150 Wrong auto increment values on INSERT .. ON DUPLICATE KEY UPDATE when the inserted columns include NULL in an auto-increment column |
|||
# |
|||
create table t1 (a int(10) auto_increment primary key, b int(11)); |
|||
insert t1 values (null,1); |
|||
insert t1 values (null,2), (1,-1), (null,3) on duplicate key update b=values(b); |
|||
select * from t1; |
|||
drop table t1; |
|||
@ -0,0 +1 @@ |
|||
--skip-name-resolve |
|||
@ -0,0 +1,29 @@ |
|||
# |
|||
# Test KILL and KILL QUERY statements. |
|||
# |
|||
# Killing a connection in an embedded server does not work like in a normal |
|||
# server, if it is waiting for a new statement. In an embedded server, the |
|||
# connection does not read() from a socket, but returns control to the |
|||
# application. 'mysqltest' does not handle the kill request. |
|||
# |
|||
|
|||
-- source include/not_embedded.inc |
|||
-- source include/not_threadpool.inc |
|||
|
|||
--echo # |
|||
--echo # MDEV-6896 kill user command cause MariaDB crash! |
|||
--echo # |
|||
|
|||
create user foo@'127.0.0.1'; |
|||
|
|||
--connect (con1,127.0.0.1,foo,,) |
|||
|
|||
--connection default |
|||
select user from information_schema.processlist; |
|||
kill user foo@'127.0.0.1'; |
|||
|
|||
let $wait_condition= |
|||
select count(*) = 0 from information_schema.processlist |
|||
where user = "foo"; |
|||
--source include/wait_condition.inc |
|||
drop user foo@'127.0.0.1'; |
|||
@ -0,0 +1 @@ |
|||
--debug |
|||
@ -0,0 +1,63 @@ |
|||
|
|||
--source include/have_debug.inc |
|||
|
|||
--disable_warnings |
|||
drop table if exists t1,t2,t3; |
|||
drop view if exists v2,v3; |
|||
--enable_warnings |
|||
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM; |
|||
|
|||
CREATE TABLE t2 ( |
|||
f1 DATE, |
|||
f2 VARCHAR(1024), |
|||
f3 VARCHAR(10), |
|||
f4 DATE, |
|||
f5 VARCHAR(10), |
|||
f6 VARCHAR(10), |
|||
f7 VARCHAR(10), |
|||
f8 DATETIME, |
|||
f9 INT, |
|||
f10 VARCHAR(1024), |
|||
f11 VARCHAR(1024), |
|||
f12 INT, |
|||
f13 VARCHAR(1024) |
|||
) ENGINE=MyISAM; |
|||
|
|||
CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2; |
|||
|
|||
CREATE TABLE t3 ( |
|||
f1 VARCHAR(1024), |
|||
f2 VARCHAR(1024), |
|||
f3 DATETIME, |
|||
f4 VARCHAR(10), |
|||
f5 INT, |
|||
f6 VARCHAR(10), |
|||
f7 VARCHAR(1024), |
|||
f8 VARCHAR(10), |
|||
f9 INT, |
|||
f10 DATE, |
|||
f11 INT, |
|||
f12 VARCHAR(1024), |
|||
f13 VARCHAR(10), |
|||
f14 DATE, |
|||
f15 DATETIME |
|||
) ENGINE=MyISAM; |
|||
|
|||
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3; |
|||
|
|||
INSERT INTO t3 VALUES |
|||
('FOO','foo','2000-08-04 00:00:00','one',1,'1','FOO','foo',1,'2004-05-09',1,'one','one','2001-12-07','2001-10-17 08:25:04'), |
|||
('BAR','bar','2001-01-01 04:52:37','two',2,'2','BAR','bar',2,'2008-01-01',2,'two','two','2006-06-19','2002-01-01 08:22:49'); |
|||
|
|||
CREATE TABLE t4 (f1 VARCHAR(10), f2 INT) ENGINE=MyISAM; |
|||
|
|||
SELECT * FROM t1; |
|||
|
|||
--error ER_BAD_FIELD_ERROR |
|||
SELECT non_existing FROM v2; |
|||
|
|||
SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5; |
|||
|
|||
drop table t1,t2,t3,t4; |
|||
drop view v2,v3; |
|||
|
|||
@ -0,0 +1,45 @@ |
|||
|
|||
--source include/have_innodb.inc |
|||
|
|||
--disable_warnings |
|||
drop table if exists t1,t2; |
|||
drop procedure if exists p1; |
|||
--enable_warnings |
|||
|
|||
--echo # |
|||
--echo #MDEV-6985: MariaDB crashes on stored procedure call |
|||
--echo # |
|||
CREATE TABLE `t1` ( |
|||
`ID` int(11) NOT NULL, |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB; |
|||
|
|||
CREATE TABLE `t2` ( |
|||
`ID` int(11) NOT NULL, |
|||
`DATE` datetime DEFAULT NULL, |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB; |
|||
|
|||
--delimiter ;; |
|||
|
|||
CREATE PROCEDURE `p1`() |
|||
BEGIN |
|||
DECLARE _mySelect CURSOR FOR |
|||
SELECT DISTINCT t1.ID |
|||
FROM t1 |
|||
LEFT JOIN t2 AS t2 ON |
|||
t2.ID = t1.ID |
|||
AND t2.DATE = ( |
|||
SELECT MAX(T3.DATE) FROM t2 AS T3 WHERE T3.ID = t2.ID AND T3.DATE<=NOW() |
|||
) |
|||
WHERE t1.ID = 1; |
|||
OPEN _mySelect; |
|||
CLOSE _mySelect; |
|||
END ;; |
|||
--delimiter ; |
|||
|
|||
CALL p1(); |
|||
CALL p1(); |
|||
|
|||
drop procedure p1; |
|||
drop table t1,t2; |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue