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
6b559096
Commit
6b559096
authored
Dec 11, 2004
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#5837 - attempt 3.
Call mark_as_null_row in join_read_const and join_read_system.
parent
e8885a08
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+6
-0
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+9
-0
sql/sql_select.cc
sql/sql_select.cc
+8
-2
sql/table.h
sql/table.h
+8
-2
No files found.
mysql-test/r/multi_update.result
View file @
6b559096
...
@@ -399,3 +399,9 @@ select * from t2;
...
@@ -399,3 +399,9 @@ select * from t2;
c2_id c2_p_id c2_note c2_active
c2_id c2_p_id c2_note c2_active
1 1 A Note 1
1 1 A Note 1
drop table t1, t2;
drop table t1, t2;
drop table if exists t2, t1;
create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb;
create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb;
insert into t2 values(1,null);
delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1';
drop table t1, t2;
mysql-test/t/multi_update.test
View file @
6b559096
...
@@ -337,3 +337,12 @@ update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
...
@@ -337,3 +337,12 @@ update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
select
*
from
t1
;
select
*
from
t1
;
select
*
from
t2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
# Test for BUG#5837 - delete with outer join and const tables
drop
table
if
exists
t2
,
t1
;
create
table
t1
(
aclid
bigint
not
null
primary
key
,
status
tinyint
(
1
)
not
null
)
type
=
innodb
;
create
table
t2
(
refid
bigint
not
null
primary
key
,
aclid
bigint
,
index
idx_acl
(
aclid
)
)
type
=
innodb
;
insert
into
t2
values
(
1
,
null
);
delete
t2
,
t1
from
t2
as
a
left
join
t1
as
b
on
(
a
.
aclid
=
b
.
aclid
)
where
a
.
refid
=
'1'
;
drop
table
t1
,
t2
;
sql/sql_select.cc
View file @
6b559096
...
@@ -4951,7 +4951,10 @@ join_read_system(JOIN_TAB *tab)
...
@@ -4951,7 +4951,10 @@ join_read_system(JOIN_TAB *tab)
table
->
file
->
print_error
(
error
,
MYF
(
0
));
table
->
file
->
print_error
(
error
,
MYF
(
0
));
return
1
;
return
1
;
}
}
table
->
null_row
=
1
;
// This is ok.
if
(
tab
->
on_expr
)
mark_as_null_row
(
tab
->
table
);
else
table
->
null_row
=
1
;
// Why do this for inner join?
empty_record
(
table
);
// Make empty record
empty_record
(
table
);
// Make empty record
return
-
1
;
return
-
1
;
}
}
...
@@ -4981,7 +4984,10 @@ join_read_const(JOIN_TAB *tab)
...
@@ -4981,7 +4984,10 @@ join_read_const(JOIN_TAB *tab)
}
}
if
(
error
)
if
(
error
)
{
{
table
->
null_row
=
1
;
if
(
tab
->
on_expr
)
mark_as_null_row
(
tab
->
table
);
else
table
->
null_row
=
1
;
empty_record
(
table
);
empty_record
(
table
);
if
(
error
!=
HA_ERR_KEY_NOT_FOUND
)
if
(
error
!=
HA_ERR_KEY_NOT_FOUND
)
{
{
...
...
sql/table.h
View file @
6b559096
...
@@ -89,8 +89,14 @@ struct st_table {
...
@@ -89,8 +89,14 @@ struct st_table {
int
current_lock
;
/* Type of lock on table */
int
current_lock
;
/* Type of lock on table */
enum
tmp_table_type
tmp_table
;
enum
tmp_table_type
tmp_table
;
my_bool
copy_blobs
;
/* copy_blobs when storing */
my_bool
copy_blobs
;
/* copy_blobs when storing */
my_bool
null_row
;
/* All columns are null */
/*
my_bool
maybe_null
,
outer_join
;
/* Used with OUTER JOIN */
Used in outer joins: if true, all columns are considered to have NULL
values, including columns declared as "not null".
*/
my_bool
null_row
;
/* 0 or JOIN_TYPE_{LEFT|RIGHT}, same as TABLE_LIST::outer_join */
my_bool
outer_join
;
my_bool
maybe_null
;
/* true if (outer_join != 0) */
my_bool
force_index
;
my_bool
force_index
;
my_bool
distinct
,
const_table
,
no_rows
;
my_bool
distinct
,
const_table
,
no_rows
;
my_bool
key_read
,
bulk_insert
;
my_bool
key_read
,
bulk_insert
;
...
...
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