Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
43ad6617
Commit
43ad6617
authored
Dec 02, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/psergey/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-compile
parents
a17de3dd
d010fd10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
5 deletions
+84
-5
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+27
-0
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+47
-1
sql/uniques.cc
sql/uniques.cc
+10
-4
No files found.
mysql-test/r/multi_update.result
View file @
43ad6617
...
@@ -363,3 +363,30 @@ t2 rows after big delete 1900001
...
@@ -363,3 +363,30 @@ t2 rows after big delete 1900001
select 't1 rows after big delete', count(*) from t1;
select 't1 rows after big delete', count(*) from t1;
t1 rows after big delete count(*)
t1 rows after big delete count(*)
t1 rows after big delete 1900001
t1 rows after big delete 1900001
drop table t1,t2;
set @ttype_save=@@table_type;
set @@table_type=innodb;
create table t1 ( c char(8) not null );
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
alter table t1 add b char(8) not null;
alter table t1 add a char(8) not null;
alter table t1 add primary key (a,b,c);
update t1 set a=c, b=c;
create table t2 like t1;
insert into t2 select * from t1;
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
drop table t1,t2;
set @@table_type=bdb;
create table t1 ( c char(8) not null );
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
alter table t1 add b char(8) not null;
alter table t1 add a char(8) not null;
alter table t1 add primary key (a,b,c);
update t1 set a=c, b=c;
create table t2 like t1;
insert into t2 select * from t1;
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
set @@table_type=@ttype_save;
drop table t1,t2;
mysql-test/t/multi_update.test
View file @
43ad6617
...
@@ -309,4 +309,50 @@ delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
...
@@ -309,4 +309,50 @@ delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
select
't2 rows after big delete'
,
count
(
*
)
from
t2
;
select
't2 rows after big delete'
,
count
(
*
)
from
t2
;
select
't1 rows after big delete'
,
count
(
*
)
from
t1
;
select
't1 rows after big delete'
,
count
(
*
)
from
t1
;
#drop table t1,t2;
drop
table
t1
,
t2
;
#
# Test for bug #1980.
#
set
@
ttype_save
=@@
table_type
;
--
disable_warnings
set
@@
table_type
=
innodb
;
create
table
t1
(
c
char
(
8
)
not
null
);
--
enable_warnings
insert
into
t1
values
(
'0'
),(
'1'
),(
'2'
),(
'3'
),(
'4'
),(
'5'
),(
'6'
),(
'7'
),(
'8'
),(
'9'
);
insert
into
t1
values
(
'A'
),(
'B'
),(
'C'
),(
'D'
),(
'E'
),(
'F'
);
alter
table
t1
add
b
char
(
8
)
not
null
;
alter
table
t1
add
a
char
(
8
)
not
null
;
alter
table
t1
add
primary
key
(
a
,
b
,
c
);
update
t1
set
a
=
c
,
b
=
c
;
create
table
t2
like
t1
;
insert
into
t2
select
*
from
t1
;
delete
t1
,
t2
from
t2
,
t1
where
t1
.
a
<
'B'
and
t2
.
b
=
t1
.
b
;
drop
table
t1
,
t2
;
--
disable_warnings
set
@@
table_type
=
bdb
;
create
table
t1
(
c
char
(
8
)
not
null
);
--
enable_warnings
insert
into
t1
values
(
'0'
),(
'1'
),(
'2'
),(
'3'
),(
'4'
),(
'5'
),(
'6'
),(
'7'
),(
'8'
),(
'9'
);
insert
into
t1
values
(
'A'
),(
'B'
),(
'C'
),(
'D'
),(
'E'
),(
'F'
);
alter
table
t1
add
b
char
(
8
)
not
null
;
alter
table
t1
add
a
char
(
8
)
not
null
;
alter
table
t1
add
primary
key
(
a
,
b
,
c
);
update
t1
set
a
=
c
,
b
=
c
;
create
table
t2
like
t1
;
insert
into
t2
select
*
from
t1
;
delete
t1
,
t2
from
t2
,
t1
where
t1
.
a
<
'B'
and
t2
.
b
=
t1
.
b
;
set
@@
table_type
=@
ttype_save
;
drop
table
t1
,
t2
;
sql/uniques.cc
View file @
43ad6617
...
@@ -37,14 +37,20 @@
...
@@ -37,14 +37,20 @@
int
unique_write_to_file
(
gptr
key
,
element_count
count
,
Unique
*
unique
)
int
unique_write_to_file
(
gptr
key
,
element_count
count
,
Unique
*
unique
)
{
{
/*
Use unique->size (size of element stored in the tree) and not
unique->tree.size_of_element. The latter is different from unique->size
when tree implementation chooses to store pointer to key in TREE_ELEMENT
(instead of storing the element itself there)
*/
return
my_b_write
(
&
unique
->
file
,
(
byte
*
)
key
,
return
my_b_write
(
&
unique
->
file
,
(
byte
*
)
key
,
unique
->
tree
.
size_of_element
)
?
1
:
0
;
unique
->
size
)
?
1
:
0
;
}
}
int
unique_write_to_ptrs
(
gptr
key
,
element_count
count
,
Unique
*
unique
)
int
unique_write_to_ptrs
(
gptr
key
,
element_count
count
,
Unique
*
unique
)
{
{
memcpy
(
unique
->
record_pointers
,
key
,
unique
->
tree
.
size_of_element
);
memcpy
(
unique
->
record_pointers
,
key
,
unique
->
size
);
unique
->
record_pointers
+=
unique
->
tree
.
size_of_element
;
unique
->
record_pointers
+=
unique
->
size
;
return
0
;
return
0
;
}
}
...
@@ -133,7 +139,7 @@ bool Unique::get(TABLE *table)
...
@@ -133,7 +139,7 @@ bool Unique::get(TABLE *table)
sort_param
.
max_rows
=
elements
;
sort_param
.
max_rows
=
elements
;
sort_param
.
sort_form
=
table
;
sort_param
.
sort_form
=
table
;
sort_param
.
rec_length
=
sort_param
.
sort_length
=
sort_param
.
ref_length
=
sort_param
.
rec_length
=
sort_param
.
sort_length
=
sort_param
.
ref_length
=
tree
.
size_of_element
;
size
;
sort_param
.
keys
=
max_in_memory_size
/
sort_param
.
sort_length
;
sort_param
.
keys
=
max_in_memory_size
/
sort_param
.
sort_length
;
sort_param
.
not_killable
=
1
;
sort_param
.
not_killable
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment