Commit 37d6a4e4 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0

parents ba8a5fdc 9d0f8a1b
...@@ -48987,6 +48987,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. ...@@ -48987,6 +48987,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet @itemize @bullet
@item @item
Fixed problem on win98 that made sending of results very slow.
@item
Boolean fulltext search weighting scheme changed to something more reasonable. Boolean fulltext search weighting scheme changed to something more reasonable.
@item @item
Fixed bug in boolean fulltext search, that caused MySQL to ignore queries of Fixed bug in boolean fulltext search, that caused MySQL to ignore queries of
...@@ -848,13 +848,13 @@ static void mysql_read_default_options(struct st_mysql_options *options, ...@@ -848,13 +848,13 @@ static void mysql_read_default_options(struct st_mysql_options *options,
options->client_flag&= CLIENT_LOCAL_FILES; options->client_flag&= CLIENT_LOCAL_FILES;
break; break;
case 23: /* replication probe */ case 23: /* replication probe */
options->rpl_probe = 1; options->rpl_probe= 1;
break; break;
case 24: /* enable-reads-from-master */ case 24: /* enable-reads-from-master */
options->rpl_parse = 1; options->no_master_reads= 0;
break; break;
case 25: /* repl-parse-query */ case 25: /* repl-parse-query */
options->no_master_reads = 0; options->rpl_parse= 1;
break; break;
default: default:
DBUG_PRINT("warning",("unknown option: %s",option[0])); DBUG_PRINT("warning",("unknown option: %s",option[0]));
......
...@@ -481,15 +481,15 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) ...@@ -481,15 +481,15 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
continue; continue;
end=ftsi.pos+ftsi.len; 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; int a, b, c;
for (a=0, b=ftb->queue.elements, c=(a+b)/2; b-a>1; c=(a+b)/2) for (a=0, b=ftb->queue.elements, c=(a+b)/2; b-a>1; c=(a+b)/2)
{ {
ftbw=(FTB_WORD *)(ftb->list[c]); ftbw=(FTB_WORD *)(ftb->list[c]);
if (_mi_compare_text(ftb->charset, word.pos,word.len, if (_mi_compare_text(ftb->charset, word.pos, word.len,
(uchar*) ftbw->word+1,ftbw->len-1, (uchar*) ftbw->word+1, ftbw->len-1,
(ftbw->flags&FTB_FLAG_TRUNC) ) >0) (my_bool) (ftbw->flags&FTB_FLAG_TRUNC)) >0)
b=c; b=c;
else else
a=c; a=c;
...@@ -499,7 +499,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) ...@@ -499,7 +499,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
ftbw=(FTB_WORD *)(ftb->list[c]); ftbw=(FTB_WORD *)(ftb->list[c]);
if (_mi_compare_text(ftb->charset, word.pos,word.len, if (_mi_compare_text(ftb->charset, word.pos,word.len,
(uchar*) ftbw->word+1,ftbw->len-1, (uchar*) ftbw->word+1,ftbw->len-1,
(ftbw->flags&FTB_FLAG_TRUNC) )) (my_bool) (ftbw->flags&FTB_FLAG_TRUNC)))
break; break;
if (ftbw->docid[1] == docid) if (ftbw->docid[1] == docid)
continue; continue;
......
...@@ -105,6 +105,8 @@ static long thread_id=0; ...@@ -105,6 +105,8 @@ static long thread_id=0;
my_bool my_thread_init(void) my_bool my_thread_init(void)
{ {
struct st_my_thread_var *tmp; struct st_my_thread_var *tmp;
my_bool error=0;
#ifdef EXTRA_DEBUG_THREADS #ifdef EXTRA_DEBUG_THREADS
fprintf(stderr,"my_thread_init(): thread_id=%ld\n",pthread_self()); fprintf(stderr,"my_thread_init(): thread_id=%ld\n",pthread_self());
#endif #endif
...@@ -119,14 +121,12 @@ my_bool my_thread_init(void) ...@@ -119,14 +121,12 @@ my_bool my_thread_init(void)
fprintf(stderr,"my_thread_init() called more than once in thread %ld\n", fprintf(stderr,"my_thread_init() called more than once in thread %ld\n",
pthread_self()); pthread_self());
#endif #endif
pthread_mutex_unlock(&THR_LOCK_lock); goto end;
return 0; /* Safequard */
} }
if (!(tmp=(struct st_my_thread_var *) if (!(tmp= (struct st_my_thread_var *) calloc(1, sizeof(*tmp))))
calloc(1, sizeof(struct st_my_thread_var))))
{ {
pthread_mutex_unlock(&THR_LOCK_lock); error= 1;
return 1; goto end;
} }
pthread_setspecific(THR_KEY_mysys,tmp); pthread_setspecific(THR_KEY_mysys,tmp);
...@@ -146,7 +146,7 @@ end: ...@@ -146,7 +146,7 @@ end:
#if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX) #if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX)
pthread_mutex_unlock(&THR_LOCK_lock); pthread_mutex_unlock(&THR_LOCK_lock);
#endif #endif
return 0; return error;
} }
void my_thread_end(void) void my_thread_end(void)
......
...@@ -195,6 +195,7 @@ send_fields(THD *thd,List<Item> &list,uint flag) ...@@ -195,6 +195,7 @@ send_fields(THD *thd,List<Item> &list,uint flag)
Item *item; Item *item;
char buff[80]; char buff[80];
CONVERT *convert= (flag & 4) ? (CONVERT*) 0 : thd->convert_set; CONVERT *convert= (flag & 4) ? (CONVERT*) 0 : thd->convert_set;
DBUG_ENTER("send_fields");
String tmp((char*) buff,sizeof(buff)),*res,*packet= &thd->packet; String tmp((char*) buff,sizeof(buff)),*res,*packet= &thd->packet;
...@@ -255,11 +256,11 @@ send_fields(THD *thd,List<Item> &list,uint flag) ...@@ -255,11 +256,11 @@ send_fields(THD *thd,List<Item> &list,uint flag)
if (my_net_write(&thd->net, (char*) packet->ptr(),packet->length())) if (my_net_write(&thd->net, (char*) packet->ptr(),packet->length()))
break; /* purecov: inspected */ break; /* purecov: inspected */
} }
send_eof(&thd->net); send_eof(&thd->net,1);
return 0; DBUG_RETURN(0);
err: err:
send_error(&thd->net,ER_OUT_OF_RESOURCES); /* purecov: inspected */ send_error(&thd->net,ER_OUT_OF_RESOURCES); /* purecov: inspected */
return 1; /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */
} }
......
...@@ -182,7 +182,9 @@ cleanup: ...@@ -182,7 +182,9 @@ cleanup:
thd->lock=0; thd->lock=0;
} }
if (deleted) if (deleted)
{
query_cache_invalidate3(thd, table_list, 1); query_cache_invalidate3(thd, table_list, 1);
}
delete select; delete select;
if (error >= 0) // Fatal error if (error >= 0) // Fatal error
send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN: 0); send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN: 0);
...@@ -470,7 +472,9 @@ bool multi_delete::send_eof() ...@@ -470,7 +472,9 @@ bool multi_delete::send_eof()
VOID(ha_autocommit_or_rollback(thd,error > 0)); VOID(ha_autocommit_or_rollback(thd,error > 0));
} }
if (deleted) if (deleted)
{
query_cache_invalidate3(thd, delete_tables, 1); query_cache_invalidate3(thd, delete_tables, 1);
}
::send_ok(&thd->net,deleted); ::send_ok(&thd->net,deleted);
return 0; return 0;
} }
......
...@@ -311,7 +311,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields, ...@@ -311,7 +311,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
} }
thd->proc_info="end"; thd->proc_info="end";
if (info.copied || info.deleted) if (info.copied || info.deleted)
{
query_cache_invalidate3(thd, table_list, 1); query_cache_invalidate3(thd, table_list, 1);
}
table->time_stamp=save_time_stamp; // Restore auto timestamp ptr table->time_stamp=save_time_stamp; // Restore auto timestamp ptr
table->next_number_field=0; table->next_number_field=0;
thd->count_cuted_fields=0; thd->count_cuted_fields=0;
...@@ -1330,7 +1332,9 @@ void select_insert::send_error(uint errcode,const char *err) ...@@ -1330,7 +1332,9 @@ void select_insert::send_error(uint errcode,const char *err)
table->file->activate_all_index(thd); table->file->activate_all_index(thd);
ha_rollback_stmt(thd); ha_rollback_stmt(thd);
if (info.copied || info.deleted) if (info.copied || info.deleted)
{
query_cache_invalidate3(thd, table, 1); query_cache_invalidate3(thd, table, 1);
}
} }
...@@ -1343,8 +1347,9 @@ bool select_insert::send_eof() ...@@ -1343,8 +1347,9 @@ bool select_insert::send_eof()
if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error)
error=error2; error=error2;
if (info.copied || info.deleted) if (info.copied || info.deleted)
{
query_cache_invalidate3(thd, table, 1); query_cache_invalidate3(thd, table, 1);
}
if (error) if (error)
{ {
table->file->print_error(error,MYF(0)); table->file->print_error(error,MYF(0));
......
...@@ -324,7 +324,9 @@ int mysql_update(THD *thd, ...@@ -324,7 +324,9 @@ int mysql_update(THD *thd,
thd->lock=0; thd->lock=0;
} }
if (updated) if (updated)
{
query_cache_invalidate3(thd, table_list, 1); query_cache_invalidate3(thd, table_list, 1);
}
delete select; delete select;
if (error >= 0) if (error >= 0)
...@@ -788,8 +790,9 @@ bool multi_update::send_eof() ...@@ -788,8 +790,9 @@ bool multi_update::send_eof()
sprintf(buff,ER(ER_UPDATE_INFO), (long) found, (long) updated, sprintf(buff,ER(ER_UPDATE_INFO), (long) found, (long) updated,
(long) thd->cuted_fields); (long) thd->cuted_fields);
if (updated) if (updated)
{
query_cache_invalidate3(thd, update_tables, 1); query_cache_invalidate3(thd, update_tables, 1);
}
::send_ok(&thd->net, ::send_ok(&thd->net,
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated, (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated,
thd->insert_id_used ? thd->insert_id() : 0L,buff); thd->insert_id_used ? thd->insert_id() : 0L,buff);
......
...@@ -1237,11 +1237,11 @@ alter_list_item: ...@@ -1237,11 +1237,11 @@ alter_list_item:
lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0)); lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0));
lex->simple_alter=0; lex->simple_alter=0;
} }
| RENAME opt_to table_alias table_ident | RENAME opt_to table_ident
{ {
LEX *lex=Lex; LEX *lex=Lex;
lex->select->db=$4->db.str; lex->select->db=$3->db.str;
lex->name= $4->table.str; lex->name= $3->table.str;
lex->simple_alter=0; lex->simple_alter=0;
} }
| create_table_options { Lex->simple_alter=0; } | create_table_options { Lex->simple_alter=0; }
...@@ -1268,6 +1268,7 @@ opt_place: ...@@ -1268,6 +1268,7 @@ opt_place:
opt_to: opt_to:
/* empty */ {} /* empty */ {}
| TO_SYM {} | TO_SYM {}
| EQ {}
| AS {}; | AS {};
slave: slave:
......
...@@ -96,7 +96,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) ...@@ -96,7 +96,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
sprintf(vio->desc, sprintf(vio->desc,
(vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
vio->sd); vio->sd);
#if !defined(___WIN__) && !defined(__EMX__) #if !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
#if !defined(NO_FCNTL_NONBLOCK) #if !defined(NO_FCNTL_NONBLOCK)
vio->fcntl_mode = fcntl(sd, F_GETFL); vio->fcntl_mode = fcntl(sd, F_GETFL);
#elif defined(HAVE_SYS_IOCTL_H) /* hpux */ #elif defined(HAVE_SYS_IOCTL_H) /* hpux */
......
...@@ -87,7 +87,7 @@ int vio_write(Vio * vio, const gptr buf, int size) ...@@ -87,7 +87,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
int r; int r;
DBUG_ENTER("vio_write"); DBUG_ENTER("vio_write");
DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size));
#ifdef __WIN__ #if defined( __WIN__)
if ( vio->type == VIO_TYPE_NAMEDPIPE) if ( vio->type == VIO_TYPE_NAMEDPIPE)
{ {
DWORD length; DWORD length;
...@@ -95,7 +95,7 @@ int vio_write(Vio * vio, const gptr buf, int size) ...@@ -95,7 +95,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
DBUG_RETURN(-1); DBUG_RETURN(-1);
DBUG_RETURN(length); DBUG_RETURN(length);
} }
r = send(vio->sd, buf, size,0); r = send(vio->sd, buf, size, 0);
#else #else
r = write(vio->sd, buf, size); r = write(vio->sd, buf, size);
#endif /* __WIN__ */ #endif /* __WIN__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment