Ignore:
Timestamp:
2018-10-23T15:33:31+13:00 (6 years ago)
Author:
ak19
Message:
  1. bugfix to GS SQLPlugout: recursive call didn't go through self variable, noticed only when processing a doc with structure (subsections). 2. Being more explicit about the params passed to gssql.pm constructor. 3. MySQL didn't let me create a table with hyphens in the tablename. So collection names that contain hyphens need to first be adjusted for use in table names.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm

    r32530 r32531  
    245245    my $self = shift (@_);
    246246    my ($doc_obj) = @_;
     247    my $doc_oid = $doc_obj->get_OID(); # this method processes a single doc at a time, so it uses the same OID throughout
    247248    my $root_section = $doc_obj->get_top_section();
    248     my $doc_oid = $doc_obj->get_OID(); # we're processing a single doc at a time, so single OID
    249249
    250250    # load the prepared INSERT statement handles for both tables (can be undef for any table depending on whether meta_only or txt_only are set)
     
    269269
    270270    my $debug_out = $self->{'debug_outhandle'};
    271     print STDERR "#### Meta stmt: " . $metadata_table_sth->{'Statement'} . "\n";
    272     print STDERR "#### Full stmt: " . $fulltxt_table_sth->{'Statement'} . "\n";
     271#    print STDERR "#### Meta stmt: " . $metadata_table_sth->{'Statement'} . "\n";
     272#    print STDERR "#### Full stmt: " . $fulltxt_table_sth->{'Statement'} . "\n";
    273273   
    274274    #my $proc_mode = $self->{'process_mode'};
     
    318318    # output all subsections: RECURSIVE CALL
    319319    foreach my $subsection (@{$section_ptr->{'subsection_order'}}) {
    320     &recursive_write_meta_and_text($doc_obj, $doc_oid, "$section.$subsection", $metadata_table_sth, $fulltxt_table_sth);
     320    $self->recursive_write_meta_and_text($doc_obj, $doc_oid, "$section.$subsection", $metadata_table_sth, $fulltxt_table_sth);
    321321    }
    322322}
Note: See TracChangeset for help on using the changeset viewer.