Bug #3336 Problems with downgrade version 4.1 to 4.0 because of BDB
Submitted: 30 Mar 2004 7:57 Modified: 30 Mar 2004 11:20
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:4.1 OS:
Assigned to: Michael Widenius CPU Architecture:Any

[30 Mar 2004 7:57] Matthias Leich
Description:
The downgrade from MySQL 4.1.2-alpha-max (with BDB engine Berkeley DB 4.1.24)
to MySQL 4.0.19-max (with BDB engine Berkeley DB 3.2.9a) is not simple, if the BDB storage engine is used. Berkeley DB 3.2.9a does not understand the 
log version 7 and btree version: 9 used by the BDB engine Berkeley DB 4.1.24.

Effects: The start of mysqld v. 4.0.19 fails with, 
  Server log:   
     040325 13:30:00  bdb:  Ignoring log file: <..>
                                     /log.0000000001: unsupported log version 7
     040325 13:30:00  bdb:  PANIC: Invalid argument
     040325 13:30:00  Can't init databases
     040325 13:30:00  Aborting

Experiment: I removed /log.0000000001 .
          The start of mysqld v. 4.0.19 was successful, but the access to
          a table with type BDB failed with 
   Server log:
      040325 13:19:50  bdb:  ./mysql/T1_BDB_WRK.db: unsupported btree version: 9
   test case protocol
      ERROR 1016 at line 5: Can't open file: 'T1_BDB_REF.db'. (errno: 1)

This is not a real bug, but customers and the support should be informed via
manual section.

How to repeat:
0. MySQL 4.0.19 and 4.1.2-alpha source (bitkeeper, my last pull ~ 25.03.2004)
   compiled with ./BUILD/compile-pentium-max

1. Create a database with version 4.1.2-alpha
2. Create a table with type BDB
3. store some rows in this tables (I do not know if this step is necessary.)
4. stop the database
5. start the database with version 4.0.19

Suggested fix:
Please alter the manual similar to

2.5.2 Upgrading from Version 4.0 to 4.1
...
Server
...
Important note: if you upgrade from Berkeley DB 3.2.9a (included in MySQL 4.0.19-max) to Berkeley DB 4.1.24 (included in MySQL 4.1.2-alpha-max), it is difficult to downgrade back to 4.0. That is because earlier versions of Berkeley DB have a different log and btree version. You will have to
 ???????????? 
   1. unload and drop your BDB tables in version 4.1
   2. delete the BDB logs
   3. start version 4.0 and recreate these tables
 ????????????
      

-----------------------------------------
The version numbers used in the text above come from my box. I think it would be useful to replace them with the MySQL and BDB version numbers where the BDB engine log and btree was changed.
[30 Mar 2004 11:20] Michael Widenius
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).