Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHH-19228 upgrade mysql testing version to 9.2 #9837

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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.

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.

None yet

2 participants