Skip to content

Conversation

@MoadElfatihi
Copy link
Contributor

@MoadElfatihi MoadElfatihi commented Mar 4, 2025

The changes is about upgrading mysal testing version to 9.2


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19228

@beikov
Copy link
Member

beikov commented Mar 5, 2025

Are you going to look into the failure? It seems MySQL is starting very slowly.

@MoadElfatihi MoadElfatihi marked this pull request as draft March 7, 2025 13:35
@MoadElfatihi MoadElfatihi marked this pull request as ready for review March 14, 2025 10:13
Copy link
Member

@beikov beikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the nulls clause from tests is not an acceptable change for a database upgrade. Can you elaborate why you had to do that?

@MoadElfatihi
Copy link
Contributor Author

MoadElfatihi commented Mar 17, 2025

Removing the nulls clause from tests is not an acceptable change for a database upgrade. Can you elaborate why you had to do that?

Comment update

@beikov I think I did not explain well my answer.
There is a bug in mysql that I had raised to the MySql team [(https://bugs.mysql.com/bug.php?id=117765&thanks=2&notify=195)] and that they confirmed to me.
Note : there is no issue in Hibernate .

Explanation :

The 2 tests are failing instead of returning 5,13,7,6,5 we had from the Mysql 5,6,7,13,5
If I did not modify the test , for example OrderedSetAggregateTest.java , the sql query generated is :
select group_concat(eob1_0.the_string order by case when (eob1_0.id) is null then 0 else 1 end, eob1_0.id desc separator ',') from EntityOfBasics eob1_0

But In some infected version in mySql it is transformed incorrectly (using explain....) :
select group_concat(hibernate_orm_test.Entity_Of_Basics.theString order by **hibernate_orm_test.Entity_Of_Basics.identifier ASC**,hibernate_orm_test.Entity_Of_Basics.identifierDESC separator ',') ASgroup_concat(theString
order by
case when (identifier) is null then 0
else 1 end,
identifier desc separator ','
fromhibernate_orm_test.Entity_Of_Basics``

Look at the text in Bold hibernate_orm_test.Entity_Of_Basics.identifier` ASC . So in this is the bug.

I agree with you, updating a test while upgrading mySQl Version seems not to be logical, but this is the cause , there is a bug in MySql ( I spend the week trying to switch off every option in the optimizer but in vain).

I got the courage to change it , why ?
select listagg(eob.theString, ',') within group (order by eob.id desc nulls : ids are primary keys and are never null, so I get ride of it to avoid confusing SGBD . I tried with 9.1 and same , you can take please a look at the bug that I raised.

@beikov
Copy link
Member

beikov commented Apr 9, 2025

I understand that the tests might not depend on the nulls clause, but the idea of the tests, as can be implied through the test method names, is to check if the nulls clause works.
Please revert the test changes and add a @SkipForDialect annotation to the test methods with the major/minor version 9.2 and a comment explaining the bug as well as referring to the link.

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Apr 10, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@beikov
Copy link
Member

beikov commented Apr 10, 2025

LGTM, please squash your commits.

@MoadElfatihi MoadElfatihi force-pushed the HHH-19228-upgrade-mysql-testing-version branch from 87b34ba to bc0c2f5 Compare April 11, 2025 00:06
@MoadElfatihi
Copy link
Contributor Author

LGTM, please squash your commits.

@beikov , I've squashed the commits. Thank you for your feedback.

@beikov beikov merged commit c6c3d3f into hibernate:main Apr 11, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants