<commit_before>DELIMITER //

DROP PROCEDURE IF EXISTS `WarrantyList`;
CREATE DEFINER=`{RO}`@`{SERVER}` PROCEDURE `WarrantyList`()
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Returns warranty'
BEGIN
 SELECT * FROM `viewInventoryWarrantys`;
END//

DROP PROCEDURE IF EXISTS `WarrantySearch`;
CREATE DEFINER=`{RO}`@`{SERVER}` PROCEDURE `WarrantySearch`(IN `s` CHAR(128))
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Search computer records by warranty'
BEGIN
 SELECT * FROM `warranty` WHERE `eowd` LIKE s OR `opd` LIKE s;
END//

DROP PROCEDURE IF EXISTS `WarrantyAddUpdate`;
CREATE DEFINER=`{ADMIN}`@`{SERVER}` PROCEDURE `WarrantyAddUpdate`(IN `e` CHAR(32), IN `o` CHAR(32))
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Add/Update warranty'
BEGIN
 INSERT INTO `warranty` (`eowd`, `opd`) VALUES (e, o) ON DUPLICATE KEY UPDATE `eowd`=e, `opd`=o;
 SELECT ROW_COUNT() AS affected;
END//

DROP PROCEDURE IF EXISTS `WarrantyUpdate`;
CREATE DEFINER=`{ADMIN}`@`{SERVER}` PROCEDURE `WarrantyUpdate`(IN `i` BIGINT, IN `e` CHAR(32), IN `o` CHAR(32))
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Update warranty'
BEGIN
 UPDATE `warranty` SET `eowd` = e, `opd` = o WHERE `id` = i LIMIT 1;
 SELECT ROW_COUNT() AS affected;
END//

DROP PROCEDURE IF EXISTS `WarrantyDelete`;
CREATE DEFINER=`{ADMIN}`@`{SERVER}` PROCEDURE `WarrantyDelete`(IN `i` BIGINT)
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Delete warranty'
BEGIN
 DELETE FROM `warranty` WHERE `id` = i;
 SELECT ROW_COUNT() AS affected;
END//

DELIMITER ;<commit_msg>Stored proc: Updates & fixes to warranty management<commit_after>DELIMITER //

DROP PROCEDURE IF EXISTS `WarrantyList`;
CREATE DEFINER=`{RO}`@`{SERVER}` PROCEDURE `WarrantyList`()
 DETERMINISTIC
 SQL SECURITY DEFINER
 COMMENT 'Returns warranty'
BEGIN
 SELECT * FROM `viewInventoryWarranty`;
END//

DROP PROCEDURE IF EXISTS `WarrantySearch`;
CREATE DEFINER=`{RO}`@`{SERVER}` PROCEDURE `WarrantySearch`(IN `s` CHAR(128))
 DETERMINISTIC
 SQL SECURITY DEFINER
 COMMENT 'Search computer records by warranty'
BEGIN
  SET @search = UNIX_TIMESTAMP(s);
  SELECT * FROM `warranty` WHERE `eowd` LIKE @s OR `opd` LIKE @s;
END//

DROP PROCEDURE IF EXISTS `WarrantyAddUpdate`;
CREATE DEFINER=`{ADMIN}`@`{SERVER}` PROCEDURE `WarrantyAddUpdate`(IN `e` CHAR(32), IN `o` CHAR(32))
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Add/Update warranty'
BEGIN
  SET @eowd = UNIX_TIMESTAMP(e);
  SET @opd = UNIX_TIMESTAMP(o);
  INSERT INTO `warranty` (`eowd`, `opd`) VALUES (@eowd, @opd) ON DUPLICATE KEY UPDATE `eowd`=@eowd, `opd`=@opd;
  SELECT ROW_COUNT() AS affected;
END//

DROP PROCEDURE IF EXISTS `WarrantyUpdate`;
CREATE DEFINER=`{ADMIN}`@`{SERVER}` PROCEDURE `WarrantyUpdate`(IN `i` BIGINT, IN `e` CHAR(32), IN `o` CHAR(32))
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Update warranty'
BEGIN
  SET @eowd = UNIX_TIMESTAMP(e);
  SET @opd = UNIX_TIMESTAMP(o);
  UPDATE `warranty` SET `eowd` = @eowd, `opd` = @opd WHERE `id` = i LIMIT 1;
  SELECT ROW_COUNT() AS affected;
END//

DROP PROCEDURE IF EXISTS `WarrantyDelete`;
CREATE DEFINER=`{ADMIN}`@`{SERVER}` PROCEDURE `WarrantyDelete`(IN `i` BIGINT)
 DETERMINISTIC
 SQL SECURITY INVOKER
 COMMENT 'Delete warranty'
BEGIN
 DELETE FROM `warranty` WHERE `id` = i;
 SELECT ROW_COUNT() AS affected;
END//

DELIMITER ;
{'fraction_non_alphanumeric': 0.13282208588957056, 'fraction_numerical': 0.007361963190184049, 'mean_word_length': 5.779625779625779, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6254201', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1296, 'n_words': 361}