Commit d6c3d655 authored by unknown's avatar unknown
Browse files

Fixes during review of new pushed code

Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong


sql/ha_berkeley.cc:
  Removed not used variable (and options)
sql/ha_berkeley.h:
  Removed not used argument
sql/ha_ndbcluster.cc:
  Remove compiler warning
sql/init.cc:
  Simplify code
sql/item_sum.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/mysql_priv.h:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/mysqld.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_class.h:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_delete.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_derived.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_lex.h:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_parse.cc:
  Indentation fixes
sql/sql_select.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_select.h:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_show.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_union.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_update.cc:
  Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_yacc.yy:
  Changed variable name i to more descriptive name
  Removed compiler warning
parent d620954a
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -958,8 +958,6 @@ int ha_berkeley::write_row(byte * record)
  {
    DB_TXN *sub_trans = transaction;
    /* Don't use sub transactions in temporary tables */
    ulong thd_options= (table->s->tmp_table == NO_TMP_TABLE ?
                        table->in_use->options : 0);
    for (uint retry=0 ; retry < berkeley_trans_retry ; retry++)
    {
      key_map changed_keys(0);
@@ -1070,7 +1068,7 @@ int ha_berkeley::key_cmp(uint keynr, const byte * old_row,
int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed,
				    const byte * old_row, DBT *old_key,
				    const byte * new_row, DBT *new_key,
				    ulong thd_options, bool local_using_ignore)
                                    bool local_using_ignore)
{
  DBT row;
  int error;
@@ -1119,8 +1117,7 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed,
int ha_berkeley::restore_keys(DB_TXN *trans, key_map *changed_keys,
			      uint primary_key,
			      const byte *old_row, DBT *old_key,
			      const byte *new_row, DBT *new_key,
			      ulong thd_options)
			      const byte *new_row, DBT *new_key)
{
  int error;
  DBT tmp_key;
@@ -1130,7 +1127,7 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map *changed_keys,
  /* Restore the old primary key, and the old row, but don't ignore
     duplicate key failure */
  if ((error=update_primary_key(trans, TRUE, new_row, new_key,
				old_row, old_key, thd_options, FALSE)))
				old_row, old_key, FALSE)))
    goto err; /* purecov: inspected */

  /* Remove the new key, and put back the old key
@@ -1167,8 +1164,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
  DBT prim_key, key, old_prim_key;
  int error;
  DB_TXN *sub_trans;
  ulong thd_options= (table->s->tmp_table == NO_TMP_TABLE ?
                      table->in_use->options : 0);
  bool primary_key_changed;
  DBUG_ENTER("update_row");
  LINT_INIT(error);
@@ -1204,7 +1199,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
    if (!(error=update_primary_key(sub_trans, primary_key_changed,
				   old_row, &old_prim_key,
				   new_row, &prim_key,
				   thd_options, using_ignore)))
				   using_ignore)))
    {
      // Update all other keys
      for (uint keynr=0 ; keynr < table->s->keys ; keynr++)
@@ -1239,8 +1234,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
	int new_error = 0;
        if (!changed_keys.is_clear_all())
	  new_error=restore_keys(transaction, &changed_keys, primary_key,
				 old_row, &old_prim_key, new_row, &prim_key,
				 thd_options);
				 old_row, &old_prim_key, new_row, &prim_key);
	if (new_error)
	{
          /* This shouldn't happen */
@@ -1342,8 +1336,6 @@ int ha_berkeley::delete_row(const byte * record)
  int error;
  DBT row, prim_key;
  key_map keys= table->s->keys_in_use;
  ulong thd_options= (table->s->tmp_table == NO_TMP_TABLE ?
                      table->in_use->options : 0);
  DBUG_ENTER("delete_row");
  statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);

+2 −3
Original line number Diff line number Diff line
@@ -74,13 +74,12 @@ class ha_berkeley: public handler
		  DBT *prim_key, key_map *keys);
  int restore_keys(DB_TXN *trans, key_map *changed_keys, uint primary_key,
		   const byte *old_row, DBT *old_key,
		   const byte *new_row, DBT *new_key,
		   ulong thd_options);
		   const byte *new_row, DBT *new_key);
  int key_cmp(uint keynr, const byte * old_row, const byte * new_row);
  int update_primary_key(DB_TXN *trans, bool primary_key_changed,
			 const byte * old_row, DBT *old_key,
			 const byte * new_row, DBT *prim_key,
			 ulong thd_options, bool local_using_ignore);
			 bool local_using_ignore);
  int read_row(int error, char *buf, uint keynr, DBT *row, DBT *key, bool);
  DBT *get_pos(DBT *to, byte *pos);

+2 −0
Original line number Diff line number Diff line
@@ -6997,6 +6997,8 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond,
      break;
    Ndb_item *a= cond->next->ndb_item;
    Ndb_item *b, *field, *value= NULL;
    LINT_INIT(field);

    switch (cond->ndb_item->argument_count()) {
    case 1:
      field= 
+1 −2
Original line number Diff line number Diff line
@@ -39,12 +39,11 @@ void unireg_init(ulong options)
#endif

  VOID(strmov(reg_ext,".frm"));
  specialflag=SPECIAL_SAME_DB_NAME;
  specialflag=SPECIAL_SAME_DB_NAME | options;  /* Set options from argv */
  /* Make a tab of powers of 10 */
  for (i=0,nr=1.0; i < array_elements(log_10) ; i++)
  {					/* It's used by filesort... */
    log_10[i]= nr ; nr*= 10.0;
  }
  specialflag|=options;			/* Set options from argv */
  DBUG_VOID_RETURN;
}
+2 −4
Original line number Diff line number Diff line
@@ -2291,8 +2291,7 @@ bool Item_sum_count_distinct::setup(THD *thd)
  DBUG_ASSERT(table == 0);
  if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
				0,
				(select_lex->options | thd->options) & 
                                ~TMP_TABLE_FORCE_MYISAM,
				(select_lex->options | thd->options),
				HA_POS_ERROR, (char*)"")))
    return TRUE;
  table->file->extra(HA_EXTRA_NO_ROWS);		// Don't update rows
@@ -3074,8 +3073,7 @@ bool Item_func_group_concat::setup(THD *thd)
  */
  if (!(table= create_tmp_table(thd, tmp_table_param, all_fields,
                                (ORDER*) 0, 0, TRUE,
                                (select_lex->options | thd->options) & 
                                ~TMP_TABLE_FORCE_MYISAM,
                                (select_lex->options | thd->options),
                                HA_POS_ERROR, (char*) "")))
    DBUG_RETURN(TRUE);
  table->file->extra(HA_EXTRA_NO_ROWS);
Loading