greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 16226

Show
Ignore:
Timestamp:
2008-06-27 15:24:51 (6 months ago)
Author:
mdewsnip
Message:

Changed a "DELETE FROM" then "INSERT INTO" into a "INSERT OR REPLACE", for simplicity (and hopefully efficiency too).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gsdl/trunk/perllib/dbutil.pm

    r16225 r16226  
    285285 
    286286    my $safe_infodb_key = &sqlite_safe($infodb_key); 
    287     print $infodb_handle "DELETE FROM data WHERE key='" . $safe_infodb_key . "';\n"; 
    288     print $infodb_handle "INSERT INTO data (key, value) VALUES ('" . $safe_infodb_key . "', '" . &sqlite_safe($infodb_entry_value) . "');\n"; 
     287    print $infodb_handle "INSERT OR REPLACE INTO data (key, value) VALUES ('" . $safe_infodb_key . "', '" . &sqlite_safe($infodb_entry_value) . "');\n"; 
    289288 
    290289    # If this infodb entry is for a document, add all the interesting document metadata to the