Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.37, 10.1.38, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
-
CentOS
Description
Very similar to an old mySQL bug (https://bugs.mysql.com/bug.php?id=86163), you will get an error about read only when executing an update statement against a temp table if that table is joined to non-temp tables, even though the targetting columns are all in the temporary table.
Borrowing the example from that bug report:
## As root user with SUPER privilege run the following: |
|
CREATE TABLE table1( |
`id` INT NOT NULL, |
`name` VARCHAR(10) NOT NULL |
);
|
|
CREATE TABLE log1( |
info VARCHAR(10) NOT NULL |
);
|
|
SET GLOBAL read_only=1; |
|
## Insert some fake data |
|
## Then as another user that has basic privileges but not the SUPER privilege run the following: |
|
CREATE TEMPORARY TABLE TEMP_TABLE1 ( |
`id` INT NOT NULL, |
`update_me` VARCHAR(10) |
);
|
|
UPDATE TEMP_TABLE1 LEFT JOIN table1 ON TEMP_TABLE1.id = table1.id SET TEMP_TABLE1.update_me = 'hello'; |
|
## you should get an error complaining that it is running with the --read-only option |
Attachments
Issue Links
- causes
-
MDEV-19491 update query stopped working after mariadb upgrade 10.2.23 -> 10.2.24
-
- Closed
-
- relates to
-
MDEV-24082 Can't update a temporay table joined with a non-temporary inside a read-only transaction
-
- Confirmed
-
This issue has been present in several past versions, and to date we have been able to work around it by manipulating our queries but we hit one where all workarounds incur a significant performance penalty. We have disabled read_only for now but we are at risk until this can be fixed so we can turn on read-only again.