Connector/J2 - max(date) returns array of bytes

Connector/J2 - max(date) returns array of bytes

am 10.11.2002 02:23:18 von jswap

I've found that Connector/J v2 returns an array of bytes rather than a
java.sql.Date object when the max() and "group by" functions are used.

How-To-Repeat:
Have a table, MyTable, with a primary key, MyID and a Date column, MyDate.

Use JDBC to run this query:
"select myid, max(mydate) from MyTable group by myid"

The ResultSet will contain byte arrays for the max(mydate) results instead
of Date objects. Although there is numerical data in the byte arrays, I
have not been able to ascertain what this data represents.

I am running MySQL v3.23.41

Thanks,

John Swapceinski


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12930@lists.mysql.com
To unsubscribe, e-mail

Re: Connector/J2 - max(date) returns array of bytes

am 10.11.2002 04:06:38 von Mark Matthews

jswap@ratemyprofessors.com wrote:

> I've found that Connector/J v2 returns an array of bytes rather than a
> java.sql.Date object when the max() and "group by" functions are used.
>
> How-To-Repeat:
> Have a table, MyTable, with a primary key, MyID and a Date column, MyDate.
>
> Use JDBC to run this query:
> "select myid, max(mydate) from MyTable group by myid"
>
> The ResultSet will contain byte arrays for the max(mydate) results
> instead
> of Date objects. Although there is numerical data in the byte arrays, I
> have not been able to ascertain what this data represents.
>
> I am running MySQL v3.23.41
>
> Thanks,
>
> John Swapceinski
>
>
> ------------------------------------------------------------ ---------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail bugs-thread12930@lists.mysql.com
> To unsubscribe, e-mail

This is a MySQL bug, not a Connector/J bug. Earlier versions of MySQL
marked certain aggregate function results with the 'BINARY' flag.=,
which is in error.

-Mark

--
For technical support contracts, visit https://order.mysql.com/?ref=mmma

__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mark Matthews
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
/_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
<___/ www.mysql.com


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12932@lists.mysql.com
To unsubscribe, e-mail