Commit d97fe3f6 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Imported Upstream version 5.5.49

parent a295acf5
...@@ -88,7 +88,7 @@ const char *client_errors[]= ...@@ -88,7 +88,7 @@ const char *client_errors[]=
"" ""
}; };
const char** get_client_errmsgs() const char** get_client_errmsgs(void)
{ {
return client_errors; return client_errors;
} }
......
...@@ -27,19 +27,7 @@ mysql_get_charset_by_csname = get_charset_by_csname; ...@@ -27,19 +27,7 @@ mysql_get_charset_by_csname = get_charset_by_csname;
mysql_net_realloc = net_realloc; mysql_net_realloc = net_realloc;
mysql_client_errors = client_errors; mysql_client_errors = client_errors;
VERSION { @VERSION_HEADER@
libmysqlclient_18 {
global:
@CLIENT_API_5_1_LIST@ @CLIENT_API_5_1_LIST@
@CLIENT_API_5_5_LIST@ @CLIENT_API_5_5_LIST@
@VERSION_FOOTER@
local:
*;
};
libmysqlclient_16 {
/* empty here. aliases are added above */
};
}
...@@ -1794,6 +1794,12 @@ SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY ...@@ -1794,6 +1794,12 @@ SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
--echo #
SELECT @@collation_connection;
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
--echo # --echo #
--echo # MDEV-5702 Incorrect results are returned with NULLIF() --echo # MDEV-5702 Incorrect results are returned with NULLIF()
--echo # --echo #
......
...@@ -357,14 +357,14 @@ int main(int argc, const char** argv ) ...@@ -357,14 +357,14 @@ int main(int argc, const char** argv )
CloseHandle(job_handle); CloseHandle(job_handle);
message("Job terminated and closed"); message("Job terminated and closed");
if (!jobobject_assigned)
{
GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, process_info.dwProcessId);
TerminateProcess(process_info.hProcess, 202);
}
if (wait_res != WAIT_OBJECT_0 + CHILD) if (wait_res != WAIT_OBJECT_0 + CHILD)
{ {
if (!jobobject_assigned)
{
TerminateProcess(process_info.hProcess, 202);
}
/* The child has not yet returned, wait for it */ /* The child has not yet returned, wait for it */
message("waiting for child to exit"); message("waiting for child to exit");
if ((wait_res= WaitForSingleObject(wait_handles[CHILD], INFINITE)) if ((wait_res= WaitForSingleObject(wait_handles[CHILD], INFINITE))
......
...@@ -7,4 +7,17 @@ a ...@@ -7,4 +7,17 @@ a
2002-03-04 2002-03-04
Warnings: Warnings:
Note 1003 2000-01-01 Note 1003 2000-01-01
set debug_dbug='';
drop table t1;
create table t1 (id int not null, ut timestamp(6) not null);
insert into t1 values(1, '2001-01-01 00:00:00.2');
insert into t1 values(1, '2001-01-01 00:00:00.1');
select * from t1;
id ut
1 2001-01-01 00:00:00.200000
1 2001-01-01 00:00:00.100000
select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1;
(select max(m2.ut) from t1 m2 where m1.id <> 0)
2001-01-01 00:00:00.200000
2001-01-01 00:00:00.200000
drop table t1; drop table t1;
...@@ -231,3 +231,16 @@ case t1.f1 when '00:00:00' then 1 end ...@@ -231,3 +231,16 @@ case t1.f1 when '00:00:00' then 1 end
1 1
NULL NULL
drop table t1; drop table t1;
#
# MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END
#
CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a;
DESCRIBE t1;
Field Type Null Key Default Extra
a decimal(1,0) YES NULL
DROP TABLE t1;
CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a;
DESCRIBE t1;
Field Type Null Key Default Extra
a decimal(2,0) YES NULL
DROP TABLE t1;
...@@ -2483,3 +2483,19 @@ Warnings: ...@@ -2483,3 +2483,19 @@ Warnings:
Note 1291 Column 'a' has duplicated value '' in ENUM Note 1291 Column 'a' has duplicated value '' in ENUM
drop table t1; drop table t1;
set @@session.collation_server=default; set @@session.collation_server=default;
#
# MDEV-7765: Crash (Assertion `!table || (!table->write_set ||
# bitmap_is_set(table->write_set, field_index) ||
# bitmap_is_set(table->vcol_set, field_index))' fails)
# on using function over not created table
#
CREATE function f1() returns int
BEGIN
declare n int;
set n:= (select count(*) from t1);
return n;
end|
create table t1 as select f1();
ERROR 42S02: Table 'test.t1' doesn't exist
drop function f1;
End of 5.5 tests
...@@ -2849,6 +2849,15 @@ f1() ...@@ -2849,6 +2849,15 @@ f1()
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
binary
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF() # MDEV-5702 Incorrect results are returned with NULLIF()
# #
CREATE TABLE t1 (d DATE); CREATE TABLE t1 (d DATE);
......
...@@ -3241,6 +3241,15 @@ f1() ...@@ -3241,6 +3241,15 @@ f1()
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
cp1251_general_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF() # MDEV-5702 Incorrect results are returned with NULLIF()
# #
CREATE TABLE t1 (d DATE); CREATE TABLE t1 (d DATE);
......
#
# Start of 5.5 tests
#
#
# MDEV-9862 Illegal mix of collation, when comparing column with CASE expression
#
SET NAMES cp850;
CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1);
SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a;
a
DROP TABLE t1;
#
# End of 5.5 tests
#
...@@ -3423,6 +3423,15 @@ f1() ...@@ -3423,6 +3423,15 @@ f1()
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
latin1_swedish_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF() # MDEV-5702 Incorrect results are returned with NULLIF()
# #
CREATE TABLE t1 (d DATE); CREATE TABLE t1 (d DATE);
......
...@@ -4239,6 +4239,15 @@ f1() ...@@ -4239,6 +4239,15 @@ f1()
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
ucs2_general_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF() # MDEV-5702 Incorrect results are returned with NULLIF()
# #
CREATE TABLE t1 (d DATE); CREATE TABLE t1 (d DATE);
......
...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') ...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1; DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b"); select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b") insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b aa b
...@@ -5060,6 +5060,15 @@ f1() ...@@ -5060,6 +5060,15 @@ f1()
DROP FUNCTION f1; DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
utf8_general_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF() # MDEV-5702 Incorrect results are returned with NULLIF()
# #
CREATE TABLE t1 (d DATE); CREATE TABLE t1 (d DATE);
...@@ -5092,9 +5101,10 @@ SET sql_mode=default; ...@@ -5092,9 +5101,10 @@ SET sql_mode=default;
SET NAMES utf8; SET NAMES utf8;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (0), (0); INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
SELECT COUNT(*) FROM t1, t1 t2 SELECT COUNT(*) FROM t1, t1 t2
GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key' COUNT(*)
25
DROP TABLE t1; DROP TABLE t1;
# #
# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
...@@ -5804,5 +5814,21 @@ c0 c1 c2 c3 c4 ...@@ -5804,5 +5814,21 @@ c0 c1 c2 c3 c4
2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24
DROP TABLE t2, t1; DROP TABLE t2, t1;
# #
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
SET NAMES utf8;
CREATE TABLE t1 (a TEXT CHARACTER SET utf8);
INSERT INTO t1 VALUES (REPEAT('A',100));
SELECT OCTET_LENGTH(a) FROM t1;
OCTET_LENGTH(a)
300
ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT OCTET_LENGTH(a),a FROM t1;
OCTET_LENGTH(a) a
255 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
DROP TABLE t1;
#
# End of 5.5 tests # End of 5.5 tests
# #
...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') ...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1; DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b"); select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b") insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b aa b
...@@ -2606,6 +2606,22 @@ Warning 1292 Truncated incorrect INTEGER value: 'a' ...@@ -2606,6 +2606,22 @@ Warning 1292 Truncated incorrect INTEGER value: 'a'
DROP TABLE t1; DROP TABLE t1;
# End of test for Bug#13581962,Bug#14096619 # End of test for Bug#13581962,Bug#14096619
# #
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
SET NAMES utf8mb4;
CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4);
INSERT INTO t1 VALUES (REPEAT('😎',100));
SELECT OCTET_LENGTH(a) FROM t1;
OCTET_LENGTH(a)
400
ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8mb4;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT OCTET_LENGTH(a),a FROM t1;
OCTET_LENGTH(a) a
252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎
DROP TABLE t1;
#
# End of 5.5 tests # End of 5.5 tests
# #
# #
......
...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') ...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1; DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b"); select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b") insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b aa b
......
...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') ...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1; DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b"); select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b") insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b aa b
......
...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') ...@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1; DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b"); select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b") insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b aa b
......
This diff is collapsed.
drop database if exists events_test; drop database if exists events_test;
create database events_test; create database events_test;
use events_test; use events_test;
create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP events_test e_26 set @a = 5 root@localhost 2027-01-01 00:00:00 DROP
drop event e_26; drop event e_26;
create event e_26 on schedule at NULL disable do set @a = 5; create event e_26 on schedule at NULL disable do set @a = 5;
ERROR HY000: Incorrect AT value: 'NULL' ERROR HY000: Incorrect AT value: 'NULL'
......
...@@ -660,9 +660,14 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV ...@@ -660,9 +660,14 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV
CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED); CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED);
INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809); INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809);
SELECT -a FROM t1; SELECT -a FROM t1;
ERROR 22003: BIGINT value is out of range in '-(-9223372036854775808)' ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)'
SELECT -b FROM t1; SELECT -b FROM t1;
ERROR 22003: BIGINT value is out of range in '-(9223372036854775809)' ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)'
INSERT INTO t1 VALUES(0,0);
SELECT -a FROM t1;
ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)'
SELECT -b FROM t1;
ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)'
DROP TABLE t1; DROP TABLE t1;
SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999; SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999;
SELECT @a + @a; SELECT @a + @a;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment