I'm currently trying to list all columns of a specific table and determine if each column is unsigned or not.
Here, an example of my test fixture:
CREATE TABLE ttypes
(
cbiginteger BIGINT UNSIGNED,
cinteger INT UNSIGNED,
csmallinteger SMALLINT UNSIGNED
) ENGINE = InnoDB;
In order to list all columns of a specific table, I have found two possibilities:
SHOW FULL COLUMNS
FROM ttypes;
According to the documentation, this query returns these fields: Field, Type, Null, Default, Extra & Comment. None of them allows me to determine if a column is unsigned or not.
After that, I look at the information_schema.columns
which is the base table used by the SHOW COLUMNS
query.
SELECT ...
FROM information_schema.columns
WHERE table_name = 'ttypes';
Unfortunately, none of the result fields allows me to determine if a column is unsigned or not.