Bug #4544 | read_only also affects temporary tables | ||
---|---|---|---|
Submitted: | 14 Jul 2004 12:12 | Modified: | 23 Nov 2005 16:07 |
Reporter: | Anders Henke | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S4 (Feature request) |
Version: | 4.0, 4.1, 5.0 | OS: | Linux (Linux) |
Assigned to: | Guilhem Bichot | CPU Architecture: | Any |
[14 Jul 2004 12:12]
Anders Henke
[15 Jul 2004 18:30]
Anders Henke
Readjusted to non-critical bug: I just noticed that 'grant select on db.* to $user' also grants a fresh user Create_tmp_table_priv and Lock_tables_priv, so if adding a 'readonly'-user implies that this user is automatically given temporary table and table locking rights, a readonly-server should also allow its users to make use of those rights and allow its users to make use of temporary tables.
[15 Jul 2004 21:16]
Sergei Golubchik
MySQL doesn't grant Create_tmp_table_priv and Lock_tables_priv automatically if you grant a select_priv only. What happens is that your privilege tables are of the old structure, and do not support Create_tmp_table_priv and Lock_tables_priv privileges. When MySQL deals wil such old tables it falls back to old behaviour - e.g. Select_priv was used to give rights to use LOCK TABLES.
[20 Jul 2004 17:48]
Guilhem Bichot
Hi Anders. Well, here's the truth: - you are 100% right requesting this feature; creating temp tables can be just a way to achieve a particular read (especially before MySQL 4.1 where the support for subselects makes it less crucial). So forbidding temp tables prevents quite a few reads. - but it's not sure this change is implementable without shaking the current code upside-down too much. I am testing a patch and will let you know. About that bad message which you got, it's true; we already fixed in 4.1. Guilhem
[14 Oct 2005 16:15]
Guilhem Bichot
working on pushing a patch for this bug in 5.0, as it has been patch pending for more than one year.
[17 Oct 2005 8:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/31170
[7 Nov 2005 15:02]
Guilhem Bichot
Starting from MySQL 5.0.16, read_only=1 will allow CREATE TEMPORARY TABLE and all statements modifying no non-temporary tables. For example, if there is a stored procedure, which has some substatements which modify temporary tables and some others which modify non-temporary tables, the CALL statement will be allowed, then the procedure will fail on the first statement modifying a non-temporary tables. ChangeSet@1.1932.312.1, 2005-10-17 10:52:34+02:00, guilhem@mysql.com Fix for BUG#4544 "read_only also affects temporary tables": the READ_ONLY global variable now allows statements which are to update only temporary tables (note: if a statement, after parse stage, looks like it will update a non-temp table, it will be rejected, even if at execution it would have turned out that 0 rows would be updated; for example UPDATE my_non_tem_table SET a=1 WHERE 1 = 0; will be rejected).
[23 Nov 2005 16:07]
Paul DuBois
Noted in 5.0.16 changelog. Modified descriptions for --read-only and read_only in the manual.