mariadb/myisam/mi_info.c
unknown 7032486889 Fixes for valgrind
Added optimzation for clustered index
Fixed bug in UPDATE ... ORDER BY
Fixed handling of UPDATE ... LIMIT


BitKeeper/deleted/.del-.cvsignore~7e29af89a3559f4c:
  Delete: Images/.cvsignore
BitKeeper/deleted/.del-README~d5a4e7ca3a2e87a9:
  Delete: repl-tests/README
BitKeeper/deleted/.del-run-all-tests~4deb6479a13e4568:
  Delete: repl-tests/run-all-tests
BitKeeper/deleted/.del-run.test~3dc5b9bd1e9feea5:
  Delete: repl-tests/test-repl-alter/run.test
BitKeeper/deleted/.del-run.test~4020771cff278f14:
  Delete: repl-tests/test-bad-query/run.test
BitKeeper/deleted/.del-run.test~452f2b66537404a8:
  Delete: repl-tests/test-dump/run.test
BitKeeper/deleted/.del-run.test~b1f0c1f96554df8:
  Delete: repl-tests/test-auto-inc/run.test
BitKeeper/deleted/.del-table-dump-check.master~e13afeb8c79264b5:
  Delete: repl-tests/test-dump/table-dump-check.master
BitKeeper/deleted/.del-table-dump-select.master~744acb955e33f3db:
  Delete: repl-tests/test-dump/table-dump-select.master
BitKeeper/deleted/.del-x.master~29a93ed7956c8693:
  Delete: repl-tests/test-auto-inc/x.master
BitKeeper/deleted/.del-x.master~3b248cbac9abda2b:
  Delete: repl-tests/test-bad-query/x.master
BitKeeper/deleted/.del-foo-dump-master.master~b49ae6bec1e918ee:
  Delete: repl-tests/test-repl/foo-dump-master.master
BitKeeper/deleted/.del-foo-dump-slave.master~f16ed20457d59be9:
  Delete: repl-tests/test-repl/foo-dump-slave.master
BitKeeper/deleted/.del-repl-timestamp.master.reject~3492d2b74b413771:
  Delete: repl-tests/test-repl-ts/repl-timestamp.master.reject
BitKeeper/deleted/.del-repl-timestamp.master~4b7782da5cc13161:
  Delete: repl-tests/test-repl-ts/repl-timestamp.master
BitKeeper/deleted/.del-run.test~a1e32ea1e4253af4:
  Delete: repl-tests/test-repl/run.test
BitKeeper/deleted/.del-run.test~ce5e626c91b760ec:
  Delete: repl-tests/test-repl-ts/run.test
BitKeeper/deleted/.del-sum-wlen-master.master~1a5ea625c79e978:
  Delete: repl-tests/test-repl/sum-wlen-master.master
BitKeeper/deleted/.del-sum-wlen-slave.master~f016d98833433084:
  Delete: repl-tests/test-repl/sum-wlen-slave.master
BitKeeper/deleted/.del-test.master~5829e7b3770179db:
  Delete: repl-tests/test-repl-alter/test.master
BitKeeper/deleted/.del-master-slave.inc~6775f6ae10137c39:
  Delete: repl-tests/include/master-slave.inc
include/my_global.h:
  Fix for purify/valgrind
myisam/mi_info.c:
  Updated comment
mysql-test/r/group_by.result:
  New test results
mysql-test/r/innodb.result:
  New test results
mysql-test/r/join_outer.result:
  New test results
mysql-test/r/multi_update.result:
  New test results
mysql-test/r/null_key.result:
  New test results
mysql-test/r/update.result:
  New test results
mysql-test/t/group_by.test:
  Added extra explain to 'suspicious' test.
mysql-test/t/innodb.test:
  Added test for UPDATE ... ORDER BY
mysql-test/t/join_outer.test:
  Changed test to be repeatable
mysql-test/t/multi_update.test:
  Slight change of test to catch more bugs
mysql-test/t/update.test:
  Better test for UPDATE ... ORDER BY
