Marco Gaiarin a écrit:
Mandi! Chris Cormack In chel di` si favelave...
And in the same file:
@@ -155,7 +155,7 @@ # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { my $dbh=C4Connect; - my $query = "replace currency (currency,rate) values ("; + my $query = "update currency set (currency,rate) values ("; $query.= $dbh->quote($input->param('currency')).","; $query.= $dbh->quote($input->param('rate')).")"; my $sth=$dbh->prepare($query);
REPLACE?! What sort of SQL instruction are REPLACE?!
REPLACE is a non standard SQL instruction, but very nice : if the primary key exists, it does a "update". If not, it does an "insert". if not primary key in the table... it does not work ;-) (but who does tables without pk ???)
Then i've gived up. ;( dpkg -i mysql-server started installing mysql on my woody server...
Best idea for instance, i think. If it does not give you a heart-break ;-)))
I think that is possibile to port koha to other DB engine, but a great work have to be done. I suppose:
1) porting the schema to more standard SQL format, using referential integrity (FOREIGN KEY) 2) do some sort of compatibility function to handle date format, seral/auto_increment differencies (if not just handle by DBI/DBD, i've never used these). 3) revising all the code checking for syntiax problem like these exposed, rewriting them in more standard as possible sql. 4) revise all the code to make them happy with referential integrity (for experience changing a schema from a db without RI to one with, expose a bounch of little problem/race condition in db handling code)
I FULLY AGREE with point 4 : i once ported a DB from mySQL to interbase/firebird... was a nightmare... worst, we had to maintain both for a while, so i had to develop some script to do this every night ;-\\\\
It is not a patch nor a little work... doable for 1.4.X release?! ;)
Bad news : i think there are a LOT of more important things to do before spending time on this problem (i say this from a librarian point of vue : it doesn't matter for a librarian if we use mySQL, postgreSQL, Oracle or ASCII file...) Note : i think this discussion should be followed in koha-devel@lists.sourceforge.net... (if you're heavily interested, we have a koha-cvs too) -- Paul Koha release manager for 1.4 version.