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
6046bc22
Commit
6046bc22
authored
Apr 24, 2019
by
Jani
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.3' of github.com:MariaDB/server into bb-10.3-jani
parents
6d2cb436
765ae6e8
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
582 additions
and
22 deletions
+582
-22
mysql-test/main/ctype_utf8.result
mysql-test/main/ctype_utf8.result
+68
-0
mysql-test/main/ctype_utf8.test
mysql-test/main/ctype_utf8.test
+75
-0
mysql-test/main/func_hybrid_type.result
mysql-test/main/func_hybrid_type.result
+114
-0
mysql-test/main/func_hybrid_type.test
mysql-test/main/func_hybrid_type.test
+63
-1
mysql-test/main/type_date.result
mysql-test/main/type_date.result
+25
-0
mysql-test/main/type_date.test
mysql-test/main/type_date.test
+14
-0
mysql-test/suite/compat/oracle/r/information_schema_parameters.result
...uite/compat/oracle/r/information_schema_parameters.result
+38
-0
mysql-test/suite/compat/oracle/t/information_schema_parameters.test
.../suite/compat/oracle/t/information_schema_parameters.test
+33
-0
mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result
mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result
+8
-0
mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt
...l-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt
+1
-0
mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test
mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test
+14
-0
sql/semisync_master.cc
sql/semisync_master.cc
+13
-14
sql/semisync_master.h
sql/semisync_master.h
+2
-5
sql/sql_lex.cc
sql/sql_lex.cc
+19
-1
sql/sql_show.cc
sql/sql_show.cc
+2
-1
sql/sql_type.cc
sql/sql_type.cc
+91
-0
sql/sql_type.h
sql/sql_type.h
+2
-0
No files found.
mysql-test/main/ctype_utf8.result
View file @
6046bc22
...
@@ -11300,5 +11300,73 @@ t1 CREATE TABLE `t1` (
...
@@ -11300,5 +11300,73 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
SET sql_mode=DEFAULT;
#
#
# MDEV-19239 ERROR 1300 (HY000): Invalid utf8 character string in 10.3.13-MariaDB
#
SET NAMES utf8;
SELECT
x.消息ID,
x.消息TITLE,
x.消息类型,
x.发送时间,
x.阅读时间,x.老师ID,
IF(x.四天内最近一次登录时间='2100-01-01 00:00:00','',x.四天内最近一次登录时间) 四天内最近一次登录时间
FROM (
SELECT
msg.*,
CASE
WHEN login.login_time BETWEEN msg.发送时间 AND DATE_ADD(msg.发送时间,INTERVAL 4 DAY)
THEN login.login_time
WHEN (login.login_time NOT BETWEEN msg.发送时间 AND DATE_ADD(msg.发送时间,INTERVAL 4 DAY)) AND login.login_time>0
THEN '2100-01-01 00:00:00' ELSE ''
END 四天内最近一次登录时间
FROM (
SELECT
me.id 消息ID,
me.title 消息TITLE,
CASE
WHEN me.type=1
THEN 'Interview Message'
WHEN me.type=2
THEN 'Orientation Message'
WHEN me.type=3
THEN 'Warning Message'
WHEN me.type=4
THEN 'Fail Message'
WHEN me.type=5
THEN 'FM Message'
WHEN me.type=6
THEN 'Training Message'
WHEN me.type=7
THEN 'TUrgent Message'
END 消息类型,
FROM_UNIXTIME(me.sending_time) 发送时间,
IF(tar.is_read=1,FROM_UNIXTIME(tar.read_time),'') 阅读时间,
tar.tid 老师ID
FROM ebk_message me
LEFT JOIN ebk_message_target tar
ON me.id=tar.msg_id
WHERE
FROM_UNIXTIME(me.sending_time,'%Y-%m-%d') BETWEEN 'start' AND 'end' AND me.status=1 AND tar.tid>0
GROUP BY
tar.tid,
me.sending_time,me.id) msg
LEFT JOIN (
SELECT tid,FROM_UNIXTIME(login_time) login_time
FROM ebk_teacher_login_log
WHERE FROM_UNIXTIME(login_time,'%Y-%m-%d') BETWEEN 'start' AND DATE_ADD('end',INTERVAL 4 DAY)
ORDER BY tid,FROM_UNIXTIME(login_time)) login
ON
msg.老师ID=login.tid
ORDER BY msg.消息ID,msg.发送时间,msg.老师ID,login_time) x
GROUP BY x.消息ID,x.发送时间,x.老师ID;
ERROR 42S02: Table 'test.ebk_message' doesn't exist
SET NAMES utf8;
CREATE TABLE t1 (x INT);
INSERT INTO t1 VALUES (1);
SELECT x AS 5天内最近一次登录时间 FROM t1;
5天内最近一次登录时间
1
DROP TABLE t1;
#
# End of 10.3 tests
# End of 10.3 tests
#
#
mysql-test/main/ctype_utf8.test
View file @
6046bc22
...
@@ -2180,6 +2180,81 @@ DROP TABLE t1;
...
@@ -2180,6 +2180,81 @@ DROP TABLE t1;
SET
sql_mode
=
DEFAULT
;
SET
sql_mode
=
DEFAULT
;
--
echo
#
--
echo
# MDEV-19239 ERROR 1300 (HY000): Invalid utf8 character string in 10.3.13-MariaDB
--
echo
#
#
# Test that the following query does not fail on "Invalid utf8 character string"
#
SET
NAMES
utf8
;
--
error
ER_NO_SUCH_TABLE
SELECT
x
.
消息ID
,
x
.
消息TITLE
,
x
.
消息类型
,
x
.
发送时间
,
x
.
阅读时间
,
x
.
老师ID
,
IF
(
x
.
四天内最近一次登录时间
=
'2100-01-01 00:00:00'
,
''
,
x
.
四天内最近一次登录时间
)
四天内最近一次登录时间
FROM
(
SELECT
msg
.*
,
CASE
WHEN
login
.
login_time
BETWEEN
msg
.
发送时间
AND
DATE_ADD
(
msg
.
发送时间
,
INTERVAL
4
DAY
)
THEN
login
.
login_time
WHEN
(
login
.
login_time
NOT
BETWEEN
msg
.
发送时间
AND
DATE_ADD
(
msg
.
发送时间
,
INTERVAL
4
DAY
))
AND
login
.
login_time
>
0
THEN
'2100-01-01 00:00:00'
ELSE
''
END
四天内最近一次登录时间
FROM
(
SELECT
me
.
id
消息ID
,
me
.
title
消息TITLE
,
CASE
WHEN
me
.
type
=
1
THEN
'Interview Message'
WHEN
me
.
type
=
2
THEN
'Orientation Message'
WHEN
me
.
type
=
3
THEN
'Warning Message'
WHEN
me
.
type
=
4
THEN
'Fail Message'
WHEN
me
.
type
=
5
THEN
'FM Message'
WHEN
me
.
type
=
6
THEN
'Training Message'
WHEN
me
.
type
=
7
THEN
'TUrgent Message'
END
消息类型
,
FROM_UNIXTIME
(
me
.
sending_time
)
发送时间
,
IF
(
tar
.
is_read
=
1
,
FROM_UNIXTIME
(
tar
.
read_time
),
''
)
阅读时间
,
tar
.
tid
老师ID
FROM
ebk_message
me
LEFT
JOIN
ebk_message_target
tar
ON
me
.
id
=
tar
.
msg_id
WHERE
FROM_UNIXTIME
(
me
.
sending_time
,
'%Y-%m-%d'
)
BETWEEN
'start'
AND
'end'
AND
me
.
status
=
1
AND
tar
.
tid
>
0
GROUP
BY
tar
.
tid
,
me
.
sending_time
,
me
.
id
)
msg
LEFT
JOIN
(
SELECT
tid
,
FROM_UNIXTIME
(
login_time
)
login_time
FROM
ebk_teacher_login_log
WHERE
FROM_UNIXTIME
(
login_time
,
'%Y-%m-%d'
)
BETWEEN
'start'
AND
DATE_ADD
(
'end'
,
INTERVAL
4
DAY
)
ORDER
BY
tid
,
FROM_UNIXTIME
(
login_time
))
login
ON
msg
.
老师ID
=
login
.
tid
ORDER
BY
msg
.
消息ID
,
msg
.
发送时间
,
msg
.
老师ID
,
login_time
)
x
GROUP
BY
x
.
消息ID
,
x
.
发送时间
,
x
.
老师ID
;
SET
NAMES
utf8
;
CREATE
TABLE
t1
(
x
INT
);
INSERT
INTO
t1
VALUES
(
1
);
SELECT
x
AS
5
天内最近一次登录时间
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
#
--
echo
# End of 10.3 tests
--
echo
# End of 10.3 tests
--
echo
#
--
echo
#
mysql-test/main/func_hybrid_type.result
View file @
6046bc22
...
@@ -3771,5 +3771,119 @@ t2 CREATE TABLE `t2` (
...
@@ -3771,5 +3771,119 @@ t2 CREATE TABLE `t2` (
DROP TABLE t1, t2;
DROP TABLE t1, t2;
SET sql_mode=DEFAULT;
SET sql_mode=DEFAULT;
#
#
# MDEV-17325 NULL-ability problems with LEAST() in combination with NO_ZERO_DATE and NO_ZERO_IN_DATE
#
SET sql_mode='NO_ZERO_DATE,NO_ZERO_IN_DATE';
SELECT
LEAST('0000-00-00',DATE'2001-01-01') AS s1,
LEAST('0001-00-01',DATE'2001-01-01') AS s2,
LEAST('0000-00-00',TIMESTAMP'2001-01-01 00:00:00') AS s3,
LEAST('0001-00-01',TIMESTAMP'2001-01-01 00:00:00') AS s4,
LEAST(0,DATE'2001-01-01') AS i1,
LEAST(20010001,DATE'2001-01-01') AS i2,
LEAST(0,TIMESTAMP'2001-01-01 00:00:00') AS i3,
LEAST(20010001,TIMESTAMP'2001-01-01 00:00:00') AS i4;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def s1 10 10 0 Y 128 0 63
def s2 10 10 0 Y 128 0 63
def s3 12 26 0 Y 128 6 63
def s4 12 26 0 Y 128 6 63
def i1 10 10 0 Y 128 0 63
def i2 10 10 0 Y 128 0 63
def i3 12 19 0 Y 128 0 63
def i4 12 19 0 Y 128 0 63
s1 s2 s3 s4 i1 i2 i3 i4
NULL NULL NULL NULL NULL NULL NULL NULL
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0001-00-01'
Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1292 Incorrect datetime value: '0001-00-01 00:00:00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '2001-00-01'
Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1292 Incorrect datetime value: '2001-00-01 00:00:00'
SET sql_mode='NO_ZERO_DATE,NO_ZERO_IN_DATE';
CREATE TABLE t1 AS SELECT
LEAST('0000-00-00',DATE'2001-01-01') AS s1,
LEAST('0001-00-01',DATE'2001-01-01') AS s2,
LEAST('0000-00-00',TIMESTAMP'2001-01-01 00:00:00') AS s3,
LEAST('0001-00-01',TIMESTAMP'2001-01-01 00:00:00') AS s4,
LEAST(0,DATE'2001-01-01') AS i1,
LEAST(20010001,DATE'2001-01-01') AS i2,
LEAST(0,TIMESTAMP'2001-01-01 00:00:00') AS i3,
LEAST(20010001,TIMESTAMP'2001-01-01 00:00:00') AS i4;
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0001-00-01'
Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1292 Incorrect datetime value: '0001-00-01 00:00:00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '2001-00-01'
Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
Warning 1292 Incorrect datetime value: '2001-00-01 00:00:00'
SELECT * FROM t1;
s1 s2 s3 s4 i1 i2 i3 i4
NULL NULL NULL NULL NULL NULL NULL NULL
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`s1` date DEFAULT NULL,
`s2` date DEFAULT NULL,
`s3` datetime(6) DEFAULT NULL,
`s4` datetime(6) DEFAULT NULL,
`i1` date DEFAULT NULL,
`i2` date DEFAULT NULL,
`i3` datetime DEFAULT NULL,
`i4` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
CREATE TABLE t1 AS SELECT LEAST(CURRENT_DATE,CURRENT_TIME) AS c1;
SELECT * FROM t1;
c1
2001-01-01 00:00:00
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET old_mode=ZERO_DATE_TIME_CAST;
CREATE TABLE t1 AS SELECT LEAST(CURRENT_DATE,CURRENT_TIME) AS c1;
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:30'
SELECT * FROM t1;
c1
NULL
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET old_mode=DEFAULT;
SET timestamp=DEFAULT;
SET sql_mode=DEFAULT;
SET sql_mode='';
SELECT LEAST(999,TIME'10:20:30') AS c1;
c1
NULL
Warnings:
Warning 1292 Incorrect datetime value: '999'
CREATE TABLE t1 AS SELECT LEAST(999,TIME'10:20:30') AS c1;
Warnings:
Warning 1292 Incorrect datetime value: '999'
SELECT * FROM t1;
c1
NULL
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` time DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# End of 10.3 tests
# End of 10.3 tests
#
#
mysql-test/main/func_hybrid_type.test
View file @
6046bc22
...
@@ -628,6 +628,68 @@ SET sql_mode=DEFAULT;
...
@@ -628,6 +628,68 @@ SET sql_mode=DEFAULT;
--
echo
#
--
echo
#
--
echo
#
End of 10.3 tests
--
echo
#
MDEV-17325 NULL-ability problems with LEAST() in combination with NO_ZERO_DATE and NO_ZERO_IN_DATE
--
echo
#
--
echo
#
SET
sql_mode
=
'NO_ZERO_DATE,NO_ZERO_IN_DATE'
;
--
disable_ps_protocol
--
enable_metadata
SELECT
LEAST
(
'0000-00-00'
,
DATE
'2001-01-01'
)
AS
s1
,
LEAST
(
'0001-00-01'
,
DATE
'2001-01-01'
)
AS
s2
,
LEAST
(
'0000-00-00'
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
s3
,
LEAST
(
'0001-00-01'
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
s4
,
LEAST
(
0
,
DATE
'2001-01-01'
)
AS
i1
,
LEAST
(
20010001
,
DATE
'2001-01-01'
)
AS
i2
,
LEAST
(
0
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
i3
,
LEAST
(
20010001
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
i4
;
--
disable_metadata
--
enable_ps_protocol
SET
sql_mode
=
'NO_ZERO_DATE,NO_ZERO_IN_DATE'
;
CREATE
TABLE
t1
AS
SELECT
LEAST
(
'0000-00-00'
,
DATE
'2001-01-01'
)
AS
s1
,
LEAST
(
'0001-00-01'
,
DATE
'2001-01-01'
)
AS
s2
,
LEAST
(
'0000-00-00'
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
s3
,
LEAST
(
'0001-00-01'
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
s4
,
LEAST
(
0
,
DATE
'2001-01-01'
)
AS
i1
,
LEAST
(
20010001
,
DATE
'2001-01-01'
)
AS
i2
,
LEAST
(
0
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
i3
,
LEAST
(
20010001
,
TIMESTAMP
'2001-01-01 00:00:00'
)
AS
i4
;
SELECT
*
FROM
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
SET
timestamp
=
UNIX_TIMESTAMP
(
'2001-01-01 10:20:30'
);
# A TIME always converts to a non-NULL DATETIME with the new CAST style
# Expect a NOT NULL column
CREATE
TABLE
t1
AS
SELECT
LEAST
(
CURRENT_DATE
,
CURRENT_TIME
)
AS
c1
;
SELECT
*
FROM
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
# A TIME can convert to a NULL DATETIME with old CAST style
# Expect a NULL-able column
SET
old_mode
=
ZERO_DATE_TIME_CAST
;
CREATE
TABLE
t1
AS
SELECT
LEAST
(
CURRENT_DATE
,
CURRENT_TIME
)
AS
c1
;
SELECT
*
FROM
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
SET
old_mode
=
DEFAULT
;
SET
timestamp
=
DEFAULT
;
SET
sql_mode
=
DEFAULT
;
SET
sql_mode
=
''
;
SELECT
LEAST
(
999
,
TIME
'10:20:30'
)
AS
c1
;
CREATE
TABLE
t1
AS
SELECT
LEAST
(
999
,
TIME
'10:20:30'
)
AS
c1
;
SELECT
*
FROM
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
SET
sql_mode
=
DEFAULT
;
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
mysql-test/main/type_date.result
View file @
6046bc22
...
@@ -863,6 +863,31 @@ d COUNT(*)
...
@@ -863,6 +863,31 @@ d COUNT(*)
NULL 2
NULL 2
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-17299 Assertion `maybe_null' failed in make_sortkey
#
CREATE TABLE t1 (pk int NOT NULL, d1 date, d2 date NOT NULL);
INSERT INTO t1 values (1,'2018-06-22','2018-06-22'),(2,'2018-07-11','2018-07-11');
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
FROM v1 GROUP BY greatest(pk, 0, d2);
group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
NULL
Warnings:
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
CREATE TABLE t2 AS SELECT greatest(pk, 0, d2) AS c1 FROM t1 LIMIT 0;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.1 tests
# End of 10.1 tests
#
#
#
#
...
...
mysql-test/main/type_date.test
View file @
6046bc22
...
@@ -591,6 +591,20 @@ INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
...
@@ -591,6 +591,20 @@ INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
SELECT
d
,
COUNT
(
*
)
FROM
t1
GROUP
BY
d
WITH
ROLLUP
HAVING
CASE
d
WHEN
'2017-05-25'
THEN
0
ELSE
1
END
;
SELECT
d
,
COUNT
(
*
)
FROM
t1
GROUP
BY
d
WITH
ROLLUP
HAVING
CASE
d
WHEN
'2017-05-25'
THEN
0
ELSE
1
END
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-17299 Assertion `maybe_null' failed in make_sortkey
--
echo
#
CREATE
TABLE
t1
(
pk
int
NOT
NULL
,
d1
date
,
d2
date
NOT
NULL
);
INSERT
INTO
t1
values
(
1
,
'2018-06-22'
,
'2018-06-22'
),(
2
,
'2018-07-11'
,
'2018-07-11'
);
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
SELECT
group_concat
(
d1
/
(
CASE
'b'
WHEN
'j'
THEN
'c'
END
))
FROM
v1
GROUP
BY
greatest
(
pk
,
0
,
d2
);
CREATE
TABLE
t2
AS
SELECT
greatest
(
pk
,
0
,
d2
)
AS
c1
FROM
t1
LIMIT
0
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t2
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
#
--
echo
# End of 10.1 tests
--
echo
# End of 10.1 tests
...
...
mysql-test/suite/compat/oracle/r/information_schema_parameters.result
View file @
6046bc22
...
@@ -814,3 +814,41 @@ DTD_IDENTIFIER ROW
...
@@ -814,3 +814,41 @@ DTD_IDENTIFIER ROW
ROUTINE_TYPE FUNCTION
ROUTINE_TYPE FUNCTION
-------- --------
-------- --------
DROP FUNCTION f1;
DROP FUNCTION f1;
#
# MDEV 18092 Query with the table I_S.PARAMETERS stop working
# after a package is created
#
SET sql_mode=ORACLE;
CREATE DATABASE db1_mdev18092;
USE db1_mdev18092;
CREATE PROCEDURE p1(a INT)
AS BEGIN
NULL;
END;
$$
CREATE OR REPLACE PACKAGE employee_tools AS
FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);
PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));
PROCEDURE raiseSalaryStd(eid INT);
PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));
END;
$$
SELECT *, '---------------' FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_SCHEMA='db1_mdev18092';
SPECIFIC_CATALOG def
SPECIFIC_SCHEMA db1_mdev18092
SPECIFIC_NAME p1
ORDINAL_POSITION 1
PARAMETER_MODE IN
PARAMETER_NAME a
DATA_TYPE int
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION 10
NUMERIC_SCALE 0
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER int(11)
ROUTINE_TYPE PROCEDURE
--------------- ---------------
DROP DATABASE db1_mdev18092;
mysql-test/suite/compat/oracle/t/information_schema_parameters.test
View file @
6046bc22
...
@@ -92,3 +92,36 @@ SET sql_mode=ORACLE;
...
@@ -92,3 +92,36 @@ SET sql_mode=ORACLE;
SELECT
*
,
'--------'
FROM
INFORMATION_SCHEMA
.
PARAMETERS
WHERE
SPECIFIC_NAME
=
'f1'
;
SELECT
*
,
'--------'
FROM
INFORMATION_SCHEMA
.
PARAMETERS
WHERE
SPECIFIC_NAME
=
'f1'
;
--
horizontal_results
--
horizontal_results
DROP
FUNCTION
f1
;
DROP
FUNCTION
f1
;
--
echo
#
--
echo
# MDEV 18092 Query with the table I_S.PARAMETERS stop working
--
echo
# after a package is created
--
echo
#
SET
sql_mode
=
ORACLE
;
CREATE
DATABASE
db1_mdev18092
;
USE
db1_mdev18092
;
DELIMITER
$$
;
CREATE
PROCEDURE
p1
(
a
INT
)
AS
BEGIN
NULL
;
END
;
$$
CREATE
OR
REPLACE
PACKAGE
employee_tools
AS
FUNCTION
getSalary
(
eid
INT
)
RETURN
DECIMAL
(
10
,
2
);
PROCEDURE
raiseSalary
(
eid
INT
,
amount
DECIMAL
(
10
,
2
));
PROCEDURE
raiseSalaryStd
(
eid
INT
);
PROCEDURE
hire
(
ename
TEXT
,
esalary
DECIMAL
(
10
,
2
));
END
;
$$
DELIMITER
;
$$
--
vertical_results
SELECT
*
,
'---------------'
FROM
INFORMATION_SCHEMA
.
PARAMETERS
WHERE
SPECIFIC_SCHEMA
=
'db1_mdev18092'
;
--
horizontal_results
DROP
DATABASE
db1_mdev18092
;
mysql-test/suite/rpl/r/rpl_semi_sync_wait_no_slave.result
0 → 100644
View file @
6046bc22
include/master-slave.inc
[connection master]
connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 SET a=1;
DROP TABLE t1;
connection slave;
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave-master.opt
0 → 100644
View file @
6046bc22
--rpl_semi_sync_master_enabled=0 --rpl_semi_sync_master_wait_no_slave=0
mysql-test/suite/rpl/t/rpl_semi_sync_wait_no_slave.test
0 → 100644
View file @
6046bc22
# The test verifies master crash of MDEV-18096 when the server starts with
# rpl_semi_sync_master_enabled = OFF rpl_semi_sync_master_wait_no_slave = OFF
--
source
include
/
master
-
slave
.
inc
--
source
include
/
have_binlog_format_mixed
.
inc
--
connection
master
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
SET
a
=
1
;
DROP
TABLE
t1
;
--
sync_slave_with_master
--
source
include
/
rpl_end
.
inc
sql/semisync_master.cc
View file @
6046bc22
...
@@ -228,7 +228,7 @@ bool Active_tranx::is_tranx_end_pos(const char *log_file_name,
...
@@ -228,7 +228,7 @@ bool Active_tranx::is_tranx_end_pos(const char *log_file_name,
DBUG_RETURN
(
entry
!=
NULL
);
DBUG_RETURN
(
entry
!=
NULL
);
}
}
int
Active_tranx
::
clear_active_tranx_nodes
(
const
char
*
log_file_name
,
void
Active_tranx
::
clear_active_tranx_nodes
(
const
char
*
log_file_name
,
my_off_t
log_file_pos
)
my_off_t
log_file_pos
)
{
{
Tranx_node
*
new_front
;
Tranx_node
*
new_front
;
...
@@ -307,7 +307,7 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name,
...
@@ -307,7 +307,7 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name,
m_trx_front
->
log_name
,
(
ulong
)
m_trx_front
->
log_pos
));
m_trx_front
->
log_name
,
(
ulong
)
m_trx_front
->
log_pos
));
}
}
DBUG_
RETURN
(
0
)
;
DBUG_
VOID_RETURN
;
}
}
...
@@ -371,20 +371,21 @@ int Repl_semi_sync_master::init_object()
...
@@ -371,20 +371,21 @@ int Repl_semi_sync_master::init_object()
{
{
result
=
enable_master
();
result
=
enable_master
();
if
(
!
result
)
if
(
!
result
)
{
result
=
ack_receiver
.
start
();
/* Start the ACK thread. */
result
=
ack_receiver
.
start
();
/* Start the ACK thread. */
/*
If rpl_semi_sync_master_wait_no_slave is disabled, let's temporarily
switch off semisync to avoid hang if there's none active slave.
*/
if
(
!
rpl_semi_sync_master_wait_no_slave
)
switch_off
();
}
}
}
else
else
{
{
result
=
disable_master
();
result
=
disable_master
();
}
}
/*
If rpl_semi_sync_master_wait_no_slave is disabled, let's temporarily
switch off semisync to avoid hang if there's none active slave.
*/
if
(
!
rpl_semi_sync_master_wait_no_slave
)
switch_off
();
return
result
;
return
result
;
}
}
...
@@ -961,17 +962,15 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
...
@@ -961,17 +962,15 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
* the current sending event catches up with last wait position. If it
* the current sending event catches up with last wait position. If it
* does match, semi-sync will be switched on again.
* does match, semi-sync will be switched on again.
*/
*/
int
Repl_semi_sync_master
::
switch_off
()
void
Repl_semi_sync_master
::
switch_off
()
{
{
int
result
;
DBUG_ENTER
(
"Repl_semi_sync_master::switch_off"
);
DBUG_ENTER
(
"Repl_semi_sync_master::switch_off"
);
m_state
=
false
;
m_state
=
false
;
/* Clear the active transaction list. */
/* Clear the active transaction list. */
assert
(
m_active_tranxs
!=
NULL
);
assert
(
m_active_tranxs
!=
NULL
);
result
=
m_active_tranxs
->
clear_active_tranx_nodes
(
NULL
,
0
);
m_active_tranxs
->
clear_active_tranx_nodes
(
NULL
,
0
);
rpl_semi_sync_master_off_times
++
;
rpl_semi_sync_master_off_times
++
;
m_wait_file_name_inited
=
false
;
m_wait_file_name_inited
=
false
;
...
@@ -979,7 +978,7 @@ int Repl_semi_sync_master::switch_off()
...
@@ -979,7 +978,7 @@ int Repl_semi_sync_master::switch_off()
sql_print_information
(
"Semi-sync replication switched OFF."
);
sql_print_information
(
"Semi-sync replication switched OFF."
);
cond_broadcast
();
/* wake up all waiting threads */
cond_broadcast
();
/* wake up all waiting threads */
DBUG_
RETURN
(
result
)
;
DBUG_
VOID_RETURN
;
}
}
int
Repl_semi_sync_master
::
try_switch_on
(
int
server_id
,
int
Repl_semi_sync_master
::
try_switch_on
(
int
server_id
,
...
...
sql/semisync_master.h
View file @
6046bc22
...
@@ -343,11 +343,8 @@ class Active_tranx
...
@@ -343,11 +343,8 @@ class Active_tranx
* position.
* position.
* If log_file_name is NULL, everything will be cleared: the sorted
* If log_file_name is NULL, everything will be cleared: the sorted
* list and the hash table will be reset to empty.
* list and the hash table will be reset to empty.
*
* Return:
* 0: success; non-zero: error
*/
*/
int
clear_active_tranx_nodes
(
const
char
*
log_file_name
,
void
clear_active_tranx_nodes
(
const
char
*
log_file_name
,
my_off_t
log_file_pos
);
my_off_t
log_file_pos
);
/* Given a position, check to see whether the position is an active
/* Given a position, check to see whether the position is an active
...
@@ -449,7 +446,7 @@ class Repl_semi_sync_master
...
@@ -449,7 +446,7 @@ class Repl_semi_sync_master
}
}
/* Switch semi-sync off because of timeout in transaction waiting. */
/* Switch semi-sync off because of timeout in transaction waiting. */
int
switch_off
();
void
switch_off
();
/* Switch semi-sync on when slaves catch up. */
/* Switch semi-sync on when slaves catch up. */
int
try_switch_on
(
int
server_id
,
int
try_switch_on
(
int
server_id
,
...
...
sql/sql_lex.cc
View file @
6046bc22
...
@@ -1587,9 +1587,27 @@ int Lex_input_stream::lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1587,9 +1587,27 @@ int Lex_input_stream::lex_one_token(YYSTYPE *yylval, THD *thd)
return
(
FLOAT_NUM
);
return
(
FLOAT_NUM
);
}
}
}
}
/*
We've found:
- A sequence of digits
- Followed by 'e' or 'E'
- Followed by some byte XX which is not a known mantissa start,
and it's known to be a valid identifier part.
XX can be either a 8bit identifier character, or a multi-byte head.
*/
yyUnget
();
yyUnget
();
return
scan_ident_start
(
thd
,
&
yylval
->
ident_cli
);
}
}
// fall through
/*
We've found:
- A sequence of digits
- Followed by some character XX, which is neither 'e' nor 'E',
and it's known to be a valid identifier part.
XX can be a 8bit identifier character, or a multi-byte head.
*/
yyUnget
();
return
scan_ident_start
(
thd
,
&
yylval
->
ident_cli
);
case
MY_LEX_IDENT_START
:
// We come here after '.'
case
MY_LEX_IDENT_START
:
// We come here after '.'
return
scan_ident_start
(
thd
,
&
yylval
->
ident_cli
);
return
scan_ident_start
(
thd
,
&
yylval
->
ident_cli
);
...
...
sql/sql_show.cc
View file @
6046bc22
...
@@ -6268,7 +6268,8 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
...
@@ -6268,7 +6268,8 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
sph
=
Sp_handler
::
handler_mysql_proc
((
stored_procedure_type
)
sph
=
Sp_handler
::
handler_mysql_proc
((
stored_procedure_type
)
proc_table
->
field
[
MYSQL_PROC_MYSQL_TYPE
]
->
proc_table
->
field
[
MYSQL_PROC_MYSQL_TYPE
]
->
val_int
());
val_int
());
if
(
!
sph
)
if
(
!
sph
||
sph
->
type
()
==
TYPE_ENUM_PACKAGE
||
sph
->
type
()
==
TYPE_ENUM_PACKAGE_BODY
)
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
if
(
!
full_access
)
if
(
!
full_access
)
...
...
sql/sql_type.cc
View file @
6046bc22
...
@@ -2933,6 +2933,97 @@ bool Type_handler::
...
@@ -2933,6 +2933,97 @@ bool Type_handler::
}
}
bool
Type_handler_temporal_result
::
Item_func_min_max_fix_attributes
(
THD
*
thd
,
Item_func_min_max
*
func
,
Item
**
items
,
uint
nitems
)
const
{
bool
rc
=
Type_handler
::
Item_func_min_max_fix_attributes
(
thd
,
func
,
items
,
nitems
);
if
(
rc
||
func
->
maybe_null
)
return
rc
;
/*
LEAST/GREATES(non-temporal, temporal) can return NULL.
CAST functions Item_{time|datetime|date}_typecast always set maybe_full
to true. Here we try to detect nullability more thoroughly.
Perhaps CAST functions should also reuse this idea eventually.
*/
const
Type_handler
*
hf
=
func
->
type_handler
();
for
(
uint
i
=
0
;
i
<
nitems
;
i
++
)
{
/*
If items[i] does not need conversion to the current temporal data
type, then we trust items[i]->maybe_null, which was already ORred
to func->maybe_null in the argument loop in fix_fields().
If items[i] requires conversion to the current temporal data type,
then conversion can fail and return NULL even for NOT NULL items.
*/
const
Type_handler
*
ha
=
items
[
i
]
->
type_handler
();
if
(
hf
==
ha
)
continue
;
// No conversion.
if
(
ha
->
cmp_type
()
!=
TIME_RESULT
)
{
func
->
maybe_null
=
true
;
// Conversion from non-temporal is not safe
break
;
}
timestamp_type
tf
=
hf
->
mysql_timestamp_type
();
timestamp_type
ta
=
ha
->
mysql_timestamp_type
();
if
(
tf
==
ta
||
(
tf
==
MYSQL_TIMESTAMP_DATETIME
&&
ta
==
MYSQL_TIMESTAMP_DATE
))
{
/*
If handlers have the same mysql_timestamp_type(),
then conversion is NULL safe. Conversion from DATE to DATETIME
is also safe. This branch includes data type pairs:
Function return type Argument type Comment
-------------------- ------------- -------------
TIMESTAMP TIMESTAMP no conversion
TIMESTAMP DATETIME not possible
TIMESTAMP DATE not possible
DATETIME DATETIME no conversion
DATETIME TIMESTAMP safe conversion
DATETIME DATE safe conversion
DATE DATE no conversion
TIME TIME no conversion
Note, a function cannot return TIMESTAMP if it has non-TIMESTAMP
arguments (it would return DATETIME in such case).
*/
DBUG_ASSERT
(
hf
->
field_type
()
!=
MYSQL_TYPE_TIMESTAMP
||
tf
==
ta
);
continue
;
}
/*
Here we have the following data type pairs that did not match
the condition above:
Function return type Argument type Comment
-------------------- ------------- -------
TIMESTAMP TIME Not possible
DATETIME TIME depends on OLD_MODE_ZERO_DATE_TIME_CAST
DATE TIMESTAMP Not possible
DATE DATETIME Not possible
DATE TIME Not possible
TIME TIMESTAMP Not possible
TIME DATETIME Not possible
TIME DATE Not possible
Most pairs are not possible, because the function data type
would be DATETIME (according to LEAST/GREATEST aggregation rules).
Conversion to DATETIME from TIME is not safe when
OLD_MODE_ZERO_DATE_TIME_CAST is set:
- negative TIME values cannot be converted to not-NULL DATETIME values
- TIME values can produce DATETIME values that do not pass
NO_ZERO_DATE and NO_ZERO_IN_DATE tests.
*/
DBUG_ASSERT
(
hf
->
field_type
()
==
MYSQL_TYPE_DATETIME
);
if
(
!
(
thd
->
variables
.
old_behavior
&
OLD_MODE_ZERO_DATE_TIME_CAST
))
continue
;
func
->
maybe_null
=
true
;
break
;
}
return
rc
;
}
bool
Type_handler_real_result
::
bool
Type_handler_real_result
::
Item_func_min_max_fix_attributes
(
THD
*
thd
,
Item_func_min_max
*
func
,
Item_func_min_max_fix_attributes
(
THD
*
thd
,
Item_func_min_max
*
func
,
Item
**
items
,
uint
nitems
)
const
Item
**
items
,
uint
nitems
)
const
...
...
sql/sql_type.h
View file @
6046bc22
...
@@ -2138,6 +2138,8 @@ class Type_handler_temporal_result: public Type_handler
...
@@ -2138,6 +2138,8 @@ class Type_handler_temporal_result: public Type_handler
Item
*
source_expr
,
Item
*
source_const
)
const
;
Item
*
source_expr
,
Item
*
source_const
)
const
;
bool
subquery_type_allows_materialization
(
const
Item
*
inner
,
bool
subquery_type_allows_materialization
(
const
Item
*
inner
,
const
Item
*
outer
)
const
;
const
Item
*
outer
)
const
;
bool
Item_func_min_max_fix_attributes
(
THD
*
thd
,
Item_func_min_max
*
func
,
Item
**
items
,
uint
nitems
)
const
;
bool
Item_sum_hybrid_fix_length_and_dec
(
Item_sum_hybrid
*
func
)
const
;
bool
Item_sum_hybrid_fix_length_and_dec
(
Item_sum_hybrid
*
func
)
const
;
bool
Item_sum_sum_fix_length_and_dec
(
Item_sum_sum
*
)
const
;
bool
Item_sum_sum_fix_length_and_dec
(
Item_sum_sum
*
)
const
;
bool
Item_sum_avg_fix_length_and_dec
(
Item_sum_avg
*
)
const
;
bool
Item_sum_avg_fix_length_and_dec
(
Item_sum_avg
*
)
const
;
...
...
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