List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:March 10 2001 3:41pm
Subject:3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)
View as plain text  
>>>>> "Boris" == Boris Granveaud <boris.granveaud@stripped>
> writes:

Boris> Hi,
Boris> I've just upgraded MySQL from 3.22.32 to 3.23.33 and I now have a 
Boris> little  problem: a select statement now returns incorrect data types. I 
Boris> asked Mark Matthew, the maintainer of the mmmysql JDBC driver, he says 
Boris> it is a MySQL related bug.

<cut>

Boris> And here is what I obtain:

Boris> MySQL 3.22.32:
Boris> ============
Boris> M:\build>java -classpath 
Boris> m:\distrib\tests.jar;m:\distrib\jdbc\mm.mysql-2.0.4-bin.jar tests.BugMySQL
Boris> name=client
Boris> value=12
Boris> name=count
Boris> value=4
Boris> name=duration
Boris> value=8
Boris> name=avg_duration
Boris> value=8
Boris> name=metric
Boris> value=8
Boris> name=avg_metric
Boris> value=8
Boris> name=cost
Boris> value=8
Boris> name=avg_cost
Boris> value=8
Boris> name=min_date
Boris> value=93
Boris> name=max_date
Boris> value=93

Boris> MySQL 3.23.33:
Boris> ============
Boris> M:\build>java -classpath 
Boris> m:\distrib\tests.jar;m:\distrib\jdbc\mm.mysql-2.0.4-bin.jar tests.BugMySQL
Boris> name=client
Boris> value=1
Boris> name=count
Boris> value=-5		# Bigint, this is ok.  In 3.22 count(*) returned int
Boris> name=duration
Boris> value=8
Boris> name=avg_duration
Boris> value=8
Boris> name=metric
Boris> value=8
Boris> name=avg_metric
Boris> value=8
Boris> name=cost
Boris> value=8
Boris> name=avg_cost
Boris> value=8
Boris> name=min_date
Boris> value=1
Boris> name=max_date
Boris> value=1

<cut>

Boris> | hitdate     | datetime     |      | MUL | 0000-00-00 00:00:00 |        
<cut>

Boris> As you can see, the types returned by min(hitdate) and max(hitdate) are  
Boris> the same as the type of the client column. But with this example, I 
Boris> have  just discovered that other types have changed too!

MAX(datetime column) should return a datetime type in 3.23.

I did just test this and it worked for me in this simple test:

create table t1 (a datetime);
insert into t1 values (now());
select max(a) as min_hitdate from t1;

Can you generate a total test case as above that returns string as a
type?

Regards,
Monty
Thread
3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)Boris Granveaud9 Mar
  • 3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)Jani Tolonen9 Mar
  • 3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)Michael Widenius10 Mar
  • Re: 3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)Boris Granveaud12 Mar
    • Re: 3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)Michael Widenius13 Mar
  • Re: 3.22.32 -> 3.23.33 breaks JDBC driver (Problem with data types)Boris Granveaud14 Mar