Skip to content

Commit 4d59f45

Browse files
committed
Merge 10.2 into 10.3
2 parents acf6f92 + 0037714 commit 4d59f45

39 files changed

+547
-78
lines changed

client/mysqlbinlog.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
3-
Copyright (c) 2009, 2014, MariaDB
3+
Copyright (c) 2009, 2019, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -233,9 +233,8 @@ bool print_annotate_event(PRINT_EVENT_INFO *print_event_info)
233233
bool error= 0;
234234
if (annotate_event)
235235
{
236-
error= annotate_event->print(result_file, print_event_info);
237-
delete annotate_event; // the event should not be printed more than once
238-
annotate_event= 0;
236+
annotate_event->print(result_file, print_event_info);
237+
free_annotate_event();
239238
}
240239
return error;
241240
}
@@ -1553,8 +1552,6 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
15531552
}
15541553
}
15551554

1556-
if (remote_opt)
1557-
ev->temp_buf= 0;
15581555
if (destroy_evt) /* destroy it later if not set (ignored table map) */
15591556
delete ev;
15601557
}

extra/mariabackup/backup_copy.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,9 @@ datafile_read(datafile_cur_t *cursor)
558558
return(XB_FIL_CUR_EOF);
559559
}
560560

561-
if (!os_file_read(IORequestRead,
561+
if (os_file_read(IORequestRead,
562562
cursor->file, cursor->buf, cursor->buf_offset,
563-
to_read)) {
563+
to_read) != DB_SUCCESS) {
564564
return(XB_FIL_CUR_ERROR);
565565
}
566566

extra/mariabackup/changed_page_bitmap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ log_online_read_bitmap_page(
196196
ut_a(bitmap_file->offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
197197
success = os_file_read(IORequestRead,
198198
bitmap_file->file, page, bitmap_file->offset,
199-
MODIFIED_PAGE_BLOCK_SIZE);
199+
MODIFIED_PAGE_BLOCK_SIZE) == DB_SUCCESS;
200200

201201
if (UNIV_UNLIKELY(!success)) {
202202

extra/mariabackup/fil_cur.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ xb_fil_cur_open(
252252
if (!node->space->crypt_data
253253
&& os_file_read(IORequestRead,
254254
node->handle, cursor->buf, 0,
255-
page_size.physical())) {
255+
page_size.physical()) == DB_SUCCESS) {
256256
mutex_enter(&fil_system.mutex);
257257
if (!node->space->crypt_data) {
258258
node->space->crypt_data
@@ -441,8 +441,8 @@ xb_fil_cur_read(
441441
cursor->buf_offset = offset;
442442
cursor->buf_page_no = (ulint)(offset / page_size);
443443

444-
if (!os_file_read(IORequestRead, cursor->file, cursor->buf, offset,
445-
(ulint) to_read)) {
444+
if (os_file_read(IORequestRead, cursor->file, cursor->buf, offset,
445+
(ulint) to_read) != DB_SUCCESS) {
446446
ret = XB_FIL_CUR_ERROR;
447447
goto func_exit;
448448
}

extra/mariabackup/xtrabackup.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3297,10 +3297,10 @@ static dberr_t xb_assign_undo_space_start()
32973297
page = static_cast<byte*>(ut_align(buf, srv_page_size));
32983298

32993299
retry:
3300-
if (!os_file_read(IORequestRead, file, page,
3301-
TRX_SYS_PAGE_NO << srv_page_size_shift,
3302-
srv_page_size)) {
3303-
msg("Reading TRX_SYS page failed.\n");
3300+
if (os_file_read(IORequestRead, file, page,
3301+
TRX_SYS_PAGE_NO << srv_page_size_shift,
3302+
srv_page_size) != DB_SUCCESS) {
3303+
msg("Reading TRX_SYS page failed.");
33043304
error = DB_ERROR;
33053305
goto func_exit;
33063306
}
@@ -4604,7 +4604,7 @@ xb_space_create_file(
46044604

46054605
free(buf);
46064606

4607-
if (!ret) {
4607+
if (ret != DB_SUCCESS) {
46084608
msg("mariabackup: could not write the first page to %s",
46094609
path);
46104610
os_file_close(*file);
@@ -4900,7 +4900,7 @@ xtrabackup_apply_delta(
49004900
<< page_size_shift);
49014901
success = os_file_read(IORequestRead, src_file,
49024902
incremental_buffer, offset, page_size);
4903-
if (!success) {
4903+
if (success != DB_SUCCESS) {
49044904
goto error;
49054905
}
49064906

@@ -4933,7 +4933,7 @@ xtrabackup_apply_delta(
49334933
success = os_file_read(IORequestRead, src_file,
49344934
incremental_buffer,
49354935
offset, page_in_buffer * page_size);
4936-
if (!success) {
4936+
if (success != DB_SUCCESS) {
49374937
goto error;
49384938
}
49394939

@@ -4981,7 +4981,7 @@ xtrabackup_apply_delta(
49814981

49824982
success = os_file_write(IORequestWrite,
49834983
dst_path, dst_file, buf, off, page_size);
4984-
if (!success) {
4984+
if (success != DB_SUCCESS) {
49854985
goto error;
49864986
}
49874987
}

mysql-test/main/multi_update_innodb.result

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,43 @@ create table t2 like t1;
151151
insert into t2 select * from t1;
152152
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
153153
drop table t1,t2;
154+
#
155+
# MDEV-16240: Assertion `0' failed in
156+
# row_sel_convert_mysql_key_to_innobase
157+
#
158+
SET @save_sql_mode=@@sql_mode;
159+
set sql_mode='';
160+
CREATE TABLE `t3` (
161+
`f1` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
162+
`f2` datetime DEFAULT '2000-01-01 00:00:00' ON UPDATE current_timestamp(),
163+
`f3` TIMESTAMP NULL DEFAULT '2000-01-01 00:00:00',
164+
`pk` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
165+
`f4` datetime DEFAULT current_timestamp(),
166+
PRIMARY KEY (`pk`),
167+
UNIQUE KEY `f2k` (`f2`),
168+
KEY `f4k` (`f4`)
169+
) ENGINE=InnoDB;
170+
INSERT INTO `t3` VALUES ('2018-05-18 15:08:07','2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00'),('0000-00-00 00:00:00','0000-00-00 00:00:00','1999-12-31 23:00:00','2002-07-03 23:04:40','0000-00-00 00:00:00');
171+
CREATE VIEW `v1` AS
172+
SELECT `t3`.`pk` AS `pk`,
173+
`t3`.`f3` AS `f3`,
174+
`t3`.`f4` AS `f4`,
175+
`t3`.`f2` AS `f2`,
176+
`t3`.`f1` AS `f1`
177+
FROM `t3`;
178+
CREATE TABLE `t4` (
179+
`f1` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
180+
`f3` timestamp NULL DEFAULT NULL,
181+
`f2` timestamp NULL DEFAULT '1999-12-31 23:00:00' ON UPDATE current_timestamp(),
182+
`pk` int(11) NOT NULL,
183+
`f4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
184+
PRIMARY KEY (`pk`)
185+
) ENGINE=InnoDB;
186+
INSERT INTO `t4` VALUES ('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,1,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,3,'2018-05-18 15:08:06'),('0000-00-00 00:00:00','0000-00-00 00:00:00',NULL,1976,'0000-00-00 00:00:00'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2000,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2001,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2002,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2003,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2004,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2005,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2018,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2019,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2024,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','1999-12-31 23:00:00',2025,'2018-05-18 15:08:06'),('0000-00-00 00:00:00',NULL,'2018-05-18 15:08:06',2026,'2018-05-18 15:08:06'),('2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00',2027,'0000-00-00 00:00:00');
187+
UPDATE `v1` t1, `t4` t2
188+
SET t1.`f2` = 6452736 WHERE t1.`f4` = 6272000;
189+
ERROR 23000: Duplicate entry '0000-00-00 00:00:00' for key 'f2k'
190+
DROP VIEW v1;
191+
DROP TABLE t3,t4;
192+
SET @@sql_mode=@save_sql_mode;
193+
# End of 10.2 tests

mysql-test/main/multi_update_innodb.test

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,52 @@ delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
173173

174174
drop table t1,t2;
175175

176+
--echo #
177+
--echo # MDEV-16240: Assertion `0' failed in
178+
--echo # row_sel_convert_mysql_key_to_innobase
179+
--echo #
180+
181+
SET @save_sql_mode=@@sql_mode;
182+
set sql_mode='';
183+
184+
CREATE TABLE `t3` (
185+
`f1` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
186+
`f2` datetime DEFAULT '2000-01-01 00:00:00' ON UPDATE current_timestamp(),
187+
`f3` TIMESTAMP NULL DEFAULT '2000-01-01 00:00:00',
188+
`pk` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
189+
`f4` datetime DEFAULT current_timestamp(),
190+
PRIMARY KEY (`pk`),
191+
UNIQUE KEY `f2k` (`f2`),
192+
KEY `f4k` (`f4`)
193+
) ENGINE=InnoDB;
194+
195+
INSERT INTO `t3` VALUES ('2018-05-18 15:08:07','2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00'),('0000-00-00 00:00:00','0000-00-00 00:00:00','1999-12-31 23:00:00','2002-07-03 23:04:40','0000-00-00 00:00:00');
196+
197+
CREATE VIEW `v1` AS
198+
SELECT `t3`.`pk` AS `pk`,
199+
`t3`.`f3` AS `f3`,
200+
`t3`.`f4` AS `f4`,
201+
`t3`.`f2` AS `f2`,
202+
`t3`.`f1` AS `f1`
203+
FROM `t3`;
204+
205+
CREATE TABLE `t4` (
206+
`f1` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
207+
`f3` timestamp NULL DEFAULT NULL,
208+
`f2` timestamp NULL DEFAULT '1999-12-31 23:00:00' ON UPDATE current_timestamp(),
209+
`pk` int(11) NOT NULL,
210+
`f4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
211+
PRIMARY KEY (`pk`)
212+
) ENGINE=InnoDB;
213+
214+
INSERT INTO `t4` VALUES ('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,1,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,3,'2018-05-18 15:08:06'),('0000-00-00 00:00:00','0000-00-00 00:00:00',NULL,1976,'0000-00-00 00:00:00'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2000,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2001,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2002,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2003,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00',NULL,2004,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2005,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2018,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2019,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','2018-05-18 15:08:06',2024,'2018-05-18 15:08:06'),('2018-05-18 17:08:06','0000-00-00 00:00:00','1999-12-31 23:00:00',2025,'2018-05-18 15:08:06'),('0000-00-00 00:00:00',NULL,'2018-05-18 15:08:06',2026,'2018-05-18 15:08:06'),('2018-05-18 17:08:07','0000-00-00 00:00:00','0000-00-00 00:00:00',2027,'0000-00-00 00:00:00');
215+
216+
--error ER_DUP_ENTRY
217+
UPDATE `v1` t1, `t4` t2
218+
SET t1.`f2` = 6452736 WHERE t1.`f4` = 6272000;
219+
220+
DROP VIEW v1;
221+
DROP TABLE t3,t4;
222+
SET @@sql_mode=@save_sql_mode;
223+
224+
--echo # End of 10.2 tests
8.42 KB
Binary file not shown.

mysql-test/suite/binlog/r/flashback.result

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,24 @@ world.city 563256876
684684
DROP TABLE test.test;
685685
DROP TABLE world.city;
686686
DROP DATABASE world;
687+
# < CASE 7 >
688+
# Test Case for MDEV-17260
689+
#
690+
RESET MASTER;
691+
CREATE TABLE t1 ( f INT PRIMARY KEY ) ENGINE=innodb;
692+
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6);
693+
# 6- Rows must be present
694+
SELECT COUNT(*) FROM t1;
695+
COUNT(*)
696+
6
697+
FLUSH LOGS;
698+
DELETE FROM t1;
699+
FLUSH LOGS;
700+
# 0- Rows must be present
701+
include/assert.inc [Table t1 should have 0 rows.]
702+
# 6- Rows must be present upon restoring from flashback
703+
include/assert.inc [Table t1 should have six rows.]
704+
DROP TABLE t1;
687705
SET binlog_format=statement;
688706
Warnings:
689707
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT

mysql-test/suite/binlog/t/flashback.test

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,36 @@ DROP TABLE test.test;
335335
DROP TABLE world.city;
336336
DROP DATABASE world;
337337

338-
## Clear
338+
--echo # < CASE 7 >
339+
--echo # Test Case for MDEV-17260
340+
--echo #
341+
342+
RESET MASTER;
343+
344+
CREATE TABLE t1 ( f INT PRIMARY KEY ) ENGINE=innodb;
345+
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6);
346+
--echo # 6- Rows must be present
347+
SELECT COUNT(*) FROM t1;
348+
FLUSH LOGS;
349+
DELETE FROM t1;
350+
FLUSH LOGS;
339351

352+
--echo # 0- Rows must be present
353+
--let $assert_cond= COUNT(*) = 0 FROM t1
354+
--let $assert_text= Table t1 should have 0 rows.
355+
--source include/assert.inc
356+
357+
--exec $MYSQL_BINLOG -vv -B --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_7.sql
358+
--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_7.sql;"
359+
360+
--echo # 6- Rows must be present upon restoring from flashback
361+
--let $assert_cond= COUNT(*) = 6 FROM t1
362+
--let $assert_text= Table t1 should have six rows.
363+
--source include/assert.inc
364+
365+
DROP TABLE t1;
366+
367+
## Clear
340368
SET binlog_format=statement;
341369
--error ER_FLASHBACK_NOT_SUPPORTED
342370
SET GLOBAL binlog_format=statement;

0 commit comments

Comments
 (0)