Skip to content

Commit

Permalink
5.3->5.5 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Golubchik committed Nov 22, 2012
2 parents 1f964ac + 86f025d commit 94b450f
Show file tree
Hide file tree
Showing 61 changed files with 1,701 additions and 160 deletions.
3 changes: 2 additions & 1 deletion client/mysqlshow.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2010, 2012, Monty Program Ab
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
Expand Down
2 changes: 1 addition & 1 deletion extra/perror.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
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
Expand Down
3 changes: 2 additions & 1 deletion include/welcome_copyright_notice.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates.
/* Copyright (c) 2011, 2012, Oracle and/or its affiliates.
Copyright (c) 2011, 2012, Monty Program Ab
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
Expand Down
70 changes: 70 additions & 0 deletions mysql-test/r/derived_opt.result
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,74 @@ CREATE TABLE t1 ( i INT );
INSERT INTO t1 VALUES ( (SELECT 1 FROM ( SELECT * FROM t1 ) as a) );
drop table t1;
set optimizer_switch=@save_optimizer_switch;
#
# MDEV-3801 Reproducible sub select join crash on 5.3.8 and 5.3.9
#
CREATE TABLE t1 (
pk int(10) unsigned NOT NULL AUTO_INCREMENT,
a char(2) DEFAULT NULL,
PRIMARY KEY (pk),
KEY a (a)
) ENGINE=MyISAM;
INSERT INTO t1 (a)
VALUES (NULL),(NULL),(NULL),('AB'),(NULL),('CD'),(NULL),(NULL);
INSERT INTO t1 SELECT NULL, a1.a FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5;
CREATE TABLE t2 (
pk int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t2 SELECT NULL FROM t2 a1, t2 a2, t2 a3, t2 a4, t2 a5;
CREATE TABLE t3 (
pk int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE=MyISAM;
INSERT INTO t3 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t3 SELECT NULL FROM t3 a1, t3 a2, t3 a3, t3 a4, t3 a5;
CREATE TABLE t4 (
a char(2) NOT NULL DEFAULT '',
PRIMARY KEY (a)
) ENGINE=MyISAM;
INSERT INTO t4 VALUES ('CD');
set @@tmp_table_size=8192;
EXPLAIN
SELECT * FROM t3 AS tx JOIN t2 AS ty ON (tx.pk = ty.pk)
WHERE
tx.pk IN
(SELECT *
FROM (SELECT DISTINCT ta.pk
FROM t3 AS ta
JOIN t2 AS tb ON (ta.pk = tb.pk)
JOIN t1 AS tc ON (tb.pk = tc.pk)
JOIN t4 AS td ON tc.a = td.a) tu)
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL #
1 PRIMARY tx eq_ref PRIMARY PRIMARY 4 tu.pk # Using index
1 PRIMARY ty eq_ref PRIMARY PRIMARY 4 tu.pk # Using index
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL #
3 DERIVED td system PRIMARY NULL NULL NULL # Using temporary
3 DERIVED tc ref PRIMARY,a a 3 const #
3 DERIVED ta eq_ref PRIMARY PRIMARY 4 test.tc.pk # Using index
3 DERIVED tb eq_ref PRIMARY PRIMARY 4 test.tc.pk # Using index; Distinct
SELECT * FROM t3 AS tX JOIN t2 AS tY ON (tX.pk = tY.pk)
WHERE
tX.pk IN
(SELECT *
FROM (SELECT DISTINCT tA.pk
FROM t3 AS tA
JOIN t2 AS tB ON (tA.pk = tB.pk)
JOIN t1 AS tC ON (tB.pk = tC.pk)
JOIN t4 AS tD ON tC.a = tD.a) tU)
limit 10;
pk pk
6 6
16 16
24 24
32 32
40 40
48 48
56 56
64 64
72 72
80 80
drop table t1, t2, t3, t4;
set optimizer_switch=@exit_optimizer_switch;
11 changes: 11 additions & 0 deletions mysql-test/r/group_by.result
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,17 @@ FROM t2
GROUP BY 1;
a
DROP TABLE t1, t2;
FLUSH STATUS;
CREATE TABLE t1 (f1 INT, f2 decimal(20,1), f3 blob);
INSERT INTO t1 values(11,NULL,'blob'),(11,NULL,'blob');
SELECT f3, MIN(f2) FROM t1 GROUP BY f1 LIMIT 1;
f3 MIN(f2)
blob NULL
DROP TABLE t1;
the value below *must* be 1
show status like 'Created_tmp_disk_tables';
Variable_name Value
Created_tmp_disk_tables 1
# End of 5.3 tests
#
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/r/information_schema.result
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,12 @@ SELECT length(CAST(b AS CHAR)) FROM ubig;
length(CAST(b AS CHAR))
20
DROP TABLE ubig;
select 1 from information_schema.tables where table_schema=repeat('a', 2000);
1
grant usage on *.* to mysqltest_1@localhost;
select 1 from information_schema.tables where table_schema=repeat('a', 2000);
1
drop user mysqltest_1@localhost;
End of 5.1 tests.
#
# Additional test for WL#3726 "DDL locking for all metadata objects"
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/r/partition.result
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,12 @@ HAVING b > geomfromtext("")
);
1
DROP TABLE t1;

MDEV-612 Valgrind error in ha_maria::check_if_incompatible_data

CREATE TABLE t1 (a INT, b INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2;
ALTER TABLE t1 ADD KEY (b);
drop table t1;
End of 5.1 tests
#
# BUG#55385: UPDATE statement throws an error, but still updates
Expand Down
147 changes: 147 additions & 0 deletions mysql-test/r/range_vs_index_merge.result
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,153 @@ Lugansk UKR 469000
Seattle USA 563374
Caracas VEN 1975294
set optimizer_switch=@save_optimizer_switch;
#
# Bug mdev-585: range vs index-merge with ORDER BY ... LIMIT n
# (LP bug #637962)
#
DROP INDEX CountryPopulation ON City;
DROP INDEX CountryName ON City;
DROP INDEX CityName on City;
CREATE INDEX Name ON City(Name);
CREATE INDEX Population ON City(Population);
EXPLAIN
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City index_merge Country,Name,Population Name,Country 35,3 NULL # Using sort_union(Name,Country); Using where
FLUSH STATUS;
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000);
ID Name Country Population
384 Cabo Frio BRA 119503
387 Camaragibe BRA 118968
403 Catanduva BRA 107761
412 Cachoeirinha BRA 103240
508 Watford GBR 113080
509 Ipswich GBR 114000
510 Slough GBR 112000
511 Exeter GBR 111000
512 Cheltenham GBR 106000
513 Gloucester GBR 107000
514 Saint Helens GBR 106293
515 Sutton Coldfield GBR 106001
516 York GBR 104425
517 Oldham GBR 103931
518 Basildon GBR 100924
519 Worthing GBR 100000
635 Mallawi EGY 119283
636 Bilbays EGY 113608
637 Mit Ghamr EGY 101801
638 al-Arish EGY 100447
701 Tarragona ESP 113016
702 Lleida (Lérida) ESP 112207
703 Jaén ESP 109247
704 Ourense (Orense) ESP 109120
705 Mataró ESP 104095
706 Algeciras ESP 103106
707 Marbella ESP 101144
759 Gonder ETH 112249
869 Cabuyao PHL 106630
870 Calapan PHL 105910
873 Cauayan PHL 103952
903 Serekunda GMB 102600
909 Sohumi GEO 111700
913 Tema GHA 109975
914 Sekondi-Takoradi GHA 103653
924 Villa Nueva GTM 101295
1844 Cape Breton CAN 114733
1847 Cambridge CAN 109186
2406 Herakleion GRC 116178
2407 Kallithea GRC 114233
2408 Larisa GRC 113090
2908 Cajamarca PER 108009
3002 Besançon FRA 117733
3003 Caen FRA 113987
3004 Orléans FRA 113126
3005 Mulhouse FRA 110359
3006 Rouen FRA 106592
3007 Boulogne-Billancourt FRA 106367
3008 Perpignan FRA 105115
3009 Nancy FRA 103605
3411 Ceyhan TUR 102412
3567 Carúpano VEN 119639
3568 Catia La Mar VEN 117012
3571 Calabozo VEN 107146
3786 Cam Ranh VNM 114041
3792 Tartu EST 101246
4002 Carrollton USA 109576
4027 Cape Coral USA 102286
4032 Cambridge USA 101355
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Handler_read_last 0
Handler_read_next 385
Handler_read_prev 0
Handler_read_rnd 377
Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
EXPLAIN
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City range Country,Name,Population Population 4 NULL # Using where
FLUSH STATUS;
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
ID Name Country Population
519 Worthing GBR 100000
638 al-Arish EGY 100447
518 Basildon GBR 100924
707 Marbella ESP 101144
3792 Tartu EST 101246
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_last 0
Handler_read_next 59
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
set optimizer_switch='index_merge=off';
EXPLAIN
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City range Country,Name,Population Population 4 NULL # Using index condition; Using where
FLUSH STATUS;
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
ID Name Country Population
519 Worthing GBR 100000
638 al-Arish EGY 100447
518 Basildon GBR 100924
707 Marbella ESP 101144
3792 Tartu EST 101246
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_last 0
Handler_read_next 59
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
set optimizer_switch=@save_optimizer_switch;
DROP DATABASE world;
use test;
CREATE TABLE t1 (
Expand Down
13 changes: 11 additions & 2 deletions mysql-test/r/range_vs_index_merge_innodb,innodb_plugin.rdiff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- r/range_vs_index_merge_innodb.result 2012-03-24 17:12:02.124422000 +0100
+++ r/range_vs_index_merge_innodb,innodb_plugin.reject 2012-03-24 18:00:13.647902620 +0100
--- ./r/range_vs_index_merge_innodb.result 2012-11-21 19:35:14.000000000 +0100
+++ ./r/range_vs_index_merge_innodb,innodb_plugin.reject 2012-11-21 20:56:00.000000000 +0100
@@ -50,14 +50,14 @@
WHERE (Population >= 100000 OR Name LIKE 'P%') AND Country='CAN' OR
(Population < 100000 OR Name Like 'T%') AND Country='ARG';
Expand Down Expand Up @@ -269,3 +269,12 @@
SELECT Name, Country, Population FROM City WHERE
(Name='Manila' AND Country='PHL') OR
(Name='Addis Abeba' AND Country='ETH') OR
@@ -1346,7 +1346,7 @@
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Country,Name,Population Population 4 NULL # Using index condition; Using where
+1 SIMPLE City range Country,Name,Population Population 4 NULL # Using where
FLUSH STATUS;
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
Loading

0 comments on commit 94b450f

Please sign in to comment.