mariadb/sql/mf_iocache.cc
unknown 221397cdbe Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882)
BUILD/compile-pentium-debug-max:
  Added --with-raid
configure.in:
  Removed -DFN_NO_CASE_SENCE for Mac OS X as this is not always true
mysql-test/install_test_db.sh:
  Added --skip-warnings
mysql-test/mysql-test-run.sh:
  Fixes to get --gdb and --ddd to work
mysql-test/r/lowercase_table2.result:
  Test for lower_case_table_names=2 and temporary tables
mysql-test/r/lowercase_table3.result:
  Fixed error message
mysql-test/r/multi_update.result:
  Test of behaviour of multi-table-delete and alias
mysql-test/t/lowercase_table2.test:
  Test for lower_case_table_names=2 and temporary tables
mysql-test/t/lowercase_table3.test:
  Fixed error
mysql-test/t/multi_update.test:
  Test of behaviour of multi-table-delete and alias (Bug #2940)
mysys/mf_iocache.c:
  Renamed _flush_io_cache to my_b_flush_io_cache
sql/ha_myisam.cc:
  Added comment
sql/lock.cc:
  Extra debugging
sql/log.cc:
  New parameter to flush_relay_log_info
sql/log_event.cc:
  New parameter to flush_relay_log_info
sql/mf_iocache.cc:
  Removed not used header files
sql/mysqld.cc:
  More debugging info
  Less warnings when run with --skip-warnings
sql/opt_range.cc:
  More debug information
sql/repl_failsafe.cc:
  New parameter to flush_relay_log_info
sql/slave.cc:
  First start SQL thread, then start IO thread. This fixed a raze condition in SLAVE START (Bug #2921)
  Ensure that we have a lock on the IO thread before flushing a relay log file that. The original code could core dump when a relay log rotated.
sql/slave.h:
  New parameter to flush_relay_log_info
sql/sql_base.cc:
  Added warning
sql/sql_handler.cc:
  Indentation fix
sql/sql_repl.cc:
  New parameter to flush_relay_log_info
sql/sql_select.cc:
  Fixed problem with deleting temporary tables when using lower_case_table_names=2. (Bug #2858)
sql/sql_table.cc:
  Fixed comment
sql/sql_yacc.yy:
  Removed compiler warning
include/my_sys.h:
  Fixed usage of unpack_filename
mysys/mf_pack.c:
  Changed unpack_filename() to return length of result string.
mysys/test_fn.c:
  Fixed usage of unpack_filename
sql/sql_db.cc:
  Fixed memory leak with raid tables
sql/table.cc:
  Fixed usage of unpack_filename
2004-03-10 13:46:11 +02:00

80 lines
2.6 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 */
/*
Cashing of files with only does (sequential) read or writes of fixed-
length records. A read isn't allowed to go over file-length. A read is ok
if it ends at file-length and next read can try to read after file-length
(and get a EOF-error).
Possibly use of asyncronic io.
macros for read and writes for faster io.
Used instead of FILE when reading or writing whole files.
This will make mf_rec_cache obsolete.
One can change info->pos_in_file to a higher value to skip bytes in file if
also info->rc_pos is set to info->rc_end.
If called through open_cached_file(), then the temporary file will
only be created if a write exeeds the file buffer or if one calls
flush_io_cache().
*/
#include "mysql_priv.h"
extern "C" {
/*
** Read buffered from the net.
** Returns 1 if can't read requested characters
** Returns 0 if record read
*/
int _my_b_net_read(register IO_CACHE *info, byte *Buffer,
uint Count __attribute__((unused)))
{
ulong read_length;
NET *net= &(current_thd)->net;
DBUG_ENTER("_my_b_net_read");
if (!info->end_of_file)
DBUG_RETURN(1); /* because my_b_get (no _) takes 1 byte at a time */
read_length=my_net_read(net);
if (read_length == packet_error)
{
info->error= -1;
DBUG_RETURN(1);
}
if (read_length == 0)
{
info->end_of_file= 0; /* End of file from client */
DBUG_RETURN(1);
}
/* to set up stuff for my_b_get (no _) */
info->read_end = (info->read_pos = (byte*) net->read_pos) + read_length;
Buffer[0] = info->read_pos[0]; /* length is always 1 */
/*
info->request_pos is used by log_loaded_block() to know the size
of the current block.
info->pos_in_file is used by log_loaded_block() too.
*/
info->pos_in_file+= read_length;
info->request_pos=info->read_pos;
info->read_pos++;
DBUG_RETURN(0);
}
} /* extern "C" */