diff options
author | unknown <monty@donna.mysql.com> | 2000-10-14 03:16:35 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-10-14 03:16:35 +0300 |
commit | 518a621adf75a55cad471f82d926842f3bcbf997 (patch) | |
tree | 1b0bc8c3909ac0c3e49a7d72615c583c9a72254d /myisam/sort.c | |
parent | da2c52f1fe73f1fca8d95875957b4bcb4bd84a4b (diff) | |
download | mariadb-git-518a621adf75a55cad471f82d926842f3bcbf997.tar.gz |
Fix of LEFT JOIN optimizer bug, problem with key cache on Windows and
a lot of portability issues.
Docs/manual.texi:
Changed FOREIGN KEY to FOREIGN KEY constraint
client/mysqladmin.c:
Don't flush MASTER or SLAVE on refresh
configure.in:
Fix for hpux 11.0
extra/perror.c:
New error message
include/my_pthread.h:
Portability fix for windows
myisam/mi_locking.c:
Ensure that locking doesn't interfere with pread/pwrite on windows
myisam/sort.c:
checked with purecover
mysys/mf_tempfile.c:
Fix for windows
mysys/my_lock.c:
Ensure that locking doesn't interfere with pread/pwrite on windows
mysys/my_winthread.c:
Portability fix
sql-bench/Results/ATIS-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/RUN-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/alter-table-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/big-tables-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/connect-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/create-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/insert-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/select-mysql-NT_4.0:
New benchmark runs
sql-bench/Results/wisconsin-mysql-NT_4.0:
New benchmark runs
sql-bench/crash-me.sh:
Fixed things for PostgreSQL
sql-bench/limits/mysql-3.23.cfg:
Update for new crash-me
sql-bench/limits/mysql.cfg:
Update for new crash-me
sql-bench/print-limit-table:
Fixed position for alter table rename
sql-bench/test-insert.sh:
Fix for PostgreSQL
sql/field.cc:
Fix for default values in CREATE ... SELECT
sql/field.h:
Fix for default values in CREATE ... SELECT
sql/log.cc:
Fixed typo
sql/log_event.cc:
Portability fix
sql/mysqlbinlog.cc:
Portability fix
sql/mysqld.cc:
Don't turn of concurrent insert with --skip-new or --safe
sql/sql_base.cc:
Portability fix
sql/sql_class.cc:
Portability fix
sql/sql_class.h:
Portability fix
sql/sql_parse.cc:
Fix for --log-slow-queries
sql/sql_repl.cc:
Portability fixes
sql/sql_select.cc:
Fixed optimizer bug for LEFT JOIN
sql/sql_select.h:
Fixed optimizer bug for LEFT JOIN
sql/sql_table.cc:
Fix for default values in CREATE ... SELECT
sql/sql_yacc.yy:
Added optional AS to: CREATE TABLE foo [ AS ] SELECT ...
Diffstat (limited to 'myisam/sort.c')
-rw-r--r-- | myisam/sort.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/myisam/sort.c b/myisam/sort.c index 436fa5a3c67..a2a28ec9109 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -128,8 +128,8 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, } if (memavl < MIN_SORT_MEMORY) { - mi_check_print_error(info->sort_info->param,"Sort buffer to small"); - goto err; + mi_check_print_error(info->sort_info->param,"Sort buffer to small"); /* purecov: tested */ + goto err; /* purecov: tested */ } (*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */ @@ -138,13 +138,13 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, if ((records=find_all_keys(info,keys,sort_keys,buffpek,&maxbuffer,&tempfile)) == HA_POS_ERROR) - goto err; + goto err; /* purecov: tested */ if (maxbuffer == 0) { if (!no_messages) printf(" - Dumping %lu keys\n",records); if (write_index(info,sort_keys,(uint) records)) - goto err; + goto err; /* purecov: inspected */ } else { @@ -152,17 +152,17 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, if (maxbuffer >= MERGEBUFF2) { if (!no_messages) - printf(" - Merging %lu keys\n",records); + printf(" - Merging %lu keys\n",records); /* purecov: tested */ if (merge_many_buff(info,keys,sort_keys,buffpek,&maxbuffer,&tempfile)) - goto err; + goto err; /* purecov: inspected */ } if (flush_io_cache(&tempfile) || reinit_io_cache(&tempfile,READ_CACHE,0L,0,0)) - goto err; + goto err; /* purecov: inspected */ if (!no_messages) - puts(" - Last merge and dumping keys"); + puts(" - Last merge and dumping keys"); /* purecov: tested */ if (merge_index(info,keys,sort_keys,buffpek,maxbuffer,&tempfile)) - goto err; + goto err; /* purecov: inspected */ } error =0; @@ -195,17 +195,17 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys, { if (indexpos >= (uint) *maxbuffer || write_keys(info,sort_keys,idx-1,buffpek+indexpos,tempfile)) - DBUG_RETURN((ha_rows) -1); + DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length); idx=1; indexpos++; } } if (error > 0) - DBUG_RETURN(HA_POS_ERROR); /* Aborted by get_key */ + DBUG_RETURN(HA_POS_ERROR); /* Aborted by get_key */ /* purecov: inspected */ if (indexpos) if (indexpos >= (uint) *maxbuffer || write_keys(info,sort_keys,idx,buffpek+indexpos,tempfile)) - DBUG_RETURN(HA_POS_ERROR); + DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ *maxbuffer=(int) indexpos; DBUG_RETURN(indexpos*(keys-1)+idx); } /* find_all_keys */ @@ -226,13 +226,13 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, if (!my_b_inited(tempfile) && open_cached_file(tempfile, info->tmpdir, "ST", DISK_BUFFER_SIZE, info->myf_rw)) - DBUG_RETURN(1); + DBUG_RETURN(1); /* purecov: inspected */ buffpek->file_pos=my_b_tell(tempfile); buffpek->count=count; for (end=sort_keys+count ; sort_keys != end ; sort_keys++) if (my_b_write(tempfile,(byte*) *sort_keys,(uint) sort_length)) - DBUG_RETURN(1); + DBUG_RETURN(1); /* purecov: inspected */ DBUG_RETURN(0); } /* write_keys */ @@ -248,7 +248,7 @@ static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys, (qsort2_cmp) info->key_cmp,info->sort_info); while (count--) if ((*info->key_write)(info->sort_info,*sort_keys++)) - DBUG_RETURN(-1); + DBUG_RETURN(-1); /* purecov: inspected */ DBUG_RETURN(0); } /* write_index */ @@ -281,11 +281,11 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys, { if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++, buffpek+i,buffpek+i+MERGEBUFF-1)) - break; + break; /* purecov: inspected */ } if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++, buffpek+i,buffpek+ *maxbuffer)) - break; + break; /* purecov: inspected */ if (flush_io_cache(to_file)) break; /* purecov: inspected */ temp=from_file; from_file=to_file; to_file=temp; @@ -350,19 +350,19 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, if (init_queue(&queue,(uint) (Tb-Fb)+1,offsetof(BUFFPEK,key),0, (int (*)(void*, byte *,byte*)) info->key_cmp, (void*) info->sort_info)) - DBUG_RETURN(1); + DBUG_RETURN(1); /* purecov: inspected */ - for (buffpek= Fb ; buffpek <= Tb && error != -1 ; buffpek++) + for (buffpek= Fb ; buffpek <= Tb ; buffpek++) { count+= buffpek->count; buffpek->base= strpos; buffpek->max_keys=maxcount; strpos+= (uint) (error=(int) read_to_buffer(from_file,buffpek, sort_length)); + if (error == -1) + goto err; /* purecov: inspected */ queue_insert(&queue,(void*) buffpek); } - if (error == -1) - goto err; while (queue.elements > 1) { @@ -373,14 +373,14 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, { if (my_b_write(to_file,(byte*) buffpek->key,(uint) sort_length)) { - error=1; goto err; + error=1; goto err; /* purecov: inspected */ } } else { if ((*info->key_write)(info->sort_info,(void*) buffpek->key)) { - error=1; goto err; + error=1; goto err; /* purecov: inspected */ } } buffpek->key+=sort_length; @@ -429,7 +429,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, if (my_b_write(to_file,(byte*) buffpek->key, (sort_length*buffpek->mem_count))) { - error=1; goto err; + error=1; goto err; /* purecov: inspected */ } } else @@ -442,7 +442,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, { if ((*info->key_write)(info->sort_info,(void*) strpos)) { - error=1; goto err; + error=1; goto err; /* purecov: inspected */ } } } @@ -468,7 +468,7 @@ merge_index(MI_SORT_PARAM *info, uint keys, uchar **sort_keys, DBUG_ENTER("merge_index"); if (merge_buffers(info,keys,tempfile,(IO_CACHE*) 0,sort_keys,buffpek,buffpek, buffpek+maxbuffer)) - DBUG_RETURN(1); + DBUG_RETURN(1); /* purecov: inspected */ DBUG_RETURN(0); } /* merge_index */ |