mirror of
https://github.com/MariaDB/server.git
synced 2026-04-24 09:15:30 +02:00
"delete from table where const" bug fixed
This commit is contained in:
parent
ba886f1086
commit
155b8e0013
2 changed files with 7 additions and 1 deletions
|
|
@ -53,5 +53,11 @@ select * from t1 where misc > 5 and bool is null;
|
|||
delete from t1 where misc > 5 and bool is null;
|
||||
select * from t1 where misc > 5 and bool is null;
|
||||
|
||||
select count(*) from t1;
|
||||
delete from t1 where 1 > 2;
|
||||
select count(*) from t1;
|
||||
delete from t1 where 3 > 2;
|
||||
select count(*) from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
|
|||
DBUG_RETURN(-1);
|
||||
|
||||
/* Test if the user wants to delete all rows */
|
||||
if (!using_limit && (!conds || conds->const_item()) &&
|
||||
if (!using_limit && (!conds || (conds->const_item() && conds->val_int())) &&
|
||||
!(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) && !safe_update)
|
||||
{
|
||||
deleted= table->file->records;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue