Commit b96142c2 authored by Anurag Shekhar's avatar Anurag Shekhar

merging with latest changes in bugteam.

parents 05bf2eba 7079338e
......@@ -558,12 +558,6 @@ int __void__;
#define LINT_INIT(var)
#endif
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify)
#define PURIFY_OR_LINT_INIT(var) var=0
#else
#define PURIFY_OR_LINT_INIT(var)
#endif
/*
Suppress uninitialized variable warning without generating code.
......
......@@ -180,8 +180,6 @@ NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFOR
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
DROP DATABASE mysqltest_db1;
Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
......
......@@ -32,6 +32,21 @@ include/start_slave.inc
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
Slave_IO_Running = No (expect No)
SELECT "Got a packet bigger than 'max_allowed_packet' bytes" AS Last_IO_Error;
Last_IO_Error
Got a packet bigger than 'max_allowed_packet' bytes
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
Slave_IO_Running = No (expect No)
SELECT "Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'" AS Last_IO_Error;
Last_IO_Error
Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'
==== clean up ====
DROP TABLE t1;
SET @@global.max_allowed_packet= 1024;
......
......@@ -5,6 +5,7 @@
# max-out size db name
source include/master-slave.inc;
source include/have_binlog_format_row.inc;
let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
disable_warnings;
......@@ -86,6 +87,35 @@ connection slave;
--source include/wait_for_slave_io_to_stop.inc
let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
--echo Slave_IO_Running = $slave_io_running (expect No)
#
# Bug#42914: The slave I/O thread must stop after trying to read the above
# event, However there is no Last_IO_Error report.
#
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
eval SELECT "$last_io_error" AS Last_IO_Error;
#
# Bug#42914: On the master, if a binary log event is larger than
# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
# is sent to a slave when it requests a dump from the master, thus leading the
# I/O thread to stop. However, there is no Last_IO_Error reported.
#
source include/master-slave-reset.inc;
connection master;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
sync_slave_with_master;
connection master;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
connection slave;
# The slave I/O thread must stop after receiving
# ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
--source include/wait_for_slave_io_to_stop.inc
let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
--echo Slave_IO_Running = $slave_io_running (expect No)
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
eval SELECT "$last_io_error" AS Last_IO_Error;
--echo ==== clean up ====
connection master;
......
......@@ -12,11 +12,11 @@ let $MYSQLD_DATADIR= `select @@datadir`;
drop table if exists t1;
create table t1 (a int) engine=myisam;
--remove_file $MYSQLD_DATADIR/test/t1.MYI
--error 1051,6
--error ER_BAD_TABLE_ERROR,6
drop table t1;
create table t1 (a int) engine=myisam;
--remove_file $MYSQLD_DATADIR/test/t1.MYD
--error 1105,6,29
--error ER_BAD_TABLE_ERROR,6,29
drop table t1;
--error 1051
--error ER_BAD_TABLE_ERROR
drop table t1;
......@@ -332,13 +332,8 @@ my_bool my_hash_insert(HASH *info, const uchar *record)
{
int flag;
size_t idx,halfbuff,hash_nr,first_index;
uchar *ptr_to_rec,*ptr_to_rec2;
HASH_LINK *data,*empty,*gpos,*gpos2,*pos;
LINT_INIT(gpos);
LINT_INIT(gpos2);
LINT_INIT(ptr_to_rec);
LINT_INIT(ptr_to_rec2);
uchar *UNINIT_VAR(ptr_to_rec),*UNINIT_VAR(ptr_to_rec2);
HASH_LINK *data,*empty,*UNINIT_VAR(gpos),*UNINIT_VAR(gpos2),*pos;
if (HASH_UNIQUE & info->flags)
{
......
......@@ -121,7 +121,7 @@ uchar* my_large_malloc_int(size_t size, myf my_flags)
DBUG_ENTER("my_large_malloc_int");
/* Align block size to my_large_page_size */
size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size;
size= MY_ALIGN(size, (size_t) my_large_page_size);
shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0)
......
......@@ -165,7 +165,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
uint add_hours= 0, start_loop;
ulong not_zero_date, allow_space;
my_bool is_internal_format;
const char *pos, *last_field_pos;
const char *pos, *UNINIT_VAR(last_field_pos);
const char *end=str+length;
const uchar *format_position;
my_bool found_delimitier= 0, found_space= 0;
......@@ -174,7 +174,6 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
DBUG_PRINT("ENTER",("str: %.*s",length,str));
LINT_INIT(field_length);
LINT_INIT(last_field_pos);
*was_cut= 0;
......
......@@ -435,8 +435,7 @@ bool Item_func::eq(const Item *item, bool binary_cmp) const
Field *Item_func::tmp_table_field(TABLE *table)
{
Field *field;
LINT_INIT(field);
Field *field= NULL;
switch (result_type()) {
case INT_RESULT:
......@@ -4236,9 +4235,8 @@ void Item_func_set_user_var::save_item_result(Item *item)
bool
Item_func_set_user_var::update()
{
bool res;
bool res= NULL;
DBUG_ENTER("Item_func_set_user_var::update");
LINT_INIT(res);
switch (cached_result_type) {
case REAL_RESULT:
......
......@@ -278,9 +278,9 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
int strict_week_number_year= -1;
int frac_part;
bool usa_time= 0;
bool sunday_first_n_first_week_non_iso;
bool strict_week_number;
bool strict_week_number_year_type;
bool UNINIT_VAR(sunday_first_n_first_week_non_iso);
bool UNINIT_VAR(strict_week_number);
bool UNINIT_VAR(strict_week_number_year_type);
const char *val_begin= val;
const char *val_end= val + length;
const char *ptr= format->format.str;
......@@ -288,11 +288,6 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
CHARSET_INFO *cs= &my_charset_bin;
DBUG_ENTER("extract_date_time");
LINT_INIT(strict_week_number);
/* Remove valgrind varnings when using gcc 3.3 and -O1 */
PURIFY_OR_LINT_INIT(strict_week_number_year_type);
PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso);
if (!sub_pattern_end)
bzero((char*) l_time, sizeof(*l_time));
......
......@@ -4702,7 +4702,7 @@ ER_NOT_SUPPORTED_YET 42000
swe "Denna version av MySQL kan nnu inte utfra '%s'"
ER_MASTER_FATAL_ERROR_READING_BINLOG
nla "Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log"
eng "Got fatal error %d: '%-.128s' from master when reading data from binary log"
eng "Got fatal error %d from master when reading data from binary log: '%-.128s'"
ger "Schwerer Fehler %d: '%-.128s vom Master beim Lesen des binren Logs"
ita "Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario"
por "Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log"
......
......@@ -2678,15 +2678,19 @@ Log entry on master is longer than max_allowed_packet (%ld) on \
slave. If the entry is correct, restart the server with a higher value of \
max_allowed_packet",
thd->variables.max_allowed_packet);
mi->report(ERROR_LEVEL, ER_NET_PACKET_TOO_LARGE,
ER(ER_NET_PACKET_TOO_LARGE));
goto err;
case ER_MASTER_FATAL_ERROR_READING_BINLOG:
sql_print_error(ER(mysql_error_number), mysql_error_number,
mysql_error(mysql));
mi->report(ERROR_LEVEL, ER_MASTER_FATAL_ERROR_READING_BINLOG,
ER(ER_MASTER_FATAL_ERROR_READING_BINLOG),
mysql_error_number, mysql_error(mysql));
goto err;
case EE_OUTOFMEMORY:
case ER_OUTOFMEMORY:
case ER_OUT_OF_RESOURCES:
sql_print_error("\
Stopping slave I/O thread due to out-of-memory error from master");
mi->report(ERROR_LEVEL, ER_OUT_OF_RESOURCES,
ER(ER_OUT_OF_RESOURCES));
goto err;
}
if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
......
......@@ -907,6 +907,9 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
remove_db_from_cache(db);
pthread_mutex_unlock(&LOCK_open);
Drop_table_error_handler err_handler(thd->get_internal_handler());
thd->push_internal_handler(&err_handler);
error= -1;
/*
We temporarily disable the binary log while dropping the objects
......@@ -939,6 +942,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
error = 0;
reenable_binlog(thd);
}
thd->pop_internal_handler();
}
if (!silent && deleted>=0)
{
......
......@@ -422,16 +422,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
String buffer(buff, sizeof(buff), system_charset_info);
int error, keyno= -1;
uint num_rows;
uchar *key;
uint key_len;
uchar *UNINIT_VAR(key);
uint UNINIT_VAR(key_len);
bool need_reopen;
DBUG_ENTER("mysql_ha_read");
DBUG_PRINT("enter",("'%s'.'%s' as '%s'",
tables->db, tables->table_name, tables->alias));
LINT_INIT(key);
LINT_INIT(key_len);
thd->lex->select_lex.context.resolve_in_table_list_only(tables);
list.push_front(new Item_field(&thd->lex->select_lex.context,
NULL, NULL, "*"));
......
......@@ -623,7 +623,7 @@ impossible position";
*/
{
log.error=0;
bool read_packet = 0, fatal_error = 0;
bool read_packet = 0;
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
......@@ -645,7 +645,7 @@ impossible position";
*/
pthread_mutex_lock(log_lock);
switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*)0)) {
switch (error= Log_event::read_log_event(&log, packet, (pthread_mutex_t*) 0)) {
case 0:
/* we read successfully, so we'll need to send it to the slave */
pthread_mutex_unlock(log_lock);
......@@ -671,8 +671,8 @@ impossible position";
default:
pthread_mutex_unlock(log_lock);
fatal_error = 1;
break;
test_for_non_eof_log_read_errors(error, &errmsg);
goto err;
}
if (read_packet)
......@@ -701,12 +701,6 @@ impossible position";
*/
}
if (fatal_error)
{
errmsg = "error reading log entry";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
log.error=0;
}
}
......
......@@ -139,10 +139,10 @@ typedef long long longlong;
#include <mysql.h>
#include <ctype.h>
static pthread_mutex_t LOCK_hostname;
#ifdef HAVE_DLOPEN
static pthread_mutex_t LOCK_hostname;
/* These must be right or mysqld will not find the symbol! */
my_bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
......
......@@ -196,13 +196,10 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
HP_SHARE *share = info->s;
int flag;
ulong halfbuff,hashnr,first_index;
uchar *ptr_to_rec,*ptr_to_rec2;
HASH_INFO *empty,*gpos,*gpos2,*pos;
uchar *UNINIT_VAR(ptr_to_rec),*UNINIT_VAR(ptr_to_rec2);
HASH_INFO *empty,*UNINIT_VAR(gpos),*UNINIT_VAR(gpos2),*pos;
DBUG_ENTER("hp_write_key");
LINT_INIT(gpos); LINT_INIT(gpos2);
LINT_INIT(ptr_to_rec); LINT_INIT(ptr_to_rec2);
flag=0;
if (!(empty= hp_find_free_hash(share,&keyinfo->block,share->records)))
DBUG_RETURN(-1); /* No more memory */
......
......@@ -302,7 +302,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *end, *kseg, *vseg;
uchar *sort_order=keyinfo->seg->charset->sort_order;
uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
uchar *saved_from, *saved_to, *saved_vseg;
uchar *UNINIT_VAR(saved_from), *UNINIT_VAR(saved_to);
uchar *UNINIT_VAR(saved_vseg);
uint saved_length=0, saved_prefix_len=0;
uint length_pack;
DBUG_ENTER("_mi_prefix_search");
......@@ -310,9 +311,6 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
LINT_INIT(length);
LINT_INIT(prefix_len);
LINT_INIT(seg_len_pack);
LINT_INIT(saved_from);
LINT_INIT(saved_to);
LINT_INIT(saved_vseg);
t_buff[0]=0; /* Avoid bugs */
end= page+mi_getint(page);
......
......@@ -712,8 +712,8 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
uchar *key, uint *return_key_length,
uchar **after_key)
{
uint keys,length,last_length,key_ref_length;
uchar *end,*lastpos,*prevpos;
uint keys,length,UNINIT_VAR(last_length),key_ref_length;
uchar *end,*lastpos,*UNINIT_VAR(prevpos);
uchar key_buff[MI_MAX_KEY_BUFF];
DBUG_ENTER("_mi_find_last_pos");
......@@ -732,8 +732,6 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
DBUG_RETURN(end);
}
LINT_INIT(prevpos);
LINT_INIT(last_length);
end=page+length-key_ref_length;
*key='\0';
length=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment