Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
031fa8f1
Commit
031fa8f1
authored
Mar 22, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
1caec9c8
8be02be0
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
292 additions
and
64 deletions
+292
-64
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+2
-3
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+0
-2
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+43
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+71
-0
mysql-test/r/log_slow_debug.result
mysql-test/r/log_slow_debug.result
+11
-2
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+7
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+7
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+31
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+45
-0
mysql-test/t/log_slow_debug.test
mysql-test/t/log_slow_debug.test
+11
-2
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+10
-0
plugin/auth_pam/auth_pam.c
plugin/auth_pam/auth_pam.c
+2
-2
plugin/server_audit/server_audit.c
plugin/server_audit/server_audit.c
+7
-6
sql/item_strfunc.cc
sql/item_strfunc.cc
+8
-31
sql/item_strfunc.h
sql/item_strfunc.h
+16
-9
sql/item_sum.cc
sql/item_sum.cc
+15
-2
sql/opt_subselect.cc
sql/opt_subselect.cc
+1
-1
sql/wsrep_binlog.cc
sql/wsrep_binlog.cc
+0
-1
storage/innobase/dict/dict0mem.cc
storage/innobase/dict/dict0mem.cc
+2
-1
storage/xtradb/dict/dict0mem.cc
storage/xtradb/dict/dict0mem.cc
+3
-2
No files found.
extra/mariabackup/xtrabackup.cc
View file @
031fa8f1
...
...
@@ -4,7 +4,7 @@ MariaBackup: hot backup tool for InnoDB
Originally Created 3/3/2009 Yasufumi Kinoshita
Written by Alexey Kopytov, Aleksandr Kuzminsky, Stewart Smith, Vadim Tkachenko,
Yasufumi Kinoshita, Ignacio Nin and Baron Schwartz.
(c) 2017, 201
8
, MariaDB Corporation.
(c) 2017, 201
9
, MariaDB Corporation.
Portions written by Marko Mäkelä.
This program is free software; you can redistribute it and/or modify
...
...
@@ -5419,8 +5419,7 @@ static ibool prepare_handle_del_files(const char *datadir, const char *db, const
/** Implement --prepare
@return whether the operation succeeded */
static
bool
xtrabackup_prepare_func
(
char
**
argv
)
static
bool
xtrabackup_prepare_func
(
char
**
argv
)
{
char
metadata_path
[
FN_REFLEN
];
...
...
mysql-test/mysql-test-run.pl
View file @
031fa8f1
...
...
@@ -197,8 +197,6 @@ my @DEFAULT_SUITES= qw(
sys_vars-
unit-
vcol-
wsrep-
galera-
)
;
my
$opt_suites
;
...
...
mysql-test/r/func_math.result
View file @
031fa8f1
...
...
@@ -826,6 +826,49 @@ SELECT STDDEV_POP(ROUND(0,@A:=2009)) FROM (SELECT 1 UNION SELECT 2) fake_table;
STDDEV_POP(ROUND(0,@A:=2009))
0.0000
#
# Start of 10.1 tests
#
#
# MDEV-17643 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()
#
CREATE TABLE t1 ( pk int NOT NULL, i1 int NOT NULL, d1 date NOT NULL, t1 time);
INSERT INTO t1 VALUES (7,9,'2007-08-15','03:55:02'),(8,7,'1993-06-05','04:17:51'),(9,7,'2034-07-01','17:31:12'),(10,0,'1998-08-24','08:09:27');
SELECT DISTINCT STDDEV_SAMP(EXPORT_SET(t1, -1379790335835635712, (i1 + 'o'), (MD5(d1)))) FROM t1;
STDDEV_SAMP(EXPORT_SET(t1, -1379790335835635712, (i1 + 'o'), (MD5(d1))))
NULL
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'o'
Warning 1292 Truncated incorrect DOUBLE value: '98e466c7ff40fe6b95cde24200f376303-13797903358356357128e466c7ff40fe6b95cde24200f376303-13797903358356357128e466c7ff40fe6b95cde242'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
Warning 1292 Truncated incorrect DOUBLE value: '-1379790335835635712e315457d879863c6ccf2ddee5562fc24-1379790335835635712e315457d879863c6ccf2ddee5562fc24-1379790335835635712e315'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
Warning 1292 Truncated incorrect DOUBLE value: '7b4dd517b633f1f6304b773523b5279747b4dd517b633f1f6304b773523b5279747b4dd517b633f1f6304b773523b527974-1379790335835635712b4dd517b6'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
Warning 1292 Truncated incorrect DOUBLE value: '-1379790335835635712b0e107767ea830fd3318893e40412a43-1379790335835635712b0e107767ea830fd3318893e40412a43-1379790335835635712b0e1'
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(128));
INSERT INTO t1 VALUES ('1e310');
INSERT INTO t1 VALUES ('-1e310');
INSERT INTO t1 VALUES ('0');
SELECT STDDEV_SAMP(a) FROM t1;
STDDEV_SAMP(a)
NULL
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1e310'
Warning 1292 Truncated incorrect DOUBLE value: '-1e310'
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (1.7e+308);
INSERT INTO t1 VALUES (-1.7e+308);
INSERT INTO t1 VALUES (0);
SELECT STDDEV_SAMP(a) FROM t1;
STDDEV_SAMP(a)
NULL
DROP TABLE t1;
#
# End of 10.1 tests
#
#
# Start of 10.2 tests
#
# Test zero
...
...
mysql-test/r/func_str.result
View file @
031fa8f1
...
...
@@ -2987,6 +2987,77 @@ select md5(_filename "a"), sha(_filename "a");
md5(_filename "a") sha(_filename "a")
0cc175b9c0f1b6a831c399e269772661 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
#
# MDEV-18881 Assertion `0' failed in make_sortkey upon SELECT with GROUP BY after LOAD DATA
#
CREATE TABLE t1 (a BIT(22), b CHAR(8) NOT NULL, c CHAR(8));
INSERT INTO t1 VALUES (0xA4B,'foo','qux');
INSERT INTO t1 VALUES (0x8F5,'bar','foobar');
INSERT INTO t1 VALUES (0x0, '', NULL);
INSERT INTO t1 VALUES (0x4B, 'foo','qux');
INSERT INTO t1 VALUES (0x8F5, 'bar', 'foobar');
SET SESSION SQL_MODE= '';
SELECT GROUP_CONCAT(c) AS f FROM t1 GROUP BY LPAD('foo', 20, b);
f
NULL
foobar,foobar
qux,qux
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
CREATE TABLE t1 AS SELECT
LPAD('a',10,' '),
RPAD('a',10,' '),
LPAD('a',10,' '),
RPAD('a',10,' '),
LPAD('a',10,NULL),
RPAD('a',10,NULL),
LPAD('a',10,''),
RPAD('a',10,''),
LPAD('a',10,RAND()),
RPAD('a',10,RAND());
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`LPAD('a',10,' ')` varchar(10) DEFAULT NULL,
`RPAD('a',10,' ')` varchar(10) DEFAULT NULL,
`LPAD('a',10,' ')` varchar(10) DEFAULT NULL,
`RPAD('a',10,' ')` varchar(10) DEFAULT NULL,
`LPAD('a',10,NULL)` varchar(10) DEFAULT NULL,
`RPAD('a',10,NULL)` varchar(10) DEFAULT NULL,
`LPAD('a',10,'')` varchar(10) DEFAULT NULL,
`RPAD('a',10,'')` varchar(10) DEFAULT NULL,
`LPAD('a',10,RAND())` varchar(10) DEFAULT NULL,
`RPAD('a',10,RAND())` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET SESSION SQL_MODE= '';
CREATE TABLE t1 AS SELECT
LPAD('a',10,' '),
RPAD('a',10,' '),
LPAD('a',10,' '),
RPAD('a',10,' '),
LPAD('a',10,NULL),
RPAD('a',10,NULL),
LPAD('a',10,''),
RPAD('a',10,''),
LPAD('a',10,RAND()),
RPAD('a',10,RAND());
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`LPAD('a',10,' ')` varchar(10) NOT NULL,
`RPAD('a',10,' ')` varchar(10) NOT NULL,
`LPAD('a',10,' ')` varchar(10) NOT NULL,
`RPAD('a',10,' ')` varchar(10) NOT NULL,
`LPAD('a',10,NULL)` varchar(10) DEFAULT NULL,
`RPAD('a',10,NULL)` varchar(10) DEFAULT NULL,
`LPAD('a',10,'')` varchar(10) DEFAULT NULL,
`RPAD('a',10,'')` varchar(10) DEFAULT NULL,
`LPAD('a',10,RAND())` varchar(10) DEFAULT NULL,
`RPAD('a',10,RAND())` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
#
# End of 5.5 tests
#
#
...
...
mysql-test/r/log_slow_debug.result
View file @
031fa8f1
...
...
@@ -14,6 +14,14 @@ FROM mysql.slow_log
WHERE sql_text NOT LIKE '%debug_dbug%';
END
$$
CREATE PROCEDURE show_slow_log_exclude_ps()
BEGIN
SELECT CONCAT('[slow] ', sql_text) AS sql_text
FROM mysql.slow_log
WHERE sql_text NOT LIKE '%debug_dbug%'
AND sql_text NOT IN ('Prepare','Close stmt');
END
$$
#
# Expect all admin statements in the slow log (ON,DEFAULT)
#
...
...
@@ -33,7 +41,7 @@ PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t4;
CALL show_slow_log();
CALL show_slow_log
_exclude_ps
();
sql_text
[slow] TRUNCATE TABLE mysql.slow_log
[slow] CREATE TABLE t1 (a INT)
...
...
@@ -115,7 +123,7 @@ PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t4;
CALL show_slow_log();
CALL show_slow_log
_exclude_ps
();
sql_text
[slow] TRUNCATE TABLE mysql.slow_log
[slow] CREATE TABLE t1 (a INT)
...
...
@@ -135,3 +143,4 @@ SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
DROP PROCEDURE show_slow_log;
DROP PROCEDURE show_slow_log_exclude_ps;
mysql-test/r/subselect_sj.result
View file @
031fa8f1
...
...
@@ -3190,5 +3190,12 @@ EXECUTE stmt;
a
drop view v3;
drop table t1,t2,t3;
#
# MDEV-18896: IN subquery in WHERE of a table-less query used for INSERT
#
create table t1 (a1 varchar(25));
create table t2 (a2 varchar(25)) ;
insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop table t1,t2;
# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
031fa8f1
...
...
@@ -3204,6 +3204,13 @@ EXECUTE stmt;
a
drop view v3;
drop table t1,t2,t3;
#
# MDEV-18896: IN subquery in WHERE of a table-less query used for INSERT
#
create table t1 (a1 varchar(25));
create table t2 (a2 varchar(25)) ;
insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop table t1,t2;
# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
#
...
...
mysql-test/t/func_math.test
View file @
031fa8f1
...
...
@@ -596,6 +596,37 @@ DROP TABLE t1;
--
echo
#
SELECT
STDDEV_POP
(
ROUND
(
0
,
@
A
:=
2009
))
FROM
(
SELECT
1
UNION
SELECT
2
)
fake_table
;
--
echo
#
--
echo
# Start of 10.1 tests
--
echo
#
--
echo
#
--
echo
# MDEV-17643 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()
--
echo
#
CREATE
TABLE
t1
(
pk
int
NOT
NULL
,
i1
int
NOT
NULL
,
d1
date
NOT
NULL
,
t1
time
);
INSERT
INTO
t1
VALUES
(
7
,
9
,
'2007-08-15'
,
'03:55:02'
),(
8
,
7
,
'1993-06-05'
,
'04:17:51'
),(
9
,
7
,
'2034-07-01'
,
'17:31:12'
),(
10
,
0
,
'1998-08-24'
,
'08:09:27'
);
SELECT
DISTINCT
STDDEV_SAMP
(
EXPORT_SET
(
t1
,
-
1379790335835635712
,
(
i1
+
'o'
),
(
MD5
(
d1
))))
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
128
));
INSERT
INTO
t1
VALUES
(
'1e310'
);
INSERT
INTO
t1
VALUES
(
'-1e310'
);
INSERT
INTO
t1
VALUES
(
'0'
);
SELECT
STDDEV_SAMP
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
OR
REPLACE
TABLE
t1
(
a
DOUBLE
);
INSERT
INTO
t1
VALUES
(
1.7e+308
);
INSERT
INTO
t1
VALUES
(
-
1.7e+308
);
INSERT
INTO
t1
VALUES
(
0
);
SELECT
STDDEV_SAMP
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.1 tests
--
echo
#
--
echo
#
--
echo
# Start of 10.2 tests
--
echo
#
...
...
mysql-test/t/func_str.test
View file @
031fa8f1
...
...
@@ -1610,6 +1610,51 @@ drop table t1,t2;
#
select
md5
(
_filename
"a"
),
sha
(
_filename
"a"
);
--
echo
#
--
echo
# MDEV-18881 Assertion `0' failed in make_sortkey upon SELECT with GROUP BY after LOAD DATA
--
echo
#
CREATE
TABLE
t1
(
a
BIT
(
22
),
b
CHAR
(
8
)
NOT
NULL
,
c
CHAR
(
8
));
INSERT
INTO
t1
VALUES
(
0xA4B
,
'foo'
,
'qux'
);
INSERT
INTO
t1
VALUES
(
0x8F5
,
'bar'
,
'foobar'
);
INSERT
INTO
t1
VALUES
(
0x0
,
''
,
NULL
);
INSERT
INTO
t1
VALUES
(
0x4B
,
'foo'
,
'qux'
);
INSERT
INTO
t1
VALUES
(
0x8F5
,
'bar'
,
'foobar'
);
SET
SESSION
SQL_MODE
=
''
;
SELECT
GROUP_CONCAT
(
c
)
AS
f
FROM
t1
GROUP
BY
LPAD
(
'foo'
,
20
,
b
);
DROP
TABLE
t1
;
SET
SESSION
SQL_MODE
=
DEFAULT
;
CREATE
TABLE
t1
AS
SELECT
LPAD
(
'a'
,
10
,
' '
),
RPAD
(
'a'
,
10
,
' '
),
LPAD
(
'a'
,
10
,
' '
),
RPAD
(
'a'
,
10
,
' '
),
LPAD
(
'a'
,
10
,
NULL
),
RPAD
(
'a'
,
10
,
NULL
),
LPAD
(
'a'
,
10
,
''
),
RPAD
(
'a'
,
10
,
''
),
LPAD
(
'a'
,
10
,
RAND
()),
RPAD
(
'a'
,
10
,
RAND
());
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
SET
SESSION
SQL_MODE
=
''
;
CREATE
TABLE
t1
AS
SELECT
LPAD
(
'a'
,
10
,
' '
),
RPAD
(
'a'
,
10
,
' '
),
LPAD
(
'a'
,
10
,
' '
),
RPAD
(
'a'
,
10
,
' '
),
LPAD
(
'a'
,
10
,
NULL
),
RPAD
(
'a'
,
10
,
NULL
),
LPAD
(
'a'
,
10
,
''
),
RPAD
(
'a'
,
10
,
''
),
LPAD
(
'a'
,
10
,
RAND
()),
RPAD
(
'a'
,
10
,
RAND
());
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
SET
SESSION
SQL_MODE
=
DEFAULT
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
...
...
mysql-test/t/log_slow_debug.test
View file @
031fa8f1
...
...
@@ -19,6 +19,14 @@ BEGIN
WHERE
sql_text
NOT
LIKE
'%debug_dbug%'
;
END
$$
CREATE
PROCEDURE
show_slow_log_exclude_ps
()
BEGIN
SELECT
CONCAT
(
'[slow] '
,
sql_text
)
AS
sql_text
FROM
mysql
.
slow_log
WHERE
sql_text
NOT
LIKE
'%debug_dbug%'
AND
sql_text
NOT
IN
(
'Prepare'
,
'Close stmt'
);
END
$$
DELIMITER
;
$$
...
...
@@ -42,7 +50,7 @@ PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t4
;
CALL
show_slow_log
();
CALL
show_slow_log
_exclude_ps
();
--
echo
#
...
...
@@ -111,7 +119,7 @@ PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t4
;
CALL
show_slow_log
();
CALL
show_slow_log
_exclude_ps
();
--
echo
#
...
...
@@ -124,3 +132,4 @@ SET @@global.slow_query_log= @org_slow_query_log;
SET
@@
global
.
log_output
=
@
org_log_output
;
SET
@@
global
.
log_slow_admin_statements
=
@
org_log_slow_admin_statements
;
DROP
PROCEDURE
show_slow_log
;
DROP
PROCEDURE
show_slow_log_exclude_ps
;
mysql-test/t/subselect_sj.test
View file @
031fa8f1
...
...
@@ -2873,6 +2873,16 @@ EXECUTE stmt;
drop
view
v3
;
drop
table
t1
,
t2
,
t3
;
--
echo
#
--
echo
# MDEV-18896: IN subquery in WHERE of a table-less query used for INSERT
--
echo
#
create
table
t1
(
a1
varchar
(
25
));
create
table
t2
(
a2
varchar
(
25
))
;
insert
into
t1
select
'xxx'
from
dual
where
'xxx'
in
(
select
a2
from
t2
);
drop
table
t1
,
t2
;
--
echo
# End of 5.5 test
# The following command must be the last one the file
...
...
plugin/auth_pam/auth_pam.c
View file @
031fa8f1
/*
Copyright (c) 2011, 201
2, Monty Program Ab
Copyright (c) 2011, 201
9, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -161,7 +161,7 @@ static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
if
(
new_username
&&
strcmp
(
new_username
,
info
->
user_name
))
strncpy
(
info
->
authenticated_as
,
new_username
,
sizeof
(
info
->
authenticated_as
));
sizeof
(
info
->
authenticated_as
)
-
1
);
info
->
authenticated_as
[
sizeof
(
info
->
authenticated_as
)
-
1
]
=
0
;
end:
...
...
plugin/server_audit/server_audit.c
View file @
031fa8f1
...
...
@@ -1053,7 +1053,7 @@ static int start_logging()
}
error_header
();
fprintf
(
stderr
,
"logging started to the file %s.
\n
"
,
alt_fname
);
strncpy
(
current_log_buf
,
alt_fname
,
sizeof
(
current_log_buf
));
strncpy
(
current_log_buf
,
alt_fname
,
sizeof
(
current_log_buf
)
-
1
);
current_log_buf
[
sizeof
(
current_log_buf
)
-
1
]
=
0
;
}
else
if
(
output_type
==
OUTPUT_SYSLOG
)
...
...
@@ -1061,7 +1061,8 @@ static int start_logging()
openlog
(
syslog_ident
,
LOG_NOWAIT
,
syslog_facility_codes
[
syslog_facility
]);
error_header
();
fprintf
(
stderr
,
"logging started to the syslog.
\n
"
);
strncpy
(
current_log_buf
,
"[SYSLOG]"
,
sizeof
(
current_log_buf
));
strncpy
(
current_log_buf
,
"[SYSLOG]"
,
sizeof
(
current_log_buf
)
-
1
);
compile_time_assert
(
sizeof
current_log_buf
>
sizeof
"[SYSLOG]"
);
}
is_active
=
1
;
return
0
;
...
...
@@ -2597,7 +2598,7 @@ static void update_file_path(MYSQL_THD thd,
internal_stop_logging
=
0
;
}
strncpy
(
path_buffer
,
new_name
,
sizeof
(
path_buffer
));
strncpy
(
path_buffer
,
new_name
,
sizeof
(
path_buffer
)
-
1
);
path_buffer
[
sizeof
(
path_buffer
)
-
1
]
=
0
;
file_path
=
path_buffer
;
exit_func:
...
...
@@ -2650,7 +2651,7 @@ static void update_incl_users(MYSQL_THD thd,
if
(
!
maria_55_started
||
!
debug_server_started
)
flogger_mutex_lock
(
&
lock_operations
);
mark_always_logged
(
thd
);
strncpy
(
incl_user_buffer
,
new_users
,
sizeof
(
incl_user_buffer
));
strncpy
(
incl_user_buffer
,
new_users
,
sizeof
(
incl_user_buffer
)
-
1
);
incl_user_buffer
[
sizeof
(
incl_user_buffer
)
-
1
]
=
0
;
incl_users
=
incl_user_buffer
;
user_coll_fill
(
&
incl_user_coll
,
incl_users
,
&
excl_user_coll
,
1
);
...
...
@@ -2669,7 +2670,7 @@ static void update_excl_users(MYSQL_THD thd __attribute__((unused)),
if
(
!
maria_55_started
||
!
debug_server_started
)
flogger_mutex_lock
(
&
lock_operations
);
mark_always_logged
(
thd
);
strncpy
(
excl_user_buffer
,
new_users
,
sizeof
(
excl_user_buffer
));
strncpy
(
excl_user_buffer
,
new_users
,
sizeof
(
excl_user_buffer
)
-
1
);
excl_user_buffer
[
sizeof
(
excl_user_buffer
)
-
1
]
=
0
;
excl_users
=
excl_user_buffer
;
user_coll_fill
(
&
excl_user_coll
,
excl_users
,
&
incl_user_coll
,
0
);
...
...
@@ -2801,7 +2802,7 @@ static void update_syslog_ident(MYSQL_THD thd __attribute__((unused)),
void
*
var_ptr
__attribute__
((
unused
)),
const
void
*
save
)
{
char
*
new_ident
=
(
*
(
char
**
)
save
)
?
*
(
char
**
)
save
:
empty_str
;
strncpy
(
syslog_ident_buffer
,
new_ident
,
sizeof
(
syslog_ident_buffer
));
strncpy
(
syslog_ident_buffer
,
new_ident
,
sizeof
(
syslog_ident_buffer
)
-
1
);
syslog_ident_buffer
[
sizeof
(
syslog_ident_buffer
)
-
1
]
=
0
;
syslog_ident
=
syslog_ident_buffer
;
error_header
();
...
...
sql/item_strfunc.cc
View file @
031fa8f1
/*
Copyright (c) 2000, 2017, Oracle and/or its affiliates.
Copyright (c) 2009, 201
8
, MariaDB Corporation
Copyright (c) 2009, 201
9
, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -3086,8 +3086,12 @@ String *Item_func_binlog_gtid_pos::val_str(String *str)
}
bool
Item_func_
r
pad
::
fix_length_and_dec
()
bool
Item_func_pad
::
fix_length_and_dec
()
{
String
*
str
;
if
(
!
args
[
2
]
->
basic_const_item
()
||
!
(
str
=
args
[
2
]
->
val_str
(
&
pad_str
))
||
!
str
->
length
())
maybe_null
=
true
;
// Handle character set for args[0] and args[2].
if
(
agg_arg_charsets_for_string_result
(
collation
,
&
args
[
0
],
2
,
2
))
return
TRUE
;
...
...
@@ -3122,7 +3126,7 @@ String *Item_func_rpad::val_str(String *str)
longlong
count
=
args
[
1
]
->
val_int
();
longlong
byte_count
;
String
*
res
=
args
[
0
]
->
val_str
(
str
);
String
*
rpad
=
args
[
2
]
->
val_str
(
&
r
pad_str
);
String
*
rpad
=
args
[
2
]
->
val_str
(
&
pad_str
);
if
(
!
res
||
args
[
1
]
->
null_value
||
!
rpad
||
((
count
<
0
)
&&
!
args
[
1
]
->
unsigned_flag
))
...
...
@@ -3195,33 +3199,6 @@ String *Item_func_rpad::val_str(String *str)
}
bool
Item_func_lpad
::
fix_length_and_dec
()
{
// Handle character set for args[0] and args[2].
if
(
agg_arg_charsets_for_string_result
(
collation
,
&
args
[
0
],
2
,
2
))
return
TRUE
;
if
(
args
[
1
]
->
const_item
())
{
ulonglong
char_length
=
(
ulonglong
)
args
[
1
]
->
val_int
();
DBUG_ASSERT
(
collation
.
collation
->
mbmaxlen
>
0
);
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
if
(
args
[
1
]
->
null_value
)
char_length
=
0
;
else
if
(
char_length
>
INT_MAX32
)
char_length
=
INT_MAX32
;
fix_char_length_ulonglong
(
char_length
);
}
else
{
max_length
=
MAX_BLOB_WIDTH
;
maybe_null
=
1
;
}
return
FALSE
;
}
String
*
Item_func_lpad
::
val_str
(
String
*
str
)
{
DBUG_ASSERT
(
fixed
==
1
);
...
...
@@ -3230,7 +3207,7 @@ String *Item_func_lpad::val_str(String *str)
longlong
count
=
args
[
1
]
->
val_int
();
longlong
byte_count
;
String
*
res
=
args
[
0
]
->
val_str
(
&
tmp_value
);
String
*
pad
=
args
[
2
]
->
val_str
(
&
l
pad_str
);
String
*
pad
=
args
[
2
]
->
val_str
(
&
pad_str
);
if
(
!
res
||
args
[
1
]
->
null_value
||
!
pad
||
((
count
<
0
)
&&
!
args
[
1
]
->
unsigned_flag
))
...
...
sql/item_strfunc.h
View file @
031fa8f1
...
...
@@ -3,7 +3,7 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009, 201
5
, MariaDB
Copyright (c) 2009, 201
9
, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -932,28 +932,35 @@ class Item_func_binlog_gtid_pos :public Item_str_func
};
class
Item_func_
rpad
:
public
Item_str_func
class
Item_func_
pad
:
public
Item_str_func
{
String
tmp_value
,
rpad_str
;
protected:
String
tmp_value
,
pad_str
;
public:
Item_func_
r
pad
(
THD
*
thd
,
Item
*
arg1
,
Item
*
arg2
,
Item
*
arg3
)
:
Item_func_pad
(
THD
*
thd
,
Item
*
arg1
,
Item
*
arg2
,
Item
*
arg3
)
:
Item_str_func
(
thd
,
arg1
,
arg2
,
arg3
)
{}
String
*
val_str
(
String
*
);
bool
fix_length_and_dec
();
};
class
Item_func_rpad
:
public
Item_func_pad
{
public:
Item_func_rpad
(
THD
*
thd
,
Item
*
arg1
,
Item
*
arg2
,
Item
*
arg3
)
:
Item_func_pad
(
thd
,
arg1
,
arg2
,
arg3
)
{}
String
*
val_str
(
String
*
);
const
char
*
func_name
()
const
{
return
"rpad"
;
}
Item
*
get_copy
(
THD
*
thd
,
MEM_ROOT
*
mem_root
)
{
return
get_item_copy
<
Item_func_rpad
>
(
thd
,
mem_root
,
this
);
}
};
class
Item_func_lpad
:
public
Item_
str_func
class
Item_func_lpad
:
public
Item_
func_pad
{
String
tmp_value
,
lpad_str
;
public:
Item_func_lpad
(
THD
*
thd
,
Item
*
arg1
,
Item
*
arg2
,
Item
*
arg3
)
:
Item_
str_func
(
thd
,
arg1
,
arg2
,
arg3
)
{}
Item_
func_pad
(
thd
,
arg1
,
arg2
,
arg3
)
{}
String
*
val_str
(
String
*
);
bool
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"lpad"
;
}
Item
*
get_copy
(
THD
*
thd
,
MEM_ROOT
*
mem_root
)
{
return
get_item_copy
<
Item_func_lpad
>
(
thd
,
mem_root
,
this
);
}
...
...
sql/item_sum.cc
View file @
031fa8f1
...
...
@@ -1808,6 +1808,18 @@ double Item_sum_std::val_real()
{
DBUG_ASSERT
(
fixed
==
1
);
double
nr
=
Item_sum_variance
::
val_real
();
if
(
isnan
(
nr
))
{
/*
variance_fp_recurrence_next() can overflow in some cases and return "nan":
CREATE OR REPLACE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (1.7e+308), (-1.7e+308), (0);
SELECT STDDEV_SAMP(a) FROM t1;
*/
null_value
=
true
;
// Convert "nan" to NULL
return
0
;
}
if
(
my_isinf
(
nr
))
return
DBL_MAX
;
DBUG_ASSERT
(
nr
>=
0.0
);
...
...
@@ -1855,8 +1867,9 @@ static void variance_fp_recurrence_next(double *m, double *s, ulonglong *count,
else
{
double
m_kminusone
=
*
m
;
*
m
=
m_kminusone
+
(
nr
-
m_kminusone
)
/
(
double
)
*
count
;
*
s
=
*
s
+
(
nr
-
m_kminusone
)
*
(
nr
-
*
m
);
volatile
double
diff
=
nr
-
m_kminusone
;
*
m
=
m_kminusone
+
diff
/
(
double
)
*
count
;
*
s
=
*
s
+
diff
*
(
nr
-
*
m
);
}
}
...
...
sql/opt_subselect.cc
View file @
031fa8f1
...
...
@@ -677,7 +677,7 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
select_lex
->
outer_select
()
->
join
&&
// 6
parent_unit
->
first_select
()
->
leaf_tables
.
elements
&&
// 7
!
in_subs
->
has_strategy
()
&&
// 8
select_lex
->
outer_select
()
->
leaf_tables
.
elements
&&
// 9
select_lex
->
outer_select
()
->
table_list
.
first
&&
// 9
!
((
join
->
select_options
|
// 10
select_lex
->
outer_select
()
->
join
->
select_options
)
// 10
&
SELECT_STRAIGHT_JOIN
)
&&
// 10
...
...
sql/wsrep_binlog.cc
View file @
031fa8f1
...
...
@@ -505,7 +505,6 @@ void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf,
if
(
init_io_cache
(
&
cache
,
file
,
0
,
WRITE_CACHE
,
0
,
0
,
MYF
(
MY_WME
|
MY_NABP
)))
{
mysql_file_close
(
file
,
MYF
(
MY_WME
));
goto
cleanup2
;
}
...
...
storage/innobase/dict/dict0mem.cc
View file @
031fa8f1
...
...
@@ -448,7 +448,8 @@ dict_mem_table_col_rename_low(
ut_ad
(
to_len
<=
NAME_LEN
);
char
from
[
NAME_LEN
+
1
];
strncpy
(
from
,
s
,
NAME_LEN
+
1
);
strncpy
(
from
,
s
,
sizeof
from
-
1
);
from
[
sizeof
from
-
1
]
=
'\0'
;
if
(
from_len
==
to_len
)
{
/* The easy case: simply replace the column name in
...
...
storage/xtradb/dict/dict0mem.cc
View file @
031fa8f1
...
...
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 201
8
, MariaDB Corporation.
Copyright (c) 2013, 201
9
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -321,7 +321,8 @@ dict_mem_table_col_rename_low(
ut_ad
(
to_len
<=
NAME_LEN
);
char
from
[
NAME_LEN
+
1
];
strncpy
(
from
,
s
,
NAME_LEN
+
1
);
strncpy
(
from
,
s
,
sizeof
from
-
1
);
from
[
sizeof
from
-
1
]
=
'\0'
;
if
(
from_len
==
to_len
)
{
/* The easy case: simply replace the column name in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment