Skip to content

Commit 964d33f

Browse files
committed
Merge branch 'mysql-8.0' into mysql-trunk
2 parents 3130e09 + eded47f commit 964d33f

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

mysql-test/suite/ndb/r/ndb_restore_conv_null.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ col2 varchar(20),
6767
col3 text,
6868
col4 date) engine=ndb;
6969
Cause backup stall
70+
7071
Starting backup
7172
Backup started
7273
update nullable set col2=NULL;
74+
7375
Waiting for backup to complete
7476
Backup completed
7577
drop table nullable;

mysql-test/suite/ndb/t/ndb_restore_conv_null.test

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@ create table not_nullable_no_nulls (
6969

7070
--echo # cannot restore nullable->non-nullable without --lossy-conversions
7171
--error 1
72-
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable_no_nulls $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
72+
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable_no_nulls $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
7373

7474
--echo # can restore nullable->non-nullable if non-nullable col has no NULL values
75-
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable_no_nulls --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
76-
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r --include-tables=test.nullable_no_nulls --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
75+
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable_no_nulls --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
76+
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r --include-tables=test.nullable_no_nulls --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
7777

7878
--echo # cannot restore nullable->non-nullable if non-nullable col has NULL values
79-
--error 139
80-
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable_with_nulls --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
79+
--error 1
80+
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable_with_nulls --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
8181

8282
--echo # cannot restore not-null->non-nullable without --promote-attributes
8383
--error 1
84-
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.not_nullable_no_nulls $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
84+
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.not_nullable_no_nulls $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
8585

8686
--echo # can restore not-null->nullable
87-
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.not_nullable_no_nulls --promote-attributes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
88-
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r --include-tables=test.not_nullable_no_nulls --promote-attributes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
87+
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.not_nullable_no_nulls --promote-attributes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
88+
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r --include-tables=test.not_nullable_no_nulls --promote-attributes $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
8989

9090
select count(*) from nullable_no_nulls where col2=REPEAT("abcde", 4) and col3=REPEAT("XYZ", 2000) and col4="2021-04-01";
9191
select count(*) from nullable_with_nulls;
@@ -114,13 +114,13 @@ while ($i)
114114
--enable_query_log
115115

116116
--echo Cause backup stall
117-
--exec $NDB_MGM --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 10039" >> $NDB_TOOLS_OUTPUT 2&>1
117+
--exec $NDB_MGM -e "all error 10039"
118118

119119
--source suite/ndb/t/ndb_backup_nowait_start.inc
120120

121121
update nullable set col2=NULL;
122122

123-
--exec $NDB_MGM --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" >> $NDB_TOOLS_OUTPUT 2&>1
123+
--exec $NDB_MGM -e "all error 0"
124124
--source suite/ndb/t/ndb_backup_nowait_wait.inc
125125

126126
drop table nullable;
@@ -134,8 +134,8 @@ create table nullable (
134134
col4 date not null)engine=ndb;
135135

136136
--echo # cannot restore nullable->non-nullable if backup log sets NULL values
137-
--error 139
138-
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2&>1
137+
--error 1
138+
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r --include-tables=test.nullable --lossy-conversions $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT 2>&1
139139

140140
select * from nullable;
141141

storage/ndb/tools/restore/consumer_restore.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,21 +3832,19 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
38323832
{
38333833
if (errorHandler(cb))
38343834
continue;
3835-
restoreLogger.log_error("Cannot get operation: %u: %s", cb->connection->getNdbError().code, cb->connection->getNdbError().message);
3835+
restoreLogger.log_error("Cannot get operation: %u: %s", cb->error_code,
3836+
m_ndb->getNdbError(cb->error_code).message);
38363837
set_fatal_error(true);
3837-
m_ndb->closeTransaction(cb->connection);
3838-
cb->connection = NULL;
38393838
return;
38403839
} // if
38413840

38423841
if (op->writeTuple() == -1)
38433842
{
38443843
if (errorHandler(cb))
38453844
continue;
3846-
restoreLogger.log_error("Error defining op: %u: %s", cb->connection->getNdbError().code, cb->connection->getNdbError().message);
3845+
restoreLogger.log_error("Error defining op: %u: %s", cb->error_code,
3846+
m_ndb->getNdbError(cb->error_code).message);
38473847
set_fatal_error(true);
3848-
m_ndb->closeTransaction(cb->connection);
3849-
cb->connection = NULL;
38503848
return;
38513849
} // if
38523850

@@ -3984,10 +3982,9 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
39843982
{
39853983
if (errorHandler(cb))
39863984
continue;
3987-
restoreLogger.log_error("Error defining op: %u: %s", cb->connection->getNdbError().code, cb->connection->getNdbError().message);
3985+
restoreLogger.log_error("Error defining op: %u: %s", cb->error_code,
3986+
m_ndb->getNdbError(cb->error_code).message);
39883987
set_fatal_error(true);
3989-
m_ndb->closeTransaction(cb->connection);
3990-
cb->connection = NULL;
39913988
return;
39923989
}
39933990

@@ -4605,8 +4602,8 @@ BackupRestore::logEntry_a(restore_callback_t *cb)
46054602
if (errorHandler(cb)) // temp error, retry
46064603
goto retry;
46074604
set_fatal_error(true);
4608-
restoreLogger.log_error("Cannot start transaction: %u: %s",
4609-
m_ndb->getNdbError().code, m_ndb->getNdbError().message);
4605+
restoreLogger.log_error("Cannot start transaction: %u: %s", cb->error_code,
4606+
m_ndb->getNdbError(cb->error_code).message);
46104607
return;
46114608
}
46124609

@@ -4629,8 +4626,8 @@ BackupRestore::logEntry_a(restore_callback_t *cb)
46294626
if (errorHandler(cb)) // temp error, retry
46304627
goto retry;
46314628
set_fatal_error(true);
4632-
restoreLogger.log_error("Cannot get operation: %u: %s",
4633-
trans->getNdbError().code, trans->getNdbError().message);
4629+
restoreLogger.log_error("Cannot get operation: %u: %s", cb->error_code,
4630+
m_ndb->getNdbError(cb->error_code).message);
46344631
return;
46354632
}
46364633

0 commit comments

Comments
 (0)