Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä 2018-11-19 18:45:53 +02:00
commit fd58bb71e2
143 changed files with 949 additions and 378 deletions

@ -1 +1 @@
Subproject commit 99f383c85c952287f8d3db927665061cd226e0f7 Subproject commit 334964f0711c3fd027f634a239eee57bc912f7ff

View File

@ -510,3 +510,14 @@ DROP TABLE t1;
SELECT 100 BETWEEN 1 AND 9223372036854775808; SELECT 100 BETWEEN 1 AND 9223372036854775808;
100 BETWEEN 1 AND 9223372036854775808 100 BETWEEN 1 AND 9223372036854775808
1 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;

View File

@ -416,3 +416,12 @@ DROP TABLE t1;
--echo # MDEV-9372 select 100 between 1 and 9223372036854775808 returns false --echo # MDEV-9372 select 100 between 1 and 9223372036854775808 returns false
--echo # --echo #
SELECT 100 BETWEEN 1 AND 9223372036854775808; SELECT 100 BETWEEN 1 AND 9223372036854775808;
--echo #
--echo # MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615
--echo #
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;
DROP TABLE t1;

View File

@ -10403,6 +10403,99 @@ f
3 3
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-17574: pushdown into derived from mergeable view
# used in multi-table UPDATE
# pushdown into materialized derived from mergeable view
# used in SELECT
#
CREATE TABLE t1 (f1 text, f2 int);
INSERT INTO t1 VALUES ('x',1), ('y',2);
CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t;
UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
EXPLAIN FORMAT=JSON UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "t.f2 < 2",
"materialized": {
"query_block": {
"select_id": 3,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "t1.f2 < 2"
}
}
}
},
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "t1.f2 = t.f2"
}
}
}
SELECT * FROM t1;
f1 f2
z 1
y 2
CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t;
SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2;
f2 f1 f2
1 z 1
EXPLAIN FORMAT=JSON SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "t.f2 < 2",
"materialized": {
"query_block": {
"select_id": 3,
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "t1.f2 < 2"
}
}
}
}
},
"block-nl-join": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "t1.f2 = t.f2"
}
}
}
DROP VIEW v1,v2;
DROP TABLE t1;
# End of 10.2 tests # End of 10.2 tests
# #
# MDEV-14579: pushdown conditions into materialized views/derived tables # MDEV-14579: pushdown conditions into materialized views/derived tables

View File

@ -2075,6 +2075,33 @@ SELECT * FROM t1;
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-17574: pushdown into derived from mergeable view
--echo # used in multi-table UPDATE
--echo # pushdown into materialized derived from mergeable view
--echo # used in SELECT
--echo #
CREATE TABLE t1 (f1 text, f2 int);
INSERT INTO t1 VALUES ('x',1), ('y',2);
CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t;
let $q1 =
UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
eval $q1;
eval EXPLAIN FORMAT=JSON $q1;
SELECT * FROM t1;
CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t;
let $q2 =
SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2;
eval $q2;
eval EXPLAIN FORMAT=JSON $q2;
DROP VIEW v1,v2;
DROP TABLE t1;
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo # --echo #

View File

@ -1049,4 +1049,24 @@ b1+'0' b2+'0' b3+'0' b4+'0' b5+'0' b6 +'0'
1 0 0 1 0 1 1 0 0 1 0 1
0 1 0 0 1 0 0 1 0 0 1 0
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free
# or Invalid write in JOIN::make_aggr_tables_info
#
CREATE TABLE t1 (pk INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);
explain
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )
UNION
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using index; Using temporary
2 UNION t1 index NULL PRIMARY 4 NULL 2 Using index; Using temporary
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )
UNION
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) );
1
1
drop table t1;
End of 5.5 tests End of 5.5 tests

View File

@ -798,4 +798,22 @@ CREATE TABLE t1 (b1 BIT, b2 BIT, b3 BIT, b4 BIT , b5 BIT, b6 BIT);
INSERT INTO t1 VALUES (1,0,0,1,0,1),(0,1,0,0,1,0); INSERT INTO t1 VALUES (1,0,0,1,0,1),(0,1,0,0,1,0);
SELECT DISTINCT b1+'0', b2+'0', b3+'0', b4+'0', b5+'0', b6 +'0' FROM t1; SELECT DISTINCT b1+'0', b2+'0', b3+'0', b4+'0', b5+'0', b6 +'0' FROM t1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free
--echo # or Invalid write in JOIN::make_aggr_tables_info
--echo #
CREATE TABLE t1 (pk INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);
explain
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )
UNION
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) );
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) )
UNION
( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) );
drop table t1;
--echo End of 5.5 tests --echo End of 5.5 tests

View File

@ -8,13 +8,21 @@ explain extended select default(str), default(strnull), default(intg), default(r
id select_type table type possible_keys key key_len ref rows filtered Extra 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 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings: Warnings:
Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default(0) AS `default(intg)`,default(0) AS `default(rel)` from dual Note 1003 select default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from dual
select * from t1 where str <> default(str); select * from t1 where str <> default(str);
str strnull intg rel str strnull intg rel
0 0 0 0
explain select * from t1 where str <> default(str); explain select * from t1 where str <> default(str);
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 1 SIMPLE t1 system NULL NULL NULL NULL 1
create view v1 as select default(str), default(strnull), default(intg), default(rel) from t1;
select * from v1;
default(str) default(strnull) default(intg) default(rel)
def NULL 10 3.14
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select default(`t1`.`str`) AS `default(str)`,default(`t1`.`strnull`) AS `default(strnull)`,default(`t1`.`intg`) AS `default(intg)`,default(`t1`.`rel`) AS `default(rel)` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1; drop table t1;
CREATE TABLE t1 (id int(11), s varchar(20)); CREATE TABLE t1 (id int(11), s varchar(20));
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');

View File

@ -11,6 +11,11 @@ explain extended select default(str), default(strnull), default(intg), default(r
select * from t1 where str <> default(str); select * from t1 where str <> default(str);
explain select * from t1 where str <> default(str); explain select * from t1 where str <> default(str);
create view v1 as select default(str), default(strnull), default(intg), default(rel) from t1;
select * from v1;
show create view v1;
drop view v1;
#TODO: uncomment when bug will be fixed #TODO: uncomment when bug will be fixed
#create table t2 select default(str), default(strnull), default(intg), default(rel) from t1; #create table t2 select default(str), default(strnull), default(intg), default(rel) from t1;
#show create table from t1; #show create table from t1;

View File

@ -811,6 +811,26 @@ SELECT JSON_MERGE('[1]', '[]');
JSON_MERGE('[1]', '[]') JSON_MERGE('[1]', '[]')
[1] [1]
# #
# MDEV-16174 Assertion `0' failed in Type_handler_string_result::
# make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*)
#
SET sql_mode='';
CREATE TABLE t1 (fld varchar(16) NOT NULL);
CREATE TABLE t2 SELECT JSON_ARRAY_INSERT(fld, '$.[0]', '0') FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`JSON_ARRAY_INSERT(fld, '$.[0]', '0')` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET sql_mode=default;
#
# MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1
#
select JSON_VALID( '{"a":1]' );
JSON_VALID( '{"a":1]' )
0
#
# End of 10.2 tests # End of 10.2 tests
# #
# #

View File

@ -466,6 +466,24 @@ SET @`json` := NULL, @`value` := NULL;
SELECT JSON_MERGE('[1]', '[]'); SELECT JSON_MERGE('[1]', '[]');
--echo #
--echo # MDEV-16174 Assertion `0' failed in Type_handler_string_result::
--echo # make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*)
--echo #
SET sql_mode='';
CREATE TABLE t1 (fld varchar(16) NOT NULL);
CREATE TABLE t2 SELECT JSON_ARRAY_INSERT(fld, '$.[0]', '0') FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t1, t2;
SET sql_mode=default;
--echo #
--echo # MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1
--echo #
select JSON_VALID( '{"a":1]' );
--echo # --echo #
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo # --echo #

View File

@ -3424,7 +3424,61 @@ DROP TABLE t1,t2;
# End of 10.1 tests # End of 10.1 tests
# #
# #
# Start of 10.3 tests # MDEV-16217: Assertion `!table || (!table->read_set ||
# bitmap_is_set(table->read_set, field_index))'
# failed in Field_num::get_date
#
CREATE TABLE t1 (pk int default 0, a1 date);
INSERT INTO t1 VALUES (1,'1900-01-01'),(2,NULL),(3,NULL),(4,NULL);
CREATE VIEW v1 AS
SELECT t1.pk AS pk, t1.a1 AS a1 FROM t1;
SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1;
a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk))
0
NULL
NULL
NULL
SELECT a1 BETWEEN (('2018-08-24')) AND (~ DEFAULT(pk)) FROM v1;
a1 BETWEEN (('2018-08-24')) AND (~ DEFAULT(pk))
0
NULL
NULL
NULL
Warnings:
Warning 1292 Incorrect datetime value: '18446744073709551615'
CREATE TABLE t2 (pk int default 1, a1 date);
INSERT INTO t2 VALUES (4,NULL);
CREATE view v2 as SELECT default(t1.pk), default(t2.pk), t1.pk from t1,t2;
select * from v2;
default(t1.pk) default(t2.pk) pk
0 1 1
0 1 2
0 1 3
0 1 4
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select default(`t1`.`pk`) AS `default(t1.pk)`,default(`t2`.`pk`) AS `default(t2.pk)`,`t1`.`pk` AS `pk` from (`t1` join `t2`) latin1 latin1_swedish_ci
CREATE view v3 as SELECT default(pk) from t2;
select * from v3;
default(pk)
1
explain extended select * from v3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 select default(`test`.`t2`.`pk`) AS `default(pk)` from dual
explain extended select default(pk) from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 select default(`test`.`t2`.`pk`) AS `default(pk)` from dual
show create view v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select default(`t2`.`pk`) AS `default(pk)` from `t2` latin1 latin1_swedish_ci
DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
#
# End of 10.2 tests
# #
# #
# MDEV-12515 Wrong value when storing DATE_ADD() and ADDTIME() to a numeric field # MDEV-12515 Wrong value when storing DATE_ADD() and ADDTIME() to a numeric field
@ -3732,3 +3786,6 @@ CAST(CAST(LAST_DAY(TIME'00:00:00') AS DATE) AS TIME) AS c2,
CAST(LAST_DAY(TIME'00:00:00') AS TIME) AS c3; CAST(LAST_DAY(TIME'00:00:00') AS TIME) AS c3;
c1 c2 c3 c1 c2 c3
2018-08-31 00:00:00 00:00:00 2018-08-31 00:00:00 00:00:00
#
# End of 10.3 tests
#

View File

