Bug #23385 Server returns only VARCHAR as type for any metadata sent to the client
Submitted: 17 Oct 2006 18:17 Modified: 26 Jan 2007 14:54
Reporter: Tonci Grgin Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Prepared statements Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: CPU Architecture:Any

[17 Oct 2006 18:17] Tonci Grgin
Parameter of any type is returned to client as VARCHAR

How to repeat:
[17 Oct 2006 20:39] Tonci Grgin
Look into:
sql_prepare.cc, send_prep_stmt:
Send types and names of placeholders to the client
XXX: fix this nasty upcast from List<Item_param> to List<Item>
/* skip parameters data: we don't support it yet */ 
if (!(param_data= (*mysql->methods->read_rows)(mysql, (MYSQL_FIELD*)0, 7)))
 MYSQL_RES *mysql_stmt_param_metadata(MYSQL_STMT *stmt)
This function currently does nothing. 

It is impossible to make a test case for this problem but it can be proven by checking what's "on the wire", for example with c/J calling PreparedStatement.getParameterMetaData(); All parameters are of type MYSQL_TYPE_VAR_STRING (253)
[26 Jan 2007 14:54] Konstantin Osipov
This bug is a duplicate of Bug#1382 "SQLDescribeParam returns the same type information".