bugzilla_db_independance_and_a_mysql_bug

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: DB independence in 2.10?
From: Kevin Brannen <kbrannen@gte.net>
Date: Wed, 22 Nov 2000 17:22:58 -0600

please ignore the reply address I'm sending this from home, see below for my
real address]

I've seen this topic discussed here in the newsgroup and in the FAQ.  I've
seen the wishlist for 3.0 (and the recent infrastructure posting).  But I
guess my question is:  is DB independence in v2.10 a useful thing?  If it were
to happen, would that be a good thing or would people not care?

I ask because I've taken checksetup.pl and made it about 99% DB independent. 
It presently works with Informix; I have yet to recheck it with Mysql, but I
suspect I've ruined only a few lines which should be easily fixable (he says
naively. :-)

I chose Informix because I'm most familiar with it, but I have Oracle
available and could do it next.

I took a few short-cuts:

* I changed the bit fields to INT, meaning there can be only 32 of "whatever"
just now.  I liked the separate table idea by one of the Daves, but didn't
want to go there just now; but I could.

* I changed the enum fields to varchar(20) and just store the string.  Didn't
feel like going to the trouble of normalizing those into separate tables.

* I had to create an if/then/else section at the top for DB dependent stuff to
go into vars (for the data types), which drive the rest of the code.  (For
nicety sake, I left the Mysql version to be all the myriad of data types; but
the other DBs would be only the standard ANSI SQL types.)

* I commented out much of the "update to the latest version" code at the
bottom.  I could probably fix, but didn't care too just now, because...

I've spent only about 3-4 hours on this now.  I've got the setup done.  I feel
I could fix the rest of the code in the .cgi and .pl files.  But is it worth
the effort?  Is 3.0 coming soon enough and is there little demand such that it
would be a waste of my time?

I've proved a point to myself that it could be done.  Should I go on or just
toss the code and consider it an education on Bugzilla?


Kevin
kevin.brannen@springbow.com

p.s. Doing this was instructive in that I found some SQL that is wrong (e.g.
where Mysql didn't complain about a "not null" column without a default not
being given a value in an insert; I think I found about 5-10 of these).

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu