Skip to content

Commit

Permalink
MDEV-19740 Debug build of 10.3.15 FTBFS
Browse files Browse the repository at this point in the history
* Replace LINT_INIT for non-struct types with ctor initializers;
* Check BUILD_DEPS list is not empty so REMOVE_DUPLICATES won't throw
  error.
  • Loading branch information
midenok committed Aug 19, 2019
1 parent 44150a7 commit 6dd3f24
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 20 deletions.
6 changes: 4 additions & 2 deletions cmake/build_depends.cmake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ IF(RPM)
SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP}) SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP})
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()
LIST(REMOVE_DUPLICATES BUILD_DEPS) IF (BUILD_DEPS)
STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}") LIST(REMOVE_DUPLICATES BUILD_DEPS)
STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}")
ENDIF()
ENDIF(RPM) ENDIF(RPM)
15 changes: 7 additions & 8 deletions sql/opt_subselect.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,15 +93,14 @@ class Loose_scan_opt
Loose_scan_opt(): Loose_scan_opt():
try_loosescan(FALSE), try_loosescan(FALSE),
bound_sj_equalities(0), bound_sj_equalities(0),
quick_uses_applicable_index(FALSE) quick_uses_applicable_index(0),
quick_max_loose_keypart(0),
best_loose_scan_key(0),
best_loose_scan_cost(0),
best_loose_scan_records(0),
best_loose_scan_start_key(NULL),
best_max_loose_keypart(0)
{ {
/* Protected by quick_uses_applicable_index */
LINT_INIT(quick_max_loose_keypart);
/* The following are protected by best_loose_scan_cost!= DBL_MAX */
LINT_INIT(best_loose_scan_key);
LINT_INIT(best_loose_scan_records);
LINT_INIT(best_max_loose_keypart);
LINT_INIT(best_loose_scan_start_key);
} }


void init(JOIN *join, JOIN_TAB *s, table_map remaining_tables) void init(JOIN *join, JOIN_TAB *s, table_map remaining_tables)
Expand Down
1 change: 1 addition & 0 deletions sql/sql_explain.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ uint Explain_union::make_union_table_name(char *buf)
break; break;
default: default:
DBUG_ASSERT(0); DBUG_ASSERT(0);
type= {NULL, 0};
} }
memcpy(buf, type.str, (len= (uint)type.length)); memcpy(buf, type.str, (len= (uint)type.length));


Expand Down
2 changes: 1 addition & 1 deletion sql/sql_select.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ class Sj_materialization_picker : public Semi_join_strategy_picker
void set_empty() void set_empty()
{ {
sjm_scan_need_tables= 0; sjm_scan_need_tables= 0;
LINT_INIT_STRUCT(sjm_scan_last_inner); sjm_scan_last_inner= 0;
is_used= FALSE; is_used= FALSE;
} }
void set_from_prev(struct st_position *prev); void set_from_prev(struct st_position *prev);
Expand Down
7 changes: 2 additions & 5 deletions sql/sql_statistics.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1808,16 +1808,13 @@ class Index_prefix_calc: public Sql_alloc
bool is_partial_fields_present; bool is_partial_fields_present;


Index_prefix_calc(THD *thd, TABLE *table, KEY *key_info) Index_prefix_calc(THD *thd, TABLE *table, KEY *key_info)
: index_table(table), index_info(key_info) : index_table(table), index_info(key_info), prefixes(0), empty(true),
calc_state(NULL), is_single_comp_pk(false), is_partial_fields_present(false)
{ {
uint i; uint i;
Prefix_calc_state *state; Prefix_calc_state *state;
uint key_parts= table->actual_n_key_parts(key_info); uint key_parts= table->actual_n_key_parts(key_info);
empty= TRUE;
prefixes= 0;
LINT_INIT_STRUCT(calc_state);


is_partial_fields_present= is_single_comp_pk= FALSE;
uint pk= table->s->primary_key; uint pk= table->s->primary_key;
if ((uint) (table->key_info - key_info) == pk && if ((uint) (table->key_info - key_info) == pk &&
table->key_info[pk].user_defined_key_parts == 1) table->key_info[pk].user_defined_key_parts == 1)
Expand Down
3 changes: 1 addition & 2 deletions sql/sql_table.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10863,10 +10863,9 @@ bool Sql_cmd_create_table_like::execute(THD *thd)
{ {
DBUG_ENTER("Sql_cmd_create_table::execute"); DBUG_ENTER("Sql_cmd_create_table::execute");
LEX *lex= thd->lex; LEX *lex= thd->lex;
TABLE_LIST *all_tables= lex->query_tables;
SELECT_LEX *select_lex= &lex->select_lex; SELECT_LEX *select_lex= &lex->select_lex;
TABLE_LIST *first_table= select_lex->table_list.first; TABLE_LIST *first_table= select_lex->table_list.first;
DBUG_ASSERT(first_table == all_tables && first_table != 0); DBUG_ASSERT(first_table == lex->query_tables && first_table != 0);
bool link_to_local; bool link_to_local;
TABLE_LIST *create_table= first_table; TABLE_LIST *create_table= first_table;
TABLE_LIST *select_tables= lex->create_last_non_select_table->next_global; TABLE_LIST *select_tables= lex->create_last_non_select_table->next_global;
Expand Down
1 change: 1 addition & 0 deletions sql/wsrep_thd.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ static bool create_wsrep_THD(wsrep_thread_args* args)
break; break;
default: default:
assert(0); assert(0);
key= 0;
break; break;
} }
#endif #endif
Expand Down
2 changes: 2 additions & 0 deletions storage/innobase/fil/fil0crypt.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2268,9 +2268,11 @@ static void fil_crypt_rotation_list_fill()
/* Protect the tablespace while we may /* Protect the tablespace while we may
release fil_system.mutex. */ release fil_system.mutex. */
space->n_pending_ops++; space->n_pending_ops++;
#ifndef DBUG_OFF
fil_space_t* s= fil_system.read_page0( fil_space_t* s= fil_system.read_page0(
space->id); space->id);
ut_ad(!s || s == space); ut_ad(!s || s == space);
#endif
space->n_pending_ops--; space->n_pending_ops--;
if (!space->size) { if (!space->size) {
/* Page 0 was not loaded. /* Page 0 was not loaded.
Expand Down
4 changes: 4 additions & 0 deletions storage/innobase/row/row0mysql.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1418,21 +1418,25 @@ row_insert_for_mysql(
&blob_heap); &blob_heap);


if (ins_mode != ROW_INS_NORMAL) { if (ins_mode != ROW_INS_NORMAL) {
#ifndef DBUG_OFF
ut_ad(table->vers_start != table->vers_end); ut_ad(table->vers_start != table->vers_end);
const mysql_row_templ_t* t const mysql_row_templ_t* t
= prebuilt->get_template_by_col(table->vers_end); = prebuilt->get_template_by_col(table->vers_end);
ut_ad(t); ut_ad(t);
ut_ad(t->mysql_col_len == 8); ut_ad(t->mysql_col_len == 8);
#endif


if (ins_mode == ROW_INS_HISTORICAL) { if (ins_mode == ROW_INS_HISTORICAL) {
set_tuple_col_8(node->row, table->vers_end, trx->id, set_tuple_col_8(node->row, table->vers_end, trx->id,
node->vers_end_buf); node->vers_end_buf);
} else /* ROW_INS_VERSIONED */ { } else /* ROW_INS_VERSIONED */ {
set_tuple_col_8(node->row, table->vers_end, TRX_ID_MAX, set_tuple_col_8(node->row, table->vers_end, TRX_ID_MAX,
node->vers_end_buf); node->vers_end_buf);
#ifndef DBUG_OFF
t = prebuilt->get_template_by_col(table->vers_start); t = prebuilt->get_template_by_col(table->vers_start);
ut_ad(t); ut_ad(t);
ut_ad(t->mysql_col_len == 8); ut_ad(t->mysql_col_len == 8);
#endif
set_tuple_col_8(node->row, table->vers_start, trx->id, set_tuple_col_8(node->row, table->vers_start, trx->id,
node->vers_start_buf); node->vers_start_buf);
} }
Expand Down
2 changes: 1 addition & 1 deletion storage/maria/ma_ft_nlq_search.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
MARIA_KEY key; MARIA_KEY key;
float tmp_weight; float tmp_weight;
DBUG_ENTER("walk_and_match"); DBUG_ENTER("walk_and_match");
LINT_INIT_STRUCT(subkeys);


word->weight=LWS_FOR_QUERY; word->weight=LWS_FOR_QUERY;


_ma_ft_make_key(info, &key, aio->keynr, keybuff, word, 0); _ma_ft_make_key(info, &key, aio->keynr, keybuff, word, 0);
key.data_length-= HA_FT_WLEN; key.data_length-= HA_FT_WLEN;
doc_cnt=0; doc_cnt=0;
subkeys.i= 0;


if (share->lock_key_trees) if (share->lock_key_trees)
mysql_rwlock_rdlock(&share->keyinfo[aio->keynr].root_lock); mysql_rwlock_rdlock(&share->keyinfo[aio->keynr].root_lock);
Expand Down
2 changes: 1 addition & 1 deletion storage/myisam/ft_nlq_search.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uint extra= HA_FT_WLEN + info->s->rec_reflength; uint extra= HA_FT_WLEN + info->s->rec_reflength;
float tmp_weight; float tmp_weight;
DBUG_ENTER("walk_and_match"); DBUG_ENTER("walk_and_match");
LINT_INIT_STRUCT(subkeys);


word->weight=LWS_FOR_QUERY; word->weight=LWS_FOR_QUERY;


keylen=_ft_make_key(info,aio->keynr,keybuff,word,0); keylen=_ft_make_key(info,aio->keynr,keybuff,word,0);
keylen-=HA_FT_WLEN; keylen-=HA_FT_WLEN;
doc_cnt=0; doc_cnt=0;
subkeys.i= 0;


if (share->concurrent_insert) if (share->concurrent_insert)
mysql_rwlock_rdlock(&share->key_root_lock[aio->keynr]); mysql_rwlock_rdlock(&share->key_root_lock[aio->keynr]);
Expand Down

0 comments on commit 6dd3f24

Please sign in to comment.