Commit d3295a28 authored by unknown's avatar unknown

After merge fixes:

- Remove compiler warnings
- Fix merge errors
- Indentation fixes


sql/ha_ndbcluster.cc:
  After merge fixes
sql/slave.cc:
  After merge fixes
sql/sp.cc:
  After merge fixes
sql/sql_table.cc:
  After merge fixes
sql/sql_view.cc:
  After merge fixes
parent 3c340a3d
...@@ -6219,20 +6219,19 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, ...@@ -6219,20 +6219,19 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
bool sorted, bool sorted,
HANDLER_BUFFER *buffer) HANDLER_BUFFER *buffer)
{ {
DBUG_ENTER("ha_ndbcluster::read_multi_range_first");
int res; int res;
KEY* key_info= table->key_info + active_index; KEY* key_info= table->key_info + active_index;
NDB_INDEX_TYPE cur_index_type= get_index_type(active_index); NDB_INDEX_TYPE cur_index_type= get_index_type(active_index);
ulong reclength= table->s->reclength; ulong reclength= table->s->reclength;
NdbOperation* op; NdbOperation* op;
Thd_ndb *thd_ndb= get_thd_ndb(current_thd); Thd_ndb *thd_ndb= get_thd_ndb(current_thd);
DBUG_ENTER("ha_ndbcluster::read_multi_range_first");
/** /**
* blobs and unique hash index with NULL can't be batched currently * blobs and unique hash index with NULL can't be batched currently
*/ */
if (uses_blob_value(m_retrieve_all_fields) || if (uses_blob_value(m_retrieve_all_fields) ||
(index_type == UNIQUE_INDEX && (cur_index_type == UNIQUE_INDEX &&
has_null_in_unique_index(active_index) && has_null_in_unique_index(active_index) &&
null_value_index_search(ranges, ranges+range_count, buffer))) null_value_index_search(ranges, ranges+range_count, buffer)))
{ {
...@@ -7953,6 +7952,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, ...@@ -7953,6 +7952,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond,
DBUG_RETURN(1); DBUG_RETURN(1);
} }
int int
ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter) ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter)
{ {
...@@ -8026,6 +8026,7 @@ ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter) ...@@ -8026,6 +8026,7 @@ ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
int int
ha_ndbcluster::build_scan_filter(Ndb_cond * &cond, NdbScanFilter *filter) ha_ndbcluster::build_scan_filter(Ndb_cond * &cond, NdbScanFilter *filter)
{ {
...@@ -8076,14 +8077,14 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack, ...@@ -8076,14 +8077,14 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
int int
ha_ndbcluster::generate_scan_filter_from_cond(Ndb_cond_stack *ndb_cond_stack, ha_ndbcluster::generate_scan_filter_from_cond(Ndb_cond_stack *ndb_cond_stack,
NdbScanFilter& filter) NdbScanFilter& filter)
{ {
DBUG_ENTER("generate_scan_filter_from_cond");
bool multiple_cond= FALSE; bool multiple_cond= FALSE;
DBUG_ENTER("generate_scan_filter_from_cond");
DBUG_PRINT("info", ("Generating scan filter"));
// Wrap an AND group around multiple conditions // Wrap an AND group around multiple conditions
if (ndb_cond_stack->next) if (ndb_cond_stack->next)
{ {
...@@ -8109,6 +8110,7 @@ ha_ndbcluster::generate_scan_filter_from_cond(Ndb_cond_stack *ndb_cond_stack, ...@@ -8109,6 +8110,7 @@ ha_ndbcluster::generate_scan_filter_from_cond(Ndb_cond_stack *ndb_cond_stack,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op, int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op,
const KEY* key_info, const KEY* key_info,
const byte *key, const byte *key,
...@@ -8119,15 +8121,14 @@ int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op, ...@@ -8119,15 +8121,14 @@ int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op,
KEY_PART_INFO* end= key_part+key_info->key_parts; KEY_PART_INFO* end= key_part+key_info->key_parts;
NdbScanFilter filter(op); NdbScanFilter filter(op);
int res; int res;
DBUG_ENTER("generate_scan_filter_from_key"); DBUG_ENTER("generate_scan_filter_from_key");
filter.begin(NdbScanFilter::AND); filter.begin(NdbScanFilter::AND);
for (; key_part != end; key_part++) for (; key_part != end; key_part++)
{ {
Field* field= key_part->field; Field* field= key_part->field;
uint32 pack_len= field->pack_length(); uint32 pack_len= field->pack_length();
const byte* ptr= key; const byte* ptr= key;
char buf[256];
DBUG_PRINT("info", ("Filtering value for %s", field->field_name)); DBUG_PRINT("info", ("Filtering value for %s", field->field_name));
DBUG_DUMP("key", (char*)ptr, pack_len); DBUG_DUMP("key", (char*)ptr, pack_len);
if (key_part->null_bit) if (key_part->null_bit)
...@@ -8162,7 +8163,6 @@ int ...@@ -8162,7 +8163,6 @@ int
ndbcluster_show_status(THD* thd) ndbcluster_show_status(THD* thd)
{ {
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
DBUG_ENTER("ndbcluster_show_status"); DBUG_ENTER("ndbcluster_show_status");
if (have_ndbcluster != SHOW_OPTION_YES) if (have_ndbcluster != SHOW_OPTION_YES)
......
...@@ -4393,6 +4393,8 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) ...@@ -4393,6 +4393,8 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
pthread_mutex_t *log_lock= rli->relay_log.get_log_lock(); pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
DBUG_ENTER("queue_event"); DBUG_ENTER("queue_event");
LINT_INIT(inc_pos);
if (mi->rli.relay_log.description_event_for_queue->binlog_version<4 && if (mi->rli.relay_log.description_event_for_queue->binlog_version<4 &&
buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */) buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */)
DBUG_RETURN(queue_old_event(mi,buf,event_len)); DBUG_RETURN(queue_old_event(mi,buf,event_len));
...@@ -4533,7 +4535,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) ...@@ -4533,7 +4535,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
err: err:
pthread_mutex_unlock(&mi->data_lock); pthread_mutex_unlock(&mi->data_lock);
DBUG_PRINT("info", ("error=%d", error)); DBUG_PRINT("info", ("error: %d", error));
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
...@@ -492,8 +492,6 @@ db_create_routine(THD *thd, int type, sp_head *sp) ...@@ -492,8 +492,6 @@ db_create_routine(THD *thd, int type, sp_head *sp)
int ret; int ret;
TABLE *table; TABLE *table;
char definer[USER_HOST_BUFF_SIZE]; char definer[USER_HOST_BUFF_SIZE];
char old_db_buf[NAME_LEN+1];
LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
DBUG_ENTER("db_create_routine"); DBUG_ENTER("db_create_routine");
DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length, DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length,
sp->m_name.str)); sp->m_name.str));
...@@ -1843,9 +1841,7 @@ create_string(THD *thd, String *buf, ...@@ -1843,9 +1841,7 @@ create_string(THD *thd, String *buf,
SYNOPSIS SYNOPSIS
sp_use_new_db() sp_use_new_db()
thd thread handle thd thread handle
new_db new database name (a string and its length) new_db new database name (a string and its length)
old_db [IN] str points to a buffer where to store the old old_db [IN] str points to a buffer where to store the old
database, length contains the size of the buffer database, length contains the size of the buffer
[OUT] if old db was not NULL, its name is copied [OUT] if old db was not NULL, its name is copied
...@@ -1853,7 +1849,6 @@ create_string(THD *thd, String *buf, ...@@ -1853,7 +1849,6 @@ create_string(THD *thd, String *buf,
accordingly. Otherwise str[0] is set to '\0' and length accordingly. Otherwise str[0] is set to '\0' and length
is set to 0. The out parameter should be used only if is set to 0. The out parameter should be used only if
the database name has been changed (see dbchangedp). the database name has been changed (see dbchangedp).
dbchangedp [OUT] is set to TRUE if the current database is changed, dbchangedp [OUT] is set to TRUE if the current database is changed,
FALSE otherwise. A database is not changed if the old FALSE otherwise. A database is not changed if the old
name is the same as the new one, both names are empty, name is the same as the new one, both names are empty,
......
...@@ -223,9 +223,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, ...@@ -223,9 +223,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
String wrong_tables; String wrong_tables;
int error; int error;
bool some_tables_deleted=0, tmp_table_deleted=0, foreign_key_error=0; bool some_tables_deleted=0, tmp_table_deleted=0, foreign_key_error=0;
DBUG_ENTER("mysql_rm_table_part2"); DBUG_ENTER("mysql_rm_table_part2");
LINT_INIT(alias);
if (!drop_temporary && lock_table_names(thd, tables)) if (!drop_temporary && lock_table_names(thd, tables))
DBUG_RETURN(1); DBUG_RETURN(1);
...@@ -2998,7 +2999,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -2998,7 +2999,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
ALTER_INFO *alter_info, bool do_send_ok) ALTER_INFO *alter_info, bool do_send_ok)
{ {
TABLE *table,*new_table=0; TABLE *table,*new_table=0;
int error; int error= 0;
char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN]; char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN];
char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias; char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
char index_file[FN_REFLEN], data_file[FN_REFLEN]; char index_file[FN_REFLEN], data_file[FN_REFLEN];
...@@ -3051,9 +3052,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -3051,9 +3052,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DBUG_RETURN(1); DBUG_RETURN(1);
VOID(pthread_mutex_lock(&LOCK_open)); VOID(pthread_mutex_lock(&LOCK_open));
if (lock_table_names(thd, table_list)) if (lock_table_names(thd, table_list))
{
error= 1;
goto view_err; goto view_err;
}
error=0;
if (!do_rename(thd, table_list, new_db, new_name, new_name, 1)) if (!do_rename(thd, table_list, new_db, new_name, new_name, 1))
{ {
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
...@@ -3154,7 +3157,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -3154,7 +3157,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
switch (alter_info->keys_onoff) { switch (alter_info->keys_onoff) {
case LEAVE_AS_IS: case LEAVE_AS_IS:
error= 0;
break; break;
case ENABLE: case ENABLE:
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN); wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
...@@ -3169,10 +3171,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -3169,10 +3171,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
} }
if (error == HA_ERR_WRONG_COMMAND) if (error == HA_ERR_WRONG_COMMAND)
{ {
error= 0;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA), ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
table->alias); table->alias);
error= 0;
} }
if (!error && (new_name != table_name || new_db != db)) if (!error && (new_name != table_name || new_db != db))
...@@ -3202,10 +3204,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -3202,10 +3204,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (error == HA_ERR_WRONG_COMMAND) if (error == HA_ERR_WRONG_COMMAND)
{ {
error= 0;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA), ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
table->alias); table->alias);
error= 0;
} }
if (!error) if (!error)
......
...@@ -862,7 +862,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, ...@@ -862,7 +862,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
Query_arena *arena, backup; Query_arena *arena, backup;
TABLE_LIST *top_view= table->top_table(); TABLE_LIST *top_view= table->top_table();
int res; int res;
bool result; bool result, view_is_mergeable;
TABLE_LIST *view_main_select_tables;
DBUG_ENTER("mysql_make_view"); DBUG_ENTER("mysql_make_view");
DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name)); DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name));
...@@ -1089,9 +1090,10 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, ...@@ -1089,9 +1090,10 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
table->next_global= view_tables; table->next_global= view_tables;
} }
bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE && view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
lex->can_be_merged()); lex->can_be_merged());
TABLE_LIST *view_main_select_tables; LINT_INIT(view_main_select_tables);
if (view_is_mergeable) if (view_is_mergeable)
{ {
/* /*
......
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