Commit 0218ecf7 authored by unknown's avatar unknown
Browse files

Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed...

Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed a number of dumb things in ha_tina.


client/mysqladmin.cc:
  gcc 4.0 fix
sql/examples/ha_archive.cc:
  Bunch of little cleanups from -Wall and gcc 4.0 fixes
sql/examples/ha_example.cc:
  Noticed that the error call was not quite right.
sql/examples/ha_tina.cc:
  Bunch of cleanups (many of which were quite dumb of me... and I have no earthly idea how they missed everyone's notice).
sql/ha_heap.cc:
  Removed unused variable (-Wall find)
sql/item_subselect.cc:
  Removed unused label.
sql/mysqld.cc:
  Cleanup of unused function and gcc 4.0 bit.
sql/opt_range.h:
  Cleanup for gcc 4.0
sql/repl_failsafe.cc:
  Cleanup for gcc 4.0
sql/slave.cc:
  Cleanup for gcc 4.0
sql/sql_acl.cc:
  Cleanup for gcc 4.0
sql/sql_insert.cc:
  Cleanedup for gcc 4.0
sql/sql_parse.cc:
  Cleanedup for gcc 4.0
sql/sql_repl.cc:
  Removed unused variable
sql/sql_select.cc:
  Cleanedup for gcc 4.0
parent e07f6ebf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
	option_wait=1;
    }
    else
      option_wait= ~0;
      option_wait= ~(uint)0;
    break;
  case '?':
  case 'I':					/* Info */
+3 −4
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ int ha_archive::write_row(byte * buf)
  written= gzwrite(share->archive_write, buf, table->reclength);
  DBUG_PRINT("ha_archive::get_row", ("Wrote %d bytes expected %d", written, table->reclength));
  share->dirty= TRUE;
  if (written != table->reclength)
  if (written != (z_off_t)table->reclength)
    goto error;
  /*
    We should probably mark the table as damagaged if the record is written
@@ -590,7 +590,7 @@ int ha_archive::write_row(byte * buf)
    {
      (*field)->get_ptr(&ptr);
      written= gzwrite(share->archive_write, ptr, (unsigned)size);
      if (written != size)
      if (written != (z_off_t)size)
        goto error;
    }
  }
@@ -613,7 +613,6 @@ int ha_archive::write_row(byte * buf)
int ha_archive::rnd_init(bool scan)
{
  DBUG_ENTER("ha_archive::rnd_init");
  int read; // gzread() returns int, and we use this to check the header

  /* We rewind the file so that we can read from the beginning if scan */
  if (scan)
@@ -747,7 +746,7 @@ int ha_archive::rnd_pos(byte * buf, byte *pos)
  DBUG_ENTER("ha_archive::rnd_pos");
  statistic_increment(ha_read_rnd_count,&LOCK_status);
  current_position= ha_get_ptr(pos, ref_length);
  z_off_t seek= gzseek(archive, current_position, SEEK_SET);
  (void)gzseek(archive, current_position, SEEK_SET);

  DBUG_RETURN(get_row(archive, buf));
}
+1 −3
Original line number Diff line number Diff line
@@ -150,10 +150,8 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)

  return share;

error2:
  thr_lock_delete(&share->lock);
  pthread_mutex_destroy(&share->mutex);
error:
  pthread_mutex_destroy(&share->mutex);
  pthread_mutex_unlock(&example_mutex);
  my_free((gptr) share, MYF(0));

+12 −25
Original line number Diff line number Diff line
@@ -341,7 +341,6 @@ int ha_tina::find_current_row(byte *buf)

  for (Field **field=table->field ; *field ; field++)
  {
    int x;
    buffer.length(0);
    mapped_ptr++; // Increment past the first quote
    for(;mapped_ptr != end_ptr; mapped_ptr++)
@@ -735,29 +734,17 @@ int ha_tina::rnd_end()
      beginning so that we move the smallest amount of data possible.
    */
    qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), (qsort_cmp)sort_set);
    for (ptr= chain; ptr < chain_ptr; ptr++)
      printf("Chain %d, %d\n", (int)ptr->begin, (int)ptr->end);
    for (ptr= chain; ptr < chain_ptr; ptr++)
    {
      //memmove(share->mapped_file + ptr->begin, share->mapped_file
      //+ ptr->end, length - (size_t)ptr->end);
      /* We peek a head to see if this is the last chain */
      printf("Delete %d, %d, %d\n", (int)ptr->begin, (int)ptr->end, (int)length);
      if (ptr+1 == chain_ptr)
      {
        printf("Shiftina(end) %d(%d) to %d\n", (int)ptr->end, (int)(length - (size_t)ptr->end), (int)ptr->begin);
        memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
                length - (size_t)ptr->end);
      }
      else
      {
        printf("Shifting %d(%d) to %d\n", (int)ptr->end, (int)((ptr++)->begin - (size_t)ptr->end), (int)ptr->begin);
        memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
                (size_t)(ptr++)->begin - (size_t)ptr->end);
      }
        memmove((caddr_t)share->mapped_file + ptr->begin, (caddr_t)share->mapped_file + ptr->end,
                (size_t)((ptr++)->begin - ptr->end));
      length= length - (size_t)(ptr->end - ptr->begin);
    }
    printf("Buffer %s\n",share->mapped_file);

    /* Truncate the file to the new size */
    if (my_chsize(share->data_file, length, 0, MYF(MY_WME)))
+0 −1
Original line number Diff line number Diff line
@@ -484,7 +484,6 @@ int ha_heap::create(const char *name, TABLE *table_arg,

    for (; key_part != key_part_end; key_part++, seg++)
    {
      uint flag=    key_part->key_type;
      Field *field= key_part->field;
      if (pos->algorithm == HA_KEY_ALG_BTREE)
	seg->type= field->key_type();
Loading