[Koha-bugs] [Bug 7167] updatedatabase improvements

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 27 12:01:34 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7167

--- Comment #104 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Hi Jared and Chris,

Thanks for your feedback :)

In fact, when I started this development, I thought about a structure to
manage. This structure is
    { errors => [], queries => [], comments => [] }
It is everywhere in this patch:
  * DB: see tables updatedb_error, updatedb_query and updatedb_report
  * perl files: see C4/Update/Database.pm and admin/updatedatabase.pl and
search queries, comments, errors
  * template files: The structure is the same (see routine
list_versions_already_knows)

If we have not the same structure with these informations (errors, comments,
queries), a big part of this development is useless.
To obtain these informations we have to "parse" the sql file. Moreover the pl
file have to return a consistent and adapted structure.

This sql "parsing" is in the routine C4::Update::Database::get_queries (~20
lines). It's not darkness :
    If the line begin with '--' it's a comment.
    If we want to change the delimiter, we change the input record separator.
Indeed, by default it's the semicolon character. We want to use this sql
statement to know when the query is terminated.
    Else it's a query

The routine check_coherency seems to cause problems. In fact, we can bypass
this check. But if we want, in the future, translate the errors we have to
encapsulate errors for a better usability. Else we would be displaying an error
from the DBMS (then not translatable).


Regarding the delimiter, it is NOT mandatory. But it is if you want to write a
query on several lines.

Finally, if we have not these informations, the patch should to be completely
rewrite...

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list