[mythtv-users] Confused About HDHomeRun

Michael T. Dean mtdean at thirdcontact.com
Wed Oct 3 17:42:37 UTC 2007


On 10/03/2007 01:29 PM, David Brodbeck wrote:
> On Oct 3, 2007, at 10:17 AM, Jerry Rubinow wrote:
>> On 10/3/07, Tom Lichti <tom at redpepperracing.com> wrote:
>>     
>>> Jerry Rubinow wrote:
>>>       
>>>> After you've done
>>>> DELETE ALL, the card numbers should start from 1.
>>> Not true at all. I've done delete all 3 times, and am up to tuners
>>> 12-15. The only way to get back to one is to delete all tuners, then
>>> modify the capture card table to reset the auto-increment field  
>>> back to
>>> 0, then re-add your cards. Or you could modify the table directly to
>>> change the ID's. I'm NOT advocating doing either of those, there  
>>> is no
>>> need, and if you do, I take no responsibility for what happens.
>>>       
>> Sorry, my mistake.  I thought I had read that somewhere.
> If you DROP TABLE in MySQL, it will reset the autoincrement field.

Once you re-create the table, yes.  ;)

> In some cases I believe MySQL will optimize "DELETE FROM Tablename;"  
> into a DROP TABLE followed by a CREATE TABLE, which can have the same  
> effect.  That may be what you're thinking of.  I think this is DB  
> engine dependent.

More likely may be optimized to a TRUNCATE TABLE (which is what "Delete
all capture cards" and "Delete all video sources" use).  TRUNCATE TABLE
resets the autoincrement columns (at least in MySQL, at least with the
MyISAM storage engine, though I think it also applies to the InnoDB
storage), so properly using "Delete all" will in fact reset numbering. 
(So, Jerry is right.  Perhaps he even read it in one of my "Delete all"
evangelism posts.)

Mike "Delete all and let <insert your god/deity/... here> sort them out"
Dean


More information about the mythtv-users mailing list