Skip to content

Upgrade error due to missing global permissions #8648

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

Open
jdarwood007 opened this issue May 10, 2025 · 5 comments · May be fixed by #8652
Open

Upgrade error due to missing global permissions #8648

jdarwood007 opened this issue May 10, 2025 · 5 comments · May be fixed by #8652
Labels
Milestone

Comments

@jdarwood007
Copy link
Member

jdarwood007 commented May 10, 2025

'SET GLOBAL innodb_default_row_format=DYNAMIC',

Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

@Sesquipedalian

@jdarwood007 jdarwood007 added this to the 3.0 Alpha 4 milestone May 10, 2025
@jdarwood007
Copy link
Member Author

Also going to love this one

You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

SMF/other/upgrade.php

Lines 3624 to 3664 in 1b52517

Db::$db->query(
'',
'CREATE FUNCTION IF NOT EXISTS {identifier:db_name}.smf_entity_decode(txt TEXT CHARSET utf8mb4) RETURNS TEXT CHARSET utf8mb4
NO SQL
DETERMINISTIC
BEGIN
DECLARE tmp TEXT CHARSET utf8mb4 DEFAULT txt;
DECLARE entity TEXT CHARSET utf8mb4;
DECLARE pos1 INT DEFAULT 1;
DECLARE pos2 INT;
DECLARE codepoint INT;
IF txt IS NULL THEN
RETURN NULL;
END IF;
LOOP
SET pos1 = LOCATE("&#", tmp, pos1);
IF pos1 = 0 THEN
RETURN tmp;
END IF;
SET pos2 = LOCATE(";", tmp, pos1 + 2);
IF pos2 > pos1 THEN
SET entity = SUBSTRING(tmp, pos1, pos2 - pos1 + 1);
IF entity REGEXP "^&#[[:digit:]]+;$" THEN
SET codepoint = CAST(SUBSTRING(entity, 3, pos2 - pos1 - 2) AS UNSIGNED);
SET tmp = CONCAT(LEFT(tmp, pos1 - 1), CHAR(codepoint USING utf32), SUBSTRING(tmp, pos2 + 1));
END IF;
IF entity REGEXP "^&#x[[:xdigit:]]+;$" THEN
SET codepoint = CAST(CONV(SUBSTRING(entity, 4, pos2 - pos1 - 3), 16, 10) AS UNSIGNED);
SET tmp = CONCAT(LEFT(tmp, pos1 - 1), CHAR(codepoint USING utf32), SUBSTRING(tmp, pos2 + 1));
END IF;
END IF;
SET pos1 = pos1 + 1;
END LOOP;
END',
[
'db_name' => Db::$db->name,
]
);
Db::$db->disableQueryCheck = false;

@Sesquipedalian
Copy link
Member

Sesquipedalian commented May 10, 2025

Oof. The first one could be treated as optional and silently skipped if it failed, but the second one is going to be a pain.

I suppose for the second one we could do a check for the necessary DB permissions and fall back to a PHP implementation if we don't have them. That'll be a lot slower, though, due to the repeated queries it will involve.

@jdarwood007
Copy link
Member Author

The weird part is that I don't know why binary logging is enabled. I don't do replication, and none of my backup operations require it. But I suspect we would have more than one user with it, as some hosts may be using it to replicate data or backup operations.

@Oldiesmann
Copy link
Contributor

I reported the first issue in #8599 but didn't know what was causing it. Nice to know we know what's causing that at least.

@Oldiesmann
Copy link
Contributor

We can get around the first issue by checking for the global row format and specifying the ROW_FORMAT for each table we create if it isn't DYNAMIC (which it should be in most cases since that's the default). Also on my server, binary logging isn't enabled so I'm not sure how common of an issue that will be.

@Sesquipedalian Sesquipedalian linked a pull request May 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants