? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
25 Mar 2016

Pull Request for Issues #9509 and #9526 .

Replaced and extends PR #9510 and #9549 .

Could also help with the cause for Issue #9511 .

Implements automatic detection of the need to run the conversion again after changes of queries in the conversion scripts.

Summary of Changes

This PR handles 6 things:

  1. Add missing column and index changes as reported in issue #9509 to utf8mb4 conversion scripts so after update these columns and indexes are same as they are after new installation.
  2. Change column user_id of table user_keys to length of 150 for new installation and update so it fits to column username of table users.
  3. Change order of processing in the 2nd conversion script so adding back the indexes takes place after all conversions and default character set and collation changes.
  4. Adapt old schema update sql scripts to limited index sizings of the utf8mb4 conversion, so if for some reason a database problem of an old sql script is to be fixed but the database is already converted to utf8mb4, it will not fail with the "1071 Specified key was too long; max key length is 767 bytes" error.
  5. Run the conversion only if the database schema does not have unfixed problems.
  6. After updating the core with any method, dectect if conversion SQL statements have changed and if so, perform it again when updating with Joomla Update! component or set it as do be done so it is shown as an open database problem ("Extensions -> Manage -> Database") when updating with the "copy the files and run database fix" method.

The changes mentioned with point 1 are:

  • Changed column length of column name in table #__users to 400.
  • Changed follwoing indexes (keys) to include column only with 1st 100 chars:
    • TABLE #__menu, KEY idx_path
    • TABLE #__users, KEY idx_name

Column path of table #__menu has already 1024 and was not enlarged in 3.5.0's joomla.sql, and so it is also not enlarged with this PR.

Testing Instructions

Overview on the tests

3 Test have to be performed to test all changes from this PR:

Test 1: Test database fix changes

Test 2: Updating with Joomla! Update component

Test 3: New installation

Tests 1 and 2 start with a current staging or 3.5.0 with the conversion already having been done but this PR has not been applied, e.g. a clean install or a sucessfully updated one.

Users who had problems with SQL errors about index size limits and unfixable open database problems in "Extensions -> Manage -> Database" when updating to 3.5.0 and who can restore either their pre- or their (not good) post-update status with a backup in a test system can skip the 3 tests below.

Instead of this they can just test updating this test system with the restored status with the Joomla! Update component using this custom URL (link removed because obsolete), and then check that after successful update no open database problems are shown in "Extensions -> Manage -> Database".

Not forget to mark your test result after testing in the issue tracker https://issues.joomla.org/tracker/joomla-cms/9590, using the "Test this" button.

Test 1: Test database fix changes

Step 1: Apply the patch for this PR e.g. with the Patchtester component to current staging or a 3.5.0.

Step 2: Go to "Extensions -> Manage -> Database".

Results:

  1. There are open database problems shown for sql file 3.5.1-2016-03-25.sql
  2. The last open database problem is something like "The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4)." , with "UTF-8 (utf8)" instead of " UTF-8 Multibyte (utf8mb4)" if no utf8mb4 support, possibly translated to your backend language.
  3. There is no SQL error shown at the top about missing columns in table #__utf8_conversion (replace #__ by your db prefix).

Step 3: Click the "Fix" button.

Result:

Database table structure is up to date.
Other Information

  • Database schema version (in #__schemas): 3.5.1-2016-03-25.
  • Update version (in #__extensions): 3.5.0.
  • Database driver: mysqli.
  • 97 database changes were checked successfully.
  • 145 database changes did not alter table structure and were skipped.

Step 4: Check with phpMyadmin if the changes mentioned with points 1 and 2 in the Summary of Changes above have been applied.

Result: Changes have been applied.

Step 5: Simulate a corrupt schema, e.g. by not applied old schema update statement by executing following SQL statement in phpMyAdmin:

ALTER TABLE #__menu DROP KEY idx_client_id_parent_id_alias_language;

Step 6: Go to "Extensions -> Manage -> Database" or if still at that page, reload the page.

Result:

Warning: Database is not up to date!
1 Database Problems Found.

  • Table #__menu does not have index 'idx_client_id_parent_id_alias_language'. (From file 2.5.0-2011-12-24.sql.)

Step 7: Click the "Fix" button.

Result: Success, no open dabatase problems, details see above result after Step 3.

Step 8: Edit file "administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql" and add following statement to the end:

ALTER TABLE #__users DROP KEY idx_gaga;

This adds dropping of a not existing index to the file, which will not do any harm but make the schema manager detect that there is a change in some conversion statements.

Step 9: Go to "Extensions -> Manage -> Database" or if still at that page, reload the page.

Result: There is 1 database problem shown about conversion to be done:

"The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4)."

with "UTF-8 (utf8)" instead of " UTF-8 Multibyte (utf8mb4)" if no utf8mb4 support, possibly translated to your backend language.

Step 10: Click the "Fix" button.

Result: Success, no open dabatase problems, details see above result after Step 3.

Step 11: Edit file "administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql" and change some columns length in an index from 100 to e.g. 101, e.g. you can change the last line to

ALTER TABLE #__users ADD KEY idx_name (name(101));

Step 12: Go to "Extensions -> Manage -> Database" or if still at that page, reload the page.

Result: There is 1 database problem shown about conversion to be done:

"The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4)."

with "UTF-8 (utf8)" instead of " UTF-8 Multibyte (utf8mb4)" if no utf8mb4 support, possibly translated to your backend language.

Step 13: Click the "Fix" button.

Result: Success, no open dabatase problems, details see above result after Step 3.

Test 2: Updating with Joomla! Update component

Step 1: Update from current staging or a 3.5.0 without this PR applied to latest staging + this PR applied, using following custom URL for the Joomla! Update component:

(link removed because obsolete)

The zip offered with this custom URL is (link removed because obsolete)

You may download it and check that all files being in the zip are equal to those in the branch of this PR.

You may also want to check the md5 sum, it is "e3ba19157aece453fd40deb5b4059a8f".

Step 2: Go to "Extensions -> Manage -> Database".

Result: Success, no open dabatase problems, details see above result after Test 1, Step 3.

Step 3: Check with phpMyadmin if the changes mentioned with points 1 and 2 in the Summary of Changes above have been applied.

Result: Changes have been applied.

Test 3: New installation

Step 1: Perform a new installation of Joomla! latest staging + this patch.

You can find the zip sourve here: (link removed because obsolete)

Step 2: Go to "Extensions -> Manage -> Database".

Result: Success, no open dabatase problems, details see above result after Test 1, Step 3.

Step 3: Check with phpMyadmin if the changes mentioned with points 1 and 2 in the Summary of Changes above have been applied.

Result: Changes have been applied.

avatar richard67 richard67 - open - 25 Mar 2016
avatar richard67 richard67 - change - 25 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Mar 2016
Labels Added: ?
avatar richard67 richard67 - change - 25 Mar 2016
Category SQL Updating
avatar richard67
richard67 - comment - 25 Mar 2016

@wilsonge Do you have an idea why the unit tests fail? It seems it is related to the statements "$queries1 = $this->db->splitSql($fileContents1);" and "$queries2 = $this->db->splitSql($fileContents2);".

Can it be because file contents are empty (should not be the case)?

Or is it because I initialized the variables "$queries1" and "$queries2" with "$queries1 = array();" and $queries1 = array();" before the statements mentioned above?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar mbabker
mbabker - comment - 25 Mar 2016

The database driver is mocked in this test case. JDatabaseDriver::splitSql() is a static method and cannot be mocked. So to make the test work with this change, essentially JSchemaChangesetTest would have to be rewritten as 5 test classes (one per driver) extending from the various TestCaseDatabase<Driver> classes so that JFactory::$database has a reference to a real JDatabaseDriver instead of a mock.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker Oh my god, I am absolutely not familiar with the unit tests. Would it maybe be possible and easier just to add the splitSql function to the mock? it is same for all drivers in driver.

avatar mbabker
mbabker - comment - 25 Mar 2016

Can't. A static method cannot be mocked.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker I mean implement it locally in the mock.

avatar mbabker
mbabker - comment - 25 Mar 2016

The unit test case mocks JDatabaseDriver. PHPUnit cannot mock any method declared static. So unless you're going to duplicate and inline JDatabaseDriver::splitSql() in an OOP manner in JSchemaChangeset you can't work around that behavior. If this change requires that JDatabaseDriver::splitSql() is used then the test case for JSchemaChangeset has to be rewritten in a way that uses a real JDatabaseDriver object, not a mock.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker Should thast be part of this PR here? Or could we test that and reqite the unit test's mock driver with another one? And if so, could someone else than me do that or at leats advise me?

avatar mbabker
mbabker - comment - 25 Mar 2016

If this PR merges with the unit tests failing then it's going to cause a chain reaction until the tests are rewritten. So no, this shouldn't be merged in a failing state for any reason short of a 0-day security issue.

avatar richard67
richard67 - comment - 25 Mar 2016

@wilsonge @mbabker Can someone advise me further with that unit test stuff? Or make a PR against my repo/branch for this PR here? I need the splitSql there to get the checksums of the statements (without comments) from the utf8mb4 conversion scripts when initializing the check query in the changeset for the schema manager so the check can see if conversion to be done or not.

An alternative would be to checksum the complete file content, but this would include also changes in comments only when there are no changes in the SQL statements themselves.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar mbabker
mbabker - comment - 25 Mar 2016

I can deal with the tests. But I don't want to go through the hassle unless this is going to be the way forward. Rarely if ever should changes require massively rewriting a test class, unfortunately you refactored JSchemaChangeset in a way that totally breaks the existing setup (not your fault either just to be clear, it's one of those technology problems).

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker

But I don't want to go through the hassle unless this is going to be the way forward.

Well, if you read the summary of changes and the test instructions, it should show that it is the way forward if it works, and this can be found out by testing.

avatar mbabker
mbabker - comment - 25 Mar 2016

I get that part. But one issue has evolved into at least 3 PRs so far which have all changed just a little bit. So if this is "the way" then we're good and I can get the tests updated. I'm just a little hesitant at first to put time in something that's been a moving target.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker No, this one should solve all issues with having problems to use the database fix, and I have combined this together with the one to update conversion by the missing stuff because it helps with testing (would have needed some changes anyway). So now just updating to 3.5.1 would solve the issues if this PR is in 3.5.1, regardless if Update Component of file copy + database fixer method is used.

The only issues which are not solved by this pr are such (mainly reported for com_finder) where duplicate finder terms have caused problems, which then could be fixed with drop and rebuild of the index.

This is a completely different thing and so not makes sense to be solved with this PR.

When this PR is merged, the structure of the utf8_conersion table is ready to handle extensions, too.

What then remains to be done is to make extensions add 2 attributes "utf8mb4conversion1" and "utf8mb4conversion2" (or so) to their XMLs, and make the extension installer handle for these 2 scrips conversion in the same way as we already do for the core, and voila: All done.

But also this is a future PR then, not needed for 3.5.1 urgently.

Tis one here is needed for 3.5.1 if it solves what it promises to solve.

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

Added Steps 11 and 12 to verify that after a new installation, the conversion status and checksums are correctly set in database.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker Another was to solve the unit tests would be to move this creating of the special change item to check for done conversion to somewhere outside the changeset.php.

But this would need to be done when the changeset is newly created, so the item can be appended to the end before the check query is executed. If you have any idea where this could be done, let me know. I will check meanwhile what I can find out.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker I could build the query outside of changeset.php wherever the changeset is instantiated, and pass it as new parameter to the constructor and the getInstance functions of the changeset, so the changeset appends just this query string to the end in the constructor. For the unit tests we would use an empty string as parameter so the check function will not be added, and later with a future PR extend that then by pasing the real thing in the unit tests, too.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar mbabker
mbabker - comment - 25 Mar 2016

I wouldn't change it like that. If the intent is for the schema change
checking API to detect this stuff, you shouldn't be passing in things it is
supposed to be checking (otherwise it kind of defeats the point).

On Friday, March 25, 2016, Richard Fath notifications@github.com wrote:

@mbabker https://github.com/mbabker I could build the query outside of
changeset.php wherever the changeset is instantiated, and pass it as new
parameter to the constructor and the getInstance functions of the
changeset, so the changeset appends just this query string to the end in
the constructor. For the unit tests we would use an empty string as
parameter so the check function will not be added, and later with a future

PR extend that then by pasing the real thing in the unit tests, too.

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/9590
https://issues.joomla.org/tracker/joomla-cms/9590.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9590 (comment)

avatar richard67
richard67 - comment - 25 Mar 2016

No, I do not pass in things to it which it shall check. I only pass in the check query, which is built outside. But still the schema change api will process the check query.

avatar mbabker
mbabker - comment - 25 Mar 2016

shrug I still say the schema management layers need to me moved to
/dev/null and recreated but as with so much of Joomla, if the hack works...

On Friday, March 25, 2016, Richard Fath notifications@github.com wrote:

Bo, I do not pass in things to it which it shall check. I only pass in the
check query, which is built outside. But still the schema change api will
process the check query.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9590 (comment)

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker I fully agree.

One thing with which you maybe can help me:

Should I add "@since 3.5.1" tags to the new parameters for the constructor and the getInstance of the changeset? I have not quickly found now an example on how to correctly use "@since" tags for single function parameters.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

Fuck, I hope nobody has the nick name "since" on GitHub. Sorry for disturbing, if so.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

Please do not test yet, I have to fix 1 little thing. The test with detecting a change in the conversion sql statements will not work yet.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

I have to roll back commit c0c6470, and so the unit tests will fail. Have to find another solution for that.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

please don't disturb SInCE ... https://github.com/since :grinning:

avatar richard67
richard67 - comment - 25 Mar 2016

Still not ready for testing, please be patient.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker @wilsonge I tried a few things but could not find a way to get the thing work without making the check query in the constructor of the changeset. So I rolled back the pervious change for this, and now again have the problem with the unit test.

Can anyone help?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

@mbabker @wilsonge P.S.: When I tested here, it did all work in the way which I restored now, only the unit tests fail now again.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar mbabker
mbabker - comment - 25 Mar 2016

Give me a little bit and I'll get the tests converted over.

avatar richard67
richard67 - comment - 25 Mar 2016

Oh, I give you as much as you need, and cannot say how thankful I am.

I know it's Easter, so I will be patient.

Have a nice Easter fest.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

ok, but his can be tested anyway right?

avatar mbabker
mbabker - comment - 25 Mar 2016

Yes.

avatar richard67
richard67 - comment - 25 Mar 2016

@andrepereiradasilva Hmm, no, wait a bit please. Seems I have to fix something.

avatar richard67
richard67 - comment - 25 Mar 2016

@andrepereiradasilva @mbabker Now it is ready for testing.

avatar richard67
richard67 - comment - 25 Mar 2016

So, now this should have been the last commit (except later for the unit tests). Was working already, just had to change an important misleading comment.

Ready for testing now, definitely, just tested everything myself againwith success.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

ok will test whne i have time

avatar richard67
richard67 - comment - 25 Mar 2016

Thanks in advance.

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

Added Tests for detecting changes in the 2nd conversion script.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

Added test for updating with Joomla! Update component.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

I had to add also an update component test to the testing instructions to make sure all changes made with this PR are tested.

Now it is (except of the unit test) complete.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

Sorry, last change for now.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

Corrected testing instructions: Update test must be done with a 3.5.0 to proof the conversionwill be done when updaing, even if it was done before (with a pre-3.5.0 this cannot be tested because no conversion done before).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

TEST 1 done with success on a clean staging install

only difference in step 2 results got and extra line.
image

But all ok.

Will now reset everything for test 2.

avatar richard67
richard67 - comment - 25 Mar 2016

@andrepereiradasilva That fits to the testing instructions. The top line is always added.

But I noticed that Test 2 with updating does not work yet. After update, the database fixer shows the utf8mb4 conversion to be done. I try to reproduce this on another test system I have, but maybe I have to add something to script.php to update the conversion status table to the new structure, similar as I did in database.php.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

so i skip to test 3? or stop the test?

avatar richard67
richard67 - comment - 25 Mar 2016

You can do Test 3, that one should work, but when I have to do a commit, any test result will be reset anyway. So maybe better wait if you do not want to waste time.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

ok i will wait

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

Added details about the update zip to Test 3.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 25 Mar 2016

@andrepereiradasilva Now you can test. The recent commit did only change script.php, which is only relevant for Test 2, and I already updated the update zip container behind the custom URL, so you can continue to test.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

Test 3 success

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

i can't make test 2 when i put your custom URL the updater doesn't find an update:

You are on the "Custom URL" update channel. This is not an official Joomla! update channel.
You already have the latest Joomla version, 3.5.1-dev.

avatar richard67
richard67 - comment - 25 Mar 2016

@andrepereiradasilva Well if you used the same system for the test before, it will not work. You have to fall back to 3.5.0 before.

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

ok ...

avatar richard67
richard67 - comment - 25 Mar 2016

Is also the subject of the test, that a 3.5.0 can be updated to this, because on a staging + this patch, there will not be any changes anymore to do for the conversion.

On a clean 3.5.0 using the nightly build update package for 3.5.1-dev, the update would succeed, but the changes in the conversion scripts (e.g. TABLE #__menu, KEY idx_path limit to 100) would not have been applied.

With my patched package behind my custom URL it will also end with success, but the conversion has been executed again at the end of the update, and so the changes have been applied.

That's why testing instructions for Test 2 sais "Update a Joomla! 3.5.0 to ...".

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

ups, didn't read properly

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

Test 2 ok too.

avatar andrepereiradasilva andrepereiradasilva - test_item - 25 Mar 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

I have tested this item :white_check_mark: successfully on 3ba979d

Excluding the unit tests followd test instructions and all worked as described.

Test server:

avatar andrepereiradasilva
andrepereiradasilva - comment - 25 Mar 2016

BTW, not related to the PR, but noticed now in upgrading from 3.5.0 to your 3.5.1 that the updater look is way better!

avatar richard67
richard67 - comment - 25 Mar 2016

@andrepereiradasilva Super, the tests look really good, also here :smile:

Now only the unit tests have to be fixed.

And maybe com_finder issues with duplicate search terms in another PR (there were still issues in the forum reported, making the term column binary sorted could maybe help).

Ah, and my other PR #9504 with the bugfix for the query downgrade would also be a good thing, even if it does not solve a current issue, but will make things safer.

Then we solved most of the issues seen after updating to 3.5.0., except maybe server related stuff like timeouts too short.

So 3.5.1 could come then.

And then another PR making the core doing the same for the extensions, check and if necessary run conversion scripts (would be specified with 2 attibutes, one for each script, in the extension's XML), and then all is done for 3.5.2 (if not ready for 3.5.1).

My other PR for having scripts for different charsets for the extensions, which you used for your PR for the localise component, those would be not needed anymore then. It would be done like for the core then.

Ah, what did you mean with the updater looking better? I did not see big differences on the Joomla! Update component's page, but maybe was too fast, and now as all my test systems are on this 3.5.1-dev I cannot just have a look. Or did you mean extensions updater?

avatar richard67 richard67 - change - 25 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 25 Mar 2016

More precise instructions regarding start conditions for Tests 1 and 2.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar andrepereiradasilva
andrepereiradasilva - comment - 26 Mar 2016

@richard67 did you test from an older version (ex: 2.5.28) upgrad too? i can't test this old upgrades now since i'm on php 7.

And maybe com_finder issues with duplicate search terms in another PR (there were still issues in the forum reported, making the term column binary sorted could maybe help).

Regarding com_finder, maybe another PR is needed, also those tables are still in general_ci. But IMHO that can go for 3.5.2.

Ah, and my other PR #9504 with the bugfix for the query downgrade would also be a good thing, even if it does not solve a current issue, but will make things safer.

That one is still for test? Doesn't conflict with this one? Can be safely tested too? Probably i will not have time to test that until monday.

And then another PR making the core doing the same for the extensions, check and if necessary run conversion scripts (would be specified with 2 attibutes, one for each script, in the extension's XML), and then all is done for 3.5.2 (if not ready for 3.5.1).

Ok. Will wait for that PR, but IMHO it's not for 3.5.1.

My other PR for having scripts for different charsets for the extensions, which you used for your PR for the localise component, those would be not needed anymore then. It would be done like for the core then.

Do you mean this one? #9468
If it's not needed please close it. It's RTC...

When all utf8mb4 stuff is working fine we look at the com_localize PoC. Until them it stays on hold.

Ah, what did you mean with the updater looking better? I did not see big differences on the Joomla! Update component's page, but maybe was too fast, and now as all my test systems are on this 3.5.1-dev I cannot just have a look. Or did you mean extensions updater?

The progress bar has a better look.

avatar richard67
richard67 - comment - 26 Mar 2016

@andrepereiradasilva No, I did not test upgrading older versions. But it should work, too, as it did before.

Regarding #9504 : Yes, that one maybe could have conflicts after this one here is merged (or applied with patch tester). But as it is now it should be testable.

Regarding #9468 : I will close that right now, thanks for the hint.

avatar richard67
richard67 - comment - 26 Mar 2016

@andrepereiradasilva Just right now I finished the worst case test with success.

Updated a clean 2.5.28 with testing data on a database not supporting utf8mb4 using my custom URL: Worked like a charm, zero errors or warnings, all new and running smooth from beginning on.

Then played back the database with the data of the clean 2.5.28. Result: Looked like a mess and had SQL error not related to this PR but to new templaes and extensions not being installed. So I installed all discovered extensions, and then used the database Fix button to solve reported database problems. I had to use it 2 times because after 1st problems were solved, some were remaining, but this can happen with this method on an old 2.5.28, and none of the problems was related to the utf8mb4 changes, only to the schema changes in past, and there were no further SQL errors shown. Then set Isis as default template, and voila: Also all fine.

In both cases, I successfully checked with phpMyAdmin that conversion to utf8_unicode has been made for all core tables except of the finder tables.

So it seems this PR here works (except of the unit test not working yet).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar joomla-cms-bot
joomla-cms-bot - comment - 26 Mar 2016

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar andrepereiradasilva andrepereiradasilva - test_item - 26 Mar 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 26 Mar 2016

I have tested this item :white_check_mark: successfully on 6c36012

the latest change has just resolve conflicts.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67 richard67 - change - 26 Mar 2016
The description was changed
avatar mbabker
mbabker - comment - 26 Mar 2016
avatar richard67
richard67 - comment - 26 Mar 2016

@mbabker Wow, am really impressed. Seems you like "WRIWYG" (what you read is what you get): It is named refactoring, and it is a refactoring. 23 changed files. Quiet a lot of work. Sorry for having caused this.

avatar mbabker
mbabker - comment - 26 Mar 2016

When you spend time with the guy who wrote PHPUnit you learn a thing or five about decent test structures :wink:

avatar joomla-cms-bot
joomla-cms-bot - comment - 26 Mar 2016

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar joomla-cms-bot joomla-cms-bot - change - 26 Mar 2016
Labels Added: ?
avatar andrepereiradasilva andrepereiradasilva - test_item - 26 Mar 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 26 Mar 2016

I have tested this item :white_check_mark: successfully on 50a139a

only test units changed. So no need to test again.

great work @mbabker!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 26 Mar 2016

@lal12 I ping you because you had the issue #9526 .

Do you have time to test this PR here?

If so, do you have a backup of your database where you had the problem, either before update, or after, and have a test Joomla! installation with an own database for testing purposes?

If this is the case, you can skip the testing instructions and instead of this test one or both of the following possbile scenarios, depending on what all you have available as backup.

The below tests would also be very welcome from any other user who had problems with SQL errors or not fixable database problems after updating to 3.5.0.

If this works for you, you can mark the test result as success in the issue tracker here: https://issues.joomla.org/tracker/joomla-cms/9590, using the "Test this" button on the top left area of the page.

But you should do these tests not on your production site, only on a test system!

Scenario 1

You have meanwhile a Joomla! 3.5.0 test system which is running well, and have a database dump (either before or after update) of the database (test or real system) where you had the problems.

In this case

  1. Apply the patch for this Pull Request either with patchtester component, if you have that, or by fetching the files added or changed by this PR.
  2. Save your good test database so you can import this back later in case of probems.
  3. Delete all tables in phpMyAdmin and then import the dump of the db which made problems.
  4. Login at the backend (admin area) and go to "Extensions -> Manager -> Database".
  5. Depending on what the status of the omported database was (pre or post update) you see more or less database problems to be fixed, and at the end as last one the undone UTF8-Multibyte or UTF8 conversion.
  6. Use the "Fix" button, if necessary 2 or 3 times, until all database problems are fixed.

The result should look then as shown below the next scenario.

Scenario 2

You do not only have a backup of the old database but also of the old file system of the Joomla! where you had the problems, both from before the update.

In this you can simply

  1. Save your good test database so you can import this back later in case of probems.
  2. Delete all tables in phpMyAdmin and then import the dump of the db which made problems.
  3. Rename the Joomla root folder of your test system so you can later use it again after the test, if you want.
  4. Restore the backuped file system from the Joomla! where you had the problems to a folder named like the joomla root of your test system you just renamed before, and copy the configuration.php from tha backuped test system to the new one so it looks at the test database.
  5. Update this system using following custom URL for the Joomla! Update component: http://test5.richard-fath.de/list_test1.xml.
  6. Go to "Extensions -> Manager -> Database".

Result: See below.

Result at the end in both cases

Database table structure is up to date.
Other Information

  • Database schema version (in #__schemas): 3.5.1-2016-03-25.
  • Update version (in #__extensions): 3.5.0.
  • Database driver: mysqli.
  • 97 database changes were checked successfully.
  • 145 database changes did not alter table structure and were skipped.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.
avatar richard67 richard67 - change - 26 Mar 2016
The description was changed
avatar richard67 richard67 - change - 26 Mar 2016
The description was changed
avatar joomla-cms-bot
joomla-cms-bot - comment - 29 Mar 2016

This PR has received new commits.

CC: @andrepereiradasilva


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar andrepereiradasilva andrepereiradasilva - test_item - 29 Mar 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 29 Mar 2016

I have tested this item :white_check_mark: successfully on f72fc57

the latest change has just remove a duplicated query in the utf8mb4 conversion script.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 29 Mar 2016

@andrepereiradasilva It may happen that I will replace this PR later tonight by a new one, which does only the necessary parts of this one to fix update errors, but not the automatic conversion reprocessing, because this introduces changes maybe not be usable for a final good solution when also handling conversion of extensions. Have to wait for @wilsonge feedback.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9590.

avatar richard67
richard67 - comment - 29 Mar 2016

Closing in favour of PR #9652 .

@andrepereiradasilva Sorry for the additional work. Could you test the new one, too? Testing is simpler than it was here.

@mbabker Sorry if I made you work for nothing with reengineering the unit tests for this PR. If you think we should keep your work, then let me know and I will not delete the branch of this PR so we can use it then, and your work will not be lost. @wilsonge Please check that, too, and let me know if I shall keep my branch.

avatar richard67 richard67 - close - 29 Mar 2016
avatar richard67 richard67 - change - 29 Mar 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-03-29 15:25:22
Closed_By richard67
avatar wilsonge
wilsonge - comment - 29 Mar 2016

I think you need to keep it. A lot of this is useful and should be merged. Just some the "easy" fixes needs to come into 3.5.1 and the rest kept back for 3.5.2 with further evaluation :)

avatar richard67
richard67 - comment - 29 Mar 2016

We could keep Michael's changes, but the other stuff is either in my new PR, or I would do it differently in a new one. The approach here was not good.

avatar wilsonge
wilsonge - comment - 29 Mar 2016

Michael's test fixes should be ported across into core

avatar mbabker
mbabker - comment - 29 Mar 2016

@wilsonge just cherry pick ff136d6 into core for the tests, it should be fine without this PR anyway. It actually makes the tests a bit more structurally sound here and gives us a chance to ID what parts of the overall API don't have explicit test coverage (only a small part of it is explicitly tested and some of that with mocked behavior and some dependent on the core schemas).

avatar wilsonge
wilsonge - comment - 29 Mar 2016

Merged

avatar richard67
richard67 - comment - 29 Mar 2016

Hmm it seems Michael's changes for making the tests use real db drivers now make unit tests fail with error on sending data from the statisctics plugin, see my still open PR #9504 , which I just rebased.

avatar mbabker
mbabker - comment - 29 Mar 2016

That looked more like a Travis failure than a Joomla failure (especially since it was only one job out of the set that failed). I retriggered it.

avatar richard67
richard67 - comment - 29 Mar 2016

Ok, thanks.

avatar richard67
richard67 - comment - 25 Mar 2017

Please stop to use any of the links I provided here for testing purpose. They will not work anymore.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/9590.

avatar richard67 richard67 - change - 25 Mar 2017
The description was changed
avatar richard67 richard67 - edited - 25 Mar 2017
avatar richard67 richard67 - change - 25 Mar 2017
The description was changed
avatar richard67 richard67 - edited - 25 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 25 Mar 2017
Category SQL Updating Administration com_admin SQL com_installer Installation Libraries Unit Tests Updating

Add a Comment

Login with GitHub to post a comment