<commit_before><?
include '../scat.php';
include '../lib/item.php';

$id= (int)$_REQUEST['id'];
if (!$id)
  die_jsonp("You need to supply an item.");

$q= "UPDATE vendor_item, barcode
        SET vendor_item.item = barcode.item
      WHERE vendor_item.item = 0 AND vendor_item.barcode = barcode.code
        AND barcode.item = $id";
<commit_msg>Match by item code, too<commit_after><?
include '../scat.php';
include '../lib/item.php';

$id= (int)$_REQUEST['id'];
if (!$id)
  die_jsonp("You need to supply an item.");

$q= "UPDATE vendor_item, item
        SET vendor_item.item = item.id
      WHERE vendor_item.item = 0 AND vendor_item.code = item.code
        AND item.id = $id";

$r= $db->query($q)
  or die_query($db, $q);

$q= "UPDATE vendor_item, barcode
        SET vendor_item.item = barcode.item
      WHERE vendor_item.item = 0 AND vendor_item.barcode = barcode.code
        AND barcode.item = $id";

{'fraction_non_alphanumeric': 0.16061606160616063, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 3.193548387096774, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6249525', 'n_tokens_mistral': 321, 'n_tokens_neox': 321, 'n_words': 87}