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
790a74d2
Commit
790a74d2
authored
Oct 21, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'github/5.5' into 10.1
parents
ae702d76
719ac0ad
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
219 additions
and
11 deletions
+219
-11
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+40
-0
mysql-test/r/processlist.result
mysql-test/r/processlist.result
+1
-0
mysql-test/r/processlist_notembedded.result
mysql-test/r/processlist_notembedded.result
+8
-0
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+26
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+26
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+25
-0
mysql-test/t/processlist.test
mysql-test/t/processlist.test
+2
-2
mysql-test/t/processlist_notembedded.test
mysql-test/t/processlist_notembedded.test
+34
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+26
-0
scripts/mysqlaccess.sh
scripts/mysqlaccess.sh
+1
-1
sql/opt_subselect.cc
sql/opt_subselect.cc
+10
-2
sql/sql_show.cc
sql/sql_show.cc
+6
-2
strings/ctype-simple.c
strings/ctype-simple.c
+14
-4
No files found.
mysql-test/r/func_math.result
View file @
790a74d2
...
...
@@ -854,6 +854,46 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Bug #29723340: MYSQL SERVER CRASH AFTER SQL QUERY WITH DATA ?AST
#
create table t1(a int);
insert t1 values("1e-214748364");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert t1 values("1e-2147483648");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert t1 values("1e-21474836480");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert t1 values("1e+214748364");
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
insert t1 values("1e+2147483647");
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
insert t1 values("1e+21474836470");
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
set global max_allowed_packet= cast(2*1024*1024*1024+1024 as unsigned);
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '2147484672'
set @a=2147483647;
insert t1 values (concat('1', repeat('0', @a+18), 'e-', @a-1, '0'));
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (1073741824) - truncated
set global max_allowed_packet=default;
select * from t1;
a
0
0
0
2147483647
2147483647
2147483647
NULL
drop table t1;
#
# End of 5.5 tests
#
#
...
...
mysql-test/r/processlist.result
View file @
790a74d2
...
...
@@ -17,6 +17,7 @@ select command, time < 5 from information_schema.processlist where id != connect
command time < 5
Sleep 1
set debug_sync='reset';
End of 5.5 tests
#
# 10.1 tests
#
...
...
mysql-test/r/processlist_notembedded.result
0 → 100644
View file @
790a74d2
#
# MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
#
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
FOUND /sleep/ in MDEV-20466.text
SET DEBUG_SYNC = 'RESET';
End of 5.5 tests
mysql-test/r/subselect_sj.result
View file @
790a74d2
...
...
@@ -3194,5 +3194,31 @@ 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;
#
# MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
#
CREATE TABLE `t1` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
);
INSERT INTO `t1` (`Id`) VALUES (1);
CREATE TABLE `t2` (
`t1_Id` int(11) NOT NULL DEFAULT 0,
`col1` int(11) DEFAULT NULL,
UNIQUE KEY `col1` (`col1`)
);
INSERT INTO `t2` (`t1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
Id
1
explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED t2 ref col1 col1 5 const 1 100.00 Using index condition; Using where
Warnings:
Note 1003 select 1 AS `Id` from (`test`.`t2`) where ((`test`.`t2`.`t1_Id` = 1) and isnull(`test`.`t2`.`col1`))
DROP TABLE t1, t2;
# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
790a74d2
...
...
@@ -3208,6 +3208,32 @@ 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;
#
# MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
#
CREATE TABLE `t1` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
);
INSERT INTO `t1` (`Id`) VALUES (1);
CREATE TABLE `t2` (
`t1_Id` int(11) NOT NULL DEFAULT 0,
`col1` int(11) DEFAULT NULL,
UNIQUE KEY `col1` (`col1`)
);
INSERT INTO `t2` (`t1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
Id
1
explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED t2 ref col1 col1 5 const 1 100.00 Using index condition; Using where
Warnings:
Note 1003 select 1 AS `Id` from (`test`.`t2`) where ((`test`.`t2`.`t1_Id` = 1) and isnull(`test`.`t2`.`col1`))
DROP TABLE t1, t2;
# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
#
...
...
mysql-test/t/func_math.test
View file @
790a74d2
...
...
@@ -625,6 +625,31 @@ SHOW CREATE TABLE t1;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #29723340: MYSQL SERVER CRASH AFTER SQL QUERY WITH DATA ?AST
--
echo
#
create
table
t1
(
a
int
);
insert
t1
values
(
"1e-214748364"
);
insert
t1
values
(
"1e-2147483648"
);
insert
t1
values
(
"1e-21474836480"
);
insert
t1
values
(
"1e+214748364"
);
insert
t1
values
(
"1e+2147483647"
);
insert
t1
values
(
"1e+21474836470"
);
# if max max_allowed_packet will ever be increased beyond 2GB, this could
# break again:
set
global
max_allowed_packet
=
cast
(
2
*
1024
*
1024
*
1024
+
1024
as
unsigned
);
connect
foo
,
localhost
,
root
;
set
@
a
=
2147483647
;
insert
t1
values
(
concat
(
'1'
,
repeat
(
'0'
,
@
a
+
18
),
'e-'
,
@
a
-
1
,
'0'
));
disconnect
foo
;
connection
default
;
set
global
max_allowed_packet
=
default
;
select
*
from
t1
;
drop
table
t1
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
...
...
mysql-test/t/processlist.test
View file @
790a74d2
...
...
@@ -49,10 +49,10 @@ SET DEBUG_SYNC = 'now WAIT_FOR query_done';
select
command
,
time
<
5
from
information_schema
.
processlist
where
id
!=
connection_id
();
disconnect
con1
;
set
debug_sync
=
'reset'
;
connection
default
;
set
debug_sync
=
'reset'
;
--
echo
End
of
5.5
tests
--
echo
#
--
echo
# 10.1 tests
...
...
mysql-test/t/processlist_notembedded.test
0 → 100644
View file @
790a74d2
source
include
/
have_debug
.
inc
;
source
include
/
have_debug_sync
.
inc
;
source
include
/
not_embedded
.
inc
;
--
echo
#
--
echo
# MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
--
echo
#
connect
(
con1
,
localhost
,
root
,,);
connection
con1
;
let
$q
=
`select CONCAT("SELECT user FROM mysql.user WHERE user ='some", CHAR(0), "' or sleep (30)")`
;
SET
DEBUG_SYNC
=
'before_join_optimize SIGNAL in_sync'
;
--
disable_query_log
--
send_eval
$q
;
--
enable_query_log
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR in_sync'
;
exec
$MYSQL
test
-
e
"SHOW PROCESSLIST"
>
$MYSQLTEST_VARDIR
/
tmp
/
MDEV
-
20466.
text
;
let
SEARCH_FILE
=
$MYSQLTEST_VARDIR
/
tmp
/
MDEV
-
20466.
text
;
let
SEARCH_PATTERN
=
sleep
;
source
include
/
search_pattern_in_file
.
inc
;
remove_file
$MYSQLTEST_VARDIR
/
tmp
//MDEV-20466.text;
disconnect
con1
;
SET
DEBUG_SYNC
=
'RESET'
;
--
echo
End
of
5.5
tests
mysql-test/t/subselect_sj.test
View file @
790a74d2
...
...
@@ -2885,6 +2885,32 @@ insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop
table
t1
,
t2
;
--
echo
#
--
echo
# MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
--
echo
#
CREATE
TABLE
`t1`
(
`Id`
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
`Id`
)
);
INSERT
INTO
`t1`
(
`Id`
)
VALUES
(
1
);
CREATE
TABLE
`t2`
(
`t1_Id`
int
(
11
)
NOT
NULL
DEFAULT
0
,
`col1`
int
(
11
)
DEFAULT
NULL
,
UNIQUE
KEY
`col1`
(
`col1`
)
);
INSERT
INTO
`t2`
(
`t1_Id`
,
`col1`
)
VALUES
(
1
,
NULL
),
(
1
,
NULL
);
SELECT
Id
FROM
t1
WHERE
Id
in
(
SELECT
t1_Id
FROM
t2
WHERE
t2
.
col1
IS
NULL
);
explain
extended
SELECT
Id
FROM
t1
WHERE
Id
in
(
SELECT
t1_Id
FROM
t2
WHERE
t2
.
col1
IS
NULL
);
DROP
TABLE
t1
,
t2
;
--
echo
# End of 5.5 test
# The following command must be the last one the file
...
...
scripts/mysqlaccess.sh
View file @
790a74d2
...
...
@@ -26,7 +26,7 @@ use Fcntl;
BEGIN
{
# ****************************
# static information...
$VERSION
=
"2.
06, 20 Dec 2000
"
;
$VERSION
=
"2.
10, 13 Sep 2019
"
;
$0
=
~ m%/
([
^/]+
)
$%
o
;
$script
=
$1
;
$script
=
'MySQLAccess'
unless
$script
;
...
...
sql/opt_subselect.cc
View file @
790a74d2
...
...
@@ -2657,9 +2657,17 @@ bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables)
{
do
/* For all equalities on all key parts */
{
/* Check if this is "t.keypart = expr(outer_tables) */
/*
Check if this is "t.keypart = expr(outer_tables)
Don't allow variants that can produce duplicates:
- Dont allow "ref or null"
- the keyuse (that is, the operation) must be null-rejecting,
unless the other expression is non-NULLable.
*/
if
(
!
(
keyuse
->
used_tables
&
sj_inner_tables
)
&&
!
(
keyuse
->
optimize
&
KEY_OPTIMIZE_REF_OR_NULL
))
!
(
keyuse
->
optimize
&
KEY_OPTIMIZE_REF_OR_NULL
)
&&
(
keyuse
->
null_rejecting
||
!
keyuse
->
val
->
maybe_null
))
{
bound_parts
|=
1
<<
keyuse
->
keypart
;
}
...
...
sql/sql_show.cc
View file @
790a74d2
...
...
@@ -2646,8 +2646,12 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
else
protocol
->
store_null
();
protocol
->
store
(
thd_info
->
state_info
,
system_charset_info
);
protocol
->
store
(
thd_info
->
query_string
.
str
(),
thd_info
->
query_string
.
charset
());
if
(
thd_info
->
query_string
.
length
())
protocol
->
store
(
thd_info
->
query_string
.
str
(),
thd_info
->
query_string
.
length
(),
thd_info
->
query_string
.
charset
());
else
protocol
->
store_null
();
if
(
!
thd
->
variables
.
old_mode
&&
!
(
thd
->
variables
.
old_behavior
&
OLD_MODE_NO_PROGRESS_INFO
))
protocol
->
store
(
thd_info
->
progress
,
3
,
&
store_buffer
);
...
...
strings/ctype-simple.c
View file @
790a74d2
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 201
4, SkySQL Ab
.
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
...
...
@@ -1622,10 +1622,20 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
goto
ret_sign
;
}
}
for
(
exponent
=
0
;
str
<
end
&&
(
ch
=
(
uchar
)
(
*
str
-
'0'
))
<
10
;
str
++
)
if
(
shift
>
0
&&
!
negative_exp
)
goto
ret_too_big
;
for
(
exponent
=
0
;
str
<
end
&&
(
ch
=
(
uchar
)
(
*
str
-
'0'
))
<
10
;
str
++
)
{
if
(
negative_exp
)
{
if
(
exponent
-
shift
>
DIGITS_IN_ULONGLONG
)
goto
ret_zero
;
}
else
{
if
(
exponent
+
shift
>
DIGITS_IN_ULONGLONG
)
goto
ret_too_big
;
}
exponent
=
exponent
*
10
+
ch
;
}
shift
+=
negative_exp
?
-
exponent
:
exponent
;
...
...
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