From patchwork Sun Nov 24 23:50:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 180137 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2443382ilf; Sun, 24 Nov 2019 15:51:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxGxo3Meig1GC0Lo+JlOjJbCtCAuzGPVt02aapIfMVuSIyEJSAd6/xt2JO1lTbeGTToqGDK X-Received: by 2002:a17:902:8494:: with SMTP id c20mr26118672plo.123.1574639495840; Sun, 24 Nov 2019 15:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574639495; cv=none; d=google.com; s=arc-20160816; b=H5EWy1Ly44DwHaykvrUQZDo187r0473SIXIik5TCeQ4Zwm5YARzgrbPFt/Py4ONvp4 az7ikx0ejcjgvyYOITmuc71PBAkjeEQGsQc0uSEAP2rAYshJVK99Tr/jz9SBNVRMxYoX NtZUfjYmNjoHZLPa0GHIiDkq2Ek7mLvn2Bfdh7lsEM539p7v8dRaaK5KWSsHx0m9vbkg wTxCYcAeWJv4C7bErjs8S77tEpY1v6+QmvDJsUpUXOAC5AE1lcC0BnDCzUSfiM0u9Ac0 zQzpl9/AJJjhLvhZW6Bb/JDYq/Nm4jAN5dbopvbRQ69IcNevwD630GN98gVas/TcrrLF ITiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=R7hWQUFV4NHG2P8eB9afkYDZIsS/qbt98MuXkomFxlc=; b=ndLwl1SWD+nNlR06sjuS0+0F7uL2KJHpd61tQ+DhiK02rQTkL8bzZIGYxM1keFuBQ5 cYVhon5oGfiTM0Cs1MB/bjl4APN03mvK5WV9LRDb48pl+J3eLObFl5zcbC9c8JuAeZ5d JFkShlFIouzqy1ODYvOl54nPtSh00AhYdlIjkYLzZy3jiURmDnzjj6NSGwDUybYjCPj/ fDYw32p17Dg4O4QSFTpmchWAym5bu1Pha/NXmVcKzjgL2gBpfWiqqdN+wu8xhhI/USjn 20sQvNf5bb5xANRmL9CwCAHdQJhO/qsmnGRDje66eeHpG+14cZsOoQ6VI47ZtNlOgP+a zDqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="Y5ghSVe/"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id az2si5174383plb.120.2019.11.24.15.51.35; Sun, 24 Nov 2019 15:51:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="Y5ghSVe/"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 83A807FCC4; Sun, 24 Nov 2019 23:51:07 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mail.openembedded.org (Postfix) with ESMTP id 6A1757FC50 for ; Sun, 24 Nov 2019 23:50:48 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id cq11so5612172pjb.3 for ; Sun, 24 Nov 2019 15:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=Cg4ckRcTmWbznFYo1v+ip3JEdDP5iM/tv32hOxb5mXc=; b=Y5ghSVe/Eh+dbjaWzPMPl8PReaU97yq2WI3dUF5qOpaK02tvG/3MYbF9rhYAR9FNPq LibgDdFULmy4msChhFZEugaYetRtxrKAqYmfguM7kdOoVPEA3TT7mnh3InXS60rqRcw7 0CP9liRpMHJtVhe1epy81itWsEuyl46S9Kqz59sm5sJ/asDrotR/bL8oBQSnT1UK0lOa JbIifYAHG1NRBWNyhMBw2ywL5ia59msSBfsb7IWjYNSCB03NedjvAvBi64xPgdJeYvwe QzU6q2yhQrWeVrnebd3T/o8e/Gxu9zKTXwK4aYAJ+avsTS3poLr561PWPMrSgINHMM4C 2ueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Cg4ckRcTmWbznFYo1v+ip3JEdDP5iM/tv32hOxb5mXc=; b=Va5sA8UStPUaQ553O+Cy6hGF0it+MqFKdHcVW5sSPK641CAJIQ3KfZE8uYXIafjzLe DPuxTNiha3+YHunhiHmEG0hS3xHJZeLhaY+AM561St7rDKgF05dZP3/dHRpNvZ33KrIn 7sINjB6Rm/JFJyP6/F5I1ZkWUcxQOtAw4/L+d+eZyHWl/TYXHa4JjjnXffmrQLHcJAyH rbekayFZ14iiDJcysLV4HUvv38s1GV2nmV8ou8aAfV7cbOKqohkJB7B4gLQfhLI8g3Hf PZynv79rxNgpg6RpNTYZZupxSR+B0AvLrvSfa56S+3adIsLOO0rG8v+KOslqnsVsZN/o r8SA== X-Gm-Message-State: APjAAAUCHRSClOWgOCYLfZnKB+2nMSYg6ttXsMRpvm0/aI9AG2KzoUAP hBuhVeLANmriOwLqofildyXNNkF2 X-Received: by 2002:a17:902:bd03:: with SMTP id p3mr25075457pls.115.1574639449368; Sun, 24 Nov 2019 15:50:49 -0800 (PST) Received: from akuster-ThinkPad-T460s.hsd1.ca.comcast.net ([2601:202:4180:a5c0:69ac:e4d2:e89f:98da]) by smtp.gmail.com with ESMTPSA id q200sm5619783pfq.87.2019.11.24.15.50.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Nov 2019 15:50:48 -0800 (PST) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Sun, 24 Nov 2019 15:50:11 -0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [zeus 06/35] cve-update-db-native: add an index on the CVE ID column X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Ross Burton Create an index on the PRODUCTS table which contains a row for each CPE, drastically increasing the performance of lookups for a specific CVE. (From OE-Core rev: b4048b05b3a00d85c40d09961f846eadcebd812e) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Anuj Mittal --- meta/recipes-core/meta/cve-update-db-native.bb | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb index c15534d..08b18f0 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -120,11 +120,14 @@ python do_populate_cve_db() { def initialize_db(c): c.execute("CREATE TABLE IF NOT EXISTS META (YEAR INTEGER UNIQUE, DATE TEXT)") + c.execute("CREATE TABLE IF NOT EXISTS NVD (ID TEXT UNIQUE, SUMMARY TEXT, \ SCOREV2 TEXT, SCOREV3 TEXT, MODIFIED INTEGER, VECTOR TEXT)") + c.execute("CREATE TABLE IF NOT EXISTS PRODUCTS (ID TEXT, \ VENDOR TEXT, PRODUCT TEXT, VERSION_START TEXT, OPERATOR_START TEXT, \ VERSION_END TEXT, OPERATOR_END TEXT)") + c.execute("CREATE INDEX IF NOT EXISTS PRODUCT_ID_IDX on PRODUCTS(ID);") def parse_node_and_insert(c, node, cveId): # Parse children node if needed