I've just discovered that all but VAR
data types do not vary their LENGTH
s. This strikes me as extremely inefficient since there may be INT
fields like an autoincrement
PRIMARY
that never change where a 1
in a BIGINT
column will take the full 8 bytes.
I have many columns that won't change once they're inserted but have the potential to be large. Instead of using all BIGINT
columns, I'd like to use VARBINARY
instead.
I want to manipulate the data as an int
in c++ yet store it as VARBINARY
in mysql.
How can these conversions be made in c++?