Bug #31263 date_format() returns System.byte

Submitted: 27 Sep 2007 21:57 Modified: 9 Oct 2007 19:02
Reporter: Sheeraz Fazal Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.1.3 OS:Other (Windows XP)
Assigned to: CPU Architecture:Any

[27 Sep 2007 21:57] Sheeraz Fazal
Description:
Following query 
select date_format(now(),'%m/%d/%Y') as start_date from dual 
returns System.byte when ToString() is applied on the DataRow.

How to repeat:
I use Fill function of to populate DataSet object and it returns single row.

ds.Tables[0].Rows[0][0].ToString(); This line worked fine with 5.0.8 but not anymore in 5.1.3

Suggested fix:
Don't know
[28 Sep 2007 20:20] Sheeraz Fazal
I have produced it on MySQL server 5.0.27-community-nt.
[9 Oct 2007 19:02] Reggie Burnett
This is not a bug in the connector.  The problem here is that in older versions of the server (such as 5.0.27), some functions such as date_format returned its value as a binary string.  Starting with 5.1, Connector/Net will by default respect these binary flags so with 5.1.3 this value is being returned as varbinary.  We added a connection string option called 'respect binary flags'.  Set this value to false and it will behave like older versions of Connector/Net where varstring values that are marked as binary will continue to be returned as strings.

Note that newer builds of the mysql server has fixed date_format to return a regular string instead of a binary string.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.