Skip to content

Commit c297308

Browse files
committed
Merge tag 'clone-5.5.65-build' into mysql-5.5-cluster-7.2
Change-Id: I8ae2e4b9deb777165d30c71e617420c2ec5156d9
2 parents 3b20835 + 1ccd472 commit c297308

File tree

18 files changed

+387
-130
lines changed

18 files changed

+387
-130
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=5
3-
MYSQL_VERSION_PATCH=64
3+
MYSQL_VERSION_PATCH=65
44
MYSQL_VERSION_EXTRA=-ndb-7.2.38

client/mysqltest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
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
@@ -6329,17 +6329,17 @@ int read_line(char *buf, int size)
63296329
/* Could be a multibyte character */
63306330
/* This code is based on the code in "sql_load.cc" */
63316331
#ifdef USE_MB
6332-
int charlen = my_mbcharlen(charset_info, (unsigned char) c);
6332+
uint charlen = my_mbcharlen(charset_info, (unsigned char) c);
6333+
if (charlen == 0)
6334+
DBUG_RETURN(1);
63336335
/* We give up if multibyte character is started but not */
63346336
/* completed before we pass buf_end */
63356337
if ((charlen > 1) && (p + charlen) <= buf_end)
63366338
{
6337-
int i;
63386339
char* mb_start = p;
6339-
63406340
*p++ = c;
63416341

6342-
for (i= 1; i < charlen; i++)
6342+
for (uint i= 1; i < charlen; i++)
63436343
{
63446344
c= my_getc(cur_file->file);
63456345
if (feof(cur_file->file))

include/m_ctype.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
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
@@ -576,7 +576,7 @@ extern my_bool my_parse_charset_xml(const char *bug, size_t len,
576576
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
577577
pchar c);
578578
extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end,
579-
const char *accept);
579+
const char *reject, int reject_length);
580580

581581
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
582582
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);

mysql-test/r/loaddata.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ DROP TABLE t1;
507507
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
508508
#
509509
CREATE TABLE t1(f1 INT);
510-
SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
510+
SELECT 0xE1C330 INTO OUTFILE 't1.dat';
511511
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
512512
DROP TABLE t1;
513513
#

mysql-test/suite/innodb/r/innodb-autoinc.result

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,11 +1376,141 @@ SELECT * FROM t;
13761376
i
13771377
1
13781378
301
1379-
351
1379+
601
13801380
SHOW CREATE TABLE t;
13811381
Table Create Table
13821382
t CREATE TABLE `t` (
13831383
`i` int(11) NOT NULL AUTO_INCREMENT,
13841384
KEY `i` (`i`)
1385-
) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=latin1
1385+
) ENGINE=InnoDB AUTO_INCREMENT=651 DEFAULT CHARSET=latin1
1386+
DROP TABLE t;
1387+
#
1388+
# Bug#15851528 DUPLICATE KEY ERROR ON AUTO-INC PK WITH MIXED AUTO_INCREMENT_INCREMENT CLIENTS
1389+
#
1390+
# This test shows that the next record to be inserted is not affected
1391+
# by a change in auto_increment_increment.
1392+
# In addition, current value of auto_increment_increment by the client
1393+
# that uses the existing autoinc value with be used to set next autoinc
1394+
# value, which will be used by next client reguardless of its own session
1395+
# setting for auto_increment_increment.
1396+
#
1397+
# Client 1: Insert a record with auto_increment_increment=2
1398+
CREATE TABLE t(
1399+
a SERIAL PRIMARY KEY,
1400+
b VARCHAR(200)) ENGINE=InnoDB;
1401+
SET SESSION auto_increment_increment=2;
1402+
SHOW CREATE TABLE t;
1403+
Table Create Table
1404+
t CREATE TABLE `t` (
1405+
`a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
1406+
`b` varchar(200) DEFAULT NULL,
1407+
PRIMARY KEY (`a`),
1408+
UNIQUE KEY `a` (`a`)
1409+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1410+
INSERT INTO t(b) VALUES('S1');
1411+
SELECT a,b FROM t;
1412+
a b
1413+
1 S1
1414+
# Client 2: Insert records with auto_increment_increment 2,1
1415+
SET SESSION auto_increment_increment=2;
1416+
SHOW CREATE TABLE t;
1417+
Table Create Table
1418+
t CREATE TABLE `t` (
1419+
`a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
1420+
`b` varchar(200) DEFAULT NULL,
1421+
PRIMARY KEY (`a`),
1422+
UNIQUE KEY `a` (`a`)
1423+
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
1424+
INSERT INTO t(b) VALUES('S2');
1425+
SELECT a,b FROM t;
1426+
a b
1427+
1 S1
1428+
3 S2
1429+
SET SESSION auto_increment_increment=1;
1430+
SHOW CREATE TABLE t;
1431+
Table Create Table
1432+
t CREATE TABLE `t` (
1433+
`a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
1434+
`b` varchar(200) DEFAULT NULL,
1435+
PRIMARY KEY (`a`),
1436+
UNIQUE KEY `a` (`a`)
1437+
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
1438+
INSERT INTO t(b) VALUES('S2');
1439+
SELECT a,b FROM t;
1440+
a b
1441+
1 S1
1442+
3 S2
1443+
5 S2
1444+
# Client 1: Insert a record with auto_increment_increment=1
1445+
SET SESSION auto_increment_increment=1;
1446+
SHOW CREATE TABLE t;
1447+
Table Create Table
1448+
t CREATE TABLE `t` (
1449+
`a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
1450+
`b` varchar(200) DEFAULT NULL,
1451+
PRIMARY KEY (`a`),
1452+
UNIQUE KEY `a` (`a`)
1453+
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
1454+
INSERT INTO t(b) VALUES('S1');
1455+
SELECT a,b FROM t;
1456+
a b
1457+
1 S1
1458+
3 S2
1459+
5 S2
1460+
6 S1
1461+
DROP TABLE t;
1462+
# Autoincrement behaviour with mixed insert.
1463+
CREATE TABLE t(
1464+
a TINYINT AUTO_INCREMENT PRIMARY KEY,
1465+
b VARCHAR(200)) ENGINE=InnoDB;
1466+
SET SESSION auto_increment_increment=100;
1467+
SHOW CREATE TABLE t;
1468+
Table Create Table
1469+
t CREATE TABLE `t` (
1470+
`a` tinyint(4) NOT NULL AUTO_INCREMENT,
1471+
`b` varchar(200) DEFAULT NULL,
1472+
PRIMARY KEY (`a`)
1473+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1474+
INSERT INTO t(b) VALUES('S0'),('S1');
1475+
SELECT a,b FROM t;
1476+
a b
1477+
1 S0
1478+
101 S1
1479+
SHOW CREATE TABLE t;
1480+
Table Create Table
1481+
t CREATE TABLE `t` (
1482+
`a` tinyint(4) NOT NULL AUTO_INCREMENT,
1483+
`b` varchar(200) DEFAULT NULL,
1484+
PRIMARY KEY (`a`)
1485+
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=latin1
1486+
INSERT INTO t(a,b) VALUES(28,'S2');
1487+
SELECT a,b FROM t;
1488+
a b
1489+
1 S0
1490+
28 S2
1491+
101 S1
1492+
SET SESSION auto_increment_increment=1;
1493+
SHOW CREATE TABLE t;
1494+
Table Create Table
1495+
t CREATE TABLE `t` (
1496+
`a` tinyint(4) NOT NULL AUTO_INCREMENT,
1497+
`b` varchar(200) DEFAULT NULL,
1498+
PRIMARY KEY (`a`)
1499+
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=latin1
1500+
INSERT INTO t(b) VALUES('S3');
1501+
SELECT a,b FROM t;
1502+
a b
1503+
1 S0
1504+
28 S2
1505+
101 S1
1506+
127 S3
1507+
SHOW CREATE TABLE t;
1508+
Table Create Table
1509+
t CREATE TABLE `t` (
1510+
`a` tinyint(4) NOT NULL AUTO_INCREMENT,
1511+
`b` varchar(200) DEFAULT NULL,
1512+
PRIMARY KEY (`a`)
1513+
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=latin1
1514+
INSERT INTO t(b) VALUES('S4');
1515+
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
13861516
DROP TABLE t;

mysql-test/suite/innodb/t/innodb-autoinc.test

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,3 +699,65 @@ INSERT INTO t VALUES (NULL);
699699
SELECT * FROM t;
700700
SHOW CREATE TABLE t;
701701
DROP TABLE t;
702+
703+
--echo #
704+
--echo # Bug#15851528 DUPLICATE KEY ERROR ON AUTO-INC PK WITH MIXED AUTO_INCREMENT_INCREMENT CLIENTS
705+
--echo #
706+
--echo # This test shows that the next record to be inserted is not affected
707+
--echo # by a change in auto_increment_increment.
708+
--echo # In addition, current value of auto_increment_increment by the client
709+
--echo # that uses the existing autoinc value with be used to set next autoinc
710+
--echo # value, which will be used by next client reguardless of its own session
711+
--echo # setting for auto_increment_increment.
712+
--echo #
713+
714+
--connection default
715+
--echo # Client 1: Insert a record with auto_increment_increment=2
716+
CREATE TABLE t(
717+
a SERIAL PRIMARY KEY,
718+
b VARCHAR(200)) ENGINE=InnoDB;
719+
SET SESSION auto_increment_increment=2;
720+
SHOW CREATE TABLE t;
721+
INSERT INTO t(b) VALUES('S1');
722+
SELECT a,b FROM t;
723+
--connect(con1,localhost,root,,)
724+
725+
--connection con1
726+
--echo # Client 2: Insert records with auto_increment_increment 2,1
727+
SET SESSION auto_increment_increment=2;
728+
SHOW CREATE TABLE t;
729+
INSERT INTO t(b) VALUES('S2');
730+
SELECT a,b FROM t;
731+
SET SESSION auto_increment_increment=1;
732+
SHOW CREATE TABLE t;
733+
INSERT INTO t(b) VALUES('S2');
734+
SELECT a,b FROM t;
735+
disconnect con1;
736+
737+
--connection default
738+
--echo # Client 1: Insert a record with auto_increment_increment=1
739+
SET SESSION auto_increment_increment=1;
740+
SHOW CREATE TABLE t;
741+
INSERT INTO t(b) VALUES('S1');
742+
SELECT a,b FROM t;
743+
DROP TABLE t;
744+
745+
--echo # Autoincrement behaviour with mixed insert.
746+
CREATE TABLE t(
747+
a TINYINT AUTO_INCREMENT PRIMARY KEY,
748+
b VARCHAR(200)) ENGINE=InnoDB;
749+
SET SESSION auto_increment_increment=100;
750+
SHOW CREATE TABLE t;
751+
INSERT INTO t(b) VALUES('S0'),('S1');
752+
SELECT a,b FROM t;
753+
SHOW CREATE TABLE t;
754+
INSERT INTO t(a,b) VALUES(28,'S2');
755+
SELECT a,b FROM t;
756+
SET SESSION auto_increment_increment=1;
757+
SHOW CREATE TABLE t;
758+
INSERT INTO t(b) VALUES('S3');
759+
SELECT a,b FROM t;
760+
SHOW CREATE TABLE t;
761+
-- error ER_DUP_ENTRY
762+
INSERT INTO t(b) VALUES('S4');
763+
DROP TABLE t;

mysql-test/t/loaddata.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#
22
# Some simple test of load data
33
#
4+
--source include/have_utf8.inc
45

56
--disable_warnings
67
drop table if exists t1, t2;
@@ -610,7 +611,7 @@ disconnect con1;
610611
--echo #
611612

612613
CREATE TABLE t1(f1 INT);
613-
EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
614+
EVAL SELECT 0xE1C330 INTO OUTFILE 't1.dat';
614615
--disable_warnings
615616
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
616617
--enable_warnings

0 commit comments

Comments
 (0)