Skip to content

Commit 22008fb

Browse files
author
Joerg Bruehe
committed
Automerge from central "trunk-bugfixing".
2 parents 4ecf25d + b5f40f3 commit 22008fb

35 files changed

+641
-113
lines changed

.bzr-mysql/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[MYSQL]
22
post_commit_to = "[email protected]"
33
post_push_to = "[email protected]"
4-
tree_name = "mysql-5.5-trunk"
4+
tree_name = "mysql-5.5-trunk-bugfixing"

include/mysql/plugin.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ typedef struct st_mysql_xid MYSQL_XID;
6666
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
6767
#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */
6868
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
69-
#define MYSQL_REPLICATION_PLUGIN 5 /* The replication plugin type */
70-
#define MYSQL_MAX_PLUGIN_TYPE_NUM 6 /* The number of plugin types */
69+
#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
70+
#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
71+
#define MYSQL_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */
7172

7273
/* We use the following strings to define licenses for plugins */
7374
#define PLUGIN_LICENSE_PROPRIETARY 0

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/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.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a);
2+
INSERT INTO t1 VALUES (0), (1), (2);
3+
START TRANSACTION;
4+
UPDATE t1 SET a = 5 WHERE a = 1;
5+
# Connection con1
6+
# InnoDB lock timeout and monitor thread runs every 15 seconds
7+
SET innodb_lock_wait_timeout = 20;
8+
START TRANSACTION;
9+
UPDATE t1 SET a = 3 WHERE a = 1;
10+
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
11+
COMMIT;
12+
# Connection default
13+
COMMIT;
14+
DROP TABLE t1;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--innodb-status-file=1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--source include/have_innodb.inc
2+
--source include/have_partition.inc
3+
4+
CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a);
5+
INSERT INTO t1 VALUES (0), (1), (2);
6+
START TRANSACTION;
7+
UPDATE t1 SET a = 5 WHERE a = 1;
8+
connect (con1, localhost, root,,);
9+
--echo # Connection con1
10+
--echo # InnoDB lock timeout and monitor thread runs every 15 seconds
11+
SET innodb_lock_wait_timeout = 20;
12+
START TRANSACTION;
13+
--error ER_LOCK_WAIT_TIMEOUT
14+
UPDATE t1 SET a = 3 WHERE a = 1;
15+
COMMIT;
16+
disconnect con1;
17+
connection default;
18+
--echo # Connection default
19+
COMMIT;
20+
DROP TABLE t1;

mysql-test/suite/rpl/r/rpl_do_grant.result

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ show grants for rpl_do_grant2@localhost;
8989
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
9090
show grants for rpl_do_grant2@localhost;
9191
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
92+
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
9293
DROP DATABASE IF EXISTS bug42217_db;
9394
CREATE DATABASE bug42217_db;
9495
GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
@@ -166,9 +167,12 @@ DROP FUNCTION upgrade_del_func;
166167
DROP FUNCTION upgrade_alter_func;
167168
DROP DATABASE bug42217_db;
168169
DROP USER 'create_rout_db'@'localhost';
169-
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
170-
USE mtr;
171-
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
170+
stop slave;
171+
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
172+
reset master;
173+
reset slave;
174+
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
175+
start slave;
172176
######## BUG#49119 #######
173177
### i) test case from the 'how to repeat section'
174178
stop slave;

