Commit cded0f91 authored by unknown's avatar unknown

bk resolve changes


sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_delete.cc:
  Same as above
parents 01dc56a5 f38e2320
...@@ -2,25 +2,34 @@ drop table if exists t1,t2,t3; ...@@ -2,25 +2,34 @@ 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), index(id2));
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 = 3; let $1 = 10000;
while ($1) while ($1)
{ {
let $2 = 3; let $2 = 5;
eval insert into t1(t) values ('$1'); eval insert into t1(t) values ('$1');
while ($2) while ($2)
{ {
eval insert into t2(id2,t) values ($1,'$2'); eval insert into t2(id2,t) values ($1,'$2');
eval insert into t3(id3,t) values ($1,'$2'); let $3 = 10;
while ($3)
{
eval insert into t3(id3,t) values ($1,'$2');
dec $3;
}
dec $2; dec $2;
} }
dec $1; dec $1;
} }
delete t1.*,t2.* from t1,t2 where t1.id1 = t2.id2 and t1.id1 = 3; delete t1.*, t2.*, t3.* from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 9500;
delete t3 from t3 left join t1 on (id1=id3) where t1.id1 is null;
delete t2 from t1,t2,t3 where id1=id2 and id2=id3 and id1=2; check table t1, t2, t3;
select * from t1;
select * from t2; select * from t1 where id1 > 9500;
select * from t3; select * from t2 where id2 > 9500;
delete t1,t2 from t1,t2 where 1; select * from t3 where id3 > 9500;
drop table t1,t2,t3;
delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 500;
select * from t1 where id1 > 500;
select * from t2 where id2 > 500;
select * from t3 where id3 > 500;
...@@ -383,7 +383,7 @@ multi_delete::~multi_delete() ...@@ -383,7 +383,7 @@ multi_delete::~multi_delete()
if (tempfiles[counter]) if (tempfiles[counter])
{ {
#ifdef SINISAS_STRIP #ifdef SINISAS_STRIP
// end_io_cache(tempfiles[counter]); end_io_cache(tempfiles[counter]);
#else #else
delete tempfiles[counter]; delete tempfiles[counter];
#endif #endif
...@@ -594,12 +594,15 @@ static IO_CACHE *strip_duplicates_from_temp (byte *memory_lane, IO_CACHE *ptr, u ...@@ -594,12 +594,15 @@ static IO_CACHE *strip_duplicates_from_temp (byte *memory_lane, IO_CACHE *ptr, u
int read_error, write_error, how_many_to_read, total_to_read = *written, pieces_in_memory = 0, mem_count,written_rows; int read_error, write_error, how_many_to_read, total_to_read = *written, pieces_in_memory = 0, mem_count,written_rows;
int offset = written_rows=*written=0; int offset = written_rows=*written=0;
int mem_pool_size = MEM_STRIP_BUF_SIZE * MAX_REFLENGTH / ref_length; int mem_pool_size = MEM_STRIP_BUF_SIZE * MAX_REFLENGTH / ref_length;
IO_CACHE *tempptr = (IO_CACHE *) sql_alloc(sizeof(IO_CACHE));
byte dup_record[MAX_REFLENGTH]; memset(dup_record,'\xFF',MAX_REFLENGTH); byte dup_record[MAX_REFLENGTH]; memset(dup_record,'\xFF',MAX_REFLENGTH);
if (reinit_io_cache(ptr,READ_CACHE,0L,0,0)) if (reinit_io_cache(ptr,READ_CACHE,0L,0,0))
return ptr; return ptr;
IO_CACHE *tempptr = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), MYF(MY_FAE | MY_ZEROFILL));
if (open_cached_file(tempptr, mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE, MYF(MY_WME))) if (open_cached_file(tempptr, mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE, MYF(MY_WME)))
{
my_free((gptr) tempptr, MYF (0));
return ptr; return ptr;
}
DYNAMIC_ARRAY written_blocks; DYNAMIC_ARRAY written_blocks;
VOID(init_dynamic_array(&written_blocks,sizeof(struct written_block),20,50)); VOID(init_dynamic_array(&written_blocks,sizeof(struct written_block),20,50));
for (;pieces_in_memory < total_to_read;) for (;pieces_in_memory < total_to_read;)
......
...@@ -2438,6 +2438,12 @@ mysql_new_select(LEX *lex) ...@@ -2438,6 +2438,12 @@ mysql_new_select(LEX *lex)
SELECT_LEX *select_lex = (SELECT_LEX *)sql_calloc(sizeof(SELECT_LEX)); SELECT_LEX *select_lex = (SELECT_LEX *)sql_calloc(sizeof(SELECT_LEX));
lex->select->next=select_lex; lex->select->next=select_lex;
lex->select=select_lex; lex->select->select_number = ++select_no; lex->select=select_lex; lex->select->select_number = ++select_no;
lex->select->item_list = lex->select_lex.item_list;
lex->select->item_list.empty();
lex->select->table_list = lex->select_lex.table_list;
lex->select->table_list.elements=0;
lex->select->table_list.first=0;
lex->select->table_list.next= (byte**) &lex->select->table_list.first;
} }
void void
......
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