I was wondering if there was a way, in MySQL, in a table definition, to set a "limit" on how big a key can get with auto_increment that's not based on data type.
More specifically, I'd like the key to be limited to 0-63 or 1-64 (the first prefered, but I know auto_increment starts at 1). The smallest integer data type is 255 values or 127 signed.
Basically, I want to be able to store these keys as a flag in a BIGINT which is limited to 64 possible flags. (If there are bigger precise data types, I'd love to know.)
I sifted thru the MySQL manual and found nothing.
Other solutions are welcome.
The requirement is to be able to store 0-* keys in a single column to be compared to a list of keys from other sources, and I think being able to use bitwise comparison is much more efficient than doing a script side cross-reference.
I could have the script manage the key, but if MySQL could do it for me, it would be that much more efficient.
More specifically, I'd like the key to be limited to 0-63 or 1-64 (the first prefered, but I know auto_increment starts at 1). The smallest integer data type is 255 values or 127 signed.
Basically, I want to be able to store these keys as a flag in a BIGINT which is limited to 64 possible flags. (If there are bigger precise data types, I'd love to know.)
I sifted thru the MySQL manual and found nothing.
Other solutions are welcome.
The requirement is to be able to store 0-* keys in a single column to be compared to a list of keys from other sources, and I think being able to use bitwise comparison is much more efficient than doing a script side cross-reference.
I could have the script manage the key, but if MySQL could do it for me, it would be that much more efficient.