-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5] Sync the sequence for pgsql after the root user is created #44324
Conversation
Good find! |
✅ Tested succesfully on macOS 👍
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44324. |
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@muhme Could you repeat your test to make sure my suggested changes did not break anything? And if successful, mark your test result in the issue tracker with the blue "Text this" button in the PR details? Thanks in advance. |
I have tested this item ✅ successfully on a2feb76 I've made a new installation of a clean 5.2-dev branch using an empty PostgreSQL database (of course after composer install and npm ci). Directly after that (no need to login to the backend) I have checked the ID of the superuser and the last value of the "#__users_id_seq" sequence with phpPgAdmin. (Last value is a misleading term because in fact is is the next value.) Result: The superuser's ID has a value between 1 and 1000, e.g. 362. The last value of the sequence is 1. Then I have done the same with the branch of this PR under the same starting conditions (clean branch, composer install, npm ci, install into empty PostgreSQL DB). Result: The superuser's ID has a value between 1 and 1000, e.g. 362. The last value of the sequence is this ID value plus 1, e.g. 363. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44324. |
Additional test: After the installation and the checks in phpPgAdmin I logged in to the administrator and have created a new user. Without the PR that new user has ID = 1 (one). With the PR the new user has ID = ID of the super user plus one. |
I have tested this item ✅ successfully on a2feb76 scripts/create 52 pgsql
cat > branch_52/tests/System/integration/install/duplicate.cy.js <<EOF
describe('Test duplicate key value error', () => {
it('in creating 1,000 users', () => {
for (let i = 1; i <= 1000; i++) {
cy.db_createUser({username: \`test user \${i}\` });
}
});
});
EOF
scripts/test 52 system tests/System/integration/install/Installation.cy.js,tests/System/integration/install/duplicate.cy.js Problem seen:
Checked PR with recreating 5.2-dev branch with additional test case and installing patch tester, applying PR 44324 and running same tests again plus all remaining System Tests:
One timeout error and repeated this single test step:
All tests are passed successfully 👍 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44324. |
Thanks you guys for the extensive testing and @alikon for fixing this long standing bug. |
Pull Request for Issue # .
on installation joomla create a SuperUser whose id is generated random(1,1000)
but with postgresql the relative sequence
#__users_id_seq
is not setted is still 1, so as soon we create an userwhose id is equal to the id created for the Super User we got
duplicate key value violates unique constraint "jos_users_pkey
Summary of Changes
set the relative sequence
#__users_id_seq
after the super user creationTesting Instructions
apply pull PR
and run cypress install/installation.cy.js
and the run this test:
scripts/test 52 system install/duplicate.cy.js
Actual result BEFORE applying this Pull Request
duplicate key value violates unique constraint "jos_users_pkey
Expected result AFTER applying this Pull Request
no more duplicate error
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed