I have always checked table definitions through DESCRIBE, but today I came across something weird.
Another guy told me the DEFAULT value shown for a column through SHOW CREATE TABLE was different from what I got from DESCRIBE. I checked information_schema and I got the same result from DESCRIBE, so I’m curious why SHOW CREATE TABLE is showing something different.
Funny thing is some people at #mysql (IRC) told me this:
protip: don’t use DESCRIBE or SHOW COLUMNS FROM, use information_schema
Funny enough, though I asked, no one told me the reason, and also given the one being different is SHOW CREATE TABLE, at this point I’m lost.
Given how the application works, I am trusting SHOW CREATE TABLE, but the wise people and my barely-knows-database knowledge tell me information_schema is right.
Could you please explain which option should I use, why, and when not, why does documentation mention nothing about not trusting one or the other?
Thanks in advance!