@ -1911,9 +1911,36 @@ DROP TABLE t1,t2;
--echo # End of 10.1 tests --echo # End of 10.1 tests
--echo # --echo #
--echo #
--echo # MDEV-16217: Assertion `!table || (!table->read_set ||
--echo # bitmap_is_set(table->read_set, field_index))'
--echo # failed in Field_num::get_date
--echo #
CREATE TABLE t1 (pk int default 0, a1 date);
INSERT INTO t1 VALUES (1,'1900-01-01'),(2,NULL),(3,NULL),(4,NULL);
CREATE VIEW v1 AS
SELECT t1.pk AS pk, t1.a1 AS a1 FROM t1;
SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1;
SELECT a1 BETWEEN (('2018-08-24')) AND (~ DEFAULT(pk)) FROM v1;
CREATE TABLE t2 (pk int default 1, a1 date);
INSERT INTO t2 VALUES (4,NULL);
CREATE view v2 as SELECT default(t1.pk), default(t2.pk), t1.pk from t1,t2;
select * from v2;
show create view v2;
CREATE view v3 as SELECT default(pk) from t2;
select * from v3;
explain extended select * from v3;
explain extended select default(pk) from t2;
show create view v3;
DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
--echo # --echo #
--echo # Start of 10.3 tests --echo # End of 10.2 tests
--echo # --echo #
--echo # --echo #
@ -2213,3 +2240,7 @@ SELECT
LAST_DAY(TIME'00:00:00') AS c1, LAST_DAY(TIME'00:00:00') AS c1,
CAST(CAST(LAST_DAY(TIME'00:00:00') AS DATE) AS TIME) AS c2, CAST(CAST(LAST_DAY(TIME'00:00:00') AS DATE) AS TIME) AS c2,
CAST(LAST_DAY(TIME'00:00:00') AS TIME) AS c3; CAST(LAST_DAY(TIME'00:00:00') AS TIME) AS c3;
--echo #
--echo # End of 10.3 tests
--echo #

View File

@ -2832,6 +2832,16 @@ select distinct 1 from t1 group by a,b with rollup limit 1;
1 1
1 1
drop table t1; drop table t1;
CREATE TABLE t1 ( pk int, i1 int, v1 varchar(1));
explain
SELECT 1 FROM t1
GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
SELECT 1 FROM t1
GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ;
1
drop table t1;
# #
# MDEV-16170 # MDEV-16170
# Server crashes in Item_null_result::type_handler on SELECT with ROLLUP # Server crashes in Item_null_result::type_handler on SELECT with ROLLUP

View File

@ -1948,6 +1948,19 @@ insert into t1 values(-126,7),(1,1),(0,0),(-1,1),(351,65534);
select distinct 1 from t1 group by a,b with rollup limit 1; select distinct 1 from t1 group by a,b with rollup limit 1;
drop table t1; drop table t1;
#
# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free
# or Invalid write in JOIN::make_aggr_tables_info
#
CREATE TABLE t1 ( pk int, i1 int, v1 varchar(1));
explain
SELECT 1 FROM t1
GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ;
SELECT 1 FROM t1
GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ;
drop table t1;
--echo # --echo #
--echo # MDEV-16170 --echo # MDEV-16170
--echo # Server crashes in Item_null_result::type_handler on SELECT with ROLLUP --echo # Server crashes in Item_null_result::type_handler on SELECT with ROLLUP

View File

@ -899,6 +899,35 @@ ERROR HY000: Table definition has changed, please retry transaction
disconnect con1; disconnect con1;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-11167: InnoDB: Warning: using a partial-field key prefix
# in search, results in assertion failure or "Can't find record" error
#
set @save_sql_mode = @@sql_mode;
set sql_mode="";
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (b INT, c INT, KEY(b)) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 2;
CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b = 'foo' WITH CHECK OPTION;
INSERT INTO t1 VALUES (1),(2);
INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4);
Warnings:
Warning 1366 Incorrect integer value: 'three' for column 'b' at row 2
UPDATE v SET a = NULL;
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
DROP view v;
DROP TABLE t1, t2;
SET @save_isp=@@innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent= ON;
CREATE TABLE t (f1 INT, f2 INT, KEY(f2)) ENGINE=InnoDB PARTITION BY HASH (f1) PARTITIONS 2;
INSERT IGNORE INTO t VALUES (NULL,0),(NULL,0),(0,21),(4,0),(1,8),(5,66);
CREATE ALGORITHM=MERGE VIEW v AS SELECT t1.* FROM t t1 JOIN t t2 WHERE t1.f1 < t2.f2 WITH LOCAL CHECK OPTION;
UPDATE v SET f2 = NULL;
ERROR 44000: CHECK OPTION failed `test`.`v`
SET GLOBAL innodb_stats_persistent= @save_isp;
DROP view v;
DROP TABLE t;
set sql_mode= @save_sql_mode;
#
# Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE # Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE
# MYSQL.INNODB_TABLE_STATS # MYSQL.INNODB_TABLE_STATS
# #

View File

@ -988,6 +988,38 @@ SELECT b FROM t1 WHERE b = 0;
--disconnect con1 --disconnect con1
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-11167: InnoDB: Warning: using a partial-field key prefix
--echo # in search, results in assertion failure or "Can't find record" error
--echo #
set @save_sql_mode = @@sql_mode;
set sql_mode="";
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (b INT, c INT, KEY(b)) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 2;
CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b = 'foo' WITH CHECK OPTION;
INSERT INTO t1 VALUES (1),(2);
INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4);
UPDATE v SET a = NULL;
DROP view v;
DROP TABLE t1, t2;
SET @save_isp=@@innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent= ON;
CREATE TABLE t (f1 INT, f2 INT, KEY(f2)) ENGINE=InnoDB PARTITION BY HASH (f1) PARTITIONS 2;
INSERT IGNORE INTO t VALUES (NULL,0),(NULL,0),(0,21),(4,0),(1,8),(5,66);
CREATE ALGORITHM=MERGE VIEW v AS SELECT t1.* FROM t t1 JOIN t t2 WHERE t1.f1 < t2.f2 WITH LOCAL CHECK OPTION;
--error ER_VIEW_CHECK_FAILED
UPDATE v SET f2 = NULL;
SET GLOBAL innodb_stats_persistent= @save_isp;
DROP view v;
DROP TABLE t;
set sql_mode= @save_sql_mode;
--echo # --echo #
--echo # Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE --echo # Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE
--echo # MYSQL.INNODB_TABLE_STATS --echo # MYSQL.INNODB_TABLE_STATS

View File

@ -2,13 +2,7 @@
# MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid # MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid
# #
SET gtid_seq_no=1000; SET gtid_seq_no=1000;
-- Tracker : SESSION_TRACK_SCHEMA
-- test
SET @@session.session_track_system_variables='last_gtid'; SET @@session.session_track_system_variables='last_gtid';
-- Tracker : SESSION_TRACK_SCHEMA
-- test
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- last_gtid -- last_gtid

View File

@ -3362,6 +3362,102 @@ Kaolin Tuning 88 68.7500
Tatiana Tuning 83 68.7500 Tatiana Tuning 83 68.7500
drop table t1; drop table t1;
# #
# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free
# or Invalid write in JOIN::make_aggr_tables_info
#
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100) order by 1+2;
BIT_OR(100) OVER ()
100
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM (
SELECT
ROW_NUMBER() OVER(), i, sum(i)
FROM t1
WHERE 1=0
limit 0
) AS sq;
ROW_NUMBER() OVER() i sum(i)
SELECT * FROM (
SELECT
ROW_NUMBER() OVER(), i, sum(i)
FROM t1
WHERE 1=0
GROUP BY i
) AS sq;
ROW_NUMBER() OVER() i sum(i)
drop table t1;
create table t1 (a int);
explain
select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup;
1 row_number() over (order by 1)
drop table t1;
explain
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP
HAVING @A := 'qwerty';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP
HAVING @A := 'qwerty';
BIT_OR(100) OVER ()
explain
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100)
HAVING @A := 'qwerty';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100)
HAVING @A := 'qwerty';
BIT_OR(100) OVER ()
create table t1 (a int);
explain
SELECT DISTINCT BIT_OR(100) OVER () FROM t1
GROUP BY LEFT('2018-08-24', 100) having 1=1 limit 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
drop table t1;
#
# MDEV-13170: Database service (MySQL) stops after update with trigger
#
CREATE TABLE t1 ( t1_id int, point_id int, ml_id int, UNIQUE KEY t1_ml_u (ml_id,point_id)) ;
INSERT INTO t1 VALUES (1,1,8884),(2,1,8885);
CREATE TABLE t2 ( db_time datetime, au_nr int, col_id int, new_val int);
CREATE TABLE t3 (id1 int, id2 int, d1 int);
CREATE TRIGGER t1_aurtrg AFTER UPDATE ON t1 FOR EACH ROW begin
CREATE OR REPLACE TEMPORARY TABLE trg_u AS
WITH l AS
(SELECT a.*,
Max(t2.col_id) over (PARTITION BY a.d1),
Max(t2.new_val) over (PARTITION BY a.d1)
FROM
(SELECT d1 , id1, id2 FROM t3) a
JOIN t2 ON (a.d1=t2.db_time AND a.id1=t2.au_nr))
SELECT 1;
END;//
update t1 set ml_id=8884 where point_id=1;
ERROR 23000: Duplicate entry '8884-1' for key 't1_ml_u'
update t1 set ml_id=8884 where point_id=1;
ERROR 23000: Duplicate entry '8884-1' for key 't1_ml_u'
drop table t1, t2,t3;
CREATE TABLE t1 (i INT, a char);
INSERT INTO t1 VALUES (1, 'a'),(2, 'b');
create view v1 as select * from t1;
PREPARE stmt FROM "SELECT i, row_number() over (partition by i order by i) FROM v1";
execute stmt;
i row_number() over (partition by i order by i)
1 1
2 1
deallocate prepare stmt;
drop table t1;
drop view v1;
#
# Start of 10.3 tests # Start of 10.3 tests
# #
# #

View File

@ -2120,6 +2120,103 @@ FROM t1
ORDER BY test, name; ORDER BY test, name;
drop table t1; drop table t1;
--echo #
--echo # MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free
--echo # or Invalid write in JOIN::make_aggr_tables_info
--echo #
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100) order by 1+2;
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM (
SELECT
ROW_NUMBER() OVER(), i, sum(i)
FROM t1
WHERE 1=0
limit 0
) AS sq;
SELECT * FROM (
SELECT
ROW_NUMBER() OVER(), i, sum(i)
FROM t1
WHERE 1=0
GROUP BY i
) AS sq;
drop table t1;
create table t1 (a int);
explain
select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup;
select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup;
drop table t1;
explain
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP
HAVING @A := 'qwerty';
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP
HAVING @A := 'qwerty';
explain
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100)
HAVING @A := 'qwerty';
SELECT DISTINCT BIT_OR(100) OVER () FROM dual
GROUP BY LEFT('2018-08-24', 100)
HAVING @A := 'qwerty';
create table t1 (a int);
explain
SELECT DISTINCT BIT_OR(100) OVER () FROM t1
GROUP BY LEFT('2018-08-24', 100) having 1=1 limit 0;
drop table t1;
--echo #
--echo # MDEV-13170: Database service (MySQL) stops after update with trigger
--echo #
CREATE TABLE t1 ( t1_id int, point_id int, ml_id int, UNIQUE KEY t1_ml_u (ml_id,point_id)) ;
INSERT INTO t1 VALUES (1,1,8884),(2,1,8885);
CREATE TABLE t2 ( db_time datetime, au_nr int, col_id int, new_val int);
CREATE TABLE t3 (id1 int, id2 int, d1 int);
delimiter //;
CREATE TRIGGER t1_aurtrg AFTER UPDATE ON t1 FOR EACH ROW begin
CREATE OR REPLACE TEMPORARY TABLE trg_u AS
WITH l AS
(SELECT a.*,
Max(t2.col_id) over (PARTITION BY a.d1),
Max(t2.new_val) over (PARTITION BY a.d1)
FROM
(SELECT d1 , id1, id2 FROM t3) a
JOIN t2 ON (a.d1=t2.db_time AND a.id1=t2.au_nr))
SELECT 1;
END;//
delimiter ;//
--error 1062
update t1 set ml_id=8884 where point_id=1;
--error 1062
update t1 set ml_id=8884 where point_id=1;
drop table t1, t2,t3;
CREATE TABLE t1 (i INT, a char);
INSERT INTO t1 VALUES (1, 'a'),(2, 'b');
create view v1 as select * from t1;
PREPARE stmt FROM "SELECT i, row_number() over (partition by i order by i) FROM v1";
execute stmt;
deallocate prepare stmt;
drop table t1;
drop view v1;
--echo # --echo #
--echo # Start of 10.3 tests --echo # Start of 10.3 tests
--echo # --echo #

View File

@ -31586,8 +31586,33 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
0 -9223372036854775808 1 2 3 4 5
0 0 17 18 19 20 21
0 124 22 23 24 25 26
0 124 27 28 29 30 31
0 -9223372036854775808 31 32 33 34 35
0 0 32 32 34 35 36
101 0 37 38 39 40 41
101 -102 103 104 105 106 107
102 -109 110 111 112 113 114
103 -109 110 111 112 113 114
105 NULL 102 103 104 105 106
108 -109 110 111 112 101 114
108 -109 110 111 112 102 114
108 -109 110 111 112 113 114
115 -116 117 118 119 120 121
122 -123 124 125 126 127 128
255 -2147483648 6 7 8 9 10
65535 -8388608 11 12 13 14 15
16777215 -32768 16 17 18 19 20
4294967295 -128 21 22 23 24 25
18446744073709551615 9223372036854775807 26 27 28 29 30
18446744073709551615 9223372036854775807 36 37 38 39 40
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 LIMIT 2; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL 0 NULL 5 6 NULL 0 NULL
@ -31747,8 +31772,33 @@ c1 c2 c3 c4 c5 c6 c7
0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 0 32 32 34 35 36
0 -9223372036854775808 31 32 33 34 35
0 124 27 28 29 30 31
0 124 22 23 24 25 26
0 0 17 18 19 20 21
0 -9223372036854775808 1 2 3 4 5
0 NULL 5 6 NULL 0 NULL
101 -102 103 104 105 106 107
101 0 37 38 39 40 41
102 -109 110 111 112 113 114
103 -109 110 111 112 113 114
105 NULL 102 103 104 105 106
108 -109 110 111 112 113 114
108 -109 110 111 112 102 114
108 -109 110 111 112 101 114
115 -116 117 118 119 120 121
122 -123 124 125 126 127 128
255 -2147483648 6 7 8 9 10
65535 -8388608 11 12 13 14 15
16777215 -32768 16 17 18 19 20
4294967295 -128 21 22 23 24 25
18446744073709551615 9223372036854775807 36 37 38 39 40
18446744073709551615 9223372036854775807 26 27 28 29 30
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC LIMIT 2; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 0 32 32 34 35 36
0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6 DESC; SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 0 32 32 34 35 36 0 0 32 32 34 35 36
@ -32014,8 +32064,33 @@ c1 c2 c3 c4 c5 c6 c7
18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 36 37 38 39 40
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
0 -9223372036854775808 1 2 3 4 5
0 0 17 18 19 20 21
0 124 22 23 24 25 26
0 124 27 28 29 30 31
0 -9223372036854775808 31 32 33 34 35
0 0 32 32 34 35 36
101 0 37 38 39 40 41
101 -102 103 104 105 106 107
102 -109 110 111 112 113 114
103 -109 110 111 112 113 114
105 NULL 102 103 104 105 106
108 -109 110 111 112 101 114
108 -109 110 111 112 102 114
108 -109 110 111 112 113 114
115 -116 117 118 119 120 121
122 -123 124 125 126 127 128
255 -2147483648 6 7 8 9 10
65535 -8388608 11 12 13 14 15
16777215 -32768 16 17 18 19 20
4294967295 -128 21 22 23 24 25
18446744073709551615 9223372036854775807 26 27 28 29 30
18446744073709551615 9223372036854775807 36 37 38 39 40
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 LIMIT 2; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 LIMIT 2;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL
0 -9223372036854775808 1 2 3 4 5
SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 NULL 5 6 NULL 0 NULL 0 NULL 5 6 NULL 0 NULL
@ -32175,8 +32250,33 @@ c1 c2 c3 c4 c5 c6 c7
18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 26 27 28 29 30
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 0 32 32 34 35 36
0 -9223372036854775808 31 32 33 34 35
0 124 27 28 29 30 31
0 124 22 23 24 25 26
0 0 17 18 19 20 21
0 -9223372036854775808 1 2 3 4 5
0 NULL 5 6 NULL 0 NULL
101 -102 103 104 105 106 107
101 0 37 38 39 40 41
102 -109 110 111 112 113 114
103 -109 110 111 112 113 114
105 NULL 102 103 104 105 106
108 -109 110 111 112 113 114
108 -109 110 111 112 102 114
108 -109 110 111 112 101 114
115 -116 117 118 119 120 121
122 -123 124 125 126 127 128
255 -2147483648 6 7 8 9 10
65535 -8388608 11 12 13 14 15
16777215 -32768 16 17 18 19 20
4294967295 -128 21 22 23 24 25
18446744073709551615 9223372036854775807 36 37 38 39 40
18446744073709551615 9223372036854775807 26 27 28 29 30
SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC LIMIT 2; SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC LIMIT 2;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 0 32 32 34 35 36
0 -9223372036854775808 31 32 33 34 35
SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6 DESC; SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6 DESC;
c1 c2 c3 c4 c5 c6 c7 c1 c2 c3 c4 c5 c6 c7
0 0 32 32 34 35 36 0 0 32 32 34 35 36

View File

@ -3767,8 +3767,25 @@ c1 c2 c3
-12 18446744073709551615 12 -12 18446744073709551615 12
SELECT * FROM t2 WHERE c2 BETWEEN 0 AND 18446744073709551615 ORDER BY c2,c1; SELECT * FROM t2 WHERE c2 BETWEEN 0 AND 18446744073709551615 ORDER BY c2,c1;
c1 c2 c3 c1 c2 c3
-4 4 4
-9 9 9
0 255 13
-9223372036854775808 18446744073709551615 12
-12 18446744073709551615 12
-11 18446744073709551615 11
-8 18446744073709551615 8
-7 18446744073709551615 7
-6 18446744073709551615 6
-5 18446744073709551615 5
-3 18446744073709551615 3
-2 18446744073709551615 2
-1 18446744073709551615 1
50 18446744073709551615 10
9223372036854775807 18446744073709551615 14
SELECT * FROM t2 WHERE c2 BETWEEN 0 AND 18446744073709551615 ORDER BY c2,c1 DESC LIMIT 2; SELECT * FROM t2 WHERE c2 BETWEEN 0 AND 18446744073709551615 ORDER BY c2,c1 DESC LIMIT 2;
c1 c2 c3 c1 c2 c3
-4 4 4
-9 9 9
SELECT * FROM t2 WHERE c2 IN(0,18446744073709551615) ORDER BY c2,c1 DESC; SELECT * FROM t2 WHERE c2 IN(0,18446744073709551615) ORDER BY c2,c1 DESC;
c1 c2 c3 c1 c2 c3
9223372036854775807 18446744073709551615 14 9223372036854775807 18446744073709551615 14

View File

@ -1115,6 +1115,11 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
--move_file $MYSQLD_DATADIR/test/t0.ibd $MYSQLD_DATADIR/test/t1.ibd --move_file $MYSQLD_DATADIR/test/t0.ibd $MYSQLD_DATADIR/test/t1.ibd
--source include/start_mysqld.inc --source include/start_mysqld.inc
if ($have_debug) {
# Initiate shutdown in order to issue a redo log checkpoint and to discard
# the redo log record that was emitted due to '+d,fil_names_write_bogus'.
--source include/restart_mysqld.inc
}
SELECT * FROM t1; SELECT * FROM t1;
SELECT * FROM t2; SELECT * FROM t2;

View File

@ -44,5 +44,7 @@ SELECT * FROM t1;
--let $restart_parameters= --let $restart_parameters=
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
# Initiate shutdown in order to issue a redo log checkpoint and to discard
# the redo log record that was emitted due to '+d,fil_names_write_bogus'.
--source include/restart_mysqld.inc
DROP TABLE t1; DROP TABLE t1;

View File

@ -62,8 +62,21 @@ const char field_separator=',';
#define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \ #define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \
((ulong) ((1LL << MY_MIN(arg, 4) * 8) - 1)) ((ulong) ((1LL << MY_MIN(arg, 4) * 8) - 1))
#define ASSERT_COLUMN_MARKED_FOR_READ DBUG_ASSERT(!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))) // Column marked for read or the field set to read out or record[0] or [1]
#define ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED DBUG_ASSERT(is_stat_field || !table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || (table->vcol_set && bitmap_is_set(table->vcol_set, field_index)))) #define ASSERT_COLUMN_MARKED_FOR_READ \
DBUG_ASSERT(!table || \
(!table->read_set || \
bitmap_is_set(table->read_set, field_index) || \
(!(ptr >= table->record[0] && \
ptr < table->record[0] + table->s->reclength))))
#define ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED \
DBUG_ASSERT(is_stat_field || !table || \
(!table->write_set || \
bitmap_is_set(table->write_set, field_index) || \
(!(ptr >= table->record[0] && \
ptr < table->record[0] + table->s->reclength))) || \
(table->vcol_set && bitmap_is_set(table->vcol_set, field_index)))
#define FLAGSTR(S,F) ((S) & (F) ? #F " " : "") #define FLAGSTR(S,F) ((S) & (F) ? #F " " : "")

View File

@ -563,6 +563,7 @@ public:
bool utf8; /* Already in utf8 */ bool utf8; /* Already in utf8 */
Item *expr; Item *expr;
LEX_CSTRING name; /* Name of constraint */ LEX_CSTRING name; /* Name of constraint */
/* see VCOL_* (VCOL_FIELD_REF, ...) */
uint flags; uint flags;
Virtual_column_info() Virtual_column_info()

View File

@ -7546,13 +7546,21 @@ Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg)
return this; return this;
if (!item_equal && used_tables() != tab_map) if (!item_equal && used_tables() != tab_map)
return this; return this;
return get_field_item_for_having(thd, this, sel); Item *item= get_field_item_for_having(thd, this, sel);
if (item)
item->marker|= SUBSTITUTION_FL;
return item;
} }
Item *Item_direct_view_ref::derived_field_transformer_for_having(THD *thd, Item *Item_direct_view_ref::derived_field_transformer_for_having(THD *thd,
uchar *arg) uchar *arg)
{ {
if ((*ref)->marker & SUBSTITUTION_FL)
{
this->marker|= SUBSTITUTION_FL;
return this;
}
st_select_lex *sel= (st_select_lex *)arg; st_select_lex *sel= (st_select_lex *)arg;
table_map tab_map= sel->master_unit()->derived->table->map; table_map tab_map= sel->master_unit()->derived->table->map;
if ((item_equal && !(item_equal->used_tables() & tab_map)) || if ((item_equal && !(item_equal->used_tables() & tab_map)) ||
@ -7603,13 +7611,20 @@ Item *Item_field::derived_field_transformer_for_where(THD *thd, uchar *arg)
st_select_lex *sel= (st_select_lex *)arg; st_select_lex *sel= (st_select_lex *)arg;
Item *producing_item= find_producing_item(this, sel); Item *producing_item= find_producing_item(this, sel);
if (producing_item) if (producing_item)
return producing_item->build_clone(thd); {
Item *producing_clone= producing_item->build_clone(thd);
if (producing_clone)
producing_clone->marker|= SUBSTITUTION_FL;
return producing_clone;
}
return this; return this;
} }
Item *Item_direct_view_ref::derived_field_transformer_for_where(THD *thd, Item *Item_direct_view_ref::derived_field_transformer_for_where(THD *thd,
uchar *arg) uchar *arg)
{ {
if ((*ref)->marker & SUBSTITUTION_FL)
return (*ref);
if (item_equal) if (item_equal)
{ {
st_select_lex *sel= (st_select_lex *)arg; st_select_lex *sel= (st_select_lex *)arg;
@ -7661,7 +7676,13 @@ Item *Item_field::derived_grouping_field_transformer_for_where(THD *thd,
st_select_lex *sel= (st_select_lex *)arg; st_select_lex *sel= (st_select_lex *)arg;
Grouping_tmp_field *gr_field= find_matching_grouping_field(this, sel); Grouping_tmp_field *gr_field= find_matching_grouping_field(this, sel);
if (gr_field) if (gr_field)
return gr_field->producing_item->build_clone(thd); {
Item *producing_clone=
gr_field->producing_item->build_clone(thd);
if (producing_clone)
producing_clone->marker|= SUBSTITUTION_FL;
return producing_clone;
}
return this; return this;
} }
@ -7670,6 +7691,11 @@ Item *
Item_direct_view_ref::derived_grouping_field_transformer_for_where(THD *thd, Item_direct_view_ref::derived_grouping_field_transformer_for_where(THD *thd,
uchar *arg) uchar *arg)
{ {
if ((*ref)->marker & SUBSTITUTION_FL)
{
this->marker|= SUBSTITUTION_FL;
return this;
}
if (!item_equal) if (!item_equal)
return this; return this;
st_select_lex *sel= (st_select_lex *)arg; st_select_lex *sel= (st_select_lex *)arg;
@ -9193,8 +9219,19 @@ bool Item_default_value::fix_fields(THD *thd, Item **items)
fixed= 1; fixed= 1;
return FALSE; return FALSE;
} }
/*
DEFAULT() do not need table field so should not ask handler to bring
field value (mark column for read)
*/
enum_column_usage save_column_usage= thd->column_usage;
thd->column_usage= COLUMNS_READ;
if (arg->fix_fields_if_needed(thd, &arg)) if (arg->fix_fields_if_needed(thd, &arg))
{
thd->column_usage= save_column_usage;
goto error; goto error;
}
thd->column_usage= save_column_usage;
real_arg= arg->real_item(); real_arg= arg->real_item();
@ -9215,15 +9252,19 @@ bool Item_default_value::fix_fields(THD *thd, Item **items)
goto error; goto error;
memcpy((void *)def_field, (void *)field_arg->field, memcpy((void *)def_field, (void *)field_arg->field,
field_arg->field->size_of()); field_arg->field->size_of());
IF_DBUG_ASSERT(def_field->is_stat_field=1,); // a hack to fool ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED // If non-constant default value expression
if (def_field->default_value && def_field->default_value->flags) if (def_field->default_value && def_field->default_value->flags)
{ {
uchar *newptr= (uchar*) thd->alloc(1+def_field->pack_length()); uchar *newptr= (uchar*) thd->alloc(1+def_field->pack_length());
if (!newptr) if (!newptr)
goto error; goto error;
/*
Even if DEFAULT() do not read tables fields, the default value
expression can do it.
*/
fix_session_vcol_expr_for_read(thd, def_field, def_field->default_value); fix_session_vcol_expr_for_read(thd, def_field, def_field->default_value);
if (should_mark_column(thd->column_usage)) if (should_mark_column(thd->column_usage))
def_field->default_value->expr->walk(&Item::register_field_in_read_map, 1, 0); def_field->default_value->expr->update_used_tables();
def_field->move_field(newptr+1, def_field->maybe_null() ? newptr : 0, 1); def_field->move_field(newptr+1, def_field->maybe_null() ? newptr : 0, 1);
} }
else else
@ -9247,6 +9288,12 @@ void Item_default_value::print(String *str, enum_query_type query_type)
return; return;
} }
str->append(STRING_WITH_LEN("default(")); str->append(STRING_WITH_LEN("default("));
/*
We take DEFAULT from a field so do not need it value in case of const
tables but its name so we set QT_NO_DATA_EXPANSION (as we print for
table definition, also we do not need table and database name)
*/
query_type= (enum_query_type) (query_type | QT_NO_DATA_EXPANSION);
arg->print(str, query_type); arg->print(str, query_type);
str->append(')'); str->append(')');
} }

View File

@ -147,6 +147,7 @@ bool mark_unsupported_function(const char *w1, const char *w2,
#define NO_EXTRACTION_FL (1 << 6) #define NO_EXTRACTION_FL (1 << 6)
#define FULL_EXTRACTION_FL (1 << 7) #define FULL_EXTRACTION_FL (1 << 7)
#define SUBSTITUTION_FL (1 << 8)
#define EXTRACTION_MASK (NO_EXTRACTION_FL | FULL_EXTRACTION_FL) #define EXTRACTION_MASK (NO_EXTRACTION_FL | FULL_EXTRACTION_FL)
extern const char *item_empty_name; extern const char *item_empty_name;
@ -5744,6 +5745,11 @@ public:
return false; return false;
} }
table_map used_tables() const; table_map used_tables() const;
virtual void update_used_tables()
{
if (field && field->default_value)
field->default_value->expr->update_used_tables();
}
Field *get_tmp_table_field() { return 0; } Field *get_tmp_table_field() { return 0; }
Item *get_tmp_table_item(THD *thd) { return this; } Item *get_tmp_table_item(THD *thd) { return this; }
Item_field *field_for_view_update() { return 0; } Item_field *field_for_view_update() { return 0; }

View File

@ -1563,6 +1563,7 @@ bool Item_func_json_array_append::fix_length_and_dec()
} }
fix_char_length_ulonglong(char_length); fix_char_length_ulonglong(char_length);
maybe_null= 1;
return FALSE; return FALSE;
} }

View File

