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
2e5450af
Commit
2e5450af
authored
Oct 29, 2020
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.1' into 10.2
parents
17cf27f5
d6302c9a
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
110 additions
and
34 deletions
+110
-34
mysql-test/r/aria_icp_debug.result
mysql-test/r/aria_icp_debug.result
+0
-0
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+2
-2
mysql-test/r/innodb_icp_debug.result
mysql-test/r/innodb_icp_debug.result
+0
-0
mysql-test/r/myisam_icp_debug.result
mysql-test/r/myisam_icp_debug.result
+0
-0
mysql-test/r/precedence.result
mysql-test/r/precedence.result
+2
-2
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+1
-1
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+5
-0
mysql-test/r/type_ranges.result
mysql-test/r/type_ranges.result
+4
-2
mysql-test/suite/sys_vars/r/div_precision_increment_func.result
...test/suite/sys_vars/r/div_precision_increment_func.result
+8
-8
mysql-test/suite/vcol/r/not_supported.result
mysql-test/suite/vcol/r/not_supported.result
+1
-1
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+5
-1
sql/item_func.cc
sql/item_func.cc
+0
-2
sql/my_decimal.h
sql/my_decimal.h
+11
-0
sql/mysqld.cc
sql/mysqld.cc
+62
-13
storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result
storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result
+5
-0
storage/tokudb/mysql-test/tokudb/r/type_ranges.result
storage/tokudb/mysql-test/tokudb/r/type_ranges.result
+4
-2
No files found.
mysql-test/
t
/aria_icp_debug.result
→
mysql-test/
r
/aria_icp_debug.result
View file @
2e5450af
File moved
mysql-test/r/func_group.result
View file @
2e5450af
...
...
@@ -1186,13 +1186,13 @@ i count(*) std(e1/e2)
3 4 0.00000000
select std(s1/s2) from bug22555;
std(s1/s2)
0.2132
8517
0.2132
5764
select std(o1/o2) from bug22555;
std(o1/o2)
0.2132576358664934
select std(e1/e2) from bug22555;
std(e1/e2)
0.2132
8517
0.2132
5764
set @saved_div_precision_increment=@@div_precision_increment;
set div_precision_increment=19;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
...
...
mysql-test/
t
/innodb_icp_debug.result
→
mysql-test/
r
/innodb_icp_debug.result
View file @
2e5450af
File moved
mysql-test/
t
/myisam_icp_debug.result
→
mysql-test/
r
/myisam_icp_debug.result
View file @
2e5450af
File moved
mysql-test/r/precedence.result
View file @
2e5450af
...
...
@@ -5920,14 +5920,14 @@ view_definition
select 2 / 3 * 3 AS `2 / 3 * 3`,2 / (3 * 3) AS `2 / (3 * 3)`,2 / 3 * 3 AS `(2 / 3) * 3`
select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3 union select * from v1;
2 / 3 * 3 2 / (3 * 3) (2 / 3) * 3
2.000
1 0.2222 2.0001
2.000
0 0.2222 2.0000
create or replace view v1 as select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
select 2 / 3 / 3 AS `2 / 3 / 3`,2 / (3 / 3) AS `2 / (3 / 3)`,2 / 3 / 3 AS `(2 / 3) / 3`
select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3 union select * from v1;
2 / 3 / 3 2 / (3 / 3) (2 / 3) / 3
0.2222
3333 2.0000 0.22223333
0.2222
2222 2.0000 0.22222222
create or replace view v1 as select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
...
...
mysql-test/r/subselect4.result
View file @
2e5450af
...
...
@@ -2596,7 +2596,7 @@ SELECT
population, area, population/area,
cast(population/area as DECIMAL(20,9)) FROM t1 LIMIT 1;
population area population/area cast(population/area as DECIMAL(20,9))
11797 91 129.6374 129.637
400000
11797 91 129.6374 129.637
362637
SELECT * FROM t1 A
WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region);
region area population
...
...
mysql-test/r/type_newdecimal.result
View file @
2e5450af
...
...
@@ -1532,8 +1532,11 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000)
0.81298807395367312459230693948000000000
create table t1 as select 5.05 / 0.014;
Warnings:
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
show warnings;
Level Code Message
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -1648,6 +1651,8 @@ my_col
0.12345678912345678912345678912345678912
DROP TABLE t1;
CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col;
Warnings:
Note 1265 Data truncated for column 'my_col' at row 1
DESCRIBE t1;
Field Type Null Key Default Extra
my_col decimal(65,4) YES NULL
...
...
mysql-test/r/type_ranges.result
View file @
2e5450af
...
...
@@ -91,6 +91,8 @@ DROP INDEX test ON t1;
insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one');
insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one');
insert ignore into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3);
Warnings:
Warning 1265 Data truncated for column 'string' at row 1
insert ignore into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1);
Warnings:
Warning 1264 Out of range value for column 'utiny' at row 1
...
...
@@ -128,7 +130,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut
auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col
10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1
11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2
12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3
12 0.3333
3333
3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3
13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1
14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295
15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295
...
...
@@ -180,7 +182,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7
select * from t2;
auto string mediumblob_col new_field
1 2 2 ne
2 0.3333 ne
2 0.3333
3333
ne
3 -1 -1 ne
4 -429496729 -4294967295 ne
5 4294967295 4294967295 ne
...
...
mysql-test/suite/sys_vars/r/div_precision_increment_func.result
View file @
2e5450af
...
...
@@ -51,9 +51,9 @@ INSERT into t1(name, salary, income_tax) values('Record_2', 501, 501*2.5/1000);
INSERT into t1(name, salary, income_tax) values('Record_3', 210, 210*2.5/1000);
SELECT * from t1;
id name salary income_tax
1 Record_1 100011 250.0
3
2 Record_2 501 1.25
3 Record_3 210 0.5
3
1 Record_1 100011 250.0
27
2 Record_2 501 1.25
25
3 Record_3 210 0.5
25
connect test_con2, localhost, root,,;
connection test_con2;
## Verifying session & global value of variable ##
...
...
@@ -69,11 +69,11 @@ INSERT into t1(name, salary, income_tax) values('Record_5', 501, 501*2.5/1000);
INSERT into t1(name, salary, income_tax) values('Record_6', 210, 210*2.5/1000);
SELECT * from t1;
id name salary income_tax
1 Record_1 100011 250.0
3
2 Record_2 501 1.25
3 Record_3 210 0.5
3
4 Record_4 100011 250.02
8
5 Record_5 501 1.25
3
1 Record_1 100011 250.0
27
2 Record_2 501 1.25
25
3 Record_3 210 0.5
25
4 Record_4 100011 250.02
7
5 Record_5 501 1.25
25
6 Record_6 210 0.525
## Dropping table t1 ##
drop table t1;
...
...
mysql-test/suite/vcol/r/not_supported.result
View file @
2e5450af
...
...
@@ -29,7 +29,7 @@ set time_zone='+1:00';
flush tables;
select * from t1;
a b v
1 2 0.3333
00000
0000000000
1 2 0.3333
33333
0000000000
select * from t8;
a b v
1234567890 2 2009-02-14 00:31:30
...
...
sql/item_cmpfunc.cc
View file @
2e5450af
...
...
@@ -891,6 +891,8 @@ int Arg_comparator::compare_decimal()
{
if
(
set_null
)
owner
->
null_value
=
0
;
my_decimal_round_if_needed
(
E_DEC_FATAL_ERROR
,
val1
,
(
*
a
)
->
decimals
,
0
);
my_decimal_round_if_needed
(
E_DEC_FATAL_ERROR
,
val2
,
(
*
b
)
->
decimals
,
0
);
return
my_decimal_cmp
(
val1
,
val2
);
}
}
...
...
@@ -915,7 +917,9 @@ int Arg_comparator::compare_e_decimal()
my_decimal
*
val2
=
(
*
b
)
->
val_decimal
(
&
decimal2
);
if
((
*
a
)
->
null_value
||
(
*
b
)
->
null_value
)
return
MY_TEST
((
*
a
)
->
null_value
&&
(
*
b
)
->
null_value
);
return
MY_TEST
(
my_decimal_cmp
(
val1
,
val2
)
==
0
);
my_decimal_round_if_needed
(
E_DEC_FATAL_ERROR
,
val1
,
(
*
a
)
->
decimals
,
0
);
my_decimal_round_if_needed
(
E_DEC_FATAL_ERROR
,
val2
,
(
*
b
)
->
decimals
,
0
);
return
my_decimal_cmp
(
val1
,
val2
)
==
0
;
}
...
...
sql/item_func.cc
View file @
2e5450af
...
...
@@ -1700,8 +1700,6 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
null_value
=
1
;
return
0
;
}
my_decimal_round
(
E_DEC_FATAL_ERROR
,
decimal_value
,
decimals
,
FALSE
,
decimal_value
);
return
decimal_value
;
}
...
...
sql/my_decimal.h
View file @
2e5450af
...
...
@@ -303,6 +303,17 @@ bool my_decimal_is_zero(const my_decimal *decimal_value)
}
inline
int
my_decimal_round_if_needed
(
uint
mask
,
my_decimal
*
dec
,
int
scale
,
bool
truncate
)
{
if
(
scale
>=
dec
->
frac
)
return
E_DEC_OK
;
return
check_result
(
mask
,
decimal_round
(
dec
,
dec
,
scale
,
(
truncate
?
TRUNCATE
:
HALF_UP
)));
}
inline
int
my_decimal_round
(
uint
mask
,
const
my_decimal
*
from
,
int
scale
,
bool
truncate
,
my_decimal
*
to
)
...
...
sql/mysqld.cc
View file @
2e5450af
...
...
@@ -2687,6 +2687,67 @@ static MYSQL_SOCKET activate_tcp_port(uint port)
DBUG_RETURN
(
ip_sock
);
}
#ifdef _WIN32
/*
Create a security descriptor for pipe.
- Use low integrity level, so that it is possible to connect
from any process.
- Give current user read/write access to pipe.
- Give Everyone read/write access to pipe minus FILE_CREATE_PIPE_INSTANCE
*/
static
void
init_pipe_security_descriptor
()
{
#define SDDL_FMT "S:(ML;; NW;;; LW) D:(A;; 0x%08x;;; WD)(A;; FRFW;;; %s)"
#define EVERYONE_PIPE_ACCESS_MASK \
(FILE_READ_DATA | FILE_READ_EA | FILE_READ_ATTRIBUTES | READ_CONTROL | \
SYNCHRONIZE | FILE_WRITE_DATA | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES)
#ifndef SECURITY_MAX_SID_STRING_CHARACTERS
/* Old SDK does not have this constant */
#define SECURITY_MAX_SID_STRING_CHARACTERS 187
#endif
/*
Figure out SID of the user that runs the server, then create SDDL string
for pipe permissions, and convert it to the security descriptor.
*/
char
sddl_string
[
sizeof
(
SDDL_FMT
)
+
8
+
SECURITY_MAX_SID_STRING_CHARACTERS
];
struct
{
TOKEN_USER
token_user
;
BYTE
buffer
[
SECURITY_MAX_SID_SIZE
];
}
token_buffer
;
HANDLE
token
;
DWORD
tmp
;
if
(
!
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
))
goto
fail
;
if
(
!
GetTokenInformation
(
token
,
TokenUser
,
&
token_buffer
,
(
DWORD
)
sizeof
(
token_buffer
),
&
tmp
))
goto
fail
;
CloseHandle
(
token
);
char
*
current_user_string_sid
;
if
(
!
ConvertSidToStringSid
(
token_buffer
.
token_user
.
User
.
Sid
,
&
current_user_string_sid
))
goto
fail
;
snprintf
(
sddl_string
,
sizeof
(
sddl_string
),
SDDL_FMT
,
EVERYONE_PIPE_ACCESS_MASK
,
current_user_string_sid
);
LocalFree
(
current_user_string_sid
);
if
(
ConvertStringSecurityDescriptorToSecurityDescriptor
(
sddl_string
,
SDDL_REVISION_1
,
&
saPipeSecurity
.
lpSecurityDescriptor
,
0
))
return
;
fail
:
sql_perror
(
"Can't start server : Initialize security descriptor"
);
unireg_abort
(
1
);
}
#endif
static
void
network_init
(
void
)
{
#ifdef HAVE_SYS_UN_H
...
...
@@ -2724,19 +2785,7 @@ static void network_init(void)
strxnmov
(
pipe_name
,
sizeof
(
pipe_name
)
-
1
,
"
\\\\
.
\\
pipe
\\
"
,
mysqld_unix_port
,
NullS
);
/*
Create a security descriptor for pipe.
- Use low integrity level, so that it is possible to connect
from any process.
- Give Everyone read/write access to pipe.
*/
if
(
!
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"S:(ML;; NW;;; LW) D:(A;; FRFW;;; WD)"
,
SDDL_REVISION_1
,
&
saPipeSecurity
.
lpSecurityDescriptor
,
NULL
))
{
sql_perror
(
"Can't start server : Initialize security descriptor"
);
unireg_abort
(
1
);
}
init_pipe_security_descriptor
();
saPipeSecurity
.
nLength
=
sizeof
(
SECURITY_ATTRIBUTES
);
saPipeSecurity
.
bInheritHandle
=
FALSE
;
if
((
hPipe
=
CreateNamedPipe
(
pipe_name
,
...
...
storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result
View file @
2e5450af
...
...
@@ -1533,8 +1533,11 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000)
0.81298807395367312459230693948000000000
create table t1 as select 5.05 / 0.014;
Warnings:
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
show warnings;
Level Code Message
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -1649,6 +1652,8 @@ my_col
0.12345678912345678912345678912345678912
DROP TABLE t1;
CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col;
Warnings:
Note 1265 Data truncated for column 'my_col' at row 1
DESCRIBE t1;
Field Type Null Key Default Extra
my_col decimal(65,4) YES NULL
...
...
storage/tokudb/mysql-test/tokudb/r/type_ranges.result
View file @
2e5450af
...
...
@@ -92,6 +92,8 @@ DROP INDEX test ON t1;
insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one');
insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one');
insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3);
Warnings:
Warning 1265 Data truncated for column 'string' at row 1
insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1);
Warnings:
Warning 1264 Out of range value for column 'utiny' at row 1
...
...
@@ -129,7 +131,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut
auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col
10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1
11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2
12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3
12 0.3333
3333
3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3
13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1
14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295
15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295
...
...
@@ -181,7 +183,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7
select * from t2;
auto string mediumblob_col new_field
1 2 2 ne
2 0.3333 ne
2 0.3333
3333
ne
3 -1 -1 ne
4 -429496729 -4294967295 ne
5 4294967295 4294967295 ne
...
...
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