Skip to content

Commit 6c32fa7

Browse files
author
Alexander Nozdrin
committed
Manual merge from mysql-next-mr.
Conflicts: - sql/log_event.cc - sql/sql_class.h
2 parents 0ec868c + 2fa7509 commit 6c32fa7

File tree

212 files changed

+6012
-2389
lines changed

Some content is hidden

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

212 files changed

+6012
-2389
lines changed

include/mysql/psi/psi.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (C) 2008-2010 Sun Microsystems, Inc
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -614,6 +614,9 @@ typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
614614
/** Delete the current thread instrumentation. */
615615
typedef void (*delete_current_thread_v1_t)(void);
616616

617+
/** Delete a thread instrumentation. */
618+
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
619+
617620
/**
618621
Get a mutex instrumentation locker.
619622
@param mutex the instrumented mutex to lock
@@ -890,6 +893,8 @@ struct PSI_v1
890893
set_thread_v1_t set_thread;
891894
/** @sa delete_current_thread_v1_t. */
892895
delete_current_thread_v1_t delete_current_thread;
896+
/** @sa delete_thread_v1_t. */
897+
delete_thread_v1_t delete_thread;
893898
/** @sa get_thread_mutex_locker_v1_t. */
894899
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
895900
/** @sa get_thread_rwlock_locker_v1_t. */

include/mysql/psi/psi_abi_v1.h.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
typedef struct PSI_thread* (*get_thread_v1_t)(void);
128128
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
129129
typedef void (*delete_current_thread_v1_t)(void);
130+
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
130131
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
131132
(struct PSI_mutex *mutex, enum PSI_mutex_operation op);
132133
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
@@ -204,6 +205,7 @@
204205
get_thread_v1_t get_thread;
205206
set_thread_v1_t set_thread;
206207
delete_current_thread_v1_t delete_current_thread;
208+
delete_thread_v1_t delete_thread;
207209
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
208210
get_thread_rwlock_locker_v1_t get_thread_rwlock_locker;
209211
get_thread_cond_locker_v1_t get_thread_cond_locker;

mysql-test/collections/default.experimental

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,16 @@ main.plugin # Bug#47146 Linking problem with exampl
1616
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
1717
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
1818

19-
perfschema.tampered_perfschema_table1 @windows # Bug#50478 2010-01-20 alik perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris
20-
perfschema.tampered_perfschema_table1 @solaris # Bug#50478 2010-01-20 alik perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris
21-
2219
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
2320
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
2421
rpl.rpl_innodb_bug28430* # Bug#46029
2522
rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
2623
rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows
2724
rpl.rpl_plugin_load* @solaris # Bug#47146
2825
rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
29-
rpl.rpl_slave_load_remove_tmpfile* @windows # Bug#50474 2010-01-20 alik rpl_slave_load_remove_tmpfile failed on windows debug enabled binary
30-
rpl.rpl_sync* @windows # Bug#50473 2010-01-20 alik rpl_sync fails on windows debug enabled binaries
3126
rpl.rpl_timezone* # Bug#47017 2009-10-27 alik rpl_timezone fails on PB-2 with mismatch error
3227

3328
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
34-
sys_vars.delayed_insert_limit_func # Bug#50435 2010-01-25 alik sys_vars.delayed_insert_limit_func fails on Ubuntu x86_64 in debug mode
3529

3630
# Declare all NDB-tests in ndb and rpl_ndb test suites experimental.
3731
# Usually the test cases from ndb and rpl_ndb test suites are not run in PB,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Check if ipv4 mapped to ipv6 is available.
2+
--disable_query_log
3+
--disable_abort_on_error
4+
connect (checkcon123456789,::FFFF:127.0.0.1,root,,test);
5+
if($mysql_errno)
6+
{
7+
skip wrong IP;
8+
}
9+
connection default;
10+
disconnect checkcon123456789;
11+
--enable_abort_on_error
12+
--enable_query_log
13+
# end check
14+

mysql-test/include/ipv6.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ eval SET @nip= inet_aton('$IPv6');
66
SELECT @nip;
77
SELECT inet_ntoa(@nip);
88
# delivers a wrong value, see bug#34037
9+
--replace_result ::1 localhost
910
SELECT USER();
11+
--replace_result ::1 localhost
1012
SELECT current_user();
1113
--disable_result_log
1214
SHOW PROCESSLIST;
@@ -17,6 +19,7 @@ disconnect con1;
1719
eval REVOKE ALL ON test.* FROM testuser@'$IPv6';
1820
eval RENAME USER testuser@'$IPv6' to testuser1@'$IPv6';
1921
eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876');
22+
--replace_result ::1 localhost
2023
SELECT USER();
2124
eval DROP USER testuser1@'$IPv6';
2225

mysql-test/r/alter_table.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,3 +1354,15 @@ DROP i,
13541354
ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
13551355
AUTO_INCREMENT = 1;
13561356
DROP TABLE t1;
1357+
CREATE TABLE t1 (a CHAR(1), PRIMARY KEY (a(255)));
1358+
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
1359+
CREATE TABLE t1 (a CHAR(1));
1360+
ALTER TABLE t1 ADD PRIMARY KEY (a(20));
1361+
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
1362+
ALTER TABLE t1 ADD KEY (a(20));
1363+
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
1364+
CREATE UNIQUE INDEX i1 ON t1 (a(20));
1365+
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
1366+
CREATE INDEX i2 ON t1 (a(20));
1367+
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
1368+
DROP TABLE t1;

mysql-test/r/constraints.result

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ create table t1 (a int check (a>0));
33
insert into t1 values (1);
44
insert into t1 values (0);
55
drop table t1;
6-
create table t1 (a int ,b int, check a>b);
6+
create table t1 (a int, b int, check (a>b));
77
insert into t1 values (1,0);
88
insert into t1 values (0,1);
99
drop table t1;
@@ -27,3 +27,19 @@ t1 CREATE TABLE `t1` (
2727
UNIQUE KEY `key_2` (`a`)
2828
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2929
drop table t1;
30+
drop table if exists t_illegal;
31+
create table t_illegal (a int, b int, check a>b);
32+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a>b)' at line 1
33+
create table t_illegal (a int, b int, constraint abc check a>b);
34+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a>b)' at line 1
35+
create table t_illegal (a int, b int, constraint abc);
36+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
37+
drop table if exists t_11714;
38+
create table t_11714(a int, b int);
39+
alter table t_11714 add constraint cons1;
40+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
41+
drop table t_11714;
42+
CREATE TABLE t_illegal (col_1 INT CHECK something (whatever));
43+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something (whatever))' at line 1
44+
CREATE TABLE t_illegal (col_1 INT CHECK something);
45+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something)' at line 1

mysql-test/r/foreign_key.result

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,45 @@ foreign key (a,b) references t3 (c,d) on update set null);
1313
create index a on t1 (a);
1414
create unique index b on t1 (a,b);
1515
drop table t1;
16+
drop table if exists t_34455;
17+
create table t_34455 (
18+
a int not null,
19+
foreign key (a) references t3 (a) match full match partial);
20+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match partial)' at line 3
21+
create table t_34455 (
22+
a int not null,
23+
foreign key (a) references t3 (a) on delete set default match full);
24+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 3
25+
create table t_34455 (
26+
a int not null,
27+
foreign key (a) references t3 (a) on update set default match full);
28+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 3
29+
create table t_34455 (
30+
a int not null,
31+
foreign key (a) references t3 (a)
32+
on delete set default on delete set default);
33+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete set default)' at line 4
34+
create table t_34455 (
35+
a int not null,
36+
foreign key (a) references t3 (a)
37+
on update set default on update set default);
38+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update set default)' at line 4
39+
create table t_34455 (a int not null);
40+
alter table t_34455
41+
add foreign key (a) references t3 (a) match full match partial);
42+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match partial)' at line 2
43+
alter table t_34455
44+
add foreign key (a) references t3 (a) on delete set default match full);
45+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 2
46+
alter table t_34455
47+
add foreign key (a) references t3 (a) on update set default match full);
48+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 2
49+
alter table t_34455
50+
add foreign key (a) references t3 (a)
51+
on delete set default on delete set default);
52+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete set default)' at line 3
53+
alter table t_34455
54+
add foreign key (a) references t3 (a)
55+
on update set default on update set default);
56+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update set default)' at line 3
57+
drop table t_34455;

mysql-test/r/gis.result

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,3 +1058,33 @@ SELECT Polygon(12345123,'');
10581058
Polygon(12345123,'')
10591059
NULL
10601060
End of 5.1 tests
1061+
CREATE TABLE t1(
1062+
col0 BINARY NOT NULL,
1063+
col2 TIMESTAMP,
1064+
SPATIAL INDEX i1 (col0)
1065+
) ENGINE=MyISAM;
1066+
ERROR 42000: A SPATIAL index may only contain a geometrical type column
1067+
CREATE TABLE t1 (
1068+
col0 BINARY NOT NULL,
1069+
col2 TIMESTAMP
1070+
) ENGINE=MyISAM;
1071+
CREATE SPATIAL INDEX idx0 ON t1(col0);
1072+
ERROR 42000: A SPATIAL index may only contain a geometrical type column
1073+
ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0);
1074+
ERROR 42000: A SPATIAL index may only contain a geometrical type column
1075+
CREATE TABLE t2 (
1076+
col0 INTEGER NOT NULL,
1077+
col1 POINT,
1078+
col2 POINT
1079+
);
1080+
CREATE SPATIAL INDEX idx0 ON t2 (col1, col2);
1081+
ERROR HY000: Incorrect arguments to SPATIAL INDEX
1082+
CREATE TABLE t3 (
1083+
col0 INTEGER NOT NULL,
1084+
col1 POINT,
1085+
col2 LINESTRING,
1086+
SPATIAL INDEX i1 (col1, col2)
1087+
);
1088+
ERROR HY000: Incorrect arguments to SPATIAL INDEX
1089+
DROP TABLE t1;
1090+
DROP TABLE t2;

mysql-test/r/group_min_max.result

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,7 @@ a c COUNT(DISTINCT c, a, b)
26862686
1 1 1
26872687
1 1 1
26882688
1 1 1
2689-
2 1 1
2689+
1 1 1
26902690
2 1 1
26912691
2 1 1
26922692
2 1 1
@@ -2714,7 +2714,7 @@ id select_type table type possible_keys key key_len ref rows Extra
27142714
1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
27152715
SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
27162716
a COUNT(DISTINCT b) SUM(DISTINCT b)
2717-
2 8 36
2717+
1 8 36
27182718
2 8 36
27192719
EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
27202720
id select_type table type possible_keys key key_len ref rows Extra
@@ -2761,7 +2761,7 @@ SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
27612761
126
27622762
126
27632763
126
2764-
168
2764+
126
27652765
168
27662766
168
27672767
168
@@ -2779,3 +2779,24 @@ SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
27792779
10
27802780
DROP TABLE t1,t2;
27812781
# end of WL#3220 tests
2782+
#
2783+
# Bug#50539: Wrong result when loose index scan is used for an aggregate
2784+
# function with distinct
2785+
#
2786+
CREATE TABLE t1 (
2787+
f1 int(11) NOT NULL DEFAULT '0',
2788+
f2 char(1) NOT NULL DEFAULT '',
2789+
PRIMARY KEY (f1,f2)
2790+
) ;
2791+
insert into t1 values(1,'A'),(1 , 'B'), (1, 'C'), (2, 'A'),
2792+
(3, 'A'), (3, 'B'), (3, 'C'), (3, 'D');
2793+
SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
2794+
f1 COUNT(DISTINCT f2)
2795+
1 3
2796+
2 1
2797+
3 4
2798+
explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
2799+
id select_type table type possible_keys key key_len ref rows Extra
2800+
1 SIMPLE t1 range NULL PRIMARY 5 NULL 9 Using index for group-by (scanning)
2801+
drop table t1;
2802+
# End of test#50539.

mysql-test/r/ipv4_as_ipv6_win.result

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)