Skip to content

Commit 707a7c4

Browse files
committed
Replace DBUG_ASSERTs guarded with safety checks with no assume variation
1 parent 9ffcc66 commit 707a7c4

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

sql/handler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ int ha_commit_trans(THD *thd, bool all)
17681768
DBUG_ASSERT(thd->transaction->stmt.ha_list == NULL ||
17691769
trans == &thd->transaction->stmt);
17701770

1771-
DBUG_ASSERT(!thd->in_sub_stmt);
1771+
DBUG_ASSERT_NO_ASSUME(!thd->in_sub_stmt);
17721772

17731773
if (thd->in_sub_stmt)
17741774
{

sql/handler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5475,8 +5475,8 @@ class handler :public Sql_alloc
54755475
{ return HA_ERR_WRONG_COMMAND; }
54765476
virtual bool set_ha_share_ref(Handler_share **arg_ha_share)
54775477
{
5478-
DBUG_ASSERT(!ha_share);
5479-
DBUG_ASSERT(arg_ha_share);
5478+
DBUG_ASSERT_NO_ASSUME(!ha_share);
5479+
DBUG_ASSERT_NO_ASSUME(arg_ha_share);
54805480
if (ha_share || !arg_ha_share)
54815481
return true;
54825482
ha_share= arg_ha_share;

sql/lex_charset.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ bool Lex_exact_charset_opt_extended_collate::
218218
if (cl.is_contextually_typed_collate_default())
219219
{
220220
CHARSET_INFO *ci= find_mapped_default_collation(used, map);
221-
DBUG_ASSERT(ci);
221+
DBUG_ASSERT_NO_ASSUME(ci);
222222
if (!ci)
223223
return true;
224224
m_ci= ci;
@@ -446,7 +446,7 @@ Lex_exact_charset_opt_extended_collate::find_compiled_default_collation() const
446446
The above should never fail, as we have default collations for
447447
all character sets.
448448
*/
449-
DBUG_ASSERT(cs);
449+
DBUG_ASSERT_NO_ASSUME(cs);
450450
return cs;
451451
}
452452

sql/service_wsrep.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd __attribute__((unused)),
195195
We should always be in victim_thd context, either client session is
196196
rolling back or rollbacker thread should be in control.
197197
*/
198-
DBUG_ASSERT(victim_thd);
199-
DBUG_ASSERT(current_thd == victim_thd);
200-
DBUG_ASSERT(wsrep_thd_is_SR(victim_thd));
198+
DBUG_ASSERT_NO_ASSUME(victim_thd);
199+
DBUG_ASSERT_NO_ASSUME(current_thd == victim_thd);
200+
DBUG_ASSERT_NO_ASSUME(wsrep_thd_is_SR(victim_thd));
201201

202202
/* Defensive measure to avoid crash in production. */
203203
if (!victim_thd) return;

sql/wsrep_mysqld.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void wsrep_init_sidno(const wsrep::id& uuid)
447447

448448
void wsrep_init_schema()
449449
{
450-
DBUG_ASSERT(!wsrep_schema);
450+
DBUG_ASSERT_NO_ASSUME(!wsrep_schema);
451451

452452
WSREP_INFO("wsrep_init_schema_and_SR %p", wsrep_schema);
453453
if (!wsrep_schema)

storage/maria/ma_blockrec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3028,7 +3028,7 @@ static my_bool write_block_record(MARIA_HA *info,
30283028
cur_block++;
30293029
}
30303030
#ifdef SANITY_CHECKS
3031-
DBUG_ASSERT(!(cur_block >= end_block));
3031+
DBUG_ASSERT_NO_ASSUME(!(cur_block >= end_block));
30323032
if ((cur_block >= end_block))
30333033
goto crashed;
30343034
#endif

storage/maria/ma_delete.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ int maria_delete(MARIA_HA *info,const uchar *record)
130130

131131
err:
132132
save_errno= my_errno;
133-
DBUG_ASSERT(save_errno);
133+
DBUG_ASSERT_NO_ASSUME(save_errno);
134134
if (!save_errno)
135135
save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */
136136

storage/maria/ma_update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec,
199199
err:
200200
DBUG_PRINT("error",("key: %d errno: %d",i,my_errno));
201201
save_errno= my_errno;
202-
DBUG_ASSERT(save_errno);
202+
DBUG_ASSERT_NO_ASSUME(save_errno);
203203
if (!save_errno)
204204
save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */
205205

storage/maria/ma_write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ int maria_write(MARIA_HA *info, const uchar *record)
415415
my_errno=save_errno;
416416
err2:
417417
save_errno=my_errno;
418-
DBUG_ASSERT(save_errno);
418+
DBUG_ASSERT_NO_ASSUME(save_errno);
419419
if (!save_errno)
420420
save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */
421421
DBUG_PRINT("error", ("got error: %d", save_errno));

0 commit comments

Comments
 (0)