Here's a simple workaround.  I ran into that once and I did this:

delete from simple_table where 1=1

That'll tell you how many tables were affected.  This is, however, much
slower.  I think there's some kind of optimization for a mass delete that
doesn't require scanning the table to count the rows.

---
[EMAIL PROTECTED]


On Sat, 16 Jan 1999, root wrote:

> >Description:
>       A mass delete such as "delete from stock;" works correctly by
>       deleting all rows, however mySQL reports "0 rows affected".
>       The 0 report happens in interactive "mysql" as well as in C++
>       programs written to check the MysqlResNSel structure.  I've
>       been using the C++ classes mysql++ v64.1.1.a.  This prevents
>       a programmer from programmatically determining how many
>       rows were affected by a mass delete and taking a different
>       branch in the code if the number affected was > 0.
> >How-To-Repeat:
>       Create a simple table, 1 column is enough
>       Add 3 or 4 rows to the table
>       From mysql issue "select * from simple_table"
>               to confirm the rows exist
>       From mysql issue "delete from simple_table"
>       mysql will report:
>               Query OK, 0 rows affected (0.03 sec)
>       From mysql issue "select * from simple_table"
>               to see that the rows were deleted
> >Fix:
>       None Known
> 
> >Submitter-Id:        <submitter ID>
> >Originator:  root
> >Organization:
>       No Organization - Home User (Personal User)
> >MySQL support: NONE
> >Synopsis:    Mass Deletes work, but report 0 rows affected
> >Severity:    critical
> >Priority:    high
> >Category:    mysql
> >Class:               sw-bug
> >Release:     mysql-3.22.14-gamma (TCX binary)
> >Server: /usr/local/mysql/bin/mysqladmin  Ver 7.8 Distrib 3.22.14-gamma, for 
>pc-linux-gnu on i686
> TCX Datakonsult AB, by Monty
> 
> Server version                3.22.14-gamma-log
> Protocol version      10
> Connection            Localhost via UNIX socket
> UNIX socket           /tmp/mysql.sock
> Uptime:                       1 day 1 hour 33 min 30 sec
> 
> Threads: 2  Questions: 152  Slow queries: 0  Opens: 38  Flush tables: 1  Open 
>tables: 12
> >Environment:
>       HP Vectra Kayak  (Intel Pentium II 350mhz) 64Mb ram
> System: Linux zegers.hlb.cable.rcn.com 2.0.35 #1 Tue Oct 13 19:22:41 JST 1998 i686 
>unknown
> Architecture: i686
> 
> Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
> GCC: Reading specs from /usr/lib/gcc-lib/i486-pc-linux-gnu/egcs-2.91.57/specs
> gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
> Compilation info: CC='gcc'  CFLAGS='-O6 -mpentium -mstack-align-double 
>-fomit-frame-pointer'  CXX='gcc'  CXXFLAGS='-O6 -mpentium -mstack-align-double 
>-fomit-frame-pointer -felide-constructors'  LDFLAGS='-static'
> Configure command: ./configure  --prefix=/usr/local/mysql '--with-comment=TCX 
>binary' --enable-assembler --with-mysqld-ldflags=-all-static 
>--with-client-ldflags=-all-static --disable-shared
> Perl: This is perl, version 5.005_02 built for i386-linux
> 
> 
> 
> 
> 
> 
> 
> -----------------------------------------------------------
> Send a mail to [EMAIL PROTECTED] with
> unsubscribe mysql [EMAIL PROTECTED]
> in the body of the message to unsubscribe from this list.
> 

-----------------------------------------------------------
Send a mail to [EMAIL PROTECTED] with
unsubscribe mysql [EMAIL PROTECTED]
in the body of the message to unsubscribe from this list.

Reply via email to