Merge with 5.1

Fixed valgrind warnings found from running main.connect under valgrind


sql/sp_head.cc:
  Ensure that vcol_info is reset
sql/sql_acl.cc:
  Fixed usage of wrong memroot for password
sql/sql_yacc.yy:
  Ensure that vcol_info is reset
This commit is contained in:
Michael Widenius 2010-04-01 12:04:26 +03:00
commit 1aafea91e5
60 changed files with 546 additions and 377 deletions

View file

@ -9,6 +9,6 @@ PATH=$PATH:/usr/ccs/bin:/usr/local/bin
path=`dirname $0`
. "$path/autorun.sh"
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
make -j 4

View file

@ -95,10 +95,9 @@ static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
char *
fn_tilde_expand(const char *txt)
{
struct passwd pwres, *pass;
struct passwd *pass;
char *temp;
size_t len = 0;
char pwbuf[1024];
if (txt[0] != '~')
return (strdup(txt));

View file

@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
case 'u':
case 'x':
case 's':
chksum= my_checksum(chksum, start, (uint) (p + 1 - start));
chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start));
start= 0; /* Not in format specifier anymore */
break;

View file

@ -144,7 +144,7 @@ kq_init(struct event_base *base)
*/
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
kqueueop->events[0].ident != -1 ||
((int) kqueueop->events[0].ident) != -1 ||
kqueueop->events[0].flags != EV_ERROR) {
event_warn("%s: detected broken kqueue; not using.", __func__);
free(kqueueop->changes);

View file

@ -96,7 +96,7 @@ void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate,
struct st_plugin_vio_info;
void mpvio_info(Vio *vio, struct st_plugin_vio_info *info);
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
char *data_plugin, const char *db);
const char *data_plugin, const char *db);
int mysql_client_plugin_init();
void mysql_client_plugin_deinit();
struct st_mysql_client_plugin;

View file

@ -157,3 +157,4 @@ INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t1;
--sync_slave_with_master

View file

@ -2,7 +2,7 @@
[mysqld]
open-files-limit= 1024
local-infile
default-character-set= latin1
character-set-server= latin1
# Increase default connect_timeout to avoid intermittent
# disconnects when test servers are put under load see BUG#28359

View file

@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, handle_signal);
signal(SIGABRT, handle_abort);
sprintf(safe_process_name, "safe_process[%d]", own_pid);
sprintf(safe_process_name, "safe_process[%d]", (int) own_pid);
message("Started");

View file

@ -681,6 +681,8 @@ sub optimize_cases {
if ( $default_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $default_engine =~ /^innodb/i );
$tinfo->{'pbxt_test'}= 1
if ( $default_engine =~ /^pbxt/i );
}
}
@ -778,6 +780,8 @@ sub collect_one_test_case {
my $disabled= shift;
my $suite_opts= shift;
my $local_default_storage_engine= $default_storage_engine;
#print "collect_one_test_case\n";
#print " suitedir: $suitedir\n";
#print " testdir: $testdir\n";
@ -932,15 +936,26 @@ sub collect_one_test_case {
tags_from_test_file($tinfo,"$testdir/${tname}.test");
if ( defined $default_storage_engine )
# Get default storage engine from suite.opt file
if (defined $suite_opts &&
"@$suite_opts" =~ "default-storage-engine=\s*([^\s]*)")
{
$local_default_storage_engine= $1;
}
if ( defined $local_default_storage_engine )
{
# Different default engine is used
# tag test to require that engine
$tinfo->{'ndb_test'}= 1
if ( $default_storage_engine =~ /^ndb/i );
if ( $local_default_storage_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $default_storage_engine =~ /^innodb/i );
if ( $local_default_storage_engine =~ /^innodb/i );
$tinfo->{'pbxt_test'}= 1
if ( $local_default_storage_engine =~ /^pbxt/i );
}
@ -1103,6 +1118,28 @@ sub collect_one_test_case {
$tinfo->{template_path}= $config;
}
if ( $tinfo->{'pbxt_test'} )
{
# This is a test that needs pbxt
if ( $::mysqld_variables{'pbxt'} eq "OFF" ||
! exists $::mysqld_variables{'pbxt'} )
{
# Engine is not supported, skip it
$tinfo->{'skip'}= 1;
return $tinfo;
}
}
else
{
# Only disable engine if it's on by default (to avoid warnings about
# not existing loose options
if ( $::mysqld_variables{'pbxt'} eq "ON")
{
push(@{$tinfo->{'master_opt'}}, "--loose-skip-pbxt");
push(@{$tinfo->{'slave_opt'}}, "--loose-skip-pbxt");
}
}
if ( $tinfo->{'example_plugin_test'} )
{
if ( !$ENV{'EXAMPLE_PLUGIN'} )
@ -1156,6 +1193,7 @@ my @tags=
["include/have_log_bin.inc", "need_binlog", 1],
["include/have_innodb.inc", "innodb_test", 1],
["include/have_pbxt.inc", "pbxt_test", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],

View file

@ -3965,7 +3965,7 @@ sub mysqld_arguments ($$$$) {
}
}
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
mtr_add_arg($args, "%s--character-set-server-set=latin1", $prefix);
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);

View file

@ -1,6 +1,7 @@
--source include/have_partition.inc
--source include/have_innodb.inc
--source include/master-slave.inc
--source include/big_test.inc
--vertical_results

View file

@ -0,0 +1,18 @@
drop table if exists t1, t2;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
BEGIN;
SELECT @@log_bin;
@@log_bin
0
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2);
COMMIT;
select * from t1;
a
1
select * from t2;
b
2
drop table t1, t2;
drop database pbxt;

View file

@ -0,0 +1,23 @@
-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
#
# bug lp:544173, xa crash with two 2pc-capable storage engines without binlog
#
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
BEGIN;
# verify that binlog is off
SELECT @@log_bin;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2);
COMMIT;
select * from t1;
select * from t2;
drop table t1, t2;
drop database pbxt;

View file

@ -0,0 +1 @@
--default-storage-engine=pbxt

View file

@ -165,10 +165,9 @@ USE test;
DROP FUNCTION bug42217_db.upgrade_del_func;
DROP FUNCTION bug42217_db.upgrade_alter_func;
DROP DATABASE bug42217_db;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
stop slave;
DROP USER 'create_rout_db'@'localhost';
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
USE mtr;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
######## BUG#49119 #######
### i) test case from the 'how to repeat section'
stop slave;

View file

@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop tables if exists t1;
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

View file

@ -209,12 +209,18 @@ USE test;
DROP FUNCTION bug42217_db.upgrade_del_func;
DROP FUNCTION bug42217_db.upgrade_alter_func;
DROP DATABASE bug42217_db;
DROP USER 'create_rout_db'@'localhost';
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
sync_slave_with_master;
# Drop the user that was already dropped on the slave
connection slave;
USE mtr;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
--disable_warnings
stop slave;
connection master;
DROP USER 'create_rout_db'@'localhost';
--enable_warnings
# BUG#49119: Master crashes when executing 'REVOKE ... ON
# {PROCEDURE|FUNCTION} FROM ...'

View file

@ -45,3 +45,4 @@ select * from t1 order by id;
connection master;
drop table t1;
drop procedure test_procedure;
--sync_slave_with_master

View file

@ -15,6 +15,10 @@
-- source include/not_staging.inc
-- source include/master-slave.inc
--disable_warnings
drop tables if exists t1;
--enable_warnings
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
create table t1 (a int not null auto_increment primary key, b int, key(b));
@ -51,10 +55,9 @@ sync_with_master; # won't work if slave SQL thread stopped
connection master; # cleanup
drop table t1;
connection slave;
sync_with_master;
sync_slave_with_master;
# If the machine is so fast that slave syncs before OPTIMIZE
# starts, this test wil demonstrate nothing but will pass.
# starts, this test will demonstrate nothing but will pass.
# End of 4.1 tests

View file

@ -53,6 +53,7 @@ UPDATE t1 SET a=99 WHERE a = 0;
SHOW BINLOG EVENTS;
DROP TABLE t1;
--sync_slave_with_master
# BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
# slave

View file

@ -149,6 +149,8 @@ DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
--enable_warnings
sync_slave_with_master;
diff_files $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql;
# End of 5.0 test case

View file

@ -1 +1 @@
--default-character-set=utf8 --skip-character-set-client-handshake
--character-set-server=utf8 --skip-character-set-client-handshake

View file

@ -1 +1 @@
--default-character-set=latin1 --default-collation=latin1_german2_ci
--character-set-server=latin1 --default-collation=latin1_german2_ci

View file

@ -1 +1 @@
--default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
--default-collation=ucs2_unicode_ci --character-set-server=ucs2,latin1

View file

@ -3924,6 +3924,12 @@ restart:
uint next_status;
uint hash_requests;
LINT_INIT(next_hash_link);
LINT_INIT(next_diskpos);
LINT_INIT(next_file);
LINT_INIT(next_status);
LINT_INIT(hash_requests);
total_found++;
found++;
KEYCACHE_DBUG_ASSERT(found <= keycache->blocks_used);

View file

@ -91,9 +91,12 @@ extern pthread_mutex_t LOCK_gethostbyname_r;
is finished with the structure.
*/
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop)
struct hostent *
my_gethostbyname_r(const char *name,
struct hostent *result __attribute__((unused)),
char *buffer __attribute__((unused)),
int buflen__attribute__((unused)),
int *h_errnop)
{
struct hostent *hp;
pthread_mutex_lock(&LOCK_gethostbyname_r);

View file

@ -2394,7 +2394,7 @@ static void client_mpvio_info(MYSQL_PLUGIN_VIO *vio,
*/
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
char *data_plugin, const char *db)
const char *data_plugin, const char *db)
{
const char *auth_plugin_name;
auth_plugin_t *auth_plugin;
@ -2540,7 +2540,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
char buff[NAME_LEN+USERNAME_LENGTH+100];
int scramble_data_len, pkt_scramble_len;
char *end, *host_info=0, *server_version_end, *pkt_end;
char *scramble_data, *scramble_plugin;
char *scramble_data;
const char *scramble_plugin;
my_socket sock;
in_addr_t ip_addr;
struct sockaddr_in sock_addr;

View file

@ -4252,7 +4252,7 @@ int handler::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
*/
int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p)
{
int result;
int result= 0;
DBUG_ENTER("handler::read_multi_range_next");
/* We should not be called after the last call returned EOF. */

View file

@ -7040,7 +7040,7 @@ bool Item_cache_int::cache_value()
}
void Item_cache_int::store(Item *item, longlong val_arg)
void Item_cache_int::store_longlong(Item *item, longlong val_arg)
{
/* An explicit values is given, save it. */
value_cached= TRUE;

View file

@ -1132,7 +1132,8 @@ class Field_enumerator
{
public:
virtual void visit_field(Field *field)= 0;
virtual ~Field_enumerator() {}; /* purecov: inspected */
virtual ~Field_enumerator() {}; /* purecov: inspected */
Field_enumerator() {} /* Remove gcc warning */
};
@ -3148,7 +3149,7 @@ public:
Item_cache_int(enum_field_types field_type_arg):
Item_cache(field_type_arg), value(0) {}
void store(Item *item, longlong val_arg);
void store_longlong(Item *item, longlong val_arg);
double val_real();
longlong val_int();
String* val_str(String *str);

View file

@ -879,7 +879,7 @@ get_time_value(THD *thd, Item ***item_arg, Item **cache_arg,
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
cache->set_used_tables(1);
cache->store(item, value);
cache->store_longlong(item, value);
*cache_arg= cache;
*item_arg= cache_arg;
}
@ -917,13 +917,13 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
cache->set_used_tables(1);
if (!(*a)->is_datetime())
{
cache->store((*a), const_value);
cache->store_longlong((*a), const_value);
a_cache= cache;
a= (Item **)&a_cache;
}
else
{
cache->store((*b), const_value);
cache->store_longlong((*b), const_value);
b_cache= cache;
b= (Item **)&b_cache;
}
@ -1145,7 +1145,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
/* Mark the cache as non-const to prevent re-caching. */
cache->set_used_tables(1);
cache->store(item, value);
cache->store_longlong(item, value);
*cache_arg= cache;
*item_arg= cache_arg;
}

File diff suppressed because it is too large Load diff

View file

@ -91,8 +91,9 @@ public:
@param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call
*/
virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name,
bool use_explicit_name, List<Item> *item_list) = 0;
virtual Item *create_with_db(THD *thd, LEX_STRING db, LEX_STRING name,
bool use_explicit_name,
List<Item> *item_list) = 0;
protected:
/** Constructor. */

View file

@ -642,7 +642,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
default:
DBUG_ASSERT(0);
};
setup(args[0], NULL);
setup_item(args[0], NULL);
/* MIN/MAX can return NULL for empty set indepedent of the used column */
maybe_null= 1;
unsigned_flag=item->unsigned_flag;
@ -676,7 +676,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
of the original MIN/MAX object and it is saved in this object's cache.
*/
void Item_sum_hybrid::setup(Item *item, Item *value_arg)
void Item_sum_hybrid::setup_item(Item *item, Item *value_arg)
{
value= Item_cache::get_cache(item);
value->setup(item);
@ -1646,7 +1646,7 @@ void Item_sum_hybrid::no_rows_in_result()
Item *Item_sum_min::copy_or_same(THD* thd)
{
Item_sum_min *item= new (thd->mem_root) Item_sum_min(thd, this);
item->setup(args[0], value);
item->setup_item(args[0], value);
return item;
}
@ -1669,7 +1669,7 @@ bool Item_sum_min::add()
Item *Item_sum_max::copy_or_same(THD* thd)
{
Item_sum_max *item= new (thd->mem_root) Item_sum_max(thd, this);
item->setup(args[0], value);
item->setup_item(args[0], value);
return item;
}

View file

@ -870,7 +870,7 @@ protected:
was_values(item->was_values)
{ }
bool fix_fields(THD *, Item **);
void setup(Item *item, Item *value_arg);
void setup_item(Item *item, Item *value_arg);
void clear();
double val_real();
longlong val_int();

View file

@ -5424,7 +5424,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
pg->state=POOL;
pthread_mutex_init(&pg->lock, MY_MUTEX_INIT_FAST);
pthread_cond_init (&pg->cond, 0);
pg->start=(my_xid *)(data + i*tc_log_page_size);
pg->ptr= pg->start=(my_xid *)(data + i*tc_log_page_size);
pg->size=pg->free=tc_log_page_size/sizeof(my_xid);
pg->end=pg->start + pg->size;
}
@ -5659,7 +5659,15 @@ int TC_LOG_MMAP::sync()
/* marking 'syncing' slot free */
pthread_mutex_lock(&LOCK_sync);
syncing=0;
pthread_cond_signal(&active->cond); // wake up a new syncer
/*
we check the "active" pointer without LOCK_active. Still, it's safe -
"active" can change from NULL to not NULL any time, but it
will take LOCK_sync before waiting on active->cond. That is, it can never
miss a signal.
And "active" can change to NULL only after LOCK_sync, so this is safe too.
*/
if (active)
pthread_cond_signal(&active->cond); // wake up a new syncer
pthread_mutex_unlock(&LOCK_sync);
return err;
}

View file

@ -8371,6 +8371,8 @@ mysqld_get_one_option(int optid,
case (int) OPT_INIT_RPL_ROLE:
{
int role;
LINT_INIT(role);
if (!find_opt_type(argument, &rpl_role_typelib, opt->name, &role))
{
rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
@ -8427,6 +8429,8 @@ mysqld_get_one_option(int optid,
case OPT_BINLOG_FORMAT:
{
int id;
LINT_INIT(id);
if (!find_opt_type(argument, &binlog_format_typelib, opt->name, &id))
{
global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
@ -8677,6 +8681,8 @@ mysqld_get_one_option(int optid,
else
{
int type;
LINT_INIT(type);
if (!find_opt_type(argument, &delay_key_write_typelib, opt->name, &type))
delay_key_write_options= (uint) type-1;
}
@ -8688,6 +8694,8 @@ mysqld_get_one_option(int optid,
case OPT_TX_ISOLATION:
{
int type;
LINT_INIT(type);
if (!find_opt_type(argument, &tx_isolation_typelib, opt->name, &type))
global_system_variables.tx_isolation= (type-1);
break;
@ -8775,6 +8783,7 @@ mysqld_get_one_option(int optid,
ulong method_conv;
int method;
LINT_INIT(method_conv);
LINT_INIT(method);
myisam_stats_method_str= argument;
if (!find_opt_type(argument, &myisam_stats_method_typelib,
@ -8837,6 +8846,7 @@ mysqld_get_one_option(int optid,
case OPT_THREAD_HANDLING:
{
int id;
LINT_INIT(id);
if (!find_opt_type(argument, &thread_handling_typelib, opt->name, &id))
global_system_variables.thread_handling= id - 1;
opt_thread_handling= thread_handling_typelib.type_names[global_system_variables.thread_handling];

View file

@ -279,7 +279,7 @@ static int net_data_is_ready(my_socket sd)
@param clear_buffer if <> 0, then clear all data from comm buff
*/
void net_clear(NET *net, my_bool clear_buffer)
void net_clear(NET *net, my_bool clear_buffer __attribute__((unused)))
{
#if !defined(EMBEDDED_LIBRARY) && defined(DBUG_OFF)
size_t count;

View file

@ -1266,16 +1266,16 @@ uchar *sys_var_set::value_ptr(THD *thd, enum_var_type type,
void sys_var_set_slave_mode::set_default(THD *thd, enum_var_type type)
{
slave_exec_mode_options= 0;
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
slave_exec_mode_options= (ULL(1) << SLAVE_EXEC_MODE_STRICT);
}
bool sys_var_set_slave_mode::check(THD *thd, set_var *var)
{
bool rc= sys_var_set::check(thd, var);
if (!rc &&
bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_STRICT) == 1 &&
bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
test_all_bits(var->save_result.ulong_value,
((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
{
rc= true;
my_error(ER_SLAVE_AMBIGOUS_EXEC_MODE, MYF(0), "");
@ -1297,15 +1297,16 @@ void fix_slave_exec_mode(enum_var_type type)
DBUG_ENTER("fix_slave_exec_mode");
compile_time_assert(sizeof(slave_exec_mode_options) * CHAR_BIT
> SLAVE_EXEC_MODE_LAST_BIT - 1);
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
if (test_all_bits(slave_exec_mode_options,
((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
{
sql_print_error("Ambiguous slave modes combination."
" STRICT will be used");
bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT);
slave_exec_mode_options&= ~(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT);
}
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0)
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
if (!(slave_exec_mode_options & (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT)))
slave_exec_mode_options|= (ULL(1)<< SLAVE_EXEC_MODE_STRICT);
DBUG_VOID_RETURN;
}

View file

@ -2089,6 +2089,8 @@ sp_head::reset_lex(THD *thd)
sublex->dec= NULL;
sublex->interval_list.empty();
sublex->type= 0;
sublex->uint_geom_type= 0;
sublex->vcol_info= 0;
DBUG_RETURN(FALSE);
}

View file

@ -536,6 +536,9 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
while (!(read_record_info.read_record(&read_record_info)))
{
ACL_USER user;
char *password;
uint password_len;
bzero(&user, sizeof(user));
update_hostname(&user.host, get_field(&mem, table->field[0]));
user.user= get_field(&mem, table->field[1]);
@ -548,8 +551,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
continue;
}
char *password= get_field(thd->mem_root, table->field[2]);
uint password_len= password ? strlen(password) : 0;
password= get_field(&mem, table->field[2]);
password_len= password ? strlen(password) : 0;
user.auth_string.str= password ? password : const_cast<char*>("");
user.auth_string.length= password_len;
set_user_salt(&user, password, password_len);
@ -7826,15 +7829,15 @@ static int do_auth_once(THD *thd, LEX_STRING *auth_plugin_name,
bool unlock_plugin= false;
plugin_ref plugin;
#ifdef EMBEDDED_LIBRARY
plugin= native_password_plugin;
#else
if (auth_plugin_name->str == native_password_plugin_name.str)
plugin= native_password_plugin;
else
#ifndef EMBEDDED_LIBRARY
if (auth_plugin_name->str == old_password_plugin_name.str)
else if (auth_plugin_name->str == old_password_plugin_name.str)
plugin= old_password_plugin;
else
if ((plugin= my_plugin_lock_by_name(thd, auth_plugin_name,
MYSQL_AUTHENTICATION_PLUGIN)))
else if ((plugin= my_plugin_lock_by_name(thd, auth_plugin_name,
MYSQL_AUTHENTICATION_PLUGIN)))
unlock_plugin= true;
#endif

View file

@ -63,6 +63,7 @@ public:
bool report_error(THD *thd);
bool is_invalidated() const { return m_invalidated; }
void reset_reprepare_observer() { m_invalidated= FALSE; }
Reprepare_observer() {} /* Remove gcc warning */
private:
bool m_invalidated;
};
@ -1117,6 +1118,7 @@ public:
/* Ignore error */
return TRUE;
}
Dummy_error_handler() {} /* Remove gcc warning */
};

View file

@ -5704,6 +5704,10 @@ compare_tables(TABLE *table,
*/
Alter_info tmp_alter_info(*alter_info, thd->mem_root);
uint db_options= 0; /* not used */
/* Set default value for return value (to ensure it's always set) */
*need_copy_table= ALTER_TABLE_DATA_CHANGED;
/* Create the prepared information. */
if (mysql_prepare_create_table(thd, create_info,
&tmp_alter_info,
@ -5762,7 +5766,6 @@ compare_tables(TABLE *table,
(table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
{
DBUG_PRINT("info", ("Basic checks -> ALTER_TABLE_DATA_CHANGED"));
*need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
@ -5792,7 +5795,6 @@ compare_tables(TABLE *table,
{
DBUG_PRINT("info", ("NULL behaviour difference in field '%s' -> "
"ALTER_TABLE_DATA_CHANGED", new_field->field_name));
*need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
@ -5828,7 +5830,6 @@ compare_tables(TABLE *table,
{
DBUG_PRINT("info", ("!field_is_equal('%s') -> ALTER_TABLE_DATA_CHANGED",
new_field->field_name));
*need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}
// Clear indexed marker
@ -5963,7 +5964,6 @@ compare_tables(TABLE *table,
{
DBUG_PRINT("info", ("check_if_incompatible_data() -> "
"ALTER_TABLE_DATA_CHANGED"));
*need_copy_table= ALTER_TABLE_DATA_CHANGED;
DBUG_RETURN(0);
}

View file

@ -1034,10 +1034,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
bool parse_status;
bool result, view_is_mergeable;
TABLE_LIST *UNINIT_VAR(view_main_select_tables);
DBUG_ENTER("mysql_make_view");
DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name));
LINT_INIT(parse_status);
LINT_INIT(view_select);
if (table->view)
{
/*

View file

@ -2342,6 +2342,7 @@ sp_init_param:
lex->interval_list.empty();
lex->uint_geom_type= 0;
lex->vcol_info= 0;
}
;
@ -8190,7 +8191,7 @@ function_call_generic:
builder= find_qualified_function_builder(thd);
DBUG_ASSERT(builder);
item= builder->create(thd, $1, $3, true, $5);
item= builder->create_with_db(thd, $1, $3, true, $5);
if (! ($$= item))
{

View file

@ -155,7 +155,8 @@ public:
/** @brief
This method will never be called if you do not implement indexes.
*/
virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; }
virtual double read_time(uint index, uint ranges, ha_rows rows)
{ return (double) rows / 20.0+1; }
/*
Everything below are methods that we implement in ha_example.cc.

View file

@ -1274,6 +1274,8 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file,
for (file= from_file; file <= to_file; file++)
{
LOGHANDLER_FILE_INFO info;
LINT_INIT(info.max_lsn);
File fd= open_logfile_by_number_no_cache(file);
LINT_INIT_STRUCT(info);
if ((fd < 0) ||
@ -3968,6 +3970,7 @@ my_bool translog_init_with_table(const char *directory,
{
LOGHANDLER_FILE_INFO info;
LINT_INIT_STRUCT(info);
/*
Accessing &log_descriptor.open_files without mutex is safe
because it is initialization

View file

@ -76,8 +76,8 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
bmove512(info->keyread_buff, page_buff, info->s->block_size);
/* Save position for a possible read next / previous */
info->int_keypos= info->keyread_buff + (ulonglong) info->int_keypos;
info->int_maxpos= info->keyread_buff + (ulonglong) info->int_maxpos;
info->int_keypos= info->keyread_buff + info->keypos_offset;
info->int_maxpos= info->keyread_buff + info->maxpos_offset;
info->int_keytree_version= key->keyinfo->version;
info->last_search_keypage= info->last_keypage;
info->page_changed= 0;
@ -214,8 +214,8 @@ static int _ma_search_no_save(register MARIA_HA *info, MARIA_KEY *key,
info->cur_row.trid= _ma_trid_from_key(&info->last_key);
/* Store offset to key */
info->int_keypos= (uchar*) (keypos - page.buff);
info->int_maxpos= (uchar*) (maxpos - page.buff);
info->keypos_offset= (uint) (keypos - page.buff);
info->maxpos_offset= (uint) (maxpos - page.buff);
info->int_nod_flag= nod_flag;
info->last_keypage= pos;
*res_page_link= page_link;

View file

@ -506,8 +506,10 @@ struct st_maria_handler
uchar *first_mbr_key; /* Searhed spatial key */
uchar *rec_buff; /* Temp buffer for recordpack */
uchar *blob_buff; /* Temp buffer for blobs */
uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
uchar *int_keypos; /* Save position for next/previous */
uchar *int_maxpos; /* -""- */
uint keypos_offset; /* Tmp storage for offset int_keypos */
uint maxpos_offset; /* Tmp storage for offset int_maxpos */
uchar *update_field_data; /* Used by update in rows-in-block */
uint int_nod_flag; /* -""- */
uint32 int_keytree_version; /* -""- */

View file

@ -44,9 +44,10 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
static int ft_add_stopword(const char *w)
{
FT_STOPWORD sw;
return !w ||
(((sw.len= (uint) strlen(sw.pos=(const uchar *)w)) >= ft_min_word_len) &&
(tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL));
return (!w ||
(((sw.len= (uint) strlen((char*) (sw.pos=(const uchar *)w))) >=
ft_min_word_len) &&
(tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)));
}
int ft_init_stopwords()

View file

@ -382,7 +382,7 @@ static MI_INFO *myisammrg_attach_children_callback(void *callback_param)
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
}
DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx my_errno: %d",
my_errno ? NULL : (long) myisam, my_errno));
my_errno ? 0L : (long) myisam, my_errno));
err:
DBUG_RETURN(my_errno ? NULL : myisam);

View file

@ -239,6 +239,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
rc= 1;
errpos= 0;
bzero((char*) &file_cache, sizeof(file_cache));
LINT_INIT(m_info);
/* Open MERGE meta file. */
if ((fd= my_open(fn_format(parent_name_buff, parent_name, "", MYRG_NAME_EXT,

View file

@ -517,7 +517,7 @@ UNIV_INLINE
rec_t*
page_rec_get_next(
/*==============*/
rec_t* rec); /*!< in: pointer to record */
const rec_t* rec); /*!< in: pointer to record */
/************************************************************//**
Gets the pointer to the next record on the page.
@return pointer to next record */

View file

@ -731,7 +731,7 @@ UNIV_INLINE
rec_t*
page_rec_get_next(
/*==============*/
rec_t* rec) /*!< in: pointer to record */
const rec_t* rec) /*!< in: pointer to record */
{
return((rec_t*) page_rec_get_next_low(rec, page_rec_is_comp(rec)));
}

View file

@ -158,7 +158,7 @@ Inserts a NODE2 after NODE1 in a list.
/** Invalidate the pointers in a list node.
@param NAME list name
@param N pointer to the node that was removed */
# define UT_LIST_REMOVE_CLEAR(NAME, N) while (0)
# define UT_LIST_REMOVE_CLEAR(NAME, N) {} while (0)
#endif
/*******************************************************************//**

View file

@ -203,7 +203,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
my_bool t_is_prefix)
{
int s_res,t_res;
my_wc_t UNINIT_VAR(s_wc),t_wc;
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;
MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;
@ -317,7 +317,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
const char *s, const char *t, size_t len)
{
int s_res,t_res;
my_wc_t UNINIT_VAR(s_wc),t_wc;
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const char *se=s+len;
const char *te=t+len;
MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;
@ -1384,7 +1384,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
my_bool t_is_prefix)
{
int s_res,t_res;
my_wc_t UNINIT_VAR(s_wc),t_wc;
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;

View file

@ -2308,7 +2308,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
my_bool t_is_prefix)
{
int s_res,t_res;
my_wc_t UNINIT_VAR(s_wc), t_wc;
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;
MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;
@ -2378,7 +2378,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs,
my_bool diff_if_only_endspace_difference)
{
int s_res, t_res, res;
my_wc_t UNINIT_VAR(s_wc),t_wc;
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se= s+slen, *te= t+tlen;
MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;

View file

@ -400,16 +400,18 @@ start:
case 's':
{
char *par= args_arr[print_arr[i].arg_idx].str_arg;
width= (print_arr[i].flags & WIDTH_ARG) ?
args_arr[print_arr[i].width].longlong_arg : print_arr[i].width;
width= ((print_arr[i].flags & WIDTH_ARG) ?
(uint) args_arr[print_arr[i].width].longlong_arg :
(uint) print_arr[i].width);
to= process_str_arg(cs, to, end, width, par, print_arr[i].flags);
break;
}
case 'b':
{
char *par = args_arr[print_arr[i].arg_idx].str_arg;
width= (print_arr[i].flags & WIDTH_ARG) ?
args_arr[print_arr[i].width].longlong_arg : print_arr[i].width;
width= ((print_arr[i].flags & WIDTH_ARG) ?
(uint) args_arr[print_arr[i].width].longlong_arg :
(uint) print_arr[i].width);
to= process_bin_arg(to, end, width, par);
break;
}
@ -428,8 +430,9 @@ start:
{
/* Integer parameter */
longlong larg;
length= (print_arr[i].flags & LENGTH_ARG) ?
args_arr[print_arr[i].length].longlong_arg : print_arr[i].length;
length= ((print_arr[i].flags & LENGTH_ARG) ?
args_arr[print_arr[i].length].longlong_arg :
(longlong) print_arr[i].length);
if (args_arr[print_arr[i].arg_idx].have_longlong)
larg = args_arr[print_arr[i].arg_idx].longlong_arg;

View file

@ -39,6 +39,7 @@ sync/sync0rw\.c: unused parameter
sync/sync0sync\.c: unused parameter
sync/sync0sync\.c: unused variable
ut/ut0ut\.c: ignoring return value of
srv/srv0srv\.c: value computed is not used
#
# bdb is not critical to keep up to date
@ -53,6 +54,12 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
# readline is not maintained by us
#
.*/cmd-line-utils/readline/.* : .*
readline\.c : unused parameter
term\.c : unused parameter
vi\.c : unused parameter
common\.c : unused parameter
term\.c : *.*
#
# Ignore some warnings in libevent, which is not maintained by us.
@ -65,6 +72,16 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
#
/usr/share/aclocal/audiofile.m4 : .*
#
# Ignore strict-aliasing warnings (for now)
#
.*: break strict-aliasing rules
#
# Ignore not important declaration warnings
#
.*: only defines private constructors and has no friends
#
# Ignore all conversion warnings on windows 64
# (Is safe as we are not yet supporting strings >= 2G)
@ -99,6 +116,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
#
storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
#
# Pbxt
#
xaction_xt\.cc: may be used uninitialized in this function
#
# I think these are due to mix of C and C++.
#
@ -112,6 +134,7 @@ include/runtime.hpp: .*pure_error.*
.*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds
.*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value
.*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function
mySTL/algorithm\.hpp: is used uninitialized in this function
#
# Groff warnings on OpenSUSE.
@ -123,18 +146,18 @@ include/runtime.hpp: .*pure_error.*
#
listener.cc : .*conversion from 'SOCKET' to 'int'.*
net_serv.cc : .*conversion from 'SOCKET' to 'int'.*
set_var.cc: right-hand operand of comma has no effect : 1000-1400
# allow a little moving space for the warning below
mi_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
ma_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650
mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650
#
# Wrong compiler warnings
#
.* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.*
ctype-simple.c : .*unary minus operator applied to unsigned type, result still unsigned.*
ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.*
# Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478
regexec\.c : .*passing argument 3 of.*matcher.* discards qualifiers from pointer target type.*
regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type
libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000
storage/xtradb/dict/dict0dict\.c: passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500

View file

@ -258,7 +258,7 @@ void do_tests()
#define test_kill_strategy(X) \
diag("kill strategy: " #X); \
DBUG_EXECUTE("reset_file", \
{ rewind(DBUG_FILE); (void) ftruncate(fileno(DBUG_FILE), 0); }); \
{ rewind(DBUG_FILE); my_chsize(fileno(DBUG_FILE), 0, 0, MYF(MY_WME)); }); \
DBUG_PRINT("info", ("kill strategy: " #X)); \
kill_strategy=X; \
do_one_test();