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
b196f030
Commit
b196f030
authored
Dec 11, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-4.0
into rurik.mysql.com:/home/igor/dev/mysql-4.0-1
parents
22c12eae
9570d010
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
3 deletions
+64
-3
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+23
-0
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+26
-0
sql/sql_class.h
sql/sql_class.h
+3
-0
sql/sql_delete.cc
sql/sql_delete.cc
+5
-1
sql/sql_update.cc
sql/sql_update.cc
+6
-2
No files found.
BitKeeper/etc/logging_ok
View file @
b196f030
...
@@ -34,6 +34,7 @@ hf@deer.(none)
...
@@ -34,6 +34,7 @@ hf@deer.(none)
hf@deer.mysql.r18.ru
hf@deer.mysql.r18.ru
hf@genie.(none)
hf@genie.(none)
igor@hundin.mysql.fi
igor@hundin.mysql.fi
igor@rurik.mysql.com
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-jkl1657.dial.inet.fi
jani@hynda.(none)
jani@hynda.(none)
jani@hynda.mysql.fi
jani@hynda.mysql.fi
...
...
mysql-test/r/multi_update.result
View file @
b196f030
...
@@ -327,3 +327,26 @@ select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and
...
@@ -327,3 +327,26 @@ select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and
a b a b
a b a b
2 2 NULL NULL
2 2 NULL NULL
drop table t1,t2;
drop table t1,t2;
drop table if exists t1, t2;
create table t1(id1 smallint(5), field char(5));
create table t2(id2 smallint(5), field char(5));
insert into t1 values (1, 'a'), (2, 'aa');
insert into t2 values (1, 'b'), (2, 'bb');
select * from t1;
id1 field
1 a
2 aa
select * from t2;
id2 field
1 b
2 bb
update t2 inner join t1 on t1.id1=t2.id2
set t2.field=t1.field
where 0=1;
update t2, t1 set t2.field=t1.field
where t1.id1=t2.id2 and 0=1;
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
where 0=1;
delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
mysql-test/t/multi_update.test
View file @
b196f030
...
@@ -267,3 +267,29 @@ insert into t2 values (1,1), (3,1);
...
@@ -267,3 +267,29 @@ insert into t2 values (1,1), (3,1);
update
t1
left
join
t2
on
t1
.
a
=
t2
.
a
set
t1
.
b
=
2
,
t2
.
b
=
2
where
t1
.
b
=
1
and
t2
.
b
=
1
or
t2
.
a
is
NULL
;
update
t1
left
join
t2
on
t1
.
a
=
t2
.
a
set
t1
.
b
=
2
,
t2
.
b
=
2
where
t1
.
b
=
1
and
t2
.
b
=
1
or
t2
.
a
is
NULL
;
select
t1
.
a
,
t1
.
b
,
t2
.
a
,
t2
.
b
from
t1
left
join
t2
on
t1
.
a
=
t2
.
a
where
t1
.
b
=
1
and
t2
.
b
=
1
or
t2
.
a
is
NULL
;
select
t1
.
a
,
t1
.
b
,
t2
.
a
,
t2
.
b
from
t1
left
join
t2
on
t1
.
a
=
t2
.
a
where
t1
.
b
=
1
and
t2
.
b
=
1
or
t2
.
a
is
NULL
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
# Test multi-update and multi-delete with impossible where
drop
table
if
exists
t1
,
t2
;
create
table
t1
(
id1
smallint
(
5
),
field
char
(
5
));
create
table
t2
(
id2
smallint
(
5
),
field
char
(
5
));
insert
into
t1
values
(
1
,
'a'
),
(
2
,
'aa'
);
insert
into
t2
values
(
1
,
'b'
),
(
2
,
'bb'
);
select
*
from
t1
;
select
*
from
t2
;
update
t2
inner
join
t1
on
t1
.
id1
=
t2
.
id2
set
t2
.
field
=
t1
.
field
where
0
=
1
;
update
t2
,
t1
set
t2
.
field
=
t1
.
field
where
t1
.
id1
=
t2
.
id2
and
0
=
1
;
delete
t1
,
t2
from
t2
inner
join
t1
on
t1
.
id1
=
t2
.
id2
where
0
=
1
;
delete
t1
,
t2
from
t2
,
t1
where
t1
.
id1
=
t2
.
id2
and
0
=
1
;
drop
table
t1
,
t2
;
sql/sql_class.h
View file @
b196f030
...
@@ -848,6 +848,8 @@ class multi_delete : public select_result
...
@@ -848,6 +848,8 @@ class multi_delete : public select_result
uint
num_of_tables
;
uint
num_of_tables
;
int
error
;
int
error
;
bool
do_delete
,
transactional_tables
,
log_delayed
,
normal_tables
;
bool
do_delete
,
transactional_tables
,
log_delayed
,
normal_tables
;
bool
tempfiles_inited
;
public:
public:
multi_delete
(
THD
*
thd
,
TABLE_LIST
*
dt
,
uint
num_of_tables
);
multi_delete
(
THD
*
thd
,
TABLE_LIST
*
dt
,
uint
num_of_tables
);
~
multi_delete
();
~
multi_delete
();
...
@@ -874,6 +876,7 @@ class multi_update : public select_result
...
@@ -874,6 +876,7 @@ class multi_update : public select_result
Copy_field
*
copy_field
;
Copy_field
*
copy_field
;
enum
enum_duplicates
handle_duplicates
;
enum
enum_duplicates
handle_duplicates
;
bool
do_update
,
trans_safe
,
transactional_tables
,
log_delayed
;
bool
do_update
,
trans_safe
,
transactional_tables
,
log_delayed
;
bool
tmp_tables_inited
;
public:
public:
multi_update
(
THD
*
thd_arg
,
TABLE_LIST
*
ut
,
List
<
Item
>
*
fields
,
multi_update
(
THD
*
thd_arg
,
TABLE_LIST
*
ut
,
List
<
Item
>
*
fields
,
...
...
sql/sql_delete.cc
View file @
b196f030
...
@@ -236,7 +236,8 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
...
@@ -236,7 +236,8 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
uint
num_of_tables_arg
)
uint
num_of_tables_arg
)
:
delete_tables
(
dt
),
thd
(
thd_arg
),
deleted
(
0
),
:
delete_tables
(
dt
),
thd
(
thd_arg
),
deleted
(
0
),
num_of_tables
(
num_of_tables_arg
),
error
(
0
),
num_of_tables
(
num_of_tables_arg
),
error
(
0
),
do_delete
(
0
),
transactional_tables
(
0
),
log_delayed
(
0
),
normal_tables
(
0
)
do_delete
(
0
),
transactional_tables
(
0
),
log_delayed
(
0
),
normal_tables
(
0
),
tempfiles_inited
(
0
)
{
{
tempfiles
=
(
Unique
**
)
sql_calloc
(
sizeof
(
Unique
*
)
*
(
num_of_tables
-
1
));
tempfiles
=
(
Unique
**
)
sql_calloc
(
sizeof
(
Unique
*
)
*
(
num_of_tables
-
1
));
}
}
...
@@ -297,6 +298,7 @@ multi_delete::initialize_tables(JOIN *join)
...
@@ -297,6 +298,7 @@ multi_delete::initialize_tables(JOIN *join)
table
->
file
->
ref_length
,
table
->
file
->
ref_length
,
MEM_STRIP_BUF_SIZE
);
MEM_STRIP_BUF_SIZE
);
}
}
tempfiles_inited
=
1
;
init_ftfuncs
(
thd
,
1
);
init_ftfuncs
(
thd
,
1
);
DBUG_RETURN
(
thd
->
fatal_error
!=
0
);
DBUG_RETURN
(
thd
->
fatal_error
!=
0
);
}
}
...
@@ -422,6 +424,8 @@ int multi_delete::do_deletes(bool from_send_error)
...
@@ -422,6 +424,8 @@ int multi_delete::do_deletes(bool from_send_error)
table_being_deleted
=
delete_tables
;
table_being_deleted
=
delete_tables
;
do_delete
=
0
;
do_delete
=
0
;
if
(
!
tempfiles_inited
)
DBUG_RETURN
(
0
);
for
(
table_being_deleted
=
table_being_deleted
->
next
;
for
(
table_being_deleted
=
table_being_deleted
->
next
;
table_being_deleted
;
table_being_deleted
;
table_being_deleted
=
table_being_deleted
->
next
,
counter
++
)
table_being_deleted
=
table_being_deleted
->
next
,
counter
++
)
...
...
sql/sql_update.cc
View file @
b196f030
...
@@ -440,7 +440,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
...
@@ -440,7 +440,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
:
all_tables
(
table_list
),
update_tables
(
0
),
thd
(
thd_arg
),
tmp_tables
(
0
),
:
all_tables
(
table_list
),
update_tables
(
0
),
thd
(
thd_arg
),
tmp_tables
(
0
),
updated
(
0
),
found
(
0
),
fields
(
field_list
),
values
(
value_list
),
updated
(
0
),
found
(
0
),
fields
(
field_list
),
values
(
value_list
),
table_count
(
0
),
copy_field
(
0
),
handle_duplicates
(
handle_duplicates_arg
),
table_count
(
0
),
copy_field
(
0
),
handle_duplicates
(
handle_duplicates_arg
),
do_update
(
1
),
trans_safe
(
0
)
do_update
(
1
),
trans_safe
(
0
)
,
tmp_tables_inited
(
0
)
{}
{}
...
@@ -622,6 +622,7 @@ multi_update::initialize_tables(JOIN *join)
...
@@ -622,6 +622,7 @@ multi_update::initialize_tables(JOIN *join)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
tmp_tables
[
cnt
]
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
tmp_tables
[
cnt
]
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
}
}
tmp_tables_inited
=
1
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
@@ -819,8 +820,11 @@ int multi_update::do_updates(bool from_send_error)
...
@@ -819,8 +820,11 @@ int multi_update::do_updates(bool from_send_error)
ha_rows
org_updated
;
ha_rows
org_updated
;
TABLE
*
table
;
TABLE
*
table
;
DBUG_ENTER
(
"do_updates"
);
DBUG_ENTER
(
"do_updates"
);
do_update
=
0
;
// Don't retry this function
do_update
=
0
;
// Don't retry this function
if
(
!
tmp_tables_inited
)
DBUG_RETURN
(
0
);
for
(
cur_table
=
update_tables
;
cur_table
;
cur_table
=
cur_table
->
next
)
for
(
cur_table
=
update_tables
;
cur_table
;
cur_table
=
cur_table
->
next
)
{
{
table
=
cur_table
->
table
;
table
=
cur_table
->
table
;
...
...
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