Bug #43166 | SQL statements executed by BACKUP/RESTORE are logged in server query log. | ||
---|---|---|---|
Submitted: | 25 Feb 2009 5:54 | Modified: | 28 Jun 2009 0:13 |
Reporter: | Rafal Somla | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | 6.0-beta | OS: | Any |
Assigned to: | Chuck Bell | CPU Architecture: | Any |
[25 Feb 2009 5:54]
Rafal Somla
[20 Mar 2009 0:12]
Chuck Bell
Solution found. May be used to fix BUG#43395. If so, I will add a note.
[20 Mar 2009 1:37]
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/commits/69880 2803 Chuck Bell 2009-03-19 BUG#43166 SQL statements executed by BACKUP/RESTORE are logged in server query log This patch turns off the general log during backup and restore to avoid writing the intermedia queries to the log. modified: sql/backup/backup_kernel.h sql/backup/kernel.cc sql/si_objects.cc sql/si_objects.h
[20 Mar 2009 1:41]
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/commits/69881 2803 Chuck Bell 2009-03-19 BUG#43166 SQL statements executed by BACKUP/RESTORE are logged in server query log This patch turns off the general log during backup and restore to avoid writing the intermedia queries to the log. added: mysql-test/suite/backup/r/backup_general_log.result mysql-test/suite/backup/t/backup_general_log.test modified: sql/backup/backup_kernel.h sql/backup/kernel.cc sql/si_objects.cc sql/si_objects.h
[20 Mar 2009 7:35]
Rafal Somla
I want to point at alternative solution: Instead of adding new "disable general query log" service to si_objects, modify its implementation so that any SQL statements executed from there will not be logged. This can be done in Si_session_context::reset_si_ctx() which prepares execution context for SQL code executed from within si_objects (via run_service_interface_sql() function). The logging could be disabled there and re-enabled, if needed, in Si_session_context::restore_si_ctx. With this solution, the backup code would remain unchanged. Also, it makes sense for other potential clients of si_objects - arguably, they don't want the queries executed from there to be logged in the server log. Actually, they (the clients of si_object) should not care whether si_objects services are implemented with SQL queries or by other means.
[20 Mar 2009 12:38]
Chuck Bell
The new methods were added to si_objects because at least one other place in the code needs to be able to turn off the general log. See BUG#43395. These new methods enable any portion of code to disable writing to the general log. Thus, the design in the patch is the best choice going forward.
[20 Mar 2009 13:55]
Rafal Somla
The current design means that si_objects methods will log SQL statements to the general query log unless user of these services disables the log explicitly. The fact that general query log should be also disabled during trigger/event firing does not justify such a design. I think more logical would be to implement si_objects methods so that they don't leave any trace in server logs. Note that disabling the query log is a matter of a single statement: thd->options|= OPTION_LOG_OFF; Thus I don't think it is a problem if this is done inside si_object methods instead of being done just once. Already, Si_session_context::reset_si_ctx() is doing a couple of such assignments and seems to be a perfect place for doing them. Also, having a separate service for setting/clearing this single flag could be considered an overkill.
[29 Apr 2009 20:39]
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/commits/73064 2700 Chuck Bell 2009-04-29 BUG#43166 SQL statements executed by BACKUP/RESTORE are logged in server query log This patch turns off the general log during backup and restore to avoid writing the intermedia queries to the log. added: mysql-test/suite/backup/r/backup_general_log.result mysql-test/suite/backup/t/backup_general_log.test modified: sql/si_objects.cc sql/si_objects.h
[30 Apr 2009 7:50]
Jørgen Løland
Good to push
[5 May 2009 16:36]
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/commits/73406 2800 Chuck Bell 2009-05-05 BUG#43166 SQL statements executed by BACKUP/RESTORE are logged in server query log This patch turns off the general log during backup and restore to avoid writing the intermediate queries to the log. added: mysql-test/suite/backup/r/backup_general_log.result mysql-test/suite/backup/t/backup_general_log.test modified: sql/si_objects.cc sql/si_objects.h
[5 May 2009 17:43]
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/commits/73413 2802 Chuck Bell 2009-05-05 BUG#43166 SQL statements executed by BACKUP/RESTORE are logged in server query log This patch turns off the general log during backup and restore to avoid writing the intermediate queries to the log. added: mysql-test/suite/backup/r/backup_general_log.result mysql-test/suite/backup/t/backup_general_log.test modified: sql/si_objects.cc sql/si_objects.h
[6 May 2009 13:48]
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/commits/73502 2805 Chuck Bell 2009-05-06 Patch contains fixes for test failures for: * (BUG#43166) backup_general_log * (WL#4612) rpl_backup modified: mysql-test/suite/backup/r/backup_general_log.result mysql-test/suite/backup/t/backup_general_log.test mysql-test/suite/rpl/t/rpl_backup_block.test
[6 May 2009 19:17]
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/commits/73524 2806 Chuck Bell 2009-05-06 Patch contains additional fixes for test failures for: * (BUG#43166) backup_general_log * (WL#4612) rpl_backup modified: mysql-test/suite/backup/r/backup_general_log.result mysql-test/suite/backup/t/backup_general_log.test mysql-test/suite/rpl/r/rpl_backup_block.result mysql-test/suite/rpl/t/rpl_backup_block.test
[7 May 2009 0:58]
Chuck Bell
Pushed to 6.0.11-alpha.
[3 Jun 2009 7:19]
Jørgen Løland
Merged to azalea June 2
[28 Jun 2009 0:13]
Paul DuBois
Noted in 6.0.11 changelog. SQL statements executed by BACKUP DATABASE and RESTORE were logged in the general query log.