Commit 9e9f21a5 authored by Sinisa@sinisa.nasamreza.org's avatar Sinisa@sinisa.nasamreza.org

Merge sinisa@work.mysql.com:/home/bk/mysql-4.0

into sinisa.nasamreza.org:/mnt/hdc/Sinisa/mysql-4.0
parents a973b855 ce09acfb
...@@ -12,10 +12,12 @@ ...@@ -12,10 +12,12 @@
.*.swp .*.swp
.deps .deps
.gdb_history .gdb_history
.gdbinit
.libs .libs
.o .o
.out .out
.snprj/* .snprj/*
.vimrc
BitKeeper/etc/config BitKeeper/etc/config
BitKeeper/etc/csets BitKeeper/etc/csets
BitKeeper/etc/csets-in BitKeeper/etc/csets-in
...@@ -199,6 +201,7 @@ libmysqld/ha_isammrg.cc ...@@ -199,6 +201,7 @@ libmysqld/ha_isammrg.cc
libmysqld/ha_myisam.cc libmysqld/ha_myisam.cc
libmysqld/ha_myisammrg.cc libmysqld/ha_myisammrg.cc
libmysqld/handler.cc libmysqld/handler.cc
libmysqld/hash_filo.cc
libmysqld/hostname.cc libmysqld/hostname.cc
libmysqld/init.cc libmysqld/init.cc
libmysqld/item.cc libmysqld/item.cc
...@@ -251,8 +254,10 @@ libmysqld/sql_string.cc ...@@ -251,8 +254,10 @@ libmysqld/sql_string.cc
libmysqld/sql_table.cc libmysqld/sql_table.cc
libmysqld/sql_test.cc libmysqld/sql_test.cc
libmysqld/sql_udf.cc libmysqld/sql_udf.cc
libmysqld/sql_unions.cc
libmysqld/sql_update.cc libmysqld/sql_update.cc
libmysqld/sql_yacc.cc libmysqld/sql_yacc.cc
libmysqld/stacktrace.c
libmysqld/table.cc libmysqld/table.cc
libmysqld/thr_malloc.cc libmysqld/thr_malloc.cc
libmysqld/time.cc libmysqld/time.cc
...@@ -265,6 +270,7 @@ linked_libmysql_r_sources ...@@ -265,6 +270,7 @@ linked_libmysql_r_sources
linked_libmysql_sources linked_libmysql_sources
linked_libmysqld_sources linked_libmysqld_sources
linked_server_sources linked_server_sources
locked
myisam/ft_dump myisam/ft_dump
myisam/ft_eval myisam/ft_eval
myisam/ft_test1 myisam/ft_test1
...@@ -279,6 +285,7 @@ mysql-test/gmon.out ...@@ -279,6 +285,7 @@ mysql-test/gmon.out
mysql-test/install_test_db mysql-test/install_test_db
mysql-test/mysql-test-run mysql-test/mysql-test-run
mysql-test/r/*.reject mysql-test/r/*.reject
mysql-test/r/rpl_log.eval
mysql-test/share/mysql mysql-test/share/mysql
mysql-test/var/* mysql-test/var/*
mysql.proj mysql.proj
...@@ -307,6 +314,7 @@ scripts/mysql_zap ...@@ -307,6 +314,7 @@ scripts/mysql_zap
scripts/mysqlaccess scripts/mysqlaccess
scripts/mysqlbug scripts/mysqlbug
scripts/mysqld_multi scripts/mysqld_multi
scripts/mysqld_safe
scripts/mysqldumpslow scripts/mysqldumpslow
scripts/mysqlhotcopy scripts/mysqlhotcopy
scripts/safe_mysqld scripts/safe_mysqld
...@@ -341,6 +349,7 @@ sql/mysqld ...@@ -341,6 +349,7 @@ sql/mysqld
sql/share/*.sys sql/share/*.sys
sql/share/charsets/gmon.out sql/share/charsets/gmon.out
sql/share/gmon.out sql/share/gmon.out
sql/share/mysql
sql/share/norwegian-ny/errmsg.sys sql/share/norwegian-ny/errmsg.sys
sql/share/norwegian/errmsg.sys sql/share/norwegian/errmsg.sys
sql/sql_yacc.cc sql/sql_yacc.cc
...@@ -364,11 +373,3 @@ support-files/mysql.server ...@@ -364,11 +373,3 @@ support-files/mysql.server
support-files/mysql.spec support-files/mysql.spec
tags tags
tmp/* tmp/*
libmysqld/hash_filo.cc
libmysqld/sql_unions.cc
libmysqld/stacktrace.c
sql/share/mysql
.gdbinit
.vimrc
scripts/mysqld_safe
mysql-test/r/rpl_log.eval
...@@ -7,7 +7,7 @@ eval select $BIG_TEST as using_big_test; ...@@ -7,7 +7,7 @@ eval select $BIG_TEST as using_big_test;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12)); create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12), index(id2)); create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3)); create table t3(id3 int not null, t char(12), index(id3));
let $1 = 10000; let $1 = 10000;
while ($1) while ($1)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */ MA 02111-1307, USA */
/* Written by Sinisa Milivojevic <sinisa@coresinc.com> */ /* Written by Sinisa Milivojevic <sinisa@mysql.com> */
#include <global.h> #include <global.h>
#ifdef HAVE_COMPRESS #ifdef HAVE_COMPRESS
......
...@@ -685,7 +685,6 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, ...@@ -685,7 +685,6 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
uchar *strpos; uchar *strpos;
BUFFPEK *buffpek,**refpek; BUFFPEK *buffpek,**refpek;
QUEUE queue; QUEUE queue;
volatile bool *killed= &current_thd->killed;
qsort2_cmp cmp; qsort2_cmp cmp;
DBUG_ENTER("merge_buffers"); DBUG_ENTER("merge_buffers");
...@@ -739,10 +738,6 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, ...@@ -739,10 +738,6 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
while (queue.elements > 1) while (queue.elements > 1)
{ {
if (*killed)
{
error=1; goto err; /* purecov: inspected */
}
for (;;) for (;;)
{ {
buffpek=(BUFFPEK*) queue_top(&queue); buffpek=(BUFFPEK*) queue_top(&queue);
......
...@@ -410,6 +410,8 @@ public: ...@@ -410,6 +410,8 @@ public:
** This is used to get result from a select ** This is used to get result from a select
*/ */
class JOIN;
class select_result :public Sql_alloc { class select_result :public Sql_alloc {
protected: protected:
THD *thd; THD *thd;
...@@ -419,6 +421,7 @@ public: ...@@ -419,6 +421,7 @@ public:
virtual int prepare(List<Item> &list) { return 0; } virtual int prepare(List<Item> &list) { return 0; }
virtual bool send_fields(List<Item> &list,uint flag)=0; virtual bool send_fields(List<Item> &list,uint flag)=0;
virtual bool send_data(List<Item> &items)=0; virtual bool send_data(List<Item> &items)=0;
virtual void initialize_tables (JOIN *join=0) {};
virtual void send_error(uint errcode,const char *err)=0; virtual void send_error(uint errcode,const char *err)=0;
virtual bool send_eof()=0; virtual bool send_eof()=0;
virtual void abort() {} virtual void abort() {}
...@@ -621,6 +624,7 @@ public: ...@@ -621,6 +624,7 @@ public:
bool send_fields(List<Item> &list, bool send_fields(List<Item> &list,
uint flag) { return 0; } uint flag) { return 0; }
bool send_data(List<Item> &items); bool send_data(List<Item> &items);
void initialize_tables (JOIN *join);
void send_error(uint errcode,const char *err); void send_error(uint errcode,const char *err);
int do_deletes (bool from_send_error); int do_deletes (bool from_send_error);
bool send_eof(); bool send_eof();
......
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB & Sinisa
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "mysql_priv.h" #include "mysql_priv.h"
#include "ha_innobase.h" #include "ha_innobase.h"
#include "sql_select.h"
/* /*
Optimize delete of all rows by doing a full generate of the table Optimize delete of all rows by doing a full generate of the table
...@@ -315,12 +316,14 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt, ...@@ -315,12 +316,14 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
#endif #endif
(void) dt->table->file->extra(HA_EXTRA_NO_READCHECK); (void) dt->table->file->extra(HA_EXTRA_NO_READCHECK);
(void) dt->table->file->extra(HA_EXTRA_NO_KEYREAD);
/* Don't use key read with MULTI-TABLE-DELETE */ /* Don't use key read with MULTI-TABLE-DELETE */
dt->table->used_keys=0; dt->table->used_keys=0;
for (dt=dt->next ; dt ; dt=dt->next,counter++) for (dt=dt->next ; dt ; dt=dt->next,counter++)
{ {
TABLE *table=dt->table; TABLE *table=dt->table;
(void) table->file->extra(HA_EXTRA_NO_READCHECK); (void) dt->table->file->extra(HA_EXTRA_NO_READCHECK);
(void) dt->table->file->extra(HA_EXTRA_NO_KEYREAD);
#ifdef SINISAS_STRIP #ifdef SINISAS_STRIP
tempfiles[counter]=(IO_CACHE *) sql_alloc(sizeof(IO_CACHE)); tempfiles[counter]=(IO_CACHE *) sql_alloc(sizeof(IO_CACHE));
if (open_cached_file(tempfiles[counter], mysql_tmpdir,TEMP_PREFIX, if (open_cached_file(tempfiles[counter], mysql_tmpdir,TEMP_PREFIX,
...@@ -363,6 +366,39 @@ multi_delete::prepare(List<Item> &values) ...@@ -363,6 +366,39 @@ multi_delete::prepare(List<Item> &values)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
inline static void
link_in_list(SQL_LIST *list,byte *element,byte **next)
{
list->elements++;
(*list->next)=element;
list->next=next;
*next=0;
}
void
multi_delete::initialize_tables(JOIN *join)
{
SQL_LIST *new_list=(SQL_LIST *) sql_alloc(sizeof(SQL_LIST));
new_list->elements=0; new_list->first=0;
new_list->next= (byte**) &(new_list->first);
for (JOIN_TAB *tab=join->join_tab, *end=join->join_tab+join->tables;
tab < end;
tab++)
{
TABLE_LIST *walk;
for (walk=(TABLE_LIST*) delete_tables ; walk ; walk=walk->next)
if (!strcmp(tab->table->path,walk->table->path))
break;
if (walk) // Table need not be the one to be deleted
{
register TABLE_LIST *ptr = (TABLE_LIST *) sql_alloc(sizeof(TABLE_LIST));
memcpy(ptr,walk,sizeof(TABLE_LIST)); ptr->next=0;
link_in_list(new_list,(byte*) ptr,(byte**) &ptr->next);
}
}
delete_tables=(TABLE_LIST *)new_list->first;
return;
}
multi_delete::~multi_delete() multi_delete::~multi_delete()
{ {
......
...@@ -385,6 +385,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, ...@@ -385,6 +385,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
thd->fatal_error) thd->fatal_error)
goto err; goto err;
thd->proc_info="preparing"; thd->proc_info="preparing";
result->initialize_tables(&join);
if ((tmp=join_read_const_tables(&join)) > 0) if ((tmp=join_read_const_tables(&join)) > 0)
goto err; goto err;
if (tmp && !(select_options & SELECT_DESCRIBE)) if (tmp && !(select_options & SELECT_DESCRIBE))
......
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