Skip to content

Commit 78376d3

Browse files
Alexey KopytovAlexey Kopytov
authored andcommitted
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in mysql-test/r/partition_innodb.result Text conflict in sql/field.h Text conflict in sql/item.h Text conflict in sql/item_cmpfunc.h Text conflict in sql/item_sum.h Text conflict in sql/log_event_old.cc Text conflict in sql/protocol.cc Text conflict in sql/sql_select.cc Text conflict in sql/sql_yacc.yy --BZR-- revision-id: [email protected] property-branch-nick: mysql-trunk-merge testament3-sha1: 9ad412d4f73e36fe9f85436dbe7313a7d612aa62
2 parents 11a48aa + 8a910a5 commit 78376d3

991 files changed

Lines changed: 938665 additions & 250 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bzrfileids

104 KB
Binary file not shown.

include/mysql/plugin.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,12 @@ struct st_mysql_plugin
390390
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
391391
void *info; /* pointer to type-specific plugin descriptor */
392392
const char *name; /* plugin name */
393-
const char *author; /* plugin author (for SHOW PLUGINS) */
394-
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
393+
const char *author; /* plugin author (for I_S.PLUGINS) */
394+
const char *descr; /* general descriptive text (for I_S.PLUGINS) */
395395
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
396396
int (*init)(void *); /* the function to invoke when plugin is loaded */
397397
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
398-
unsigned int version; /* plugin version (for SHOW PLUGINS) */
398+
unsigned int version; /* plugin version (for I_S.PLUGINS) */
399399
struct st_mysql_show_var *status_vars;
400400
struct st_mysql_sys_var **system_vars;
401401
void * __reserved1; /* reserved for dependency checking */

mysql-test/Makefile.am

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ TEST_DIRS = t r include std_data std_data/parts collections \
9999
suite/ndb suite/ndb/t suite/ndb/r \
100100
suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
101101
suite/parts suite/parts/t suite/parts/r suite/parts/inc \
102-
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include
102+
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
103+
suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
104+
suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
105+
suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \
106+
suite/engines/rr_trx/t
103107

104108
# Used by dist-hook and install-data-local to copy all
105109
# test files into either dist or install directory
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
2+
EXPLAIN
3+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
4+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
5+
6+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
7+
EXPLAIN
8+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
9+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
10+
11+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
12+
EXPLAIN
13+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
14+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
15+
16+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
17+
EXPLAIN
18+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
19+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
20+
21+
if (!$skip_null_safe_test)
22+
{
23+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
24+
EXPLAIN
25+
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
26+
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
27+
}
28+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
29+
EXPLAIN
30+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
31+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
32+
33+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
34+
EXPLAIN
35+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
36+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
37+
38+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
39+
EXPLAIN
40+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
41+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
42+
43+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
44+
EXPLAIN
45+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
46+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
47+
48+
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
49+
EXPLAIN
50+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
51+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;

mysql-test/mysql-stress-test.pl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
$pid_file="mysql_stress_test.pid";
123123
$opt_mysqltest= ($^O =~ /mswin32/i) ? "mysqltest.exe" : "mysqltest";
124124
$opt_check_tests_file="";
125-
# OBM adding a setting for 'max-connect-retries=7' the default of 500 is to high
126-
@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=7");
125+
# OBM adding a setting for 'max-connect-retries=20' the default of 500 is to high
126+
@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=20");
127127

128128
# Client ip address
129129
$client_ip=inet_ntoa((gethostbyname(hostname()))[4]);
@@ -150,7 +150,12 @@
150150

151151
%error_strings = ( 'Failed in mysql_real_connect()' => S1,
152152
'Can\'t connect' => S1,
153-
'not found (Errcode: 2)' => S1 );
153+
'not found (Errcode: 2)' => S1,
154+
'does not exist' => S1,
155+
'Could not open connection \'default\' after \d+ attempts' => S1,
156+
'wrong errno ' => S3,
157+
'Result length mismatch' => S4,
158+
'Result content mismatch' => S4);
154159

155160
%error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2,
156161
1027 => S2, 1037 => S2, 1038 => S2,

