PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar lscorcia
lscorcia
29 Nov 2023

Pull Request for Issue #42413.

Summary of Changes

On MySQL Galera replication clusters MEMORY tables are not supported, but MySQL returns an error only at the first write. If the table is empty the first write never happens and no error is returned at the ALTER TABLE instruction, but it will fail at the first write (i.e. editing an article). Proceed with the conversion to MEMORY only if the tables are not empty.

Testing Instructions

See linked issue. I have tested this on my Production environment.

Actual result BEFORE applying this Pull Request

Joomla returns the following error while editing an article:

Save failed with the following error: The table does not comply with the requirements by an external plugin.

Expected result AFTER applying this Pull Request

Save operation should complete successfully.

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

avatar lscorcia lscorcia - open - 29 Nov 2023
avatar lscorcia lscorcia - change - 29 Nov 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Nov 2023
Category Administration com_finder
avatar lscorcia lscorcia - change - 29 Nov 2023
Labels Added: PR-5.0-dev
avatar alikon
alikon - comment - 29 Nov 2023

i'm a newbie with MySQL Galera ..and even i cannot remember the MariaDB equivalent name
but sounds safe, on code review

avatar alikon
alikon - comment - 29 Nov 2023

P.S
thanks for your 1st pr ?

avatar grooverdan
grooverdan - comment - 14 Apr 2024

from a pure SQL concept looks good. Could be condensed I think to a single query:

$db->setQuery('SELECT EXISTS (SELECT 1 FROM ' . $db->quoteName('#__finder_tokens' UNION ALL SELECT 1 FROM ' . $db->quoteName('#__finder_tokens_aggregate') . ')');

Alternately:

I"m not 100% sure of the Joomla structures however if doing individual tests before alter:

foreach (array($db->quoteName('#__finder_tokens), $db->quoteName('#__finder_tokens_aggregate')) as $tbl) {
            $db->setQuery('SELECT EXISTS (SELECT 1 FROM ' . $tbl . ')');
            if ($db->loadResult() === 0) {
                continue;
            }
            $db->setQuery('ALTER TABLE ' . $tbl . ' ENGINE = MEMORY');
            $db->execute();
} 
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Properly detect db engine support before converting tables to MEMORY
[5.1] Properly detect db engine support before converting tables to MEMORY
avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.1] Properly detect db engine support before converting tables to MEMORY
[5.2] Properly detect db engine support before converting tables to MEMORY
avatar HLeithner HLeithner - edited - 2 Sep 2024

Add a Comment

Login with GitHub to post a comment