diff options
author | unknown <monty@donna.mysql.com> | 2001-02-15 03:43:14 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2001-02-15 03:43:14 +0200 |
commit | c1488c7e5896920e5f66e28de38964ae9b5ff22e (patch) | |
tree | 48461790e73014dbea005fbd6ef8d48e83cc6f14 /myisam | |
parent | 8ece82e4dcef6b7dd097350890e27b593ec079b1 (diff) | |
download | mariadb-git-c1488c7e5896920e5f66e28de38964ae9b5ff22e.tar.gz |
Changed --replace to --replace_result in mysqltest
Changed errmsg -> my_errmsg (portability issue)
Fixed that mysqlbinlog writes SET TIMESTAMP before all queries
Fixed comments in default my.cnf files
Docs/manual.texi:
Updated information about character sets
client/mysqladmin.c:
Added missing help text
client/mysqltest.c:
Changed --replace to --replace_result to not conflict with SQL replace command
include/my_sys.h:
change errmsg -> my_errmsg (portability issue)
libmysql/errmsg.c:
change errmsg -> my_errmsg (portability issue)
myisam/mi_cache.c:
Changed seek+read to pread
myisam/mi_check.c:
Fix bug that caused myisamchk to be very slow under some specific error conditions
myisam/mi_dynrec.c:
cleanup
myisam/myisamchk.c:
Write out value of checksum
myisam/myisamdef.h:
cleanup
mysql-test/r/backup.result:
Fixed the case where backup caused different error messages
mysql-test/r/bdb.result:
Added new test case
mysql-test/r/fulltext.result:
Fix for new CREATE TABLE format
mysql-test/t/backup.test:
Use --replace_result and --send
mysql-test/t/bdb.test:
New test case
mysql-test/t/status.test:
Use --send
mysys/errors.c:
change errmsg -> my_errmsg (portability issue)
mysys/my_error.c:
change errmsg -> my_errmsg (portability issue)
mysys/typelib.c:
Only accept full type names
sql/derror.cc:
change errmsg -> my_errmsg (portability issue)
sql/ha_berkeley.cc:
Fixed bug when using key parts that could be NULL
sql/log_event.cc:
Log SET TIMESTAMP before all queries
sql/mysqlbinlog.cc:
Incremented version number
sql/mysqld.cc:
change errmsg -> my_errmsg (portability issue)
Always accept --skip-gemeni, --skip-bdb and --skip-innobase
sql/slave.cc:
cleanup
sql/sql_base.cc:
cleanup
sql/sql_db.cc:
cleanup
support-files/my-huge.cnf.sh:
Remove usage of # at end of line
support-files/my-large.cnf.sh:
Remove usage of # at end of line
support-files/my-medium.cnf.sh:
Remove usage of # at end of line
support-files/my-small.cnf.sh:
Remove usage of # at end of line
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_cache.c | 8 | ||||
-rw-r--r-- | myisam/mi_check.c | 51 | ||||
-rw-r--r-- | myisam/mi_dynrec.c | 7 | ||||
-rw-r--r-- | myisam/myisamchk.c | 5 | ||||
-rw-r--r-- | myisam/myisamdef.h | 4 |
5 files changed, 46 insertions, 29 deletions
diff --git a/myisam/mi_cache.c b/myisam/mi_cache.c index f2f7af8eac3..0e630cae22b 100644 --- a/myisam/mi_cache.c +++ b/myisam/mi_cache.c @@ -18,8 +18,6 @@ /* Used instead of my_b_read() to allow for no-cacheed seeks */ #include "myisamdef.h" -#define READING_NEXT 1 -#define READING_HEADER 2 /* Copy block from cache if it`s in it. If re_read_if_possibly is */ /* set read to cache (if after current file-position) else read to */ @@ -39,8 +37,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length, if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos)) read_length=(uint) (info->pos_in_file-pos); info->seek_not_done=1; - VOID(my_seek(info->file,pos,MY_SEEK_SET,MYF(0))); - if (my_read(info->file,buff,read_length,MYF(MY_NABP))) + if (my_pread(info->file,buff,read_length,pos,MYF(MY_NABP))) DBUG_RETURN(1); if (!(length-=read_length)) DBUG_RETURN(0); @@ -85,8 +82,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length, DBUG_RETURN(0); } info->seek_not_done=1; - VOID(my_seek(info->file,pos,MY_SEEK_SET,MYF(0))); - if ((read_length=my_read(info->file,buff,length,MYF(0))) == length) + if ((read_length=my_pread(info->file,buff,length,pos,MYF(0))) == length) DBUG_RETURN(0); if (!(flag & READING_HEADER) || (int) read_length == -1 || read_length+in_buff_length < 3) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 2736e98cea9..d1429b35a87 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -745,12 +745,14 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) do { if (_mi_read_cache(¶m->read_cache,(byte*) block_info.header, - (start_block=block_info.next_filepos), - sizeof(block_info.header),test(! flag) | 2)) + (start_block=block_info.next_filepos), + sizeof(block_info.header), + (flag ? 0 : READING_NEXT) | READING_HEADER)) goto err; if (start_block & (MI_DYN_ALIGN_SIZE-1)) { - mi_check_print_error(param,"Wrong aligned block at %s",llstr(start_block,llbuff)); + mi_check_print_error(param,"Wrong aligned block at %s", + llstr(start_block,llbuff)); goto err2; } b_type=_mi_get_block_info(&block_info,-1,start_block); @@ -841,7 +843,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) got_error=1; break; } if (_mi_read_cache(¶m->read_cache,(byte*) to,block_info.filepos, - (uint) block_info.data_len, test(flag == 1))) + (uint) block_info.data_len, + flag == 1 ? READING_NEXT : 0)) goto err; to+=block_info.data_len; link_used+= block_info.filepos-start_block; @@ -895,7 +898,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) break; case COMPRESSED_RECORD: if (_mi_read_cache(¶m->read_cache,(byte*) block_info.header, pos, - info->s->pack.ref_length, 1)) + info->s->pack.ref_length, READING_NEXT)) goto err; start_recpos=pos; splits++; @@ -910,7 +913,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) break; } if (_mi_read_cache(¶m->read_cache,(byte*) info->rec_buff, - block_info.filepos, block_info.rec_len,1)) + block_info.filepos, block_info.rec_len, READING_NEXT)) goto err; if (_mi_pack_rec_unpack(info,record,info->rec_buff,block_info.rec_len)) { @@ -2112,6 +2115,7 @@ static int sort_get_next_record(SORT_INFO *sort_info) { pos=MY_ALIGN(pos,MI_DYN_ALIGN_SIZE); param->retry_without_quick=1; + sort_info->start_recpos=pos; } do { @@ -2130,8 +2134,9 @@ static int sort_get_next_record(SORT_INFO *sort_info) llstr(param->search_after_block,llbuff), llstr(sort_info->start_recpos,llbuff2)); if (_mi_read_cache(¶m->read_cache,(byte*) block_info.header,pos, - MI_BLOCK_INFO_HEADER_LENGTH, - test(! found_record) | 2)) + MI_BLOCK_INFO_HEADER_LENGTH, + (! found_record ? READING_NEXT : 0) | + READING_HEADER)) { if (found_record) { @@ -2172,6 +2177,7 @@ static int sort_get_next_record(SORT_INFO *sort_info) block_info.header[i] <= MI_MAX_DYN_HEADER_BYTE) break; pos+=(ulong) i; + sort_info->start_recpos=pos; continue; } if (b_type & BLOCK_DELETED) @@ -2206,7 +2212,8 @@ static int sort_get_next_record(SORT_INFO *sort_info) if (found_record) goto try_next; searching=1; - pos++; + pos+= MI_DYN_ALIGN_SIZE; + sort_info->start_recpos=pos; block_info.second_read=0; continue; } @@ -2226,7 +2233,8 @@ static int sort_get_next_record(SORT_INFO *sort_info) if (found_record) goto try_next; searching=1; - pos++; + pos+= MI_DYN_ALIGN_SIZE; + sort_info->start_recpos=pos; block_info.second_read=0; continue; } @@ -2242,7 +2250,10 @@ static int sort_get_next_record(SORT_INFO *sort_info) if (found_record) goto try_next; if (searching) - pos++; + { + pos+=MI_DYN_ALIGN_SIZE; + sort_info->start_recpos=pos; + } else pos=block_info.filepos+block_info.block_len; block_info.second_read=0; @@ -2275,7 +2286,7 @@ static int sort_get_next_record(SORT_INFO *sort_info) if (left_length < block_info.data_len || ! block_info.data_len) { mi_check_print_info(param,"Found block with too small length at %s; Skipped", - llstr(sort_info->start_recpos,llbuff)); + llstr(sort_info->start_recpos,llbuff)); goto try_next; } if (block_info.filepos + block_info.data_len > @@ -2286,9 +2297,11 @@ static int sort_get_next_record(SORT_INFO *sort_info) goto try_next; } if (_mi_read_cache(¶m->read_cache,to,block_info.filepos, - block_info.data_len, test(found_record == 1))) + block_info.data_len, + (found_record == 1 ? READING_NEXT : 0))) { - mi_check_print_info(param,"Read error for block at: %s (error: %d); Skipped", + mi_check_print_info(param, + "Read error for block at: %s (error: %d); Skipped", llstr(block_info.filepos,llbuff),my_errno); goto try_next; } @@ -2335,8 +2348,9 @@ static int sort_get_next_record(SORT_INFO *sort_info) case COMPRESSED_RECORD: for (searching=0 ;; searching=1, sort_info->pos++) { - if (_mi_read_cache(¶m->read_cache,(byte*) block_info.header,sort_info->pos, - share->pack.ref_length,1)) + if (_mi_read_cache(¶m->read_cache,(byte*) block_info.header, + sort_info->pos, + share->pack.ref_length,READING_NEXT)) DBUG_RETURN(-1); if (searching && ! sort_info->fix_datafile) { @@ -2361,10 +2375,11 @@ static int sort_get_next_record(SORT_INFO *sort_info) continue; } if (_mi_read_cache(¶m->read_cache,(byte*) info->rec_buff, - block_info.filepos, block_info.rec_len,1)) + block_info.filepos, block_info.rec_len, + READING_NEXT)) { if (! searching) - mi_check_print_info(param,"Couldn't read hole record from %s", + mi_check_print_info(param,"Couldn't read whole record from %s", llstr(sort_info->pos,llbuff)); continue; } diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index 789831db810..4c05f6c737d 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -1294,8 +1294,9 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf, if (info->opt_flag & READ_CACHE_USED) { if (_mi_read_cache(&info->rec_cache,(byte*) block_info.header,filepos, - sizeof(block_info.header), - test(!flag && skipp_deleted_blocks) | 2)) + sizeof(block_info.header), + (!flag && skipp_deleted_blocks ? READING_NEXT : 0) | + READING_HEADER)) goto panic; b_type=_mi_get_block_info(&block_info,-1,filepos); } @@ -1368,7 +1369,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf, { if (_mi_read_cache(&info->rec_cache,(byte*) to,filepos, block_info.data_len, - test(!flag && skipp_deleted_blocks))) + (!flag && skipp_deleted_blocks) ? READING_NEXT :0)) goto panic; } else diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 7c86ea14c2d..0e57c793dae 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -201,7 +201,7 @@ static struct option long_options[] = static void print_version(void) { - printf("%s Ver 1.42 for %s at %s\n",my_progname,SYSTEM_TYPE, + printf("%s Ver 1.44 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); } @@ -952,7 +952,8 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name) share->base.raid_chunksize); } if (share->options & HA_OPTION_CHECKSUM) - printf("Using checksums\n"); + printf("Checksum: %23s\n",llstr(info->s->state.checksum,llbuff)); +; if (share->options & HA_OPTION_DELAY_KEY_WRITE) printf("Keys are only flushed at close\n"); diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index ad153d58b70..8b50f0111c6 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -290,6 +290,10 @@ struct st_myisam_info { #define STATE_NOT_OPTIMIZED_KEYS 16 #define STATE_NOT_SORTED_PAGES 32 + /* options to mi_read_cache */ + +#define READING_NEXT 1 +#define READING_HEADER 2 #define mi_getint(x) ((uint) mi_uint2korr(x) & 32767) #define mi_putint(x,y,nod) { uint16 boh=(nod ? (uint16) 32768 : 0) + (uint16) (y);\ |