summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-08-21 13:44:01 +0300
committerunknown <monty@hundin.mysql.fi>2001-08-21 13:44:01 +0300
commit023cbef04c5bec28e939d5076c5f329ab7f3994f (patch)
tree4e64a1ec67abe449474688af7b06340fac1019d7 /myisam
parentf3171b49b3507b84b5f26bdaf73932495741d7fc (diff)
downloadmariadb-git-023cbef04c5bec28e939d5076c5f329ab7f3994f.tar.gz
Remove usage of my_dup(), as this casued error 127 when reading MyISAM tables
New definition of WEEK(). Docs/manual.texi: Changelog myisam/mi_cache.c: Better logging on error myisam/mi_open.c: Remove usage of my_dup(), as this casued error 127 when reading tables mysql-test/r/func_time.result: More tests for the WEEK/YEARWEEK function mysql-test/t/func_time.test: More tests for the WEEK/YEARWEEK function sql/time.cc: New definition of WEEK
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_cache.c6
-rw-r--r--myisam/mi_open.c16
2 files changed, 15 insertions, 7 deletions
diff --git a/myisam/mi_cache.c b/myisam/mi_cache.c
index 0e630cae22b..0aae316f23d 100644
--- a/myisam/mi_cache.c
+++ b/myisam/mi_cache.c
@@ -73,6 +73,9 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
if (!(flag & READING_HEADER) || info->error == -1 ||
(uint) info->error+in_buff_length < 3)
{
+ DBUG_PRINT("error",
+ ("Error %d reading next-multi-part block (Got %d bytes)",
+ my_errno, info->error));
if (!my_errno)
my_errno=HA_ERR_WRONG_IN_RECORD;
DBUG_RETURN(1);
@@ -87,6 +90,9 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
if (!(flag & READING_HEADER) || (int) read_length == -1 ||
read_length+in_buff_length < 3)
{
+ DBUG_PRINT("error",
+ ("Error %d reading new block (Got %d bytes)",
+ my_errno, (int) read_length));
if (!my_errno)
my_errno=HA_ERR_WRONG_IN_RECORD;
DBUG_RETURN(1);
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 36cf8cfd6bd..4e98148663b 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -1009,8 +1009,13 @@ char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo)
}
/**************************************************************************
- ** Help functions for recover
- *************************************************************************/
+Open data file with or without RAID
+We can't use dup() here as the data file descriptors need to have different
+active seek-positions.
+
+The argument file_to_dup is here for the future if there would on some OS
+exist a dup()-like call that would give us two different file descriptors.
+*************************************************************************/
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup)
{
@@ -1026,11 +1031,8 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup)
}
else
#endif
- if (file_to_dup >= 0)
- info->dfile=my_dup(file_to_dup,MYF(MY_WME));
- else
- info->dfile=my_open(share->data_file_name, share->mode | O_SHARE,
- MYF(MY_WME));
+ info->dfile=my_open(share->data_file_name, share->mode | O_SHARE,
+ MYF(MY_WME));
return info->dfile >= 0 ? 0 : 1;
}