[MDEV-5464] sql shows the wrong values Created: 2013-12-18 Updated: 2013-12-22 Due: 2014-01-13 Resolved: 2013-12-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.34 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Peter Magsam | Assignee: | Elena Stepanova |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows server Glassfish 4.0 eclipse primefaces |
||
| Attachments: |
|
| Description |
|
this sql shows the wrong values. The order by in the left join shows the oldest values and not the values which are stored after t2.giltab <= '2013-12-22' . In the table are values with different validity date and i want to show only the last one and not the history. In Mysql it works. But we want to use mariadb in our opensource erp-application http://osretail.de/osRetail/
|
| Comments |
| Comment by Elena Stepanova [ 2013-12-19 ] |
|
Could you please provide an example of the wrong result and the expected result set? |
| Comment by Peter Magsam [ 2013-12-22 ] |
|
Hello Elena, you see 3 attachments. The first shows the contents of the datable the second the query with mariaDB and the last query with mysql. Regards Peter Peter Magsam D-91327 Gößweinstein Tel. +499242/29 99 822 |
| Comment by Elena Stepanova [ 2013-12-22 ] |
|
Hi Peter, Thank you, the situation is clearer now. Both results are not wrong. I know it's a frustrating thing to hear, but unfortunately it is so, not due to MariaDB specifics, but due to MySQL basics. It happens because your query is initially indeterministic. " It happens often that people fall into this trap, with their main argument being "but it worked all right in MySQL for ages". It really did not and does not, and what you are getting is a result of pure luck. For example, if you try to switch the table from InnoDB to MyISAM or vice versa, you are likely to get yet another resultset, which will also be correct, if there is any point to call any result correct if the query itself is broken. For a side note, if you want to keep playing with this query, please check the data in your databases, apparently it is not identical. The MySQL resultset in your 3rd screenshot contains a record with giltab='2013-01-01', which is not in the first screenshot at all. |