mysql-test/suite/rpl/r/rpl_semi_sync.result

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,27 @@ min(a)
120120
select max(a) from t1;
121121
max(a)
122122
300
123+
124+
# BUG#50157
125+
# semi-sync replication crashes when replicating a transaction which
126+
# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
127+
[ on master ]
128+
SET SESSION AUTOCOMMIT= 0;
129+
CREATE TABLE t2(c1 INT) ENGINE=innodb;
130+
BEGIN;
131+
132+
# Even though it is in a transaction, this statement is binlogged into binlog
133+
# file immediately.
134+
CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
135+
136+
# These statements will not be binlogged until the transaction is committed
137+
INSERT INTO t2 VALUES(11);
138+
INSERT INTO t2 VALUES(22);
139+
COMMIT;
140+
DROP TABLE t2, t3;
141+
SET SESSION AUTOCOMMIT= 1;
123142
#
124-
# Test semi-sync master will switch OFF after one transacton
143+
# Test semi-sync master will switch OFF after one transaction
125144
# timeout waiting for slave reply.
126145
#
127146
include/stop_slave.inc
@@ -135,7 +154,7 @@ Variable_name Value
135154
Rpl_semi_sync_master_no_tx 0
136155
show status like 'Rpl_semi_sync_master_yes_tx';
137156
Variable_name Value
138-
Rpl_semi_sync_master_yes_tx 301
157+
Rpl_semi_sync_master_yes_tx 304
139158
show status like 'Rpl_semi_sync_master_clients';
140159
Variable_name Value
141160
Rpl_semi_sync_master_clients 1
@@ -150,7 +169,7 @@ Variable_name Value
150169
Rpl_semi_sync_master_no_tx 1
151170
show status like 'Rpl_semi_sync_master_yes_tx';
152171
Variable_name Value
153-
Rpl_semi_sync_master_yes_tx 301
172+
Rpl_semi_sync_master_yes_tx 304
154173
insert into t1 values (100);
155174
[ master status should be OFF ]
156175
show status like 'Rpl_semi_sync_master_status';
@@ -161,7 +180,7 @@ Variable_name Value
161180
Rpl_semi_sync_master_no_tx 302
162181
show status like 'Rpl_semi_sync_master_yes_tx';
163182
Variable_name Value
164-
Rpl_semi_sync_master_yes_tx 301
183+
Rpl_semi_sync_master_yes_tx 304
165184
#
166185
# Test semi-sync status on master will be ON again when slave catches up
167186
#
@@ -194,7 +213,7 @@ Variable_name Value
194213
Rpl_semi_sync_master_no_tx 302
195214
show status like 'Rpl_semi_sync_master_yes_tx';
196215
Variable_name Value
197-
Rpl_semi_sync_master_yes_tx 301
216+
Rpl_semi_sync_master_yes_tx 304
198217
show status like 'Rpl_semi_sync_master_clients';
199218
Variable_name Value
200219
Rpl_semi_sync_master_clients 1
@@ -213,7 +232,7 @@ Variable_name Value
213232
Rpl_semi_sync_master_no_tx 302
214233
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
215234
Variable_name Value
216-
Rpl_semi_sync_master_yes_tx 302
235+
Rpl_semi_sync_master_yes_tx 305
217236
FLUSH NO_WRITE_TO_BINLOG STATUS;
218237
[ Semi-sync master status variables after FLUSH STATUS ]
219238
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';

mysql-test/suite/rpl/t/disabled.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212

1313
rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails
1414
rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2
15-
rpl_cross_version : BUG#43913 2009-10-22 luis rpl_cross_version fails with symptom in described in bug report
1615
rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR
1+
--replicate-same-server-id --relay-log=slave-relay-bin

mysql-test/suite/rpl/t/rpl_do_grant.test

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ show grants for rpl_do_grant2@localhost;
120120
# BUG42217 mysql.procs_priv does not get replicated
121121
#####################################################
122122
connection master;
123+
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
124+
sync_slave_with_master;
125+
connection master;
123126

124127
--disable_warnings
125128
DROP DATABASE IF EXISTS bug42217_db;
@@ -209,12 +212,19 @@ USE bug42217_db;
209212
DROP FUNCTION upgrade_del_func;
210213
DROP FUNCTION upgrade_alter_func;
211214
DROP DATABASE bug42217_db;
215+
-- sync_slave_with_master
216+
-- connection master
217+
218+
# user was already dropped in the slave before
219+
# so no need to wait for the slave to replicate
220+
# this statement (if it did and we later synced
221+
# the slave it would end up in an error anyway)
212222
DROP USER 'create_rout_db'@'localhost';
213223

214-
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
215-
connection slave;
216-
USE mtr;
217-
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
224+
# finish entire clean up (remove binlogs)
225+
# so that we leave a pristine environment for the
226+
# following tests
227+
-- source include/master-slave-reset.inc
218228

219229
# BUG#49119: Master crashes when executing 'REVOKE ... ON
220230
# {PROCEDURE|FUNCTION} FROM ...'

mysql-test/suite/rpl/t/rpl_heartbeat_basic.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ let $slave_param_comparison= =;
382382
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
383383
# Flush logs every 0.1 second during 5 sec
384384
--disable_query_log
385-
let $i=50;
385+
let $i=100;
386386
while ($i) {
387387
FLUSH LOGS;
388388
dec $i;

mysql-test/suite/rpl/t/rpl_semi_sync.test

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ disable_query_log;
1111
connection master;
1212
call mtr.add_suppression("Timeout waiting for reply of binlog");
1313
call mtr.add_suppression("Read semi-sync reply");
14+
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT.");
1415
connection slave;
1516
call mtr.add_suppression("Master server does not support semi-sync");
1617
call mtr.add_suppression("Semi-sync slave .* reply");
@@ -193,8 +194,38 @@ select count(distinct a) from t1;
193194
select min(a) from t1;
194195
select max(a) from t1;
195196

197+
--echo
198+
--echo # BUG#50157
199+
--echo # semi-sync replication crashes when replicating a transaction which
200+
--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
201+
202+
connection master;
203+
echo [ on master ];
204+
SET SESSION AUTOCOMMIT= 0;
205+
CREATE TABLE t2(c1 INT) ENGINE=innodb;
206+
sync_slave_with_master;
207+
208+
connection master;
209+
BEGIN;
210+
--echo
211+
--echo # Even though it is in a transaction, this statement is binlogged into binlog
212+
--echo # file immediately.
213+
--disable_warnings
214+
CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
215+
--enable_warnings
216+
--echo
217+
--echo # These statements will not be binlogged until the transaction is committed
218+
INSERT INTO t2 VALUES(11);
219+
INSERT INTO t2 VALUES(22);
220+
COMMIT;
221+
222+
DROP TABLE t2, t3;
223+
SET SESSION AUTOCOMMIT= 1;
224+
sync_slave_with_master;
225+
226+
196227
--echo #
197-
--echo # Test semi-sync master will switch OFF after one transacton
228+
--echo # Test semi-sync master will switch OFF after one transaction
198229
--echo # timeout waiting for slave reply.
199230
--echo #
200231
connection slave;

mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ source include/have_binlog_format_row.inc;
1010

1111
LET $ENGINE_TYPE= MyISAM;
1212
source extra/rpl_tests/rpl_tmp_table_and_DDL.test;
13+
sync_slave_with_master;
1314

mysql-test/t/alter_table.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,3 +1089,31 @@ ALTER TABLE t1
10891089
ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
10901090
AUTO_INCREMENT = 1;
10911091
DROP TABLE t1;
1092+
1093+
1094+
#
1095+
# Bug#50542 5.5.x doesn't check length of key prefixes:
1096+
# corruption and crash results
1097+
#
1098+
# This case is related to Bug#31031 (above)
1099+
# A statement where the index key is larger/wider than
1100+
# the column type, should cause an error
1101+
#
1102+
--error ER_WRONG_SUB_KEY
1103+
CREATE TABLE t1 (a CHAR(1), PRIMARY KEY (a(255)));
1104+
1105+
# Test other variants of creating indices
1106+
CREATE TABLE t1 (a CHAR(1));
1107+
# ALTER TABLE
1108+
--error ER_WRONG_SUB_KEY
1109+
ALTER TABLE t1 ADD PRIMARY KEY (a(20));
1110+
--error ER_WRONG_SUB_KEY
1111+
ALTER TABLE t1 ADD KEY (a(20));
1112+
# CREATE INDEX
1113+
--error ER_WRONG_SUB_KEY
1114+
CREATE UNIQUE INDEX i1 ON t1 (a(20));
1115+
--error ER_WRONG_SUB_KEY
1116+
CREATE INDEX i2 ON t1 (a(20));
1117+
# cleanup
1118+
DROP TABLE t1;
1119+

0 commit comments

Comments
 (0)