@ -2913,6 +2913,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
{ {
SELECT_LEX *sl= lex->all_selects_list; SELECT_LEX *sl= lex->all_selects_list;
DBUG_ENTER("reinit_stmt_before_use"); DBUG_ENTER("reinit_stmt_before_use");
Window_spec *win_spec;
/* /*
We have to update "thd" pointer in LEX, all its units and in LEX::result, We have to update "thd" pointer in LEX, all its units and in LEX::result,
@ -2981,6 +2982,17 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
/* Fix ORDER list */ /* Fix ORDER list */
for (order= sl->order_list.first; order; order= order->next) for (order= sl->order_list.first; order; order= order->next)
order->item= &order->item_ptr; order->item= &order->item_ptr;
/* Fix window functions too */
List_iterator<Window_spec> it(sl->window_specs);
while ((win_spec= it++))
{
for (order= win_spec->partition_list->first; order; order= order->next)
order->item= &order->item_ptr;
for (order= win_spec->order_list->first; order; order= order->next)
order->item= &order->item_ptr;
}
{ {
#ifdef DBUG_ASSERT_EXISTS #ifdef DBUG_ASSERT_EXISTS
bool res= bool res=

View File

@ -2611,6 +2611,18 @@ setup_subq_exit:
if (!tables_list || !table_count) if (!tables_list || !table_count)
{ {
choose_tableless_subquery_plan(); choose_tableless_subquery_plan();
/* The output has atmost one row */
if (group_list)
{
group_list= NULL;
group_optimized_away= 1;
rollup.state= ROLLUP::STATE_NONE;
}
order= NULL;
simple_order= TRUE;
select_distinct= FALSE;
if (select_lex->have_window_funcs()) if (select_lex->have_window_funcs())
{ {
if (!(join_tab= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB)))) if (!(join_tab= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB))))

View File

@ -2585,7 +2585,7 @@ int multi_update::do_updates()
check_opt_it.rewind(); check_opt_it.rewind();
while(TABLE *tbl= check_opt_it++) while(TABLE *tbl= check_opt_it++)
{ {
if (unlikely((local_error= tbl->file->ha_rnd_init(1)))) if (unlikely((local_error= tbl->file->ha_rnd_init(0))))
{ {
err_table= tbl; err_table= tbl;
goto err; goto err;

View File

@ -236,24 +236,37 @@ WHEELFOR SALESMAN 10030.00
MARTIN ENGINEER 10000.00 MARTIN ENGINEER 10000.00
DROP TABLE t1, connect.emp; DROP TABLE t1, connect.emp;
CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1'; CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1';
SELECT * FROM t2 WHERE command='drop table tx1';
command number message command number message
drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:24) Unknown table 'connect.tx1' drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:24) Unknown table 'connect.tx1'
Warnings:
Warning 1105 Execute: java.sql.SQLSyntaxErrorException: (conn:24) Unknown table 'connect.tx1'
SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))'; SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))';
command number message command number message
create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows
Warnings:
Warning 1105 Affected rows
SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')"); SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')");
command number message command number message
insert into tx1 values(1,'The number one',456.12) 1 Affected rows insert into tx1 values(1,'The number one',456.12) 1 Affected rows
insert into tx1(a,b) values(2,'The number two'),(3,'The number three') 2 Affected rows insert into tx1(a,b) values(2,'The number two'),(3,'The number three') 2 Affected rows
Warnings:
Warning 1105 Affected rows
SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2'; SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2';
command number message command number message
update tx1 set c = 3.1416 where a = 2 1 Affected rows update tx1 set c = 3.1416 where a = 2 1 Affected rows
Warnings:
Warning 1105 Affected rows
SELECT * FROM t2 WHERE command='select * from tx1'; SELECT * FROM t2 WHERE command='select * from tx1';
command number message command number message
select * from tx1 3 Result set column number select * from tx1 3 Result set column number
Warnings:
Warning 1105 Result set column number
SELECT * FROM t2 WHERE command='delete from tx1 where a = 2'; SELECT * FROM t2 WHERE command='delete from tx1 where a = 2';
command number message command number message
delete from tx1 where a = 2 1 Affected rows delete from tx1 where a = 2 1 Affected rows
Warnings:
Warning 1105 Affected rows
SELECT * FROM connect.tx1; SELECT * FROM connect.tx1;
a b c a b c
1 The number one 456.12 1 The number one 456.12

View File

@ -9,12 +9,18 @@ OPTION_LIST='Execsrc=1';
SELECT * FROM t2 WHERE command='drop table employee'; SELECT * FROM t2 WHERE command='drop table employee';
command number message command number message
drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
Warnings:
Warning 1105 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))'; SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))';
command number message command number message
create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows
Warnings:
Warning 1105 Affected rows
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
command number message command number message
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
Warnings:
Warning 1105 Affected rows
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono' CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'
OPTION_LIST='Tabtype=TABLE,Maxres=10'; OPTION_LIST='Tabtype=TABLE,Maxres=10';
@ -63,4 +69,6 @@ DROP SERVER 'postgresql';
SELECT * FROM t2 WHERE command='drop table employee'; SELECT * FROM t2 WHERE command='drop table employee';
command number message command number message
drop table employee 0 Affected rows drop table employee 0 Affected rows
Warnings:
Warning 1105 Affected rows
DROP TABLE t2; DROP TABLE t2;

View File

@ -26,9 +26,7 @@ Created 6/2/1994 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "btr0btr.h" #include "btr0btr.h"
#include "ha_prototypes.h"
#include "fsp0sysspace.h"
#include "page0page.h" #include "page0page.h"
#include "page0zip.h" #include "page0zip.h"
#include "gis0rtree.h" #include "gis0rtree.h"
@ -43,7 +41,6 @@ Created 6/2/1994 Heikki Tuuri
#include "trx0trx.h" #include "trx0trx.h"
#include "srv0mon.h" #include "srv0mon.h"
#include "gis0geo.h" #include "gis0geo.h"
#include "ut0new.h"
#include "dict0boot.h" #include "dict0boot.h"
#include "row0sel.h" /* row_search_max_autoinc() */ #include "row0sel.h" /* row_search_max_autoinc() */

View File

@ -47,7 +47,6 @@ Created 11/5/1995 Heikki Tuuri
#include "btr0btr.h" #include "btr0btr.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "fil0crypt.h" #include "fil0crypt.h"
#include "fsp0sysspace.h"
#include "buf0buddy.h" #include "buf0buddy.h"
#include "lock0lock.h" #include "lock0lock.h"
#include "sync0rw.h" #include "sync0rw.h"
@ -62,12 +61,10 @@ Created 11/5/1995 Heikki Tuuri
#include "dict0dict.h" #include "dict0dict.h"
#include "log0recv.h" #include "log0recv.h"
#include "srv0mon.h" #include "srv0mon.h"
#include "fsp0sysspace.h"
#endif /* !UNIV_INNOCHECKSUM */ #endif /* !UNIV_INNOCHECKSUM */
#include "page0zip.h" #include "page0zip.h"
#include "sync0sync.h" #include "sync0sync.h"
#include "buf0dump.h" #include "buf0dump.h"
#include "ut0new.h"
#include <new> #include <new>
#include <map> #include <map>
#include <sstream> #include <sstream>
@ -75,7 +72,6 @@ Created 11/5/1995 Heikki Tuuri
#include "fil0pagecompress.h" #include "fil0pagecompress.h"
#include "fsp0pagecompress.h" #include "fsp0pagecompress.h"
#endif #endif
#include "ha_prototypes.h"
#include "ut0byte.h" #include "ut0byte.h"
#include <new> #include <new>

View File

@ -24,7 +24,6 @@ Doublwrite buffer module
Created 2011/12/19 Created 2011/12/19
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "buf0dblwr.h" #include "buf0dblwr.h"
#include "buf0buf.h" #include "buf0buf.h"
#include "buf0checksum.h" #include "buf0checksum.h"

View File

@ -25,9 +25,8 @@ The database buffer buf_pool flush algorithm
Created 11/11/1995 Heikki Tuuri Created 11/11/1995 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h" #include "univ.i"
#include <mysql/service_thd_wait.h> #include <mysql/service_thd_wait.h>
#include <my_dbug.h>
#include <sql_class.h> #include <sql_class.h>
#include "buf0flu.h" #include "buf0flu.h"
@ -46,7 +45,6 @@ Created 11/11/1995 Heikki Tuuri
#include "os0file.h" #include "os0file.h"
#include "trx0sys.h" #include "trx0sys.h"
#include "srv0mon.h" #include "srv0mon.h"
#include "fsp0sysspace.h"
#include "ut0stage.h" #include "ut0stage.h"
#include "fil0pagecompress.h" #include "fil0pagecompress.h"
#ifdef UNIV_LINUX #ifdef UNIV_LINUX

View File

@ -44,7 +44,6 @@ Created 11/5/1995 Heikki Tuuri
#include "log0recv.h" #include "log0recv.h"
#include "srv0srv.h" #include "srv0srv.h"
#include "srv0mon.h" #include "srv0mon.h"
#include "lock0lock.h"
/** The number of blocks from the LRU_old pointer onward, including /** The number of blocks from the LRU_old pointer onward, including
the block pointed to, must be buf_pool->LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV the block pointed to, must be buf_pool->LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV

View File

@ -24,7 +24,7 @@ The database buffer read
Created 11/5/1995 Heikki Tuuri Created 11/5/1995 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h" #include "univ.i"
#include <mysql/service_thd_wait.h> #include <mysql/service_thd_wait.h>
#include "buf0rea.h" #include "buf0rea.h"

View File

@ -24,8 +24,6 @@ SQL data field and tuple
Created 5/30/1994 Heikki Tuuri Created 5/30/1994 Heikki Tuuri
*************************************************************************/ *************************************************************************/
#include "ha_prototypes.h"
#include "data0data.h" #include "data0data.h"
#include "rem0rec.h" #include "rem0rec.h"
#include "rem0cmp.h" #include "rem0cmp.h"

View File

@ -24,8 +24,6 @@ Data types
Created 1/16/1996 Heikki Tuuri Created 1/16/1996 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "data0type.h" #include "data0type.h"
/** The DB_TRX_ID,DB_ROLL_PTR values for "no history is available" */ /** The DB_TRX_ID,DB_ROLL_PTR values for "no history is available" */

View File

@ -24,8 +24,6 @@ Data dictionary creation and booting
Created 4/18/1996 Heikki Tuuri Created 4/18/1996 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "dict0boot.h" #include "dict0boot.h"
#include "dict0crea.h" #include "dict0crea.h"
#include "btr0btr.h" #include "btr0btr.h"

View File

@ -24,8 +24,6 @@ Database object creation
Created 1/8/1996 Heikki Tuuri Created 1/8/1996 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "dict0crea.h" #include "dict0crea.h"
#include "btr0pcur.h" #include "btr0pcur.h"
#include "btr0btr.h" #include "btr0btr.h"
@ -43,8 +41,6 @@ Created 1/8/1996 Heikki Tuuri
#include "ut0vec.h" #include "ut0vec.h"
#include "dict0priv.h" #include "dict0priv.h"
#include "fts0priv.h" #include "fts0priv.h"
#include "fsp0space.h"
#include "fsp0sysspace.h"
#include "srv0start.h" #include "srv0start.h"
/*****************************************************************//** /*****************************************************************//**

View File

@ -27,11 +27,8 @@ Created 25/08/2016 Jan Lindström
#include "dict0stats.h" #include "dict0stats.h"
#include "dict0stats_bg.h" #include "dict0stats_bg.h"
#include "dict0defrag_bg.h" #include "dict0defrag_bg.h"
#include "row0mysql.h" #include "btr0btr.h"
#include "srv0start.h" #include "srv0start.h"
#include "ut0new.h"
#include <vector>
static ib_mutex_t defrag_pool_mutex; static ib_mutex_t defrag_pool_mutex;

View File

@ -60,7 +60,6 @@ ib_warn_row_too_big(const dict_table_t* table);
#include "dict0mem.h" #include "dict0mem.h"
#include "dict0priv.h" #include "dict0priv.h"
#include "dict0stats.h" #include "dict0stats.h"
#include "fsp0sysspace.h"
#include "fts0fts.h" #include "fts0fts.h"
#include "fts0types.h" #include "fts0types.h"
#include "lock0lock.h" #include "lock0lock.h"
@ -81,7 +80,6 @@ ib_warn_row_too_big(const dict_table_t* table);
#include "srv0start.h" #include "srv0start.h"
#include "sync0sync.h" #include "sync0sync.h"
#include "trx0undo.h" #include "trx0undo.h"
#include "ut0new.h"
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>

View File

@ -25,8 +25,6 @@ from dictionary tables
Created 4/24/1996 Heikki Tuuri Created 4/24/1996 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "dict0load.h" #include "dict0load.h"
#include "mysql_version.h" #include "mysql_version.h"
@ -39,7 +37,6 @@ Created 4/24/1996 Heikki Tuuri
#include "dict0priv.h" #include "dict0priv.h"
#include "dict0stats.h" #include "dict0stats.h"
#include "fsp0file.h" #include "fsp0file.h"
#include "fsp0sysspace.h"
#include "fts0priv.h" #include "fts0priv.h"
#include "mach0data.h" #include "mach0data.h"
#include "page0page.h" #include "page0page.h"

View File

@ -25,7 +25,6 @@ Created Jan 06, 2010 Vasil Dimov
*******************************************************/ *******************************************************/
#include "univ.i" #include "univ.i"
#include "ut0ut.h" #include "ut0ut.h"
#include "ut0rnd.h" #include "ut0rnd.h"
#include "dyn0buf.h" #include "dyn0buf.h"
@ -33,8 +32,6 @@ Created Jan 06, 2010 Vasil Dimov
#include "trx0trx.h" #include "trx0trx.h"
#include "pars0pars.h" #include "pars0pars.h"
#include "dict0stats.h" #include "dict0stats.h"
#include "ha_prototypes.h"
#include "ut0new.h"
#include <mysql_com.h> #include <mysql_com.h>
#include "btr0btr.h" #include "btr0btr.h"

View File

@ -30,7 +30,6 @@ Created Apr 25, 2012 Vasil Dimov
#include "dict0defrag_bg.h" #include "dict0defrag_bg.h"
#include "row0mysql.h" #include "row0mysql.h"
#include "srv0start.h" #include "srv0start.h"
#include "ut0new.h"
#include "fil0fil.h" #include "fil0fil.h"
#ifdef WITH_WSREP #ifdef WITH_WSREP
# include "mysql/service_wsrep.h" # include "mysql/service_wsrep.h"

View File

@ -39,7 +39,6 @@ Modified Jan Lindström jan.lindstrom@mariadb.com
#include "btr0scrub.h" #include "btr0scrub.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fil0pagecompress.h" #include "fil0pagecompress.h"
#include "ha_prototypes.h" // IB_LOG_
#include <my_crypt.h> #include <my_crypt.h>
/** Mutex for keys */ /** Mutex for keys */

View File

@ -32,10 +32,7 @@ Created 10/25/1995 Heikki Tuuri
#include "dict0boot.h" #include "dict0boot.h"
#include "dict0dict.h" #include "dict0dict.h"
#include "fsp0file.h" #include "fsp0file.h"
#include "fsp0file.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fsp0space.h"
#include "fsp0sysspace.h"
#include "hash0hash.h" #include "hash0hash.h"
#include "log0log.h" #include "log0log.h"
#include "log0recv.h" #include "log0recv.h"
@ -48,7 +45,6 @@ Created 10/25/1995 Heikki Tuuri
#include "row0trunc.h" #include "row0trunc.h"
#include "srv0start.h" #include "srv0start.h"
#include "trx0purge.h" #include "trx0purge.h"
#include "ut0new.h"
#include "buf0lru.h" #include "buf0lru.h"
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "os0event.h" #include "os0event.h"

View File

@ -47,7 +47,6 @@ Updated 14/02/2015
#include "page0zip.h" #include "page0zip.h"
#include "trx0sys.h" #include "trx0sys.h"
#include "row0mysql.h" #include "row0mysql.h"
#include "ha_prototypes.h" // IB_LOG_
#include "buf0lru.h" #include "buf0lru.h"
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "sync0sync.h" #include "sync0sync.h"

View File

@ -24,16 +24,11 @@ Tablespace data file implementation
Created 2013-7-26 by Kevin Lewis Created 2013-7-26 by Kevin Lewis
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "fsp0types.h" #include "fsp0types.h"
#include "fsp0sysspace.h"
#include "os0file.h" #include "os0file.h"
#include "page0page.h" #include "page0page.h"
#include "srv0start.h" #include "srv0start.h"
#include "ut0new.h"
#include "fil0crypt.h"
/** Initialize the name, size and order of this datafile /** Initialize the name, size and order of this datafile
@param[in] name tablespace name, will be copied @param[in] name tablespace name, will be copied

View File

@ -24,8 +24,6 @@ File space management
Created 11/29/1995 Heikki Tuuri Created 11/29/1995 Heikki Tuuri
***********************************************************************/ ***********************************************************************/
#include "ha_prototypes.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "buf0buf.h" #include "buf0buf.h"
#include "fil0fil.h" #include "fil0fil.h"
@ -41,7 +39,6 @@ Created 11/29/1995 Heikki Tuuri
#include "btr0sea.h" #include "btr0sea.h"
#include "dict0boot.h" #include "dict0boot.h"
#include "log0log.h" #include "log0log.h"
#include "fsp0sysspace.h"
#include "dict0mem.h" #include "dict0mem.h"
#include "fsp0types.h" #include "fsp0types.h"

View File

@ -24,9 +24,6 @@ Shared tablespace implementation.
Created 2012-11-16 by Sunny Bains as srv/srv0space.cc Created 2012-11-16 by Sunny Bains as srv/srv0space.cc
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "fsp0space.h"
#include "fsp0sysspace.h" #include "fsp0sysspace.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "os0file.h" #include "os0file.h"

View File

@ -24,8 +24,6 @@ Created 2012-11-16 by Sunny Bains as srv/srv0space.cc
Refactored 2013-7-26 by Kevin Lewis Refactored 2013-7-26 by Kevin Lewis
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "fsp0sysspace.h" #include "fsp0sysspace.h"
#include "srv0start.h" #include "srv0start.h"
#include "trx0sys.h" #include "trx0sys.h"
@ -33,7 +31,6 @@ Refactored 2013-7-26 by Kevin Lewis
#include "mem0mem.h" #include "mem0mem.h"
#include "os0file.h" #include "os0file.h"
#include "row0mysql.h" #include "row0mysql.h"
#include "ut0new.h"
/** The server header file is included to access opt_initialize global variable. /** The server header file is included to access opt_initialize global variable.
If server passes the option for create/open DB to SE, we should remove such If server passes the option for create/open DB to SE, we should remove such

View File

@ -24,8 +24,6 @@ Full Text Search parser helper file.
Created 2007/3/16 Sunny Bains. Created 2007/3/16 Sunny Bains.
***********************************************************************/ ***********************************************************************/
#include "ha_prototypes.h"
#include "fts0ast.h" #include "fts0ast.h"
#include "fts0pars.h" #include "fts0pars.h"
#include "fts0fts.h" #include "fts0fts.h"

View File

@ -22,8 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
Full Text Search interface Full Text Search interface
***********************************************************************/ ***********************************************************************/
#include "ha_prototypes.h"
#include "trx0roll.h" #include "trx0roll.h"
#include "row0mysql.h" #include "row0mysql.h"
#include "row0upd.h" #include "row0upd.h"
@ -40,7 +38,6 @@ Full Text Search interface
#include "dict0stats.h" #include "dict0stats.h"
#include "btr0pcur.h" #include "btr0pcur.h"
#include "sync0sync.h" #include "sync0sync.h"
#include "ut0new.h"
static const ulint FTS_MAX_ID_LEN = 32; static const ulint FTS_MAX_ID_LEN = 32;

View File

@ -26,8 +26,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang
***********************************************************************/ ***********************************************************************/
#include "ha_prototypes.h"
#include "fts0fts.h" #include "fts0fts.h"
#include "row0sel.h" #include "row0sel.h"
#include "que0types.h" #include "que0types.h"

View File

@ -25,8 +25,6 @@ Created 2007/03/27 Sunny Bains
Completed 2011/7/10 Sunny and Jimmy Yang Completed 2011/7/10 Sunny and Jimmy Yang
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "dict0dict.h" #include "dict0dict.h"
#include "ut0rbt.h" #include "ut0rbt.h"
#include "row0sel.h" #include "row0sel.h"
@ -36,7 +34,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang
#include "fts0pars.h" #include "fts0pars.h"
#include "fts0types.h" #include "fts0types.h"
#include "fts0plugin.h" #include "fts0plugin.h"
#include "ut0new.h"
#include <iomanip> #include <iomanip>
#include <vector> #include <vector>

View File

@ -25,7 +25,6 @@ its own storage, avoiding duplicates.
Created September 22, 2007 Vasil Dimov Created September 22, 2007 Vasil Dimov
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "ha0storage.h" #include "ha0storage.h"
#include "hash0hash.h" #include "hash0hash.h"
#include "mem0mem.h" #include "mem0mem.h"

View File

@ -78,8 +78,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "dict0stats_bg.h" #include "dict0stats_bg.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fsp0space.h"
#include "fsp0sysspace.h"
#include "fts0fts.h" #include "fts0fts.h"
#include "fts0plugin.h" #include "fts0plugin.h"
#include "fts0priv.h" #include "fts0priv.h"
@ -12927,16 +12925,25 @@ inline int ha_innobase::delete_table(const char* name, enum_sql_command sqlcom)
int ha_innobase::delete_table(const char* name) int ha_innobase::delete_table(const char* name)
{ {
enum_sql_command sqlcom = enum_sql_command(thd_sql_command(ha_thd())); enum_sql_command sqlcom = enum_sql_command(thd_sql_command(ha_thd()));
/* SQLCOM_TRUNCATE should be passed via ha_innobase::truncate() only.
if (sqlcom == SQLCOM_TRUNCATE On client disconnect, when dropping temporary tables, the
&& thd_killed(ha_thd()) previous sqlcom would not be overwritten. In such a case, we
&& (m_prebuilt == NULL || m_prebuilt->table->is_temporary())) { will have thd_kill_level() != NOT_KILLED, !m_prebuilt can
sqlcom = SQLCOM_DROP_TABLE; hold, and sqlcom could be anything, including TRUNCATE.
}
/* SQLCOM_TRUNCATE will be passed via ha_innobase::truncate() only. */ The sqlcom only matters for persistent tables; no persistent
DBUG_ASSERT(sqlcom != SQLCOM_TRUNCATE); metadata or FOREIGN KEY metadata is kept for temporary
return delete_table(name, sqlcom); tables. Therefore, we relax the assertion. If there is a bug
that slips through this assertion due to !m_prebuilt, the
worst impact should be that on DROP TABLE of a persistent
table, FOREIGN KEY constraints will be ignored and their
metadata will not be removed. */
DBUG_ASSERT(sqlcom != SQLCOM_TRUNCATE
|| (thd_kill_level(ha_thd()) != THD_IS_NOT_KILLED
&& (!m_prebuilt
|| m_prebuilt->table->is_temporary())));
return delete_table(name, sqlcom);
} }
/** Remove all tables in the named database inside InnoDB. /** Remove all tables in the named database inside InnoDB.
@ -13158,7 +13165,7 @@ int ha_innobase::truncate()
dict_table_t* ib_table = m_prebuilt->table; dict_table_t* ib_table = m_prebuilt->table;
const time_t update_time = ib_table->update_time; const time_t update_time = ib_table->update_time;
const ulint stored_lock = m_prebuilt->stored_select_lock_type; const ulint stored_lock = m_prebuilt->stored_select_lock_type;
memset(&info, 0, sizeof info); info.init();
update_create_info_from_table(&info, table); update_create_info_from_table(&info, table);
if (ib_table->is_temporary()) { if (ib_table->is_temporary()) {

View File

@ -23,7 +23,7 @@ Smart ALTER TABLE
*******************************************************/ *******************************************************/
/* Include necessary SQL headers */ /* Include necessary SQL headers */
#include "ha_prototypes.h" #include "univ.i"
#include <debug_sync.h> #include <debug_sync.h>
#include <log.h> #include <log.h>
#include <sql_lex.h> #include <sql_lex.h>
@ -38,7 +38,6 @@ Smart ALTER TABLE
#include "dict0priv.h" #include "dict0priv.h"
#include "dict0stats.h" #include "dict0stats.h"
#include "dict0stats_bg.h" #include "dict0stats_bg.h"
#include "fsp0sysspace.h"
#include "log0log.h" #include "log0log.h"
#include "rem0types.h" #include "rem0types.h"
#include "row0log.h" #include "row0log.h"
@ -56,7 +55,6 @@ Smart ALTER TABLE
#include "pars0pars.h" #include "pars0pars.h"
#include "row0sel.h" #include "row0sel.h"
#include "ha_innodb.h" #include "ha_innodb.h"
#include "ut0new.h"
#include "ut0stage.h" #include "ut0stage.h"
static const char *MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN= static const char *MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN=

View File

@ -25,10 +25,9 @@ Created July 18, 2007 Vasil Dimov
Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits) Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits)
*******************************************************/ *******************************************************/
#include "ha_prototypes.h" #include "univ.i"
#include <mysql_version.h> #include <mysql_version.h>
#include <field.h> #include <field.h>
#include "univ.i"
#include <sql_acl.h> #include <sql_acl.h>
#include <sql_show.h> #include <sql_show.h>
@ -58,8 +57,6 @@ Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits)
#include "sync0arr.h" #include "sync0arr.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "fil0crypt.h" #include "fil0crypt.h"
#include "fsp0sysspace.h"
#include "ut0new.h"
#include "dict0crea.h" #include "dict0crea.h"
/** structure associates a name string with a file page type and/or buffer /** structure associates a name string with a file page type and/or buffer

View File

@ -24,8 +24,6 @@ Insert buffer
Created 7/19/1997 Heikki Tuuri Created 7/19/1997 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h"
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "sync0sync.h" #include "sync0sync.h"
#include "btr0sea.h" #include "btr0sea.h"
@ -55,7 +53,6 @@ my_bool srv_ibuf_disable_background_merge;
#include "log0recv.h" #include "log0recv.h"
#include "que0que.h" #include "que0que.h"
#include "srv0start.h" /* srv_shutdown_state */ #include "srv0start.h" /* srv_shutdown_state */
#include "fsp0sysspace.h"
#include "rem0cmp.h" #include "rem0cmp.h"
/* STRUCTURE OF AN INSERT BUFFER RECORD /* STRUCTURE OF AN INSERT BUFFER RECORD

View File

@ -28,7 +28,6 @@ Created 03/11/2014 Shaohua Wang
#include "dict0dict.h" #include "dict0dict.h"
#include "page0cur.h" #include "page0cur.h"
#include "ut0new.h"
#include <vector> #include <vector>

View File

@ -35,9 +35,7 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0flu.h" #include "buf0flu.h"
#include "buf0lru.h" #include "buf0lru.h"
#include "buf0rea.h" #include "buf0rea.h"
#include "sync0debug.h"
#include "fsp0types.h" #include "fsp0types.h"
#include "ut0new.h"
/** A chunk of buffers. The buffer pool is allocated in chunks. */ /** A chunk of buffers. The buffer pool is allocated in chunks. */
struct buf_chunk_t{ struct buf_chunk_t{

View File

@ -34,7 +34,6 @@ Created 1/8/1996 Heikki Tuuri
#include "row0types.h" #include "row0types.h"
#include "mtr0mtr.h" #include "mtr0mtr.h"
#include "fil0crypt.h" #include "fil0crypt.h"
#include "fsp0space.h"
/*********************************************************************//** /*********************************************************************//**
Creates a table create graph. Creates a table create graph.

View File

@ -34,7 +34,6 @@ Created 1/8/1996 Heikki Tuuri
#include "dict0mem.h" #include "dict0mem.h"
#include "dict0types.h" #include "dict0types.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fsp0sysspace.h"
#include "hash0hash.h" #include "hash0hash.h"
#include "mem0mem.h" #include "mem0mem.h"
#include "rem0types.h" #include "rem0types.h"
@ -42,7 +41,6 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0types.h" #include "trx0types.h"
#include "ut0byte.h" #include "ut0byte.h"
#include "ut0mem.h" #include "ut0mem.h"
#include "ut0new.h"
#include "ut0rnd.h" #include "ut0rnd.h"
#include <deque> #include <deque>
#include "fsp0fsp.h" #include "fsp0fsp.h"

View File

@ -28,13 +28,11 @@ Created 4/24/1996 Heikki Tuuri
#ifndef dict0load_h #ifndef dict0load_h
#define dict0load_h #define dict0load_h
#include "univ.i"
#include "dict0types.h" #include "dict0types.h"
#include "trx0types.h" #include "trx0types.h"
#include "ut0byte.h" #include "ut0byte.h"
#include "mem0mem.h" #include "mem0mem.h"
#include "btr0types.h" #include "btr0types.h"
#include "ut0new.h"
#include <deque> #include <deque>

View File

@ -47,7 +47,6 @@ Created 1/8/1996 Heikki Tuuri
#include "buf0buf.h" #include "buf0buf.h"
#include "gis0type.h" #include "gis0type.h"
#include "os0once.h" #include "os0once.h"
#include "ut0new.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "fil0crypt.h" #include "fil0crypt.h"
#include <set> #include <set>

View File

@ -27,12 +27,9 @@ Created 2013-7-26 by Kevin Lewis
#ifndef fsp0file_h #ifndef fsp0file_h
#define fsp0file_h #define fsp0file_h
#include "ha_prototypes.h"
#include "log0log.h"
#include "mem0mem.h" #include "mem0mem.h"
#include "os0file.h" #include "os0file.h"
#include "fil0crypt.h" #include "fil0fil.h"
#include <vector>
/** Types of raw partitions in innodb_data_file_path */ /** Types of raw partitions in innodb_data_file_path */
enum device_t { enum device_t {

View File

@ -33,7 +33,6 @@ Created 12/18/1995 Heikki Tuuri
#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_INNOCHECKSUM
#include "fsp0space.h"
#include "fut0lst.h" #include "fut0lst.h"
#include "mtr0mtr.h" #include "mtr0mtr.h"
#include "page0types.h" #include "page0types.h"

View File

@ -27,11 +27,9 @@ Created 2013-7-26 by Kevin Lewis
#ifndef fsp0space_h #ifndef fsp0space_h
#define fsp0space_h #define fsp0space_h
#include "univ.i"
#include "fsp0file.h" #include "fsp0file.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fsp0types.h" #include "fsp0types.h"
#include "ut0new.h"
#include <vector> #include <vector>

View File

@ -26,7 +26,6 @@ Created 2013-7-26 by Kevin Lewis
#ifndef fsp0sysspace_h #ifndef fsp0sysspace_h
#define fsp0sysspace_h #define fsp0sysspace_h
#include "univ.i"
#include "fsp0space.h" #include "fsp0space.h"
/** If the last data file is auto-extended, we add this many pages to it /** If the last data file is auto-extended, we add this many pages to it

View File

@ -27,7 +27,6 @@ Created 2007/03/16/03 Sunny Bains
#ifndef INNOBASE_FST0AST_H #ifndef INNOBASE_FST0AST_H
#define INNOBASE_FST0AST_H #define INNOBASE_FST0AST_H
#include "ha_prototypes.h"
#include "mem0mem.h" #include "mem0mem.h"
#ifdef UNIV_PFS_MEMORY #ifdef UNIV_PFS_MEMORY

View File

@ -27,8 +27,6 @@ Created 2011/09/02 Sunny Bains
#ifndef fts0fts_h #ifndef fts0fts_h
#define fts0fts_h #define fts0fts_h
#include "ha_prototypes.h"
#include "data0type.h" #include "data0type.h"
#include "data0types.h" #include "data0types.h"
#include "dict0types.h" #include "dict0types.h"

View File

@ -26,7 +26,7 @@ Created 2013/06/04 Shaohua Wang
#ifndef INNOBASE_FTS0PLUGIN_H #ifndef INNOBASE_FTS0PLUGIN_H
#define INNOBASE_FTS0PLUGIN_H #define INNOBASE_FTS0PLUGIN_H
#include "ha_prototypes.h" #include "univ.i"
extern struct st_mysql_ftparser fts_default_parser; extern struct st_mysql_ftparser fts_default_parser;

View File

@ -27,9 +27,6 @@ Created 2007-03-27 Sunny Bains
#ifndef INNOBASE_FTS0TYPES_IC #ifndef INNOBASE_FTS0TYPES_IC
#define INNOBASE_FTS0TYPES_IC #define INNOBASE_FTS0TYPES_IC
#include "rem0cmp.h"
#include "ha_prototypes.h"
/******************************************************************//** /******************************************************************//**
Duplicate a string. Duplicate a string.
@return < 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2 */ @return < 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2 */

View File

@ -26,8 +26,6 @@ Created 2013/03/27 Jimmy Yang
#ifndef gis0type_h #ifndef gis0type_h
#define gis0type_h #define gis0type_h
#include "univ.i"
#include "buf0buf.h" #include "buf0buf.h"
#include "data0type.h" #include "data0type.h"
#include "data0types.h" #include "data0types.h"
@ -41,7 +39,6 @@ Created 2013/03/27 Jimmy Yang
#include "ut0wqueue.h" #include "ut0wqueue.h"
#include "que0types.h" #include "que0types.h"
#include "gis0geo.h" #include "gis0geo.h"
#include "ut0new.h"
#include <vector> #include <vector>
#include <list> #include <list>

View File

@ -27,13 +27,11 @@ Created 9/20/1997 Heikki Tuuri
#ifndef log0recv_h #ifndef log0recv_h
#define log0recv_h #define log0recv_h
#include "univ.i"
#include "ut0byte.h" #include "ut0byte.h"
#include "buf0types.h" #include "buf0types.h"
#include "hash0hash.h" #include "hash0hash.h"
#include "log0log.h" #include "log0log.h"
#include "mtr0types.h" #include "mtr0types.h"
#include "ut0new.h"
#include <list> #include <list>
#include <vector> #include <vector>

View File

@ -24,8 +24,6 @@ The memory management
Created 6/8/1994 Heikki Tuuri Created 6/8/1994 Heikki Tuuri
*************************************************************************/ *************************************************************************/
#include "ut0new.h"
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
# define mem_heap_create_block(heap, n, type, file_name, line) \ # define mem_heap_create_block(heap, n, type, file_name, line) \
mem_heap_create_block_func(heap, n, file_name, line, type) mem_heap_create_block_func(heap, n, file_name, line, type)

View File

@ -29,7 +29,6 @@ Created 2/2/1994 Heikki Tuuri
#include "univ.i" #include "univ.i"
#include "dict0types.h" #include "dict0types.h"
#include "mtr0types.h" #include "mtr0types.h"
#include "ut0new.h"
#include <map> #include <map>

View File

@ -27,12 +27,11 @@ Created 7/1/1994 Heikki Tuuri
#ifndef rem0cmp_h #ifndef rem0cmp_h
#define rem0cmp_h #define rem0cmp_h
#include "ha_prototypes.h"
#include "data0data.h" #include "data0data.h"
#include "data0type.h" #include "data0type.h"
#include "dict0dict.h" #include "dict0types.h"
#include "rem0rec.h" #include "rem0types.h"
#include <my_sys.h> #include "page0types.h"
/*************************************************************//** /*************************************************************//**
Returns TRUE if two columns are equal for comparison purposes. Returns TRUE if two columns are equal for comparison purposes.

View File

@ -24,6 +24,7 @@ Created 7/1/1994 Heikki Tuuri
************************************************************************/ ************************************************************************/
#include <mysql_com.h> #include <mysql_com.h>
#include <my_sys.h>
/** Compare two data fields. /** Compare two data fields.
@param[in] dfield1 data field; must have type field set @param[in] dfield1 data field; must have type field set

View File

@ -28,21 +28,19 @@ Created 9/17/2000 Heikki Tuuri
#ifndef row0mysql_h #ifndef row0mysql_h
#define row0mysql_h #define row0mysql_h
#include "ha_prototypes.h"
#include "sql_list.h"
#include "sql_cmd.h"
#include "data0data.h" #include "data0data.h"
#include "que0types.h" #include "que0types.h"
#include "dict0types.h" #include "dict0types.h"
#include "trx0types.h" #include "trx0types.h"
#include "row0types.h" #include "row0types.h"
#include "btr0pcur.h" #include "btr0types.h"
#include "trx0types.h" #include "lock0types.h"
#include "fil0crypt.h" #include "fil0fil.h"
#include "fts0fts.h"
#include "gis0type.h"
// Forward declaration #include "sql_list.h"
struct SysIndexCallback; #include "sql_cmd.h"
extern ibool row_rollback_on_timeout; extern ibool row_rollback_on_timeout;

View File

@ -31,7 +31,6 @@ Created 2013-04-25 Krunal Bauskar
#include "dict0boot.h" #include "dict0boot.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "srv0start.h" #include "srv0start.h"
#include "ut0new.h"
#include <vector> #include <vector>

View File

@ -42,12 +42,12 @@ Created 10/10/1995 Heikki Tuuri
#ifndef srv0srv_h #ifndef srv0srv_h
#define srv0srv_h #define srv0srv_h
#include "my_global.h" #include "univ.i"
#include "mysql/psi/mysql_stage.h" #include "mysql/psi/mysql_stage.h"
#include "mysql/psi/psi.h" #include "mysql/psi/psi.h"
#include "univ.i" #include "log0log.h"
#include "os0event.h" #include "os0event.h"
#include "que0types.h" #include "que0types.h"
#include "trx0types.h" #include "trx0types.h"

View File

@ -30,6 +30,8 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rseg.h" #include "trx0rseg.h"
#include "que0types.h" #include "que0types.h"
#include <queue>
/** A dummy undo record used as a return value when we have a whole undo log /** A dummy undo record used as a return value when we have a whole undo log
which needs no purge */ which needs no purge */
extern trx_undo_rec_t trx_purge_dummy_rec; extern trx_undo_rec_t trx_purge_dummy_rec;

View File

@ -27,15 +27,10 @@ Created 3/26/1996 Heikki Tuuri
#ifndef trx0trx_h #ifndef trx0trx_h
#define trx0trx_h #define trx0trx_h
#include <set>
#include "ha_prototypes.h"
#include "dict0types.h" #include "dict0types.h"
#include "trx0types.h" #include "trx0types.h"
#include "lock0types.h" #include "lock0types.h"
#include "log0log.h"
#include "que0types.h" #include "que0types.h"
#include "mem0mem.h" #include "mem0mem.h"
#include "trx0xa.h" #include "trx0xa.h"
@ -43,6 +38,9 @@ Created 3/26/1996 Heikki Tuuri
#include "fts0fts.h" #include "fts0fts.h"
#include "read0types.h" #include "read0types.h"
#include <vector>
#include <set>
// Forward declaration // Forward declaration
struct mtr_t; struct mtr_t;

View File

@ -29,9 +29,7 @@ Created 3/26/1996 Heikki Tuuri
#include "ut0byte.h" #include "ut0byte.h"
#include "ut0mutex.h" #include "ut0mutex.h"
#include "ut0new.h"
#include <queue>
#include <vector> #include <vector>
/** printf(3) format used for printing DB_TRX_ID and other system fields */ /** printf(3) format used for printing DB_TRX_ID and other system fields */

View File

@ -29,12 +29,8 @@ Created 2012-03-24 Sunny Bains.
#ifndef ut0mutex_h #ifndef ut0mutex_h
#define ut0mutex_h #define ut0mutex_h
extern uint srv_spin_wait_delay;
extern ulong srv_n_spin_wait_rounds;
#include "sync0policy.h" #include "sync0policy.h"
#include "ib0mutex.h" #include "ib0mutex.h"
#include <set>
/** Create a typedef using the MutexType<PolicyType> /** Create a typedef using the MutexType<PolicyType>
@param[in] M Mutex type @param[in] M Mutex type

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -140,8 +140,6 @@ InnoDB:
#include "mysql/psi/psi_memory.h" /* PSI_memory_key, PSI_memory_info */ #include "mysql/psi/psi_memory.h" /* PSI_memory_key, PSI_memory_info */
#include "univ.i"
#include "os0proc.h" /* os_mem_alloc_large() */ #include "os0proc.h" /* os_mem_alloc_large() */
#include "os0thread.h" /* os_thread_sleep() */ #include "os0thread.h" /* os_thread_sleep() */
#include "ut0ut.h" /* ut_strcmp_functor, ut_basename_noext() */ #include "ut0ut.h" /* ut_strcmp_functor, ut_basename_noext() */

View File

@ -23,8 +23,6 @@ A vector of pointers to data items
Created 4/6/2006 Osku Salerma Created 4/6/2006 Osku Salerma
************************************************************************/ ************************************************************************/
#include "ut0new.h"
#define IB_VEC_OFFSET(v, i) (vec->sizeof_value * i) #define IB_VEC_OFFSET(v, i) (vec->sizeof_value * i)
/******************************************************************** /********************************************************************

View File

@ -26,8 +26,7 @@ Created 5/7/1996 Heikki Tuuri
#define LOCK_MODULE_IMPLEMENTATION #define LOCK_MODULE_IMPLEMENTATION
#include "univ.i"
#include "ha_prototypes.h"
#include <mysql/service_thd_error_context.h> #include <mysql/service_thd_error_context.h>
#include <sql_class.h> #include <sql_class.h>
@ -37,11 +36,8 @@ Created 5/7/1996 Heikki Tuuri
#include "dict0mem.h" #include "dict0mem.h"
#include "trx0purge.h" #include "trx0purge.h"
#include "trx0sys.h" #include "trx0sys.h"
#include "srv0mon.h"
#include "ut0vec.h" #include "ut0vec.h"
#include "btr0btr.h" #include "btr0cur.h"
#include "dict0boot.h"
#include "ut0new.h"
#include "row0sel.h" #include "row0sel.h"
#include "row0mysql.h" #include "row0mysql.h"
#include "row0vers.h" #include "row0vers.h"
@ -3289,48 +3285,55 @@ lock_update_discard(
lock_mutex_enter(); lock_mutex_enter();
if (!lock_rec_get_first_on_page(lock_sys.rec_hash, block) if (lock_rec_get_first_on_page(lock_sys.rec_hash, block)) {
&& (!lock_rec_get_first_on_page(lock_sys.prdt_hash, block))) { ut_ad(!lock_rec_get_first_on_page(lock_sys.prdt_hash, block));
/* No locks exist on page, nothing to do */ ut_ad(!lock_rec_get_first_on_page(lock_sys.prdt_page_hash,
block));
/* Inherit all the locks on the page to the record and
reset all the locks on the page */
lock_mutex_exit(); if (page_is_comp(page)) {
rec = page + PAGE_NEW_INFIMUM;
return; do {
} heap_no = rec_get_heap_no_new(rec);
/* Inherit all the locks on the page to the record and reset all lock_rec_inherit_to_gap(heir_block, block,
the locks on the page */ heir_heap_no, heap_no);
if (page_is_comp(page)) { lock_rec_reset_and_release_wait(
rec = page + PAGE_NEW_INFIMUM; block, heap_no);
do { rec = page + rec_get_next_offs(rec, TRUE);
heap_no = rec_get_heap_no_new(rec); } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
} else {
rec = page + PAGE_OLD_INFIMUM;
lock_rec_inherit_to_gap(heir_block, block, do {
heir_heap_no, heap_no); heap_no = rec_get_heap_no_old(rec);
lock_rec_reset_and_release_wait(block, heap_no); lock_rec_inherit_to_gap(heir_block, block,
heir_heap_no, heap_no);
rec = page + rec_get_next_offs(rec, TRUE); lock_rec_reset_and_release_wait(
} while (heap_no != PAGE_HEAP_NO_SUPREMUM); block, heap_no);
rec = page + rec_get_next_offs(rec, FALSE);
} while (heap_no != PAGE_HEAP_NO_SUPREMUM);
}
lock_rec_free_all_from_discard_page_low(
block->page.id.space(), block->page.id.page_no(),
lock_sys.rec_hash);
} else { } else {
rec = page + PAGE_OLD_INFIMUM; lock_rec_free_all_from_discard_page_low(
block->page.id.space(), block->page.id.page_no(),
do { lock_sys.prdt_hash);
heap_no = rec_get_heap_no_old(rec); lock_rec_free_all_from_discard_page_low(
block->page.id.space(), block->page.id.page_no(),
lock_rec_inherit_to_gap(heir_block, block, lock_sys.prdt_page_hash);
heir_heap_no, heap_no);
lock_rec_reset_and_release_wait(block, heap_no);
rec = page + rec_get_next_offs(rec, FALSE);
} while (heap_no != PAGE_HEAP_NO_SUPREMUM);
} }
lock_rec_free_all_from_discard_page(block);
lock_mutex_exit(); lock_mutex_exit();
} }

View File

@ -29,17 +29,8 @@ Created 9/7/2013 Jimmy Yang
#include "lock0lock.h" #include "lock0lock.h"
#include "lock0priv.h" #include "lock0priv.h"
#include "lock0prdt.h" #include "lock0prdt.h"
#include "ha_prototypes.h"
#include "trx0purge.h"
#include "dict0mem.h" #include "dict0mem.h"
#include "dict0boot.h"
#include "trx0sys.h"
#include "srv0mon.h"
#include "ut0vec.h"
#include "btr0btr.h"
#include "dict0boot.h"
#include "que0que.h" #include "que0que.h"
#include <set>
/*********************************************************************//** /*********************************************************************//**
Get a minimum bounding box from a Predicate Get a minimum bounding box from a Predicate

View File

@ -26,7 +26,7 @@ Created 25/5/2010 Sunny Bains
#define LOCK_MODULE_IMPLEMENTATION #define LOCK_MODULE_IMPLEMENTATION
#include "ha_prototypes.h" #include "univ.i"
#include <mysql/service_thd_wait.h> #include <mysql/service_thd_wait.h>
#include <mysql/service_wsrep.h> #include <mysql/service_wsrep.h>

View File

@ -31,7 +31,7 @@ Database log
Created 12/9/1995 Heikki Tuuri Created 12/9/1995 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h" #include "univ.i"
#include <debug_sync.h> #include <debug_sync.h>
#include <my_service_manager.h> #include <my_service_manager.h>

View File

@ -25,7 +25,7 @@ Recovery
Created 9/20/1997 Heikki Tuuri Created 9/20/1997 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "ha_prototypes.h" #include "univ.i"
#include <vector> #include <vector>
#include <map> #include <map>
@ -52,8 +52,6 @@ Created 9/20/1997 Heikki Tuuri
#include "trx0undo.h" #include "trx0undo.h"
#include "trx0rec.h" #include "trx0rec.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "fsp0sysspace.h"
#include "ut0new.h"
#include "row0trunc.h" #include "row0trunc.h"
#include "buf0rea.h" #include "buf0rea.h"
#include "srv0srv.h" #include "srv0srv.h"

View File

@ -24,8 +24,6 @@ The memory management
Created 6/9/1994 Heikki Tuuri Created 6/9/1994 Heikki Tuuri
*************************************************************************/ *************************************************************************/
#include "ha_prototypes.h"
#include "mem0mem.h" #include "mem0mem.h"
#include "buf0buf.h" #include "buf0buf.h"
#include "srv0srv.h" #include "srv0srv.h"

Some files were not shown because too many files have changed in this diff Show More