List Info

Thread: Re: R2 and MySql




Re: R2 and MySql
country flaguser name
Czech Republic
2007-11-26 12:10:54
Have had a bit of server problems lately so it has taken
some time to figure
out this one, but now I am pretty down to what needs to be
done to get BW to
create InnoDB tables properly on Mysql, to take full use of
transactions and
constrains.

This can be done in one of two way, were the easiest, as I
see it, includes
to patch the ADODB lib. Then it would just be a few lines of
code in 2-3
places and things will stay rather clean. The other way, not
to patch ADODB
will take quite a bit more changes and I am not even sure if
it can be done
properly as BW is setup now. It will at least be a lot more
uglier, so I
wont go into details of it until we have looked at the patch
of lib option.

Another point I think we should consider as well regarding
MySql, is to not
support anything else then use of the InnoDB engine. That
mean we will by
default create InnoDB tables on MySql, even if the system
have MyIsam as
default. Most have, but for all versions of MySql we
currently support they
also have InnoDB available, unless the 'SkipInnoDb' flag is
set in MySql
startup configuration. We should also consider to use the
ADODB 'mysqlt'
driver rather then 'mysql' to get transaction support, as
all versions of
MySql we support also support this but require InnoDB. 

I would also like us to upgrade ADODB to use the latest 4.96
version, we use
4.94 now with some patches. I have forwarded these patches
over o 4.96 and
have it working fine with MySql. I cannot tell for sure how
it will effect
other db's but from looking at the changes between the two I
haven't found
anything that obviously will cause breakage. It would need
so testing of
course, but I think it's a good time to do it now before we
branch.

Ok, now over to the changes I see. I generally don't like
the idea of
patching libs, unless there is obvious bugs, but in this
case I think it's
the right thing to do.

So, the drivers adodb-mysql.inc.php and adodb-mysqli.inc.php
would need to
have the line

var $_genSeqSQL = "create table %s (id int not
null)";

changed to

var $_genSeqSQL = "create table %s (id int not null)
ENGINE=InnoDB";

the adodb-datadict.inc.php would need to have a change to
function
ChangeTableSQL(), however I suggest we replicate this
function in
datadict-mysql.inc.php instead as it keeps things claner and
more flexible,
and we also avoid to make special tests for mysql in
relation to this. The
new override function will have added to it:

		if (!isset($taboptions['DROP']))
			$taboptions = array_merge($taboptions, array(
'MYSQL' => 'ENGINE=INNODB'));

Also note that the file datadict-mysqli.inc.php we have now
(added by xing)
is totally unnecessary and can be removed.

That's basically it, apart from removing of some code that
now try to add
InnoDb but doesn't cut it. I will of course present a full
patch here before
any commit. Of course we could leave MySql as it is now as
it install w/o
error, but I am not quite sure if it really works all the
way. I don't see
this as a good approach though as our code basically is
written to make use
of constrains and transactions, which also is available to
MySql users with
InnoDB.

If we would do this w/o patching the adodb files, it will
get much more
complicated and bug risky as we would hve to test for mysql
in a lot of
places and "possibly" pass a table option value to
create InnoDB tables. It
gets specially tricky as ChangeTableSQL() is called from
within the lib at
some instances... The basic problem here is the layout of
MySql with
different available engines and as it at the same time hangs
on to old
fashion MyIsam as the default. But let's halt there for a
moment and see
what we get to, I hope to finish this soon though.

/Y





------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
bitweaver-core mailing list
bitweaver-corelists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitweave
r-core

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )