From: Alan van den Bosch Date: October 31 2000 1:11pm Subject: Re: ha_berkeley.[ch] files List-Archive: http://lists.mysql.com/internals/86 Message-Id: <00110100113408.13992@odin> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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= =2Eh >> files. I've the impression that transaction support has been successfu= lly >> compiled and tested to a degree. However, there are references to a me= mber >> 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 expamp= le >> 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 usin= g=20 MSVC++ 6.0 with sp3 on win95b. Have done a quick test (single user/single= =20 transaction) and it seems to work - after I remembered to set autocommit = off.=20 Well the server doesnt fall over anyway :-) The db-3.2.3b tarball includes a few different directories specific to=20 building on different platforms (win32,vms...) and the db.h file in the=20 build_win32 directory is from sleepycat ver 2 -> app_private only in=20 __db_dbt. I added app_private to __db and __db_env by hand. I cant see a = *nix=20 version of db.h in the tarball either so I assume that the first db.h alr= eady=20 on a *nix system the compiler comes accross will be used. This tarball ma= y=20 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 t= hrew=20 a #ifndef HAVE_GETOPT ... #endif around most of the contents of=20 db-3.2.3b/clib/getopt.c, starting from just below where db_config.h is=20 included (was tempting to just remove it from the project, which prolly w= ould=20 have been easier, but HAVE_GETOPT is mentioned in db_config.h already for= =20 what its worth ) 2) the use of the type 'byte' in ha_berkeley.[ch] caused MSVC++ to barf. = I=20 went sick with type casting arguments till the compiler was content - hop= e I=20 havent broken too much ;-) 3) db-3.2.3b/os_win32/os_rename.c uses MoveFileEx(), which is not availab= le=20 on win95/98 - they have also used a hack to get around a bug in this func= tion=20 that occurs if the destination file file allready exists which involves=20 calling MoveFile() if MoveFileEx() fails. The files comments explain it=20 nicely. I replaced this with a call to DeleteFile() then a call to=20 MoveFile(). DeleteFile() will close the file before deleting it if needed= =20 (alegedly). Thankyou for your assistance and I hope this is of some help. --=20 Regards, Alan van den Bosch Sanguis Pty Ltd /* All generalizations are false. */