Bug #38345 Result in first column depends on last field in select statments
Submitted: 24 Jul 2008 12:31 Modified: 25 Jul 2008 18:13
Reporter: Pawel Palka Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0.44-log mysql-5.0.44 OS:Linux (Gentoo Linux)
Assigned to: CPU Architecture:Any
Tags: Result in first column depends on last field in select statments

[24 Jul 2008 12:31] Pawel Palka
Description:
SELECT wt.oferta_id, wt.od AS data_wyjazdu_od, wt.id_dojazd AS id_dojazd, wt.id_wyzywienie AS id_wyzywienie  FROM wycieczki_terminy wt
WHERE wt.narty = '0' and wt.objazdowa = '0'
GROUP BY oferta_id
ORDER BY wt.od DESC
LIMIT 20 OFFSET 0;

Prooduce results

1000723    2009-07-10    1    2
20517    2009-03-06    1    2
20875    2009-01-08    1    1
20882    2008-12-30    1    4
7892    2008-12-19    3    4
20535    2008-12-18    1    1
20652    2008-12-18    1    1
20883    2008-12-17    1    4
20889    2008-12-17    1    4
20890    2008-12-17    1    1
20893    2008-12-17    1    4
20896    2008-12-17    1    4
20899    2008-12-17    1    4
20929    2008-12-17    1    6
12584    2008-12-11    1    3
18019    2008-12-11    1    4
20505    2008-12-06    1    2
20059    2008-12-04    1    4
20060    2008-12-04    1    1
20061    2008-12-04    1    1

and

SELECT wt.oferta_id, wt.od AS data_wyjazdu_od, wt.id_dojazd AS id_dojazd
FROM wycieczki_terminy wt
WHERE wt.narty = '0' and wt.objazdowa = '0'
GROUP BY oferta_id
ORDER BY wt.od DESC
LIMIT 20 OFFSET 0;

Prooduce results

2175    2009-08-02    1
10382    2009-08-02    1
12503    2009-07-19    1
16744    2009-07-19    1
12663    2009-07-12    1
1000723    2009-07-10    1
15864    2009-07-05    1
13170    2009-07-01    1
15851    2009-07-01    1
12507    2009-06-21    1
12510    2009-06-21    1
15686    2009-06-20    1
2169    2009-06-19    1
11479    2009-06-18    1
12626    2009-06-18    1
12628    2009-06-18    1
12623    2009-06-17    1
67    2009-06-12    1
12621    2009-06-12    1
12652    2009-06-11    1

First column (id) its not same. See record with id 67. In first statments
67 id doesnt exists. Remove in first statments form select (wt.id_wyzywienie AS id_wyzywienie) produce others results

How to repeat:
I can`t prepare small table
[24 Jul 2008 14:50] MySQL Verification Team
Thank you for the bug report. Could you please test with latest released version and still you got the same behavior please provide the complete test case (dump file with create table and insert data). Thanks in advance.
[24 Jul 2008 16:06] MySQL Verification Team
Please upload it into a compressed file at:

ftp://ftp.mysql.com/pub/mysql/upload

and comment here the file's name i.e: bug38345.zip in this way it will be available for the developers too. Thanks in advance.
[25 Jul 2008 14:25] Pawel Palka
I upgraded to newest version (on windows 5.0.51b) and this bug doesn`t exists
[25 Jul 2008 18:13] Valeriy Kravchuk
Not repeatable on recent versions.