<commit_before>DROP FUNCTION IF EXISTS packDate;
CREATE FUNCTION packDate (yy TINYINT UNSIGNED, mm TINYINT UNSIGNED, dd TINYINT UNSIGNED)
RETURNS INT UNSIGNED DETERMINISTIC
RETURN (yy << 24) | ((mm - 1) << 20) | ((dd - 1) << 14);

-- DB update 2017_09_26_00 -> 2017_10_15_00
DROP PROCEDURE IF EXISTS `updateDb`;
DELIMITER //
CREATE PROCEDURE updateDb ()
proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE';
SELECT COUNT(*) INTO @COLEXISTS
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_10_14_01';
IF @COLEXISTS = 0 THEN LEAVE proc; END IF;
START TRANSACTION;
ALTER TABLE version_db_world CHANGE COLUMN 2017_10_14_01 2017_10_15_00 bit;
SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1504044222560696700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF;
--
-- START UPDATING QUERIES
--
INSERT INTO version_db_world (`sql_rev`) VALUES ('1504044222560696700');

-- fix NO_ZERO_DATE error on mysql 5.7 (for latest linux platforms)
-- please use 5.6 on windows
SET SESSION sql_mode = "ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES";

DROP TABLE IF EXISTS holiday_dates;
CREATE TABLE holiday_dates (
  id INT UNSIGNED NOT NULL,
  date_id TINYINT UNSIGNED NOT NULL,
  date_value INT UNSIGNED NOT NULL,
  PRIMARY KEY (id, date_id)
);

INSERT INTO holiday_dates VALUES
(181, 6, 220692480 + (1 << 14)), -- rescheduled
(181, 7, 238338048 + (1 << 14)),
(181, 8, 254869504 + (1 << 14)),
(181, 9, 270958592 + (1 << 14)),
(181, 10, 288635520), -- 7.2 (PTR) dbc
(181, 11, 305166976),
(181, 12, 322271872),
(201, 9, 221723264),
(201, 10, 238484096),
(201, 11, 255244928),<commit_msg>Update 2017_10_15_00.sql<commit_after>DROP FUNCTION IF EXISTS packDate;
CREATE FUNCTION packDate (yy TINYINT UNSIGNED, mm TINYINT UNSIGNED, dd TINYINT UNSIGNED)
RETURNS INT UNSIGNED DETERMINISTIC
RETURN (yy << 24) | ((mm - 1) << 20) | ((dd - 1) << 14);

-- DB update 2017_09_26_00 -> 2017_10_15_00
DROP PROCEDURE IF EXISTS `updateDb`;
DELIMITER //
CREATE PROCEDURE updateDb ()
proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE';
SELECT COUNT(*) INTO @COLEXISTS
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_10_14_02';
IF @COLEXISTS = 0 THEN LEAVE proc; END IF;
START TRANSACTION;
ALTER TABLE version_db_world CHANGE COLUMN 2017_10_14_02 2017_10_15_00 bit;
SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1504044222560696700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF;
--
-- START UPDATING QUERIES
--
INSERT INTO version_db_world (`sql_rev`) VALUES ('1504044222560696700');

-- fix NO_ZERO_DATE error on mysql 5.7 (for latest linux platforms)
-- please use 5.6 on windows
SET SESSION sql_mode = "ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES";

DROP TABLE IF EXISTS holiday_dates;
CREATE TABLE holiday_dates (
  id INT UNSIGNED NOT NULL,
  date_id TINYINT UNSIGNED NOT NULL,
  date_value INT UNSIGNED NOT NULL,
  PRIMARY KEY (id, date_id)
);

INSERT INTO holiday_dates VALUES
(181, 6, 220692480 + (1 << 14)), -- rescheduled
(181, 7, 238338048 + (1 << 14)),
(181, 8, 254869504 + (1 << 14)),
(181, 9, 270958592 + (1 << 14)),
(181, 10, 288635520), -- 7.2 (PTR) dbc
(181, 11, 305166976),
(181, 12, 322271872),
(201, 9, 221723264),
(201, 10, 238484096),
(201, 11, 255244928),
{'fraction_non_alphanumeric': 0.11498669819686669, 'fraction_numerical': 0.1525273425953296, 'mean_word_length': 5.209174311926605, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 7, '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': '5820511', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1291, 'n_words': 400}