Commit 9d0f8a1b authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fixed that enable-reads-from-master and repl-parse-query works in option files.

Fixed slowdown problem on win98
Fixed syntax for ALTER TABLE .. RENAME
parent 36f81cb5
......@@ -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
......@@ -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]));
......
......@@ -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;
......
......@@ -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)
......
......@@ -195,6 +195,7 @@ send_fields(THD *thd,List<Item> &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<Item> &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 */
}
......
......@@ -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;
}
......
......@@ -311,7 +311,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &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));
......
......@@ -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);
......
......@@ -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:
......
......@@ -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 */
......
......@@ -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__ */
......
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