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
25223439
Commit
25223439
authored
Jul 23, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into mysql.com:/usr/home/ram/work/5.0.b8143
parents
774300af
16878843
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
mysql-test/r/delete.result
mysql-test/r/delete.result
+10
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+11
-0
sql/sql_delete.cc
sql/sql_delete.cc
+8
-0
No files found.
mysql-test/r/delete.result
View file @
25223439
...
...
@@ -192,3 +192,13 @@ delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
select * from t3;
a b
drop table t1,t2,t3;
create table t1(a date not null);
insert into t1 values (0);
select * from t1 where a is null;
a
0000-00-00
delete from t1 where a is null;
select count(*) from t1;
count(*)
0
drop table t1;
mysql-test/t/delete.test
View file @
25223439
...
...
@@ -171,3 +171,14 @@ delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
# This should be empty
select
*
from
t3
;
drop
table
t1
,
t2
,
t3
;
#
# Bug #8143: deleting '0000-00-00' values using IS NULL
#
create
table
t1
(
a
date
not
null
);
insert
into
t1
values
(
0
);
select
*
from
t1
where
a
is
null
;
delete
from
t1
where
a
is
null
;
select
count
(
*
)
from
t1
;
drop
table
t1
;
sql/sql_delete.cc
View file @
25223439
...
...
@@ -91,6 +91,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
/* Handler didn't support fast delete; Delete rows one by one */
}
if
(
conds
)
{
Item
::
cond_result
result
;
conds
=
remove_eq_conds
(
thd
,
conds
,
&
result
);
if
(
result
==
Item
::
COND_FALSE
)
// Impossible where
limit
=
0
;
}
table
->
used_keys
.
clear_all
();
table
->
quick_keys
.
clear_all
();
// Can't use 'only index'
select
=
make_select
(
table
,
0
,
0
,
conds
,
0
,
&
error
);
...
...
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