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