if not (already_configured [ Db ] init_status) then
begin
if not (Helm_registry.get_bool "matita.system") then
- MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
+ ((* SQL does not allow dots in table names. Let's replace them
+ with underscore and let's quote underscores by doubling them *)
+ let owner = Helm_registry.get "matita.owner" in
+ let owner = Str.global_replace (Str.regexp "_") "__" owner in
+ let owner = Str.global_replace (Str.regexp "\\.") "_" owner in
+ if Str.string_match (Str.regexp "^[a-zA-Z][a-zA-Z0-9_]*$") owner 0 then
+ MetadataTypes.ownerize_tables owner
+ else (
+ prerr_endline ("Error: the matita.owner configuration variable must contain only latin characters, digits and underscores. If the default configuration is used, the variable is set to the USER environment variable and can be changed prepending the USER=any_valid_name to the matita command.");
+ exit (-1)
+ )
+ );
LibraryDb.create_owner_environment ();
Db::init_status
end