List:Internals« Previous MessageNext Message »
From:Alan van den Bosch Date:October 31 2000 1:11pm
Subject:Re: ha_berkeley.[ch] files
View as plain text  
On Tue, 31 Oct 2000, you wrote:
>On Tue, Oct 31, 2000 at 02:32:15PM +1100, Alan van den Bosch wrote:
>> I Downloaded the src tarballs for mysql-3.23.27-beta-win-src.zip and
>> db-3.2.3b.tar.gz had had a poke around slq/ha_berkeley.[ch] and the db.h
>> files. I've the impression that transaction support has been successfully
>> compiled and tested to a degree. However, there are references to a member
>> of the DB type (__DB struct) that doesnt exist in that structure, but is a
>> member of the DBT type ( does app_private ring any bells? ). An expample
>> of this is the berkley_cmp_packed_key() function in ha_berkeley.c
>
>There's an app_private in __db, __db_env and __db_dbt.  We
>haven't done any work on getting MySQL on Windows to build
>with BDB, though, so ... I have no idea what troubles you'll
>run into there.  We will get to that ... sometime.  Monty is
>on a trip to the US right now, and probably he's the one who
>will need to handle it.  Unless you do first!
>
>What exactly is happening?
>
>Tim

Hi Tim,

I managed to get mysql-opt built statically linked with libdb32s.lib using 
MSVC++ 6.0 with sp3 on win95b. Have done a quick test (single user/single 
transaction) and it seems to work - after I remembered to set autocommit off. 
Well the server doesnt fall over anyway :-)

The db-3.2.3b tarball includes a few different directories specific to 
building on different platforms (win32,vms...) and the db.h file in the 
build_win32 directory is from sleepycat ver 2 -> app_private only in 
__db_dbt. I added app_private to __db and __db_env by hand. I cant see a *nix 
version of db.h in the tarball either so I assume that the first db.h already 
on a *nix system the compiler comes accross will be used. This tarball may 
not be enough by itself to get db-3 happening on *nix :-(

Some other issues I came across;

1) both mysql (mysys.lib) and libdb32s.lib have 'getopt' implemented. I threw 
a #ifndef HAVE_GETOPT ... #endif around most of the contents of 
db-3.2.3b/clib/getopt.c, starting from just below where db_config.h is 
included (was tempting to just remove it from the project, which prolly would 
have been easier, but HAVE_GETOPT is mentioned in db_config.h already for 
what its worth )

2) the use of the type 'byte' in ha_berkeley.[ch] caused MSVC++ to barf. I 
went sick with type casting arguments till the compiler was content - hope I 
havent broken too much ;-)

3) db-3.2.3b/os_win32/os_rename.c uses MoveFileEx(), which is not available 
on win95/98 - they have also used a hack to get around a bug in this function 
that occurs if the destination file file allready exists which involves 
calling MoveFile() if MoveFileEx() fails. The files comments explain it 
nicely. I replaced this with a call to DeleteFile() then a call to 
MoveFile(). DeleteFile() will close the file before deleting it if needed 
(alegedly).

Thankyou for your assistance and I hope this is of some help.

-- 
Regards,

Alan van den Bosch
Sanguis Pty Ltd


/* All generalizations are false. */
Thread
ha_berkeley.[ch] filesAlan van den Bosch31 Oct
  • Re: ha_berkeley.[ch] filesThimble Smith31 Oct
    • Re: ha_berkeley.[ch] filesAlan van den Bosch31 Oct
      • Re: ha_berkeley.[ch] filesThimble Smith31 Oct