List:General Discussion« Previous MessageNext Message »
From:mos Date:April 22 2010 2:44pm
Subject:Re: Auto Increment in InnoDB
View as plain text  
At 12:03 AM 4/22/2010, Aveek Misra wrote:
>I have a InnoDB table which contains columns named 'cluster' and 'file' 
>('cluster' + 'file' is a primary key). I want to add a new column that 
>tracks the revision number of a file for a given cluster and a file. The 
>situation is tailor made for a MyIsam table where I can add a new Auto 
>Increment column as a secondary column in a multiple column index. How can 
>I get the same behavior in an InnoDB table? Given below is a view of how 
>the records will look like
>
>--------------------------------------------------------
>| Cluster             |    File                |   Rev       |
>--------------------------------------------------------
>| clusterA           |   fileA               |   1            |
>--------------------------------------------------------
>| clusterA           |   fileA               |   2            |
>---------------------------------------------------------
>| clusterB           |   fileA               |   1            |
>--------------------------------------------------------
>| clusterB           |   fileB               |   1            |
>--------------------------------------------------------

Aveek,
     You should be able to add an autoincrement field to a compound key if 
the autoinc field is the first field of the compound key. This probably 
doesn't help you though.

Mike




>Thanks
>Aveek
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

Thread
Auto Increment in InnoDBAveek Misra22 Apr
  • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
    • Re: Auto Increment in InnoDBAveek Misra22 Apr
      • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
        • Re: Auto Increment in InnoDBAveek Misra22 Apr
          • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
            • Re: Auto Increment in InnoDBAveek Misra22 Apr
              • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
            • Re: Auto Increment in InnoDBCarsten Pedersen22 Apr
              • Re: Auto Increment in InnoDBJohan De Meersman22 Apr
                • Re: Auto Increment in InnoDBChris W22 Apr
                  • Re: Auto Increment in InnoDBJohan De Meersman23 Apr
  • Re: Auto Increment in InnoDBmos22 Apr