Bug #38814 Backup: character_set_database change
Submitted: 14 Aug 2008 23:54 Modified: 29 Jun 2009 15:41
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.7-alpha-debug OS:Linux (SUSE 10 32-bit)
Assigned to: Chuck Bell CPU Architecture:Any

[14 Aug 2008 23:54] Peter Gulutzan
Description:
I say SET @@character_set_database=swe7.
I backup.
I restore.
I do not explicitly change default database.
I say SELECT @@character_set_database.
The result is not swe7.

How to repeat:
mysql> set @@character_set_server = latin5;
Query OK, 0 rows affected (0.02 sec)

mysql> create database da character set cp932;
Query OK, 1 row affected (0.04 sec)

mysql> use da
Database changed
mysql> set @@character_set_database = swe7;
Query OK, 0 rows affected (0.03 sec)

mysql> backup database da to '102';
+-----------+
| backup_id |
+-----------+
| 25        |
+-----------+
1 row in set (0.99 sec)

mysql> restore from '102';
+-----------+
| backup_id |
+-----------+
| 26        |
+-----------+
1 row in set (0.00 sec)

mysql> select @@character_set_database;
+--------------------------+
| @@character_set_database |
+--------------------------+
| latin5                   |
+--------------------------+
1 row in set (0.00 sec)
[15 Aug 2008 0:29] MySQL Verification Team
Thank you for the bug report. Verified as described:

Server version: 6.0.7-alpha-nt-debug-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql 6.0 > set @@character_set_server = latin5;
Query OK, 0 rows affected (0.06 sec)

mysql 6.0 > create database da character set cp932;
Query OK, 1 row affected (0.05 sec)

mysql 6.0 > use da
Database changed
mysql 6.0 > set @@character_set_database = swe7;
Query OK, 0 rows affected (0.02 sec)

mysql 6.0 > backup database da to '102';
+-----------+
| backup_id |
+-----------+
| 3         |
+-----------+
1 row in set (1.25 sec)

mysql 6.0 > restore from '102';
+-----------+
| backup_id |
+-----------+
| 4         |
+-----------+
1 row in set (0.13 sec)

mysql 6.0 > select @@character_set_database;
+--------------------------+
| @@character_set_database |
+--------------------------+
| latin5                   |
+--------------------------+
1 row in set (0.00 sec)
[7 May 2009 2:26] Chuck Bell
The problem is isolated to restore, but patch must ensure neither backup nor restore changes the character_set_database variable setting.
[7 May 2009 22:32] 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/73618

2808 Chuck Bell	2009-05-07
      BUG#38814 : Backup: character_set_database change
      
      The backup system changes the character_set_database value on
      restore.
      
      This patch corrects the behavior by saving the value prior to
      backup or restore and then resets it after the operation is 
      complete.
      modified:
        mysql-test/suite/backup/r/backup_charsets.result
        mysql-test/suite/backup/t/backup_charsets.test
        sql/sql_parse.cc
[8 May 2009 15:03] Ingo Strüwing
Back to "in progress". Please find a change request by email.
[12 May 2009 21:13] 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/73874

2808 Chuck Bell	2009-05-12
      BUG#38814 : Backup: character_set_database change
      
      The backup system changes the character_set_database value on
      restore.
      
      This patch corrects the behavior by saving the value prior to
      backup or restore and then resets it after the operation is
      complete.
      modified:
        mysql-test/suite/backup/r/backup_charsets.result
        mysql-test/suite/backup/t/backup_charsets.test
        sql/si_objects.cc
[12 May 2009 22:27] 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/73881

2808 Chuck Bell	2009-05-12
      BUG#38814 : Backup: character_set_database change
      
      The backup system changes the character_set_database value on
      restore.
      
      This patch corrects the behavior by saving the value prior to
      backup or restore and then resets it after the operation is 
      complete.
      modified:
        mysql-test/suite/backup/r/backup_charsets.result
        mysql-test/suite/backup/t/backup_charsets.test
        sql/si_objects.cc
[21 May 2009 16:58] Rafal Somla
Good to push.
[21 May 2009 18:08] 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/74737

2705 Chuck Bell	2009-05-21
      BUG#38814 : Backup: character_set_database change
      
      The backup system changes the character_set_database value on
      restore.
      
      This patch corrects the behavior by saving the value prior to
      backup or restore and then resets it after the operation is 
      complete.
      modified:
        mysql-test/suite/backup/r/backup_charsets.result
        mysql-test/suite/backup/t/backup_charsets.test
        sql/si_objects.cc
[21 May 2009 18:13] 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/74738

2706 Chuck Bell	2009-05-21
      BUG#38814 : Backup: character_set_database change
      
      The backup system changes the character_set_database value on
      restore.
      
      This patch corrects the behavior by saving the value prior to
      backup or restore and then resets it after the operation is 
      complete.
      modified:
        mysql-test/suite/backup/r/backup_charsets.result
        mysql-test/suite/backup/t/backup_charsets.test
        sql/si_objects.cc
[3 Jun 2009 7:14] Jørgen Løland
Merged to azalea June 2
[29 Jun 2009 14:47] Chuck Bell
Pushed to 5.4.4.
[29 Jun 2009 15:41] Paul DuBois
No changelog entry needed. Not in any released version.