Unexpected table creation results
All:
I have come across an unexpected MySQL behaviour that is causing me a bit of grief. It's to do with something common - creating a table - so I doubt it's a bug but I dont understand the behaviour, nor can I find docs that tell me what is going on. So to explain:
I first create a table in the usual way:
CREATE TABLE REGISTER (UID BIGINT, TYPEID BIGINT, ......, PRIMARY KEY (UID));
where "...." represents a bunch of other fields. No problem with the creation and I get a table. However, if I now say 'DESCRIBE REGISTER', I get a really unexpected result:
Field Type ..... (other cols omitted)
-------------------------------------------------------
UID BIGINT(20) ....
TYPEID BIGINT(20) ....
I dont understand why a field specified in the create statement as a 'bigint' is instantiated as a 20 element array of bigints in the database. Can anybody explain??
I have a similar thing with BOOL columns too - I have three of these. Two get instantiated as tinyint(1) - fair enough - but the third becomes an int(11) for no apparent reason.
Whilst this seems to have no effect on operation (I can still successfully do a 'select uid from register where uid> some_number') it is going to be a huge space waster, as this table will literally have millions of rows in it.
Any suggestions or thoughts, anybody ???
Regards
Rick
Subject
Written By
Posted
Unexpected table creation results
March 25, 2014 04:15AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.