List:General Discussion« Previous MessageNext Message »
From:Martin Edelius Date:March 19 1999 1:30pm
Subject:SV: delete returns incorect number of deleted rows.
View as plain text  
The manual clearly states that when deleting all rows MySQL recreates
the table as an empty table and can therefor not know how many rows that
were affected. It's not an bug, it's a feature.


Best regards,
Martin Edelius
Spirex Digital Design

--------------------------------
www: http://www.spirex.se
Mail: martin.edelius@stripped
Phone: +46-31-514651, 0708-113711
Fax: +46-31-514331
S-422 43 Hisings Backa
--------------------------------


-----Ursprungligt meddelande-----
Till: mysql@stripped <mysql@stripped>
Datum: den 19 mars 1999 14:12


>>Description:
>
>delete from table returns 0 rows affected when all the rows are
affected.
>
>>How-To-Repeat:
>
>First make a table that has some data (in this case was called
CATEGORY_MEMBERS.
>Then execute as follows.
>
>mysql> select * from CATEGORY_MEMBERS;
>+----+--------+--------+
>| ID | REC_ID | CAT_ID |
>+----+--------+--------+
>|  1 |      1 |      1 |
>|  2 |      2 |      2 |
>+----+--------+--------+
>2 rows in set (0.00 sec)
>
>mysql> delete from CATEGORY_MEMBERS where ID = 2;
>Query OK, 1 row affected (0.00 sec)
>
>mysql> select * from CATEGORY_MEMBERS;
>+----+--------+--------+
>| ID | REC_ID | CAT_ID |
>+----+--------+--------+
>|  1 |      1 |      1 |
>+----+--------+--------+
>1 row in set (0.01 sec)
>
>mysql> delete from CATEGORY_MEMBERS;
>Query OK, 0 rows affected (0.01 sec)
>
>mysql> select * from CATEGORY_MEMBERS;
>Empty set (0.01 sec)
>
>>Fix:
>
>
>>Submitter-Id: <submitter ID>
>>Originator: Piff Super-User
>>Organization:
>
>>MySQL support: none
>>Synopsis: delete from returns incorrect # of affected rows if deleting
all rows.
>>Severity: non-critical
>>Priority: medium
>>Category: mysql
>>Class: sw-bug
>>Release: mysql-3.22.20a (TCX binary)
>
>>Environment:
>
>System: SunOS piff 5.7 Generic sun4u sparc SUNW,Ultra-5_10
>Architecture: sun4
>
>Some paths:  /usr/local/bin/perl /usr/local/bin/make
/usr/local/bin/gmake /usr/local/bin/gcc /usr/local/bin/cc
>GCC: Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.8.1/specs
>gcc version 2.8.1
>Compilation info: CC='gcc'  CFLAGS='-O3 -fomit-frame-pointer'
CXX='gcc'

CXXFLAGS='-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions 
-fno-rtti'  LDFLAGS=''
>Configure command: ./configure  --prefix=/usr/local/mysql
'--with-comment=TCX binary' --with-low-memory --disable-shared
>Perl: This is perl, version 5.004_04 built for sun4-solaris
>
>---------------------------------------------------------------------
>To request this thread, e-mail mysql-thread595@stripped
>To unsubscribe, e-mail the address shown in the
>List-Unsubscribe header of this message.
>For additional commands, e-mail: mysql-help@stripped
>
>


Thread
SV: delete returns incorect number of deleted rows.Martin Edelius19 Mar
  • Re: SV: delete returns incorect number of deleted rows.James Nord19 Mar