Bug #89016 DESCRIBE table metadata differs between statments and prepared statments
Submitted: 21 Dec 2017 13:46 Modified: 22 Dec 2017 6:44
Reporter: Luis Silva Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:8.0.4 OS:Linux
Assigned to: CPU Architecture:Any

[21 Dec 2017 13:46] Luis Silva
Description:
Doing query:
"DESCRIBE test"

where test is a table created using:
"CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, label CHAR(1))"

Getting metadata for this using statments and prepared statments gives different values on column 2:

#		 Column 2			= Type/Type
#		 meta->getCatalogName()		= def/def
#		 meta->getColumnDisplaySize() = 16777215/16777215
#		 meta->getColumnLabel()		= Type/Type
#		 meta->getColumnName()		= Type/Type
#		 meta->getColumnType()		= 15/15
#		 meta->getColumnTypeName()	= TEXT/TEXT
#		 meta->getPrecision()		= 7/7
#		 meta->getScale()		= 0/0
#		 meta->getSchemaName()		= mysql/mysql
#		 meta->getTableName()		= columns/col

How to repeat:
Create table:
"CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, label CHAR(1))"

Do query using statements and prepared statements:
"DESCRIBE test"

Compare metadata between statments and prepared statments.