mysql-test/r/group_min_max.result

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,236 @@ a
25372537
1
25382538
2
25392539
DROP TABLE t1;
2540+
#
2541+
# Bug#47762: Incorrect result from MIN() when WHERE tests NOT NULL column
2542+
# for NULL
2543+
#
2544+
## Test for NULLs allowed
2545+
CREATE TABLE t1 ( a INT, KEY (a) );
2546+
INSERT INTO t1 VALUES (1), (2), (3);
2547+
EXPLAIN
2548+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
2549+
id select_type table type possible_keys key key_len ref rows Extra
2550+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2551+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
2552+
MIN( a )
2553+
NULL
2554+
EXPLAIN
2555+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
2556+
id select_type table type possible_keys key key_len ref rows Extra
2557+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2558+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
2559+
MIN( a )
2560+
NULL
2561+
EXPLAIN
2562+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
2563+
id select_type table type possible_keys key key_len ref rows Extra
2564+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2565+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
2566+
MIN( a )
2567+
NULL
2568+
EXPLAIN
2569+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2570+
id select_type table type possible_keys key key_len ref rows Extra
2571+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2572+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2573+
MIN( a )
2574+
NULL
2575+
EXPLAIN
2576+
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2577+
id select_type table type possible_keys key key_len ref rows Extra
2578+
x x x x x x x x x No matching min/max row
2579+
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2580+
MIN( a )
2581+
NULL
2582+
EXPLAIN
2583+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
2584+
id select_type table type possible_keys key key_len ref rows Extra
2585+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2586+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
2587+
MIN( a )
2588+
NULL
2589+
EXPLAIN
2590+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
2591+
id select_type table type possible_keys key key_len ref rows Extra
2592+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2593+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
2594+
MIN( a )
2595+
NULL
2596+
EXPLAIN
2597+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
2598+
id select_type table type possible_keys key key_len ref rows Extra
2599+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2600+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
2601+
MIN( a )
2602+
NULL
2603+
EXPLAIN
2604+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
2605+
id select_type table type possible_keys key key_len ref rows Extra
2606+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2607+
x x x x x x x x x Using where; Using index
2608+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
2609+
MIN( a )
2610+
NULL
2611+
EXPLAIN
2612+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
2613+
id select_type table type possible_keys key key_len ref rows Extra
2614+
x x x x x x x x x No matching min/max row
2615+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
2616+
MIN( a )
2617+
NULL
2618+
INSERT INTO t1 VALUES (NULL), (NULL);
2619+
EXPLAIN
2620+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
2621+
id select_type table type possible_keys key key_len ref rows Extra
2622+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2623+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
2624+
MIN( a )
2625+
NULL
2626+
EXPLAIN
2627+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
2628+
id select_type table type possible_keys key key_len ref rows Extra
2629+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2630+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
2631+
MIN( a )
2632+
NULL
2633+
EXPLAIN
2634+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
2635+
id select_type table type possible_keys key key_len ref rows Extra
2636+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2637+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
2638+
MIN( a )
2639+
NULL
2640+
EXPLAIN
2641+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2642+
id select_type table type possible_keys key key_len ref rows Extra
2643+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2644+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2645+
MIN( a )
2646+
NULL
2647+
EXPLAIN
2648+
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2649+
id select_type table type possible_keys key key_len ref rows Extra
2650+
x x x x x x x x x Select tables optimized away
2651+
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2652+
MIN( a )
2653+
NULL
2654+
EXPLAIN
2655+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
2656+
id select_type table type possible_keys key key_len ref rows Extra
2657+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2658+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
2659+
MIN( a )
2660+
NULL
2661+
EXPLAIN
2662+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
2663+
id select_type table type possible_keys key key_len ref rows Extra
2664+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2665+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
2666+
MIN( a )
2667+
NULL
2668+
EXPLAIN
2669+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
2670+
id select_type table type possible_keys key key_len ref rows Extra
2671+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2672+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
2673+
MIN( a )
2674+
NULL
2675+
EXPLAIN
2676+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
2677+
id select_type table type possible_keys key key_len ref rows Extra
2678+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2679+
x x x x x x x x x Using where; Using index
2680+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
2681+
MIN( a )
2682+
NULL
2683+
EXPLAIN
2684+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
2685+
id select_type table type possible_keys key key_len ref rows Extra
2686+
x x x x x x x x x Select tables optimized away
2687+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
2688+
MIN( a )
2689+
NULL
2690+
DROP TABLE t1;
2691+
## Test for NOT NULLs
2692+
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY);
2693+
INSERT INTO t1 VALUES (1), (2), (3);
2694+
#
2695+
# NULL-safe operator test disabled for non-NULL indexed columns.
2696+
#
2697+
# See bugs
2698+
#
2699+
# - Bug#52173: Reading NULL value from non-NULL index gives
2700+
# wrong result in embedded server
2701+
#
2702+
# - Bug#52174: Sometimes wrong plan when reading a MAX value from
2703+
# non-NULL index
2704+
#
2705+
EXPLAIN
2706+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
2707+
id select_type table type possible_keys key key_len ref rows Extra
2708+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2709+
SELECT MIN( a ) FROM t1 WHERE a = NULL;
2710+
MIN( a )
2711+
NULL
2712+
EXPLAIN
2713+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
2714+
id select_type table type possible_keys key key_len ref rows Extra
2715+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2716+
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
2717+
MIN( a )
2718+
NULL
2719+
EXPLAIN
2720+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
2721+
id select_type table type possible_keys key key_len ref rows Extra
2722+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2723+
SELECT MIN( a ) FROM t1 WHERE a > NULL;
2724+
MIN( a )
2725+
NULL
2726+
EXPLAIN
2727+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2728+
id select_type table type possible_keys key key_len ref rows Extra
2729+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2730+
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2731+
MIN( a )
2732+
NULL
2733+
EXPLAIN
2734+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
2735+
id select_type table type possible_keys key key_len ref rows Extra
2736+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2737+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
2738+
MIN( a )
2739+
NULL
2740+
EXPLAIN
2741+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
2742+
id select_type table type possible_keys key key_len ref rows Extra
2743+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2744+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
2745+
MIN( a )
2746+
NULL
2747+
EXPLAIN
2748+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
2749+
id select_type table type possible_keys key key_len ref rows Extra
2750+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2751+
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
2752+
MIN( a )
2753+
NULL
2754+
EXPLAIN
2755+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
2756+
id select_type table type possible_keys key key_len ref rows Extra
2757+
x x x x x x x x x Impossible WHERE noticed after reading const tables
2758+
x x x x x x x x x Using where; Using index
2759+
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
2760+
MIN( a )
2761+
NULL
2762+
EXPLAIN
2763+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
2764+
id select_type table type possible_keys key key_len ref rows Extra
2765+
x x x x x x x x x Impossible WHERE
2766+
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
2767+
MIN( a )
2768+
NULL
2769+
DROP TABLE t1;
25402770
End of 5.1 tests
25412771
#
25422772
# WL#3220 (Loose index scan for COUNT DISTINCT)

mysql-test/r/having.result

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,39 @@ HAVING amount > 0
450450
ORDER BY t1.id1;
451451
id1 amount
452452
DROP TABLE t1;
453+
#
454+
# Bug#48916 Server incorrectly processing HAVING clauses with an ORDER BY clause
455+
#
456+
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT, f3 INT);
457+
INSERT INTO t1 VALUES (2,7,9), (4,7,9), (6,2,9), (17,0,9);
458+
SELECT table1.f1, table2.f2
459+
FROM t1 AS table1
460+
JOIN t1 AS table2 ON table1.f3 = table2.f3
461+
WHERE table2.f1 = 2
462+
GROUP BY table1.f1, table2.f2
463+
HAVING (table2.f2 = 8 AND table1.f1 >= 6);
464+
f1 f2
465+
EXPLAIN EXTENDED
466+
SELECT table1.f1, table2.f2
467+
FROM t1 AS table1
468+
JOIN t1 AS table2 ON table1.f3 = table2.f3
469+
WHERE table2.f1 = 2
470+
GROUP BY table1.f1, table2.f2
471+
HAVING (table2.f2 = 8 AND table1.f1 >= 6);
472+
id select_type table type possible_keys key key_len ref rows filtered Extra
473+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables
474+
Warnings:
475+
Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having (('7' = 8) and (`test`.`table1`.`f1` >= 6))
476+
EXPLAIN EXTENDED
477+
SELECT table1.f1, table2.f2
478+
FROM t1 AS table1
479+
JOIN t1 AS table2 ON table1.f3 = table2.f3
480+
WHERE table2.f1 = 2
481+
GROUP BY table1.f1, table2.f2
482+
HAVING (table2.f2 = 8);
483+
id select_type table type possible_keys key key_len ref rows filtered Extra
484+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables
485+
Warnings:
486+
Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having ('7' = 8)
487+
DROP TABLE t1;
453488
End of 5.0 tests

0 commit comments

Comments
 (0)