<commit_before>#pragma once
#include <vector>
#include <hash_set>
#include <list>

#include "Common.h"
#include "IDAController.h"
#include "DataStructure.h"
#include "LogOperation.h"

const enum {DiffMachineFileSQLiteFormat};

#define MATCH_MAP_TABLE "MatchMap"
#define CREATE_MATCH_MAP_TABLE_STATEMENT "CREATE TABLE " MATCH_MAP_TABLE" ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
			TheSourceFileID INTEGER, \n\
			TheTargetFileID INTEGER, \n\
			TheSourceAddress INTEGER, \n\
			TheTargetAddress INTEGER, \n\
			MatchType INTEGER, \n\
			Type INTEGER, \n\
			SubType INTEGER, \n\
			Status INTEGER, \n\
			MatchRate INTEGER, \n\
			UnpatchedParentAddress INTEGER, \n\
			PatchedParentAddress INTEGER\n\
		 );"

#define INSERT_MATCH_MAP_TABLE_STATEMENT "INSERT INTO  "MATCH_MAP_TABLE" ( TheSourceFileID, TheTargetFileID, TheSourceAddress, TheTargetAddress, MatchType, Type, SubType, Status, MatchRate, UnpatchedParentAddress, PatchedParentAddress ) values ( '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u' );"
#define DELETE_MATCH_MAP_TABLE_STATEMENT "DELETE FROM "MATCH_MAP_TABLE" WHERE TheSourceFileID=%u and TheTargetFileID=%u"
#define CREATE_MATCH_MAP_TABLE_SOURCE_ADDRESS_INDEX_STATEMENT "CREATE INDEX "MATCH_MAP_TABLE"TheSourceAddressIndex ON "MATCH_MAP_TABLE" ( TheSourceAddress )"
#define CREATE_MATCH_MAP_TABLE_TARGET_ADDRESS_INDEX_STATEMENT "CREATE INDEX "MATCH_MAP_TABLE"TheTargetAddressIndex ON "MATCH_MAP_TABLE" ( TheTargetAddress )"

#define FILE_LIST_TABLE "FileList"
#define CREATE_FILE_LIST_TABLE_STATEMENT "CREATE TABLE " FILE_LIST_TABLE " ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
			Type VARCHAR(25), \n\
			Filename VARCHAR(255), \n\
			FileID INTEGER, \n\
			FunctionAddress INTEGER\n\
		 );"

#define INSERT_FILE_LIST_TABLE_STATEMENT "INSERT INTO  "FILE_LIST_TABLE" ( Type, Filename, FileID, FunctionAddress ) values ( '%s', '%s', '%d', '%d' );"

#define UNIDENTIFIED_BLOCKS_TABLE "UnidentifiedBlocks"
#define CREATE_UNIDENTIFIED_BLOCKS_TABLE_STATEMENT "CREATE TABLE "UNIDENTIFIED_BLOCKS_TABLE" ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
			OldFileID INTEGER, \n\
			NewFileID INTEGER, \n\
			Type INTEGER, \n\
			Address INTEGER\n\
		 );"
#define INSERT_UNIDENTIFIED_BLOCKS_TABLE_STATEMENT "INSERT INTO  "UNIDENTIFIED_BLOCKS_TABLE" ( Type, Address ) values ( '%u', '%u' );"

#define FUNCTION_MATCH_INFO_TABLE "FunctionMatchInfo"
#define CREATE_FUNCTION_MATCH_INFO_TABLE_STATEMENT "CREATE TABLE " FUNCTION_MATCH_INFO_TABLE" ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\<commit_msg>FileList table schema change - removed FunctionAddress field<commit_after>#pragma once
#include <vector>
#include <hash_set>
#include <list>

#include "Common.h"
#include "IDAController.h"
#include "DataStructure.h"
#include "LogOperation.h"

const enum {DiffMachineFileSQLiteFormat};

#define MATCH_MAP_TABLE "MatchMap"
#define CREATE_MATCH_MAP_TABLE_STATEMENT "CREATE TABLE " MATCH_MAP_TABLE" ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
			TheSourceFileID INTEGER, \n\
			TheTargetFileID INTEGER, \n\
			TheSourceAddress INTEGER, \n\
			TheTargetAddress INTEGER, \n\
			MatchType INTEGER, \n\
			Type INTEGER, \n\
			SubType INTEGER, \n\
			Status INTEGER, \n\
			MatchRate INTEGER, \n\
			UnpatchedParentAddress INTEGER, \n\
			PatchedParentAddress INTEGER\n\
		 );"

#define INSERT_MATCH_MAP_TABLE_STATEMENT "INSERT INTO  "MATCH_MAP_TABLE" ( TheSourceFileID, TheTargetFileID, TheSourceAddress, TheTargetAddress, MatchType, Type, SubType, Status, MatchRate, UnpatchedParentAddress, PatchedParentAddress ) values ( '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u' );"
#define DELETE_MATCH_MAP_TABLE_STATEMENT "DELETE FROM "MATCH_MAP_TABLE" WHERE TheSourceFileID=%u and TheTargetFileID=%u"
#define CREATE_MATCH_MAP_TABLE_SOURCE_ADDRESS_INDEX_STATEMENT "CREATE INDEX "MATCH_MAP_TABLE"TheSourceAddressIndex ON "MATCH_MAP_TABLE" ( TheSourceAddress )"
#define CREATE_MATCH_MAP_TABLE_TARGET_ADDRESS_INDEX_STATEMENT "CREATE INDEX "MATCH_MAP_TABLE"TheTargetAddressIndex ON "MATCH_MAP_TABLE" ( TheTargetAddress )"

#define FILE_LIST_TABLE "FileList"
#define CREATE_FILE_LIST_TABLE_STATEMENT "CREATE TABLE " FILE_LIST_TABLE " ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
			Type VARCHAR(25), \n\
			Filename VARCHAR(255), \n\
			FileID INTEGER \n\
		 );"

#define INSERT_FILE_LIST_TABLE_STATEMENT "INSERT INTO  "FILE_LIST_TABLE" ( Type, Filename, FileID, FunctionAddress ) values ( '%s', '%s', '%d', '%d' );"

#define UNIDENTIFIED_BLOCKS_TABLE "UnidentifiedBlocks"
#define CREATE_UNIDENTIFIED_BLOCKS_TABLE_STATEMENT "CREATE TABLE "UNIDENTIFIED_BLOCKS_TABLE" ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
			OldFileID INTEGER, \n\
			NewFileID INTEGER, \n\
			Type INTEGER, \n\
			Address INTEGER\n\
		 );"
#define INSERT_UNIDENTIFIED_BLOCKS_TABLE_STATEMENT "INSERT INTO  "UNIDENTIFIED_BLOCKS_TABLE" ( Type, Address ) values ( '%u', '%u' );"

#define FUNCTION_MATCH_INFO_TABLE "FunctionMatchInfo"
#define CREATE_FUNCTION_MATCH_INFO_TABLE_STATEMENT "CREATE TABLE " FUNCTION_MATCH_INFO_TABLE" ( \n\
			id INTEGER PRIMARY KEY AUTOINCREMENT, \n\
{'fraction_non_alphanumeric': 0.11180609851446442, 'fraction_numerical': 0.001954652071931196, 'mean_word_length': 5.662760416666667, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1977522', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1721, 'n_words': 423}