[MDEV-6581] Writing to TEMPORARY TABLE not possible in read-only Created: 2014-08-14 Updated: 2020-11-21 Resolved: 2016-08-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Temporary, Replication |
| Affects Version/s: | 5.5.39, 10.0.12, 10.1 |
| Fix Version/s: | 5.5.51, 10.1.17, 10.0.27 |
| Type: | Bug | Priority: | Major |
| Reporter: | Arjen Lentz | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 4 |
| Labels: | upstream, upstream-fixed | ||
| Environment: |
any |
||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
MySQL 5.5 refman for read-only: However, this appears to not be true. I've just repeated this with MariaDB 10.0.12
=== As per the original upstream bug report, the problem only shows up when binary logging is enabled. Obviously that's merely a fact and not a valid workaround Furthermore, MyISAM behaviour on the above is also broken. From the above, I guess it's the binary log code reporting the error, and I would reckon that that's also where the bug exists. Note: Client applications are failing on this after upgrading to MariaDB 10.0, which is why I have marked the bug as critical. While the upstream bug info is somewhat ambiguous in terms of when the problem first appeared, it definitely existed in 5.5. At some point in the past, it didn't occur, and obviously the manual indicates how it should work. So it's a regression. Mind that any testcase needs to ensure that the binlog is enabled and the other possibilities described above are covered, so that it effectively catches the problem. |
| Comments |
| Comment by Arjen Lentz [ 2014-08-14 ] | |||||||||||||||||||||||||||
|
Client reports that it worked in 5.1.73 | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-08-16 ] | |||||||||||||||||||||||||||
|
The problem appeared in MySQL 5.5 somewhere between 5.5.2 and 5.5.3. MTR test case:
| |||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-10-01 ] | |||||||||||||||||||||||||||
|
Ok. What happens here is:
Possible fixes are:
Both fixes change results of lots of tests and have a high risk of breaking something. Thus we can consider this only for 10.1 branch at the earliest. Furthermore, it seems that the desired behavior is to prevent any binlog writes in the read-only mode, otherwise one cannot easily fail-over as slave binlogs will contain some random events added between master events, even if the slave is read-only. Note that a correct read-only binlog would prevent also CREATE TEMPORARY TABLE in the above test case. And it would've aborted INSERT before it is completed, not at commit time. This has also a very high potential of breaking existing applications, so I'll move this whole but report to 10.1. | |||||||||||||||||||||||||||
| Comment by Arjen Lentz [ 2014-10-02 ] | |||||||||||||||||||||||||||
|
Ok - thanks for that Serg. Applications can of course use a different GRANT for slave access, and this can be a good work-around for now. However, if all grants are available on the slave, an application could potentially still connect with the wrong login and thus write to the slave. | |||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-10-10 ] | |||||||||||||||||||||||||||
|
To fix, somehow. CREATE TEMPORARY TABLE is allowed, but INSERT is not — that's certainly a bug. | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-04-28 ] | |||||||||||||||||||||||||||
|
See also | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-05 ] | |||||||||||||||||||||||||||
|
Please also note that CREATE TEMPORARY TABLE .. AS SELECT with InnoDB fails even without binary logging. The table gets created, but not populated, and the error is returned. | |||||||||||||||||||||||||||
| Comment by Nicolas Payart [ 2016-06-15 ] | |||||||||||||||||||||||||||
|
This bug still exists in MariaDB 10.1.14. | |||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-08-03 ] | |||||||||||||||||||||||||||
|
In MySQL they've implemented the second approach "don't mark transactions read-write if no real storage engine is affected". |