sql/field.cc:
  Simple optimization
sql/ha_heap.h:
  Added optimzation for clustered index
sql/ha_innodb.cc:
  Added optimzation for clustered index
sql/ha_innodb.h:
  Added optimzation for clustered index
sql/handler.h:
  Added optimzation for clustered index
sql/item_sum.cc:
  Removed some usage of current_thd
sql/mysqld.cc:
  Fix bug when compiling for purify/valgrind
sql/opt_range.cc:
  Added optimzation for clustered index
sql/records.cc:
  Fixed comment
sql/sql_list.h:
  Fixed comment
sql/sql_select.cc:
  Removed some usage of current_thd
sql/sql_select.h:
  Removed some usage of current_thd
sql/sql_union.cc:
  Removed some usage of current_thd
sql/sql_update.cc:
  Fixed bug in UPDATE ... ORDER BY
  Fixed handling of UPDATE ... LIMIT
support-files/my-huge.cnf.sh:
  Added default size for query cache
support-files/my-large.cnf.sh:
  Added default size for query cache
2003-04-23 21:52:16 +03:00

104 lines
3.5 KiB
C

/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Return useful base information for an open table */
#include "myisamdef.h"
#ifdef __WIN__
#include <sys/stat.h>
#endif
/* Get position to last record */
my_off_t mi_position(MI_INFO *info)
{
return info->lastpos;
}
/* Get information about the table */
/* if flag == 2 one get current info (no sync from database */
int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
{
MY_STAT state;
MYISAM_SHARE *share=info->s;
DBUG_ENTER("mi_status");
x->recpos = info->lastpos;
if (flag == HA_STATUS_POS)
DBUG_RETURN(0); /* Compatible with ISAM */
if (!(flag & HA_STATUS_NO_LOCK))
{
pthread_mutex_lock(&share->intern_lock);
VOID(_mi_readinfo(info,F_RDLCK,0));
fast_mi_writeinfo(info);
pthread_mutex_unlock(&share->intern_lock);
}
if (flag & HA_STATUS_VARIABLE)
{
x->records = info->state->records;
x->deleted = info->state->del;
x->delete_length = info->state->empty;
x->data_file_length =info->state->data_file_length;
x->index_file_length=info->state->key_file_length;
x->keys = share->state.header.keys;
x->check_time = share->state.check_time;
x->mean_reclength = info->state->records ?
(ulong) ((info->state->data_file_length-info->state->empty)/
info->state->records) : (ulong) share->min_pack_length;
}
if (flag & HA_STATUS_ERRKEY)
{
x->errkey = info->errkey;
x->dupp_key_pos= info->dupp_key_pos;
}
if (flag & HA_STATUS_CONST)
{
x->reclength = share->base.reclength;
x->max_data_file_length=share->base.max_data_file_length;
x->max_index_file_length=info->s->base.max_key_file_length;
x->filenr = info->dfile;
x->options = share->options;
x->create_time=share->state.create_time;
x->reflength= mi_get_pointer_length(share->base.max_data_file_length,4);
x->record_offset= ((share->options &
(HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ?
0L : share->base.pack_reclength);
x->sortkey= -1; /* No clustering */
/* The following should be included even if we are not compiling with
USE_RAID as the client must be able to request it! */
x->rec_per_key = share->state.rec_per_key_part;
x->raid_type= share->base.raid_type;
x->raid_chunks= share->base.raid_chunks;
x->raid_chunksize= share->base.raid_chunksize;
x->key_map = share->state.key_map;
x->data_file_name = share->data_file_name;
x->index_file_name = share->index_file_name;
}
if ((flag & HA_STATUS_TIME) && !my_fstat(info->dfile,&state,MYF(0)))
x->update_time=state.st_mtime;
else
x->update_time=0;
if (flag & HA_STATUS_AUTO)
{
x->auto_increment= share->state.auto_increment+1;
if (!x->auto_increment) /* This shouldn't happen */
x->auto_increment= ~(ulonglong) 0;
}
DBUG_RETURN(0);
}