Skip to content

Commit

Permalink
Merge branch '10.1' of https://github.com/MariaDB/server into ok-debpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
ottok committed Aug 31, 2015
2 parents 6bd94cf + 44a9977 commit e87e26a
Show file tree
Hide file tree
Showing 740 changed files with 26,931 additions and 13,798 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=6
MYSQL_VERSION_PATCH=7
MYSQL_VERSION_EXTRA=
19 changes: 19 additions & 0 deletions include/m_ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
#define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */
#define MY_CS_STRNXFRM_BAD_NWEIGHTS 0x10000 /* strnxfrm ignores "nweights" */
#define MY_CS_NOPAD 0x20000 /* if does not ignore trailing spaces */
#define MY_CS_NON1TO1 0x40000 /* Has a complex mapping from characters
to weights, e.g. contractions, expansions,
ignorable characters */
#define MY_CHARSET_UNDEFINED 0

/* Character repertoire flags */
Expand Down Expand Up @@ -511,6 +515,20 @@ struct my_charset_handler_st
char *dst, size_t dst_length,
const char *src, size_t src_length,
size_t nchars, MY_STRCOPY_STATUS *status);
/**
Write a character to the target string, using its native code.
For Unicode character sets (utf8, ucs2, utf16, utf16le, utf32, filename)
native codes are equvalent to Unicode code points.
For 8bit character sets the native code is just the byte value.
For Asian characters sets:
- MB1 native code is just the byte value (e.g. on the ASCII range)
- MB2 native code is ((b0 << 8) + b1).
- MB3 native code is ((b0 <<16) + (b1 << 8) + b2)
Note, CHARSET_INFO::min_sort_char and CHARSET_INFO::max_sort_char
are defined in native notation and should be written using
cs->cset->native_to_mb() rather than cs->cset->wc_mb().
*/
my_charset_conv_wc_mb native_to_mb;
};

extern MY_CHARSET_HANDLER my_charset_8bit_handler;
Expand Down Expand Up @@ -664,6 +682,7 @@ extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);

int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_wc_mb_bin(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);

int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);
Expand Down
7 changes: 7 additions & 0 deletions include/my_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,13 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#define UNINIT_VAR(x) x
#endif

/* This is only to be used when reseting variables in a class constructor */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define LINT_INIT(x) x= 0
#else
#define LINT_INIT(x)
#endif

#if !defined(HAVE_UINT)
#undef HAVE_UINT
#define HAVE_UINT
Expand Down
4 changes: 4 additions & 0 deletions include/mysql/psi/mysql_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -1033,11 +1033,13 @@ inline_mysql_socket_accept
SOCK_CLOEXEC);
#else
socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
#ifdef FD_CLOEXEC
flags= fcntl(socket_accept.fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
fcntl(socket_accept.fd, F_SETFD, flags);
}
#endif
#endif

/* Instrumentation end */
Expand All @@ -1053,11 +1055,13 @@ inline_mysql_socket_accept
SOCK_CLOEXEC);
#else
socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
#ifdef FD_CLOEXEC
flags= fcntl(socket_accept.fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
fcntl(socket_accept.fd, F_SETFD, flags);
}
#endif
#endif
}

Expand Down
16 changes: 16 additions & 0 deletions mysql-test/include/ctype_like_cond_propagation.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,19 @@ SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
DROP TABLE t1;

--echo #
--echo # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
--echo #

CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('a'),('a ');
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
DROP TABLE t1;

--echo #
--echo # End of MDEV-8694
--echo #
18 changes: 18 additions & 0 deletions mysql-test/include/ctype_utf8_ilseq.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,35 @@ INSERT INTO t1 (ch) VALUES (_utf8 0x61D680);

SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch;

SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch;

SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch;
--replace_column 9 #
EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch;

ALTER TABLE t1 DROP KEY ch;
Expand Down
1 change: 1 addition & 0 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4374,6 +4374,7 @@ ($$)
qr/InnoDB: Redo log crypto: Can't initialize to key version -1u/,
qr/InnoDB: Dumping buffer pool.*/,
qr/InnoDB: Buffer pool.*/,
qr/InnoDB: Warning: Writer thread is waiting this semaphore/,
qr/Slave: Unknown table 't1' .* 1051/,
qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/,
qr/slave SQL thread aborted/,
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,15 @@ t2 CREATE TABLE `t2` (
drop table if exists t1, t2;
create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert into t1 (a) values(1);
Warnings:
Warning 1364 Field 'b' doesn't have a default value
Warning 1364 Field 'c' doesn't have a default value
Warning 1364 Field 'd' doesn't have a default value
Warning 1364 Field 'e' doesn't have a default value
Warning 1364 Field 'f' doesn't have a default value
Warning 1364 Field 'g' doesn't have a default value
Warning 1364 Field 'h' doesn't have a default value
Warning 1364 Field 'i' doesn't have a default value
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/r/analyze_stmt_orderby.result
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 5,
"r_used_priority_queue": true,
"r_output_rows": 6,
Expand Down Expand Up @@ -140,6 +141,7 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10000,
"r_buffer_size": "REPLACED",
Expand Down Expand Up @@ -204,6 +206,7 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 4,
"r_used_priority_queue": true,
"r_output_rows": 4,
Expand Down Expand Up @@ -288,6 +291,7 @@ ANALYZE
"r_rows": 10,
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
Expand Down Expand Up @@ -343,6 +347,7 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 10,
"r_buffer_size": "REPLACED",
Expand Down Expand Up @@ -451,11 +456,13 @@ ANALYZE
"r_total_time_ms": "REPLACED",
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 1,
"r_used_priority_queue": true,
"r_output_rows": 2,
"filesort": {
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_used_priority_queue": false,
"r_output_rows": 6,
"r_buffer_size": "REPLACED",
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/r/bigint.result
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ create table t1 select 1 as 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(1) NOT NULL DEFAULT '0'
`a` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select 9223372036854775809 as 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(19) unsigned NOT NULL DEFAULT '0'
`a` bigint(19) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a
Expand Down Expand Up @@ -397,12 +397,12 @@ select -(-9223372036854775808), -(-(-9223372036854775808));
create table t1 select -9223372036854775808 bi;
describe t1;
Field Type Null Key Default Extra
bi bigint(20) NO 0
bi bigint(20) NO NULL
drop table t1;
create table t1 select -9223372036854775809 bi;
describe t1;
Field Type Null Key Default Extra
bi decimal(19,0) NO 0
bi decimal(19,0) NO NULL
drop table t1;
#
# Bug #45360: wrong results
Expand Down
36 changes: 18 additions & 18 deletions mysql-test/r/case.result
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ CASE WHEN 1 THEN 0.1e1 else '1' END AS c12
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL DEFAULT '',
`c3` varchar(1) NOT NULL DEFAULT '',
`c4` varchar(1) NOT NULL DEFAULT '',
`c5` varchar(4) NOT NULL DEFAULT '',
`c6` varchar(4) NOT NULL DEFAULT '',
`c7` decimal(2,1) NOT NULL DEFAULT '0.0',
`c8` decimal(2,1) NOT NULL DEFAULT '0.0',
`c1` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL,
`c2` varchar(1) CHARACTER SET latin1 COLLATE latin1_danish_ci NOT NULL,
`c3` varchar(1) NOT NULL,
`c4` varchar(1) NOT NULL,
`c5` varchar(4) NOT NULL,
`c6` varchar(4) NOT NULL,
`c7` decimal(2,1) NOT NULL,
`c8` decimal(2,1) NOT NULL,
`c9` decimal(2,1) DEFAULT NULL,
`c10` double NOT NULL DEFAULT '0',
`c11` double NOT NULL DEFAULT '0',
`c12` varchar(5) NOT NULL DEFAULT ''
`c10` double NOT NULL,
`c11` double NOT NULL,
`c12` varchar(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
Expand Down Expand Up @@ -151,13 +151,13 @@ Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,c
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`COALESCE(1)` int(1) NOT NULL DEFAULT '0',
`COALESCE(1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE('a')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1,1.0)` decimal(2,1) NOT NULL DEFAULT '0.0',
`COALESCE(1,'1')` varchar(1) NOT NULL DEFAULT '',
`COALESCE(1.1,'1')` varchar(4) NOT NULL DEFAULT '',
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
`COALESCE(1)` int(1) NOT NULL,
`COALESCE(1.0)` decimal(2,1) NOT NULL,
`COALESCE('a')` varchar(1) NOT NULL,
`COALESCE(1,1.0)` decimal(2,1) NOT NULL,
`COALESCE(1,'1')` varchar(1) NOT NULL,
`COALESCE(1.1,'1')` varchar(4) NOT NULL,
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 SELECT IFNULL('a' COLLATE latin1_swedish_ci, 'b' COLLATE latin1_bin);
Expand Down
36 changes: 18 additions & 18 deletions mysql-test/r/cast.result
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ create table t1 select cast(_koi8r'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT ''
`t` varchar(4) CHARACTER SET cp1251 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
Expand Down Expand Up @@ -438,11 +438,11 @@ ab a ab a 6100
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varbinary(2) NOT NULL DEFAULT '',
`c2` varbinary(2) NOT NULL DEFAULT '',
`c3` varbinary(2) NOT NULL DEFAULT '',
`c4` varbinary(2) NOT NULL DEFAULT '',
`c5` varbinary(2) NOT NULL DEFAULT ''
`c1` varbinary(2) NOT NULL,
`c2` varbinary(2) NOT NULL,
`c3` varbinary(2) NOT NULL,
`c4` varbinary(2) NOT NULL,
`c5` varbinary(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
Expand Down Expand Up @@ -471,11 +471,11 @@ c1 c2 c3 c4 c5
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c2` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c3` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c4` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '',
`c5` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT ''
`c1` varchar(2) CHARACTER SET utf8 NOT NULL,
`c2` varchar(2) CHARACTER SET utf8 NOT NULL,
`c3` varchar(2) CHARACTER SET utf8 NOT NULL,
`c4` varchar(2) CHARACTER SET utf8 NOT NULL,
`c5` varchar(2) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a binary(4), b char(4) character set koi8r);
Expand Down Expand Up @@ -582,12 +582,12 @@ create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`cast(1 as unsigned)` int(1) unsigned NOT NULL DEFAULT '0',
`cast(1 as signed)` int(1) NOT NULL DEFAULT '0',
`cast(1 as unsigned)` int(1) unsigned NOT NULL,
`cast(1 as signed)` int(1) NOT NULL,
`cast(1 as double(5,2))` double(5,2) DEFAULT NULL,
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL DEFAULT '0.000',
`cast("A" as binary)` varbinary(1) NOT NULL DEFAULT '',
`cast("A" as char(100))` varbinary(100) NOT NULL DEFAULT '',
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL,
`cast("A" as binary)` varbinary(1) NOT NULL,
`cast("A" as char(100))` varbinary(100) NOT NULL,
`cast("2001-1-1" as DATE)` date DEFAULT NULL,
`cast("2001-1-1" as DATETIME)` datetime DEFAULT NULL,
`cast("1:2:3" as TIME)` time DEFAULT NULL
Expand Down Expand Up @@ -751,8 +751,8 @@ Warning 1292 Truncated incorrect INTEGER value: '9999999999999999999999999999999
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '',
`CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT ''
`CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL,
`CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
# End of test for Bug#13581962, Bug#14096619
Expand Down
Loading

0 comments on commit e87e26a

Please sign in to comment.