GUI problem using "group by"-query with SQLPlugin

Hi,

I found a problem using SQLPlugin. Searching the right place for issues with SQLplugin I found http://www.jetbrains.net/jira/browse/SQLQ. Unfortunately there is no possibility to post an issue. So I post the problem here.

The problem arises with MySQL-Database. Using "FROM_UNIXTIME()" within a query the output looks like "2006-05-04 06:00:00". But if the query contains a "group by"-statement, the resulting text has a wrong character format: "32 30 30 36 2d 30 35 2d 30 34 20 30 36 3a 30 30 3a 30 30".

Here is a simple example:

create table BUG_TEST (
date bigint,
value integer
);

insert into BUG_TEST values(unix_timestamp('2006-05-04 06:00:00'), 1);
insert into BUG_TEST values(unix_timestamp('2006-05-04 06:00:00'), 2);
insert into BUG_TEST values(unix_timestamp('2006-05-04 06:00:00'), 3);

insert into BUG_TEST values(unix_timestamp('2006-05-05 06:00:00'), 4);
insert into BUG_TEST values(unix_timestamp('2006-05-05 06:00:00'), 5);
insert into BUG_TEST values(unix_timestamp('2006-05-05 06:00:00'), 6);


/* query without group-by */
select FROM_UNIXTIME(date) "Time", value from BUG_TEST;
/*
Result of mysql:
----


-------+

Time

value

----


-------+

2006-05-04 06:00:00

1

2006-05-04 06:00:00

2

2006-05-04 06:00:00

3

2006-05-05 06:00:00

4

2006-05-05 06:00:00

5

2006-05-05 06:00:00

6

----


-------+


Result of SQLPlugin:
04.05.2006 06:00:00, 1
04.05.2006 06:00:00, 2
04.05.2006 06:00:00, 3
05.05.2006 06:00:00, 4
05.05.2006 06:00:00, 5
05.05.2006 06:00:00, 6

Both results are as expected.
*/


/* query with group-by */
select FROM_UNIXTIME(date) "Time", sum(value) from BUG_TEST group by date;
/*
Result of mysql:
----
----


+

Time

sum(value)

----


----


+

2006-05-04 06:00:00

6

2006-05-05 06:00:00

15

----


----


+


Result of SQLPlugin:
32 30 30 36 2d 30 35 2d 30 34 20 30 36 3a 30 30 3a 30 30, 6.0
32 30 30 36 2d 30 35 2d 30 35 20 30 36 3a 30 30 3a 30 30, 15.0

The mysql-Result is correct, the SQLPlugin one is not.
The SQLPlugin shows the ascii-codes instead of the character itself.
*/

Please sign in to leave a comment.