Bug #115 mysql_prepare returns wrong field info for 'EXPLAIN ...' queries
Submitted: 3 Mar 2003 7:21 Modified: 29 Mar 2003 15:14
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:4.1 OS:
Assigned to: Bugs System CPU Architecture:Any

[3 Mar 2003 7:21] Mark Matthews
If you prepare an 'EXPLAIN....' query, the field info that is returned is incorrect, the field info returned on execute() is correct. Georg Richter has seen this from PHP as well (using libmysql). An example of the field info returned (1 column, it should be 10) is (this is a dump of the JDBC structure):

[0]= Field  (id=52)
	buffer= byte[54]  (id=53)
	charsetIndex= 63
	charsetName= "ISO8859_1"
	colDecimals= 0
	colFlag= 0
	connection= Connection  (id=20)
	databaseName= null
	databaseNameLength= 4
	databaseNameStart= 1
	defaultValue= null
	defaultValueLength= -1
	defaultValueStart= -1
	fullName= null
	fullNameWithDatabase= null
	fullOriginalName= null
	fullOriginalNameWithDatabase= null
	length= 11
	mysqlType= 3
	name= null
	nameLength= 4
	nameStart= 32
	originalColumnName= null
	originalColumnNameLength= 4
	originalColumnNameStart= 37
	originalTableName= null
	originalTableNameLength= 12
	originalTableNameStart= 19
	precisionAdjustFactor= 0
	sqlType= 4
	tableName= null
	tableNameLength= 12
	tableNameStart= 6

How to repeat: