Bug #1382 SQLDescribeParam returns the same type information
Submitted: 23 Sep 2003 9:40 Modified: 23 Jan 2007 18:16
Reporter: [ name withheld ] Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Prepared statements Severity:S2 (Serious)
Version:4.0, 4.1, 5.0, 5.1 OS:Any (all)
Assigned to: CPU Architecture:Any
Tags: bfsm_2007_02_01
Triage: Triaged: D2 (Serious) / R4 (High) / E5 (Major)

[23 Sep 2003 9:40] [ name withheld ]
Regardless of the database column type, the SQLDescribeParam() function returns the same information (SQL_VARCHAR, size 255, ...).

How to repeat:
After allocating the statement handle and preparing the parameter, call SQLDescribeParam for a non SQL_VARCHAR parameter in the statement.  The result returned by SQLDescribeParam is SQL_VARCHAR

Suggested fix:
[6 Oct 2003 0:18] Venu Anuganti
The reason for this is, MySQL versions 3.23 nor 4.0 doesnt support true prepared statements, and there is no means the driver can get what the parameter column is. This will be fixed and available from 3.52 when MySQL 4.1 supports true prepared statements.
[22 Oct 2006 17:22] Konstantin Osipov
Bug#23385 "Server returns only VARCHAR as type for any metadata sent to the client" is a duplicate of this bug.
[20 Jun 2008 20:28] Bruce Sinclair
Since it is known that SQLDescribeParam does not work, SQLGetFunctions should not report that it is supported when SQL_API_SQLDESCRIBEPARAM is queried.