Skip to content

Commit

Permalink
Suppress linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Apr 25, 2024
1 parent f7374a6 commit 8a8aa7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/extensionAPI/exaMetadata/ExaMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (r *metaDataReaderImpl) ReadMetadataTables(tx *sql.Tx, schemaName string) (

/* [impl -> dsn~extension-context-metadata~1]. */
func (r *metaDataReaderImpl) GetScriptByName(tx *sql.Tx, schemaName, scriptName string) (*ExaScriptRow, error) {
// #nosec G201 Using schema as query parameter is not possible
query := fmt.Sprintf(`
SELECT SCRIPT_SCHEMA, SCRIPT_NAME, SCRIPT_TYPE, SCRIPT_INPUT_TYPE, SCRIPT_RESULT_TYPE, SCRIPT_TEXT, SCRIPT_COMMENT
FROM %s.EXA_ALL_SCRIPTS
Expand All @@ -72,6 +73,7 @@ WHERE SCRIPT_SCHEMA=? AND SCRIPT_NAME=?`, r.metaDataSchema)
}

func (r *metaDataReaderImpl) readExaAllScriptTable(tx *sql.Tx, schemaName string) (*ExaScriptTable, error) {
// #nosec G201 Using schema as query parameter is not possible
query := fmt.Sprintf(`
SELECT SCRIPT_SCHEMA, SCRIPT_NAME, SCRIPT_TYPE, SCRIPT_INPUT_TYPE, SCRIPT_RESULT_TYPE, SCRIPT_TEXT, SCRIPT_COMMENT
FROM %s.EXA_ALL_SCRIPTS
Expand Down Expand Up @@ -120,6 +122,7 @@ func readScriptRow(result *sql.Rows) (*ExaScriptRow, error) {
}

func (r *metaDataReaderImpl) readExaAllVirtualSchemasTable(tx *sql.Tx) (*ExaVirtualSchemasTable, error) {
// #nosec G201 Using schema as query parameter is not possible
query := fmt.Sprintf(`
SELECT SCHEMA_NAME, SCHEMA_OWNER, ADAPTER_SCRIPT_SCHEMA, ADAPTER_SCRIPT_NAME, ADAPTER_NOTES
FROM %s.EXA_ALL_VIRTUAL_SCHEMAS`, r.metaDataSchema)
Expand Down
2 changes: 2 additions & 0 deletions pkg/integrationTesting/scriptFixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func CreateVirtualSchemaFixtureNullValues(db *sql.DB) ScriptFixture {
execSQL(db, "CREATE SCHEMA TEST_META_DATA")
createMetaDataTable(db, "EXA_ALL_VIRTUAL_SCHEMAS")
createMetaDataTable(db, "EXA_ALL_SCRIPTS")
// nolint:dupword // Duplicating the word "NULL" is required here
execSQL(db, `INSERT INTO TEST_META_DATA.EXA_ALL_VIRTUAL_SCHEMAS VALUES (NULL, NULL, NULL, 'TEST', NULL, NULL, NULL, NULL)`)
return ScriptFixture{db: db}
}
Expand All @@ -62,6 +63,7 @@ func CreateScriptFixtureNullValues(db *sql.DB) ScriptFixture {
execSQL(db, "CREATE SCHEMA TEST_META_DATA")
createMetaDataTable(db, "EXA_ALL_VIRTUAL_SCHEMAS")
createMetaDataTable(db, "EXA_ALL_SCRIPTS")
// nolint:dupword // Duplicating the word "NULL" is required here
execSQL(db, `INSERT INTO TEST_META_DATA.EXA_ALL_SCRIPTS VALUES ('TEST', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)`)
return ScriptFixture{db: db}
}
Expand Down

0 comments on commit 8a8aa7b

Please sign in to comment.