Still need help with this, guys. :) I read that was a problem with the list
being over some limit (?). So, in case you did not receive this, I hereby
resent it. Otherwise, I am sorry for posting it twice.

Thanks,

- Mark


------------------------------------
Ok, rebuillding a table, I did (in Perl):

    $sth = $dbh -> prepare ("LOCK TABLES $table WRITE");
    die $dbh->errstr if (not defined ($sth -> execute));

    $sth = $dbh -> prepare ("DELETE FROM $table");
    die $dbh->errstr if (not defined ($sth -> execute));

This truncated the table. Then I filled the table anew, and, at the end
(before the UNLOCK), issued:

    $sth = $dbh -> prepare ("OPTIMIZE TABLE $table");
    die $dbh->errstr if (not defined ($sth -> execute));

Then... the ENTIRE table is gone after the optimize! If I do not run the
optimize, the table is fully restored. But once I optimize it, it is flat
gone!

I am not so new as to cry "bug" the moment something escapes my grasp; but I
find this very odd, to say the least. I know OPTIMIZE reclaims losts space
and such. But what seems to have happened, is that the newly filled rows
(that went over the old onces that were deleted) now also get deleted by the
OPTIMIZE. If not a bug, then that behavior, pardon my French, is downright
crazy. If RE-USED old rows get wiped after an OPTIMIZE, then there is
something rotten in the state of Denmark. :) I mean, re-used rows are in use
again!

This seems related to the LOCK. If I do not LOCK the table first, everything
is ok, even after the OPTIMIZE. But with the table still LOCKED (as I am,
obviously, still writing to it), all re-used rows in the table just get
wiped out after the OPTIMIZE!

Yes, I am the guy that decided to set up shop at home too, on my Windows XP
machine, to test out a few things before using them on my production server.
Good thing I did. :)

I tried this on both my FreeBSD box, MySQL 3.32.49 and my home editions,
version 3.23.52; the result is the same in both cases.

Please, any suggestions would be helpful,

Thanks,

- Mark


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to