mirror of
https://github.com/MariaDB/server.git
synced 2025-03-25 00:18:42 +01:00
Fixed compiler warnings and warnings from build.tags
Other things - Ensure that ut_d() is set to EXPR if ut_ad() is DEBUG_ASSERT() If not, we will get a crash in purge_sys_t::~purge_sys_t() as this ut_ad() code expect's that the ut_d() codes has been executed
This commit is contained in:
parent
276b0c8ef0
commit
1e04ad284c
22 changed files with 33 additions and 19 deletions
client
include/mysql
sql
item_cmpfunc.ccitem_jsonfunc.ccopt_range.ccslave.ccsql_admin.ccsql_table.ccsys_vars.ictable.ccwsrep_binlog.cc
storage
connect
innobase
maria
myisam
support-files
|
@ -19,6 +19,8 @@
|
|||
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
|
||||
|
||||
#define CHECK_VERSION "2.7.4-MariaDB"
|
||||
/* Avoid warnings from %'s format */
|
||||
#define USING_MARIADB_SNPRINTF_EXTENSIONS
|
||||
|
||||
#include "client_priv.h"
|
||||
#include <m_ctype.h>
|
||||
|
|
|
@ -96,7 +96,7 @@ extern struct my_snprintf_service_st {
|
|||
#define ATTRIBUTE_FORMAT_DEFINED
|
||||
#define ATTRIBUTE_FORMAT(A,B,C)
|
||||
#endif
|
||||
#ifdef MYSQL_ABI_CHECK
|
||||
#if defined(MYSQL_ABI_CHECK) || defined(USING_MARIADB_SNPRINTF_EXTENSIONS)
|
||||
#undef ATTRIBUTE_FORMAT
|
||||
#define ATTRIBUTE_FORMAT(A,B,C)
|
||||
#endif
|
||||
|
|
|
@ -479,7 +479,6 @@ void Item_bool_rowready_func2::fix_length_and_dec()
|
|||
int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
|
||||
Item **a1, Item **a2)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
owner= owner_arg;
|
||||
set_null= set_null && owner_arg;
|
||||
a= a1;
|
||||
|
@ -488,7 +487,7 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
|
|||
Type_handler_hybrid_field_type tmp;
|
||||
if (tmp.aggregate_for_comparison(owner_arg->func_name(), tmp_args, 2, false))
|
||||
{
|
||||
DBUG_ASSERT(thd->is_error());
|
||||
DBUG_ASSERT(current_thd->is_error());
|
||||
return 1;
|
||||
}
|
||||
m_compare_handler= tmp.type_handler();
|
||||
|
|
|
@ -1258,6 +1258,7 @@ longlong Item_func_json_contains_path::val_int()
|
|||
longlong result;
|
||||
json_path_t p;
|
||||
int n_found;
|
||||
LINT_INIT(n_found);
|
||||
|
||||
if ((null_value= args[0]->null_value))
|
||||
return 0;
|
||||
|
@ -1985,6 +1986,7 @@ String *Item_func_json_merge::val_str(String *str)
|
|||
json_engine_t je1, je2;
|
||||
String *js1= args[0]->val_json(&tmp_js1), *js2;
|
||||
uint n_arg;
|
||||
LINT_INIT(js2);
|
||||
|
||||
if (args[0]->null_value)
|
||||
goto null_return;
|
||||
|
|
|
@ -7501,6 +7501,8 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
|
|||
param->current_table);
|
||||
#ifdef HAVE_SPATIAL
|
||||
Field::geometry_type sav_geom_type;
|
||||
LINT_INIT(sav_geom_type);
|
||||
|
||||
if (field_item->field->type() == MYSQL_TYPE_GEOMETRY)
|
||||
{
|
||||
sav_geom_type= ((Field_geom*) field_item->field)->geom_type;
|
||||
|
|
|
@ -3728,8 +3728,7 @@ int
|
|||
apply_event_and_update_pos_for_parallel(Log_event* ev, THD* thd,
|
||||
rpl_group_info *rgi)
|
||||
{
|
||||
Relay_log_info* rli= rgi->rli;
|
||||
mysql_mutex_assert_not_owner(&rli->data_lock);
|
||||
mysql_mutex_assert_not_owner(&rgi->rli->data_lock);
|
||||
int reason= apply_event_and_update_pos_setup(ev, thd, rgi);
|
||||
/*
|
||||
In parallel replication, sql_slave_skip_counter is handled in the SQL
|
||||
|
|
|
@ -394,7 +394,9 @@ static bool open_only_one_table(THD* thd, TABLE_LIST* table,
|
|||
open_and_lock_tables(thd, table, TRUE, 0));
|
||||
}
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
dbug_err:
|
||||
#endif
|
||||
|
||||
thd->prepare_derived_at_open= FALSE;
|
||||
|
||||
|
|
|
@ -2193,7 +2193,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||
bool trans_tmp_table_deleted= 0, non_trans_tmp_table_deleted= 0;
|
||||
bool non_tmp_table_deleted= 0;
|
||||
bool is_drop_tmp_if_exists_added= 0;
|
||||
bool was_view= 0, was_table, is_sequence;
|
||||
bool was_view= 0, was_table= 0, is_sequence;
|
||||
String built_query;
|
||||
String built_trans_tmp_query, built_non_trans_tmp_query;
|
||||
DBUG_ENTER("mysql_rm_table_no_locks");
|
||||
|
|
|
@ -612,7 +612,9 @@ public:
|
|||
/* parse and feel list with default values */
|
||||
if (thd)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
bool res=
|
||||
#endif
|
||||
sysvartrack_validate_value(thd,
|
||||
var->save_result.string_value.str,
|
||||
var->save_result.string_value.length);
|
||||
|
|
|
@ -1177,7 +1177,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
|
|||
char *keynames, *names, *comment_pos;
|
||||
const uchar *forminfo, *extra2;
|
||||
const uchar *frm_image_end = frm_image + frm_length;
|
||||
uchar *record, *null_flags, *null_pos, *mysql57_vcol_null_pos;
|
||||
uchar *record, *null_flags, *null_pos, *mysql57_vcol_null_pos= 0;
|
||||
const uchar *disk_buff, *strpos;
|
||||
ulong pos, record_offset;
|
||||
ulong rec_buff_length;
|
||||
|
@ -2387,6 +2387,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
|
|||
DBUG_ASSERT(field_nr < share->fields);
|
||||
reg_field= share->field[field_nr];
|
||||
}
|
||||
else
|
||||
reg_field= 0; // Safety
|
||||
|
||||
vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE;
|
||||
vcol_info->set_vcol_type((enum_vcol_info_type) type);
|
||||
|
@ -7368,7 +7370,7 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
|
|||
DBUG_ASSERT(vcol_info);
|
||||
DBUG_ASSERT(vcol_info->expr);
|
||||
|
||||
bool update, swap_values= 0;
|
||||
bool update= 0, swap_values= 0;
|
||||
switch (update_mode) {
|
||||
case VCOL_UPDATE_FOR_READ:
|
||||
update= !vcol_info->stored_in_db
|
||||
|
|
|
@ -452,7 +452,7 @@ void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf,
|
|||
File file;
|
||||
IO_CACHE cache;
|
||||
Log_event_writer writer(&cache, 0);
|
||||
Format_description_log_event *ev;
|
||||
Format_description_log_event *ev= 0;
|
||||
|
||||
int len= my_snprintf(filename, PATH_MAX, "%s/GRA_%lld_%lld_v2.log",
|
||||
wsrep_data_home_dir, (longlong) thd->thread_id,
|
||||
|
|
|
@ -2692,7 +2692,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
|
|||
htrc("Cond type=%d\n", cond->type());
|
||||
|
||||
if (cond->type() == COND::COND_ITEM) {
|
||||
char *pb0, *pb1, *pb2, *ph0, *ph1, *ph2;
|
||||
char *pb0, *pb1, *pb2, *ph0= 0, *ph1= 0, *ph2= 0;
|
||||
bool bb = false, bh = false;
|
||||
Item_cond *cond_item= (Item_cond *)cond;
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
|||
|
||||
if (Srcdef) {
|
||||
if ((catp = strstr(Srcdef, "%s"))) {
|
||||
char *fil1, *fil2;
|
||||
char *fil1= 0, *fil2;
|
||||
PSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
||||
|
||||
if (!ph)
|
||||
|
|
|
@ -1873,7 +1873,7 @@ buf_flush_batch(
|
|||
|
||||
buf_pool_mutex_enter(buf_pool);
|
||||
|
||||
ulint count = 0;
|
||||
ulint count __attribute__((unused))= 0;
|
||||
|
||||
/* Note: The buffer pool mutex is released and reacquired within
|
||||
the flush functions. */
|
||||
|
|
|
@ -2046,7 +2046,7 @@ innobase_release_temporary_latches(
|
|||
DBUG_ASSERT(hton == innodb_hton_ptr);
|
||||
|
||||
if (!srv_was_started) {
|
||||
} else if (trx_t* trx = thd_to_trx(thd)) {
|
||||
} else if (trx_t* trx __attribute__((unused))= thd_to_trx(thd)) {
|
||||
trx_assert_no_search_latch(trx);
|
||||
}
|
||||
|
||||
|
@ -13107,7 +13107,7 @@ create_table_info_t::set_tablespace_type(
|
|||
int
|
||||
create_table_info_t::initialize()
|
||||
{
|
||||
trx_t* parent_trx;
|
||||
trx_t* parent_trx __attribute__((unused));
|
||||
|
||||
DBUG_ENTER("create_table_info_t::initialize");
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ ut_dbg_assertion_failed(
|
|||
|
||||
/** Debug assertion */
|
||||
#define ut_ad DBUG_ASSERT
|
||||
#ifdef UNIV_DEBUG
|
||||
#if defined(UNIV_DEBUG) || !defined(DBUG_OFF)
|
||||
/** Debug statement. Does nothing unless UNIV_DEBUG is defined. */
|
||||
#define ut_d(EXPR) EXPR
|
||||
#else
|
||||
|
|
|
@ -272,7 +272,7 @@ current phase.
|
|||
inline
|
||||
void
|
||||
ut_stage_alter_t::inc(
|
||||
ulint inc_val /* = 1 */)
|
||||
ulint inc_val __attribute__((unused)) /* = 1 */)
|
||||
{
|
||||
if (m_progress == NULL) {
|
||||
return;
|
||||
|
|
|
@ -55,7 +55,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
|
|||
uint internal_table= flags & HA_CREATE_INTERNAL_TABLE;
|
||||
ulong reclength, real_reclength,min_pack_length;
|
||||
char kfilename[FN_REFLEN], klinkname[FN_REFLEN], *klinkname_ptr;
|
||||
char dfilename[FN_REFLEN], dlinkname[FN_REFLEN], *dlinkname_ptr;
|
||||
char dfilename[FN_REFLEN], dlinkname[FN_REFLEN], *dlinkname_ptr= 0;
|
||||
ulong pack_reclength;
|
||||
ulonglong tot_length,max_rows, tmp;
|
||||
enum en_fieldtype type;
|
||||
|
|
|
@ -28,6 +28,8 @@ void _ma_ft_segiterator_init(MARIA_HA *info, uint keynr, const uchar *record,
|
|||
ftsi->num=info->s->keyinfo[keynr].keysegs;
|
||||
ftsi->seg=info->s->keyinfo[keynr].seg;
|
||||
ftsi->rec=record;
|
||||
ftsi->pos= 0; /* Avoid warnings from gcc */
|
||||
ftsi->len= 0; /* Avoid warnings from gcc */
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const uchar *record,
|
|||
ftsi->num=info->s->keyinfo[keynr].keysegs;
|
||||
ftsi->seg=info->s->keyinfo[keynr].seg;
|
||||
ftsi->rec=record;
|
||||
ftsi->pos= 0; /* Avoid warnings from gcc */
|
||||
ftsi->len= 0; /* Avoid warnings from gcc */
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
uint internal_table= flags & HA_CREATE_INTERNAL_TABLE;
|
||||
ulong reclength, real_reclength,min_pack_length;
|
||||
char kfilename[FN_REFLEN],klinkname[FN_REFLEN], *klinkname_ptr;
|
||||
char dfilename[FN_REFLEN],dlinkname[FN_REFLEN], *dlinkname_ptr;
|
||||
char dfilename[FN_REFLEN],dlinkname[FN_REFLEN], *dlinkname_ptr= 0;
|
||||
ulong pack_reclength;
|
||||
ulonglong tot_length,max_rows, tmp;
|
||||
enum en_fieldtype type;
|
||||
|
|
|
@ -8,7 +8,7 @@ then
|
|||
echo sql mysys strings client storage dbug libmysql sql-common \
|
||||
extra mysys_ssl strings regex pcre vio include \
|
||||
tools unittest plugin libmysqld | \
|
||||
xargs -n1 git ls-files | grep -v '\.jar$' | \
|
||||
xargs -n1 git ls-files | grep -v '\.jar$' | grep -v '\xz$' |
|
||||
xargs etags -o TAGS --append
|
||||
else
|
||||
find . -type f ! -name "*.jar" |
|
||||
|
|
Loading…
Add table
Reference in a new issue