diff --git a/Docs/manual.texi b/Docs/manual.texi index df6be904ced..864322bbb75 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -48953,6 +48953,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item +Fixed problem on win98 that made sending of results very slow. +@item Boolean fulltext search weighting scheme changed to something more reasonable. @item Fixed bug in boolean fulltext search, that caused MySQL to ignore queries of diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index baa6f5a72f2..feee3451f51 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -848,13 +848,13 @@ static void mysql_read_default_options(struct st_mysql_options *options, options->client_flag&= CLIENT_LOCAL_FILES; break; case 23: /* replication probe */ - options->rpl_probe = 1; + options->rpl_probe= 1; break; case 24: /* enable-reads-from-master */ - options->rpl_parse = 1; + options->no_master_reads= 0; break; case 25: /* repl-parse-query */ - options->no_master_reads = 0; + options->rpl_parse= 1; break; default: DBUG_PRINT("warning",("unknown option: %s",option[0])); diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 24b585985c0..c3883ed0961 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -481,15 +481,15 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) continue; end=ftsi.pos+ftsi.len; - while (ft_simple_get_word((byte **)&ftsi.pos,(byte *)end,&word)) + while (ft_simple_get_word((byte **) &ftsi.pos,(byte *) end, &word)) { int a, b, c; for (a=0, b=ftb->queue.elements, c=(a+b)/2; b-a>1; c=(a+b)/2) { ftbw=(FTB_WORD *)(ftb->list[c]); - if (_mi_compare_text(ftb->charset, word.pos,word.len, - (uchar*) ftbw->word+1,ftbw->len-1, - (ftbw->flags&FTB_FLAG_TRUNC) ) >0) + if (_mi_compare_text(ftb->charset, word.pos, word.len, + (uchar*) ftbw->word+1, ftbw->len-1, + (my_bool) (ftbw->flags&FTB_FLAG_TRUNC)) >0) b=c; else a=c; @@ -498,8 +498,8 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) { ftbw=(FTB_WORD *)(ftb->list[c]); if (_mi_compare_text(ftb->charset, word.pos,word.len, - (uchar*) ftbw->word+1,ftbw->len-1, - (ftbw->flags&FTB_FLAG_TRUNC) )) + (uchar*) ftbw->word+1,ftbw->len-1, + (my_bool) (ftbw->flags&FTB_FLAG_TRUNC))) break; if (ftbw->docid[1] == docid) continue; diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 0bd542d2bd9..8e6fdbbbec5 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -105,6 +105,8 @@ static long thread_id=0; my_bool my_thread_init(void) { struct st_my_thread_var *tmp; + my_bool error=0; + #ifdef EXTRA_DEBUG_THREADS fprintf(stderr,"my_thread_init(): thread_id=%ld\n",pthread_self()); #endif @@ -117,16 +119,14 @@ my_bool my_thread_init(void) { #ifdef EXTRA_DEBUG fprintf(stderr,"my_thread_init() called more than once in thread %ld\n", - pthread_self()); + pthread_self()); #endif - pthread_mutex_unlock(&THR_LOCK_lock); - return 0; /* Safequard */ + goto end; } - if (!(tmp=(struct st_my_thread_var *) - calloc(1, sizeof(struct st_my_thread_var)))) + if (!(tmp= (struct st_my_thread_var *) calloc(1, sizeof(*tmp)))) { - pthread_mutex_unlock(&THR_LOCK_lock); - return 1; + error= 1; + goto end; } pthread_setspecific(THR_KEY_mysys,tmp); @@ -146,7 +146,7 @@ end: #if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX) pthread_mutex_unlock(&THR_LOCK_lock); #endif - return 0; + return error; } void my_thread_end(void) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 88854396ae3..4d6c4ba1bb9 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -195,6 +195,7 @@ send_fields(THD *thd,List &list,uint flag) Item *item; char buff[80]; CONVERT *convert= (flag & 4) ? (CONVERT*) 0 : thd->convert_set; + DBUG_ENTER("send_fields"); String tmp((char*) buff,sizeof(buff)),*res,*packet= &thd->packet; @@ -255,11 +256,11 @@ send_fields(THD *thd,List &list,uint flag) if (my_net_write(&thd->net, (char*) packet->ptr(),packet->length())) break; /* purecov: inspected */ } - send_eof(&thd->net); - return 0; + send_eof(&thd->net,1); + DBUG_RETURN(0); err: send_error(&thd->net,ER_OUT_OF_RESOURCES); /* purecov: inspected */ - return 1; /* purecov: inspected */ + DBUG_RETURN(1); /* purecov: inspected */ } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index f5a5a684fc0..9d1037a9dc7 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -182,7 +182,9 @@ cleanup: thd->lock=0; } if (deleted) - query_cache_invalidate3(thd, table_list, 1); + { + query_cache_invalidate3(thd, table_list, 1); + } delete select; if (error >= 0) // Fatal error send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN: 0); @@ -470,7 +472,9 @@ bool multi_delete::send_eof() VOID(ha_autocommit_or_rollback(thd,error > 0)); } if (deleted) + { query_cache_invalidate3(thd, delete_tables, 1); + } ::send_ok(&thd->net,deleted); return 0; } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 69fc7c00955..6cc4f258c65 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -311,7 +311,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List &fields, } thd->proc_info="end"; if (info.copied || info.deleted) + { query_cache_invalidate3(thd, table_list, 1); + } table->time_stamp=save_time_stamp; // Restore auto timestamp ptr table->next_number_field=0; thd->count_cuted_fields=0; @@ -1330,7 +1332,9 @@ void select_insert::send_error(uint errcode,const char *err) table->file->activate_all_index(thd); ha_rollback_stmt(thd); if (info.copied || info.deleted) + { query_cache_invalidate3(thd, table, 1); + } } @@ -1343,8 +1347,9 @@ bool select_insert::send_eof() if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) error=error2; if (info.copied || info.deleted) + { query_cache_invalidate3(thd, table, 1); - + } if (error) { table->file->print_error(error,MYF(0)); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index db520af61c1..f8a0d169d5a 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -324,7 +324,9 @@ int mysql_update(THD *thd, thd->lock=0; } if (updated) + { query_cache_invalidate3(thd, table_list, 1); + } delete select; if (error >= 0) @@ -788,8 +790,9 @@ bool multi_update::send_eof() sprintf(buff,ER(ER_UPDATE_INFO), (long) found, (long) updated, (long) thd->cuted_fields); if (updated) + { query_cache_invalidate3(thd, update_tables, 1); - + } ::send_ok(&thd->net, (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated, thd->insert_id_used ? thd->insert_id() : 0L,buff); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 63bfb217b52..79227bcc3f9 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1237,11 +1237,11 @@ alter_list_item: lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0)); lex->simple_alter=0; } - | RENAME opt_to table_alias table_ident + | RENAME opt_to table_ident { LEX *lex=Lex; - lex->select->db=$4->db.str; - lex->name= $4->table.str; + lex->select->db=$3->db.str; + lex->name= $3->table.str; lex->simple_alter=0; } | create_table_options { Lex->simple_alter=0; } @@ -1268,6 +1268,7 @@ opt_place: opt_to: /* empty */ {} | TO_SYM {} + | EQ {} | AS {}; slave: diff --git a/vio/vio.c b/vio/vio.c index 62814e50240..67cb7ec95cd 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -96,7 +96,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) sprintf(vio->desc, (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), vio->sd); -#if !defined(___WIN__) && !defined(__EMX__) +#if !defined(___WIN__) && !defined(__EMX__) && !defined(OS2) #if !defined(NO_FCNTL_NONBLOCK) vio->fcntl_mode = fcntl(sd, F_GETFL); #elif defined(HAVE_SYS_IOCTL_H) /* hpux */ diff --git a/vio/viosocket.c b/vio/viosocket.c index 14b4305b95a..85e239f29ac 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -87,7 +87,7 @@ int vio_write(Vio * vio, const gptr buf, int size) int r; DBUG_ENTER("vio_write"); DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); -#ifdef __WIN__ +#if defined( __WIN__) if ( vio->type == VIO_TYPE_NAMEDPIPE) { DWORD length; @@ -95,7 +95,7 @@ int vio_write(Vio * vio, const gptr buf, int size) DBUG_RETURN(-1); DBUG_RETURN(length); } - r = send(vio->sd, buf, size,0); + r = send(vio->sd, buf, size, 0); #else r = write(vio->sd, buf, size); #endif /* __WIN__ */