MySQL Forums
Forum List  »  Certification

Posted by: Neeraj Vasudeva
Date: July 26, 2007 03:12PM


I was trying to use TRUNCATE TABLE command, and as per certification book MySQL® 5.0 Certification Study Guide,(Section 11.5. The DELETE and TRUNCATE TABLE Statements) it says that Truncate never returns the no. of rows it removed from table, where as to my surprised it did returned the no. of rows but issue is these are NOT the correct rows returned.

Refer to below code

mysql> create table newcity select * from city;
Query OK, 4079 rows affected (0.24 sec)
Records: 4079 Duplicates: 0 Warnings: 0

mysql> truncate table newcity;
Query OK, 3727 rows affected (0.08 sec)

Ideally Truncate table should have returned 4079 instead it returned 3727 rows. Any idea about this issue ?

I am using 5.0.22-community-nt & the table newcity has ENGINE as Innodb

Waiting for reply.


Neeraj Vasudeva

Options: ReplyQuote

Written By
July 26, 2007 03:12PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.