I get the following error mesages when I try to create tables:
Error
SQL query: Copy
CREATE TABLE FILE (
sha256 VARCHAR NOT NULL,
sha1 VARCHAR NOT NULL,
md5 VARCHAR NOT NULL,
crc32 VARCHAR NOT NULL,
file_name VARCHAR NOT NULL,
file_size INTEGER NOT NULL,
package_id INTEGER NOT NULL,
CONSTRAINT PK_FILE__FILE PRIMARY KEY (sha256, sha1, md5, crc32, file_name, file_size, package_id)
);
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL,
sha1 VARCHAR NOT NULL,
md5 VARCHAR NOT NULL,
crc...' at line 2
Using this .sql file from the NSRL:
```
CREATE TABLE FILE (
sha256 VARCHAR NOT NULL,
sha1 VARCHAR NOT NULL,
md5 VARCHAR NOT NULL,
crc32 VARCHAR NOT NULL,
file_name VARCHAR NOT NULL,
file_size INTEGER NOT NULL,
package_id INTEGER NOT NULL,
CONSTRAINT PK_FILE__FILE PRIMARY KEY (sha256, sha1, md5, crc32, file_name, file_size, package_id)
);
CREATE TABLE MFG (
manufacturer_id INTEGER NOT NULL,
name VARCHAR NOT NULL,
CONSTRAINT PK_MFG__MFG_ID PRIMARY KEY (manufacturer_id)
);
CREATE TABLE OS (
operating_system_id INTEGER NOT NULL,
name VARCHAR NOT NULL,
version VARCHAR NOT NULL,
manufacturer_id INTEGER NOT NULL,
CONSTRAINT PK_OS__OS_ID PRIMARY KEY (operating_system_id, manufacturer_id)
);
CREATE TABLE PKG (
package_id INTEGER NOT NULL,
name VARCHAR NOT NULL,
version VARCHAR NOT NULL,
operating_system_id INTEGER NOT NULL,
manufacturer_id INTEGER NOT NULL,
language VARCHAR NOT NULL,
application_type VARCHAR NOT NULL,
CONSTRAINT PK_PGK__PKG_ID PRIMARY KEY (package_id, operating_system_id, manufacturer_id, language, application_type)
);
CREATE TABLE VERSION (
version VARCHAR UNIQUE NOT NULL,
build_set VARCHAR NOT NULL,
build_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
release_date TIMESTAMP NOT NULL,
description VARCHAR NOT NULL,
CONSTRAINT PK_VERSION__VERSION PRIMARY KEY (version)
);
CREATE VIEW DISTINCT_HASH AS
SELECT DISTINCT
sha256,
sha1,
md5,
crc32
FROM
FILE
/* DISTINCT_HASH(sha256,sha1,md5,crc32) */;
```
{"report":{"fcp":1364.7999992370605,"ttfb":457.19999980926514,"pageVisibility":"visible","entityId":127293,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"dd29c3c5-de45-4075-a150-127b64b77a34","navigationType":0,"readyForUser":1452.7999992370605,"redirectCount":0,"resourceLoadedEnd":1183.5,"resourceLoadedStart":465.29999923706055,"resourceTiming":[{"duration":124.90000057220459,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":465.29999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":465.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":590.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":132.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":465.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":465.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":597.7999992370605,"responseStart":0,"secureConnectionStart":0},{"duration":427.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":465.79999923706055,"connectEnd":465.79999923706055,"connectStart":465.79999923706055,"domainLookupEnd":465.79999923706055,"domainLookupStart":465.79999923706055,"fetchStart":465.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":614.2999992370605,"responseEnd":893.3999996185303,"responseStart":632.2999992370605,"secureConnectionStart":465.79999923706055},{"duration":576.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":465.8999996185303,"connectEnd":465.8999996185303,"connectStart":465.8999996185303,"domainLookupEnd":465.8999996185303,"domainLookupStart":465.8999996185303,"fetchStart":465.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":617.1999998092651,"responseEnd":1042.1999998092651,"responseStart":636.3999996185303,"secureConnectionStart":465.8999996185303},{"duration":171.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":466.19999980926514,"connectEnd":466.19999980926514,"connectStart":466.19999980926514,"domainLookupEnd":466.19999980926514,"domainLookupStart":466.19999980926514,"fetchStart":466.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":617.5,"responseEnd":637.2999992370605,"responseStart":635.0999994277954,"secureConnectionStart":466.19999980926514},{"duration":171.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":466.3999996185303,"connectEnd":466.3999996185303,"connectStart":466.3999996185303,"domainLookupEnd":466.3999996185303,"domainLookupStart":466.3999996185303,"fetchStart":466.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":618.1999998092651,"responseEnd":637.5999994277954,"responseStart":635.7999992370605,"secureConnectionStart":466.3999996185303},{"duration":173.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":466.5999994277954,"connectEnd":466.5999994277954,"connectStart":466.5999994277954,"domainLookupEnd":466.5999994277954,"domainLookupStart":466.5999994277954,"fetchStart":466.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":618.7999992370605,"responseEnd":640.2999992370605,"responseStart":638.5999994277954,"secureConnectionStart":466.5999994277954},{"duration":149.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":466.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":466.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":616.5,"responseStart":0,"secureConnectionStart":0},{"duration":216.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":467,"connectEnd":467,"connectStart":467,"domainLookupEnd":467,"domainLookupStart":467,"fetchStart":467,"redirectEnd":0,"redirectStart":0,"requestStart":631,"responseEnd":683.5999994277954,"responseStart":679.0999994277954,"secureConnectionStart":467},{"duration":149.39999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":467.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":467.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":616.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":187.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":467.3999996185303,"connectEnd":467.3999996185303,"connectStart":467.3999996185303,"domainLookupEnd":467.3999996185303,"domainLookupStart":467.3999996185303,"fetchStart":467.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":631.3999996185303,"responseEnd":654.6999998092651,"responseStart":648.5999994277954,"secureConnectionStart":467.3999996185303},{"duration":711,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":471.5,"connectEnd":471.5,"connectStart":471.5,"domainLookupEnd":471.5,"domainLookupStart":471.5,"fetchStart":471.5,"redirectEnd":0,"redirectStart":0,"requestStart":1170.6999998092651,"responseEnd":1182.5,"responseStart":1181.5999994277954,"secureConnectionStart":471.5},{"duration":711.9000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":471.5999994277954,"connectEnd":471.5999994277954,"connectStart":471.5999994277954,"domainLookupEnd":471.5999994277954,"domainLookupStart":471.5999994277954,"fetchStart":471.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":1170.8999996185303,"responseEnd":1183.5,"responseStart":1182.6999998092651,"secureConnectionStart":471.5999994277954},{"duration":219,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1026.2999992370605,"connectEnd":1026.2999992370605,"connectStart":1026.2999992370605,"domainLookupEnd":1026.2999992370605,"domainLookupStart":1026.2999992370605,"fetchStart":1026.2999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":1212.3999996185303,"responseEnd":1245.2999992370605,"responseStart":1244.2999992370605,"secureConnectionStart":1026.2999992370605}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":292,"responseStart":457,"responseEnd":468,"domLoading":460,"domInteractive":1507,"domContentLoadedEventStart":1507,"domContentLoadedEventEnd":1550,"domComplete":2608,"loadEventStart":2608,"loadEventEnd":2609,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1488.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1489.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.start","time":1490},{"name":"bigPipe.activity-panel-pipe-id.end","time":1490.8999996185303},{"name":"activityTabFullyLoaded","time":1567.8999996185303}],"measures":[],"correlationId":"5f94ee2a976f84","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":93,"dbReadsTimeInMs":12,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
One should specify the maximum length of the string when using VARCHAR type - https://mariadb.com/kb/en/varchar/