MySQL: How to determine a value type?
A partial answer:

$ mysql -u root --column-type-info -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
...


Note the extra parameters.  Now I will issue just one simple command; see what it comes back with:

mysql&gt; SELECT * FROM things;
--------------
SELECT * FROM things
--------------

ERROR 1046 (3D000): No database selected
mysql&gt; use try;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql&gt; SELECT * FROM things;
--------------
SELECT * FROM things
--------------

Field   1:  `thing_id`
Catalog:    `def`
Database:   `try`
Table:      `things`
Org_table:  `things`
Type:       LONG
Collation:  binary (63)
Length:     11
Max_length: 1
Decimals:   0
Flags:      NOT_NULL PRI_KEY AUTO_INCREMENT NUM PART_KEY 

Field   2:  `name`
Catalog:    `def`
Database:   `try`
Table:      `things`
Org_table:  `things`
Type:       VAR_STRING
Collation:  utf8_general_ci (33)
Length:     96
Max_length: 7
Decimals:   0
Flags:      NOT_NULL 


+----------+---------+
| thing_id | name    |
+----------+---------+
|        2 | thing 2 |
|        3 | thing 3 |
|        4 | thing 1 |
+----------+---------+
3 rows in set (0.00 sec)

mysql&gt; 


I don't think there is a way to get the 'type' of an expression.