From b8ff304a1c5ce546046a1427e33cf4354ec70e81 Mon Sep 17 00:00:00 2001 From: isc-egabhart Date: Mon, 5 Dec 2022 16:52:22 -0500 Subject: [PATCH 1/2] Add Version checking for $system.SQL.Explain Versions of IRIS in some applications do not have the method $system.SQL.Explain and instead use $system.SQL.ShowPlan --- cls/pkg/isc/codetidy/CodeTidy.cls | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cls/pkg/isc/codetidy/CodeTidy.cls b/cls/pkg/isc/codetidy/CodeTidy.cls index 1851c6c..6c9691b 100644 --- a/cls/pkg/isc/codetidy/CodeTidy.cls +++ b/cls/pkg/isc/codetidy/CodeTidy.cls @@ -79,7 +79,7 @@ ClassMethod Class(pClassName As %String, pSaveChanges = 0) As %Status do triggerStream.WriteLine($piece(triggerDefinition.Code, $char(13, 10) , lineNumber) ) } // Process the stream - do ..ProcessStream(triggerStream, triggerDefinition.Language, sqlSchemaName, "Trigger:" _ ClassName _ ":" _ triggerDefinition.Name) + do ..ProcessStream(triggerStream, triggerDefinition.Language, sqlSchemaName, "Trigger:" _ pClassName _ ":" _ triggerDefinition.Name) // and copy from stream back to string do triggerStream.Rewind() set triggerString = "" @@ -920,7 +920,14 @@ ClassMethod GetSQLPlan(ByRef SQL As %String, Schema As %String, Output Plan As % set packages = "" if Schema '= "" set packages = packages _ $listbuild(Schema) if Schema '= "SQLUser" set packages = packages _ $listbuild("SQLUser") - do $system.SQL.Explain(.sql, {"quiet":1, "preparse":1, "selectmode":1}, , .%plan) + + // Version detection as $system.SQL.ShowPlan is now deprecated + if $$$comMemberDefined("%System.SQL", $$$cCLASSmethod, "Explain") { + do $system.SQL.Explain(.sql, {"quiet":1, "preparse":1, "selectmode":1}, , .%plan) + } + else { + do $system.SQL.ShowPlan(.sql, 1, 0, packages, , , , , 1) + } // Check for plan if $data(%plan(1)) { From e40372343ae35b2b97e8cfb050b2cbddf1c25b8a Mon Sep 17 00:00:00 2001 From: isc-tleavitt <73311181+isc-tleavitt@users.noreply.github.com> Date: Tue, 6 Dec 2022 11:36:42 -0500 Subject: [PATCH 2/2] Changelog + module.xml changes Prepping for release --- CHANGELOG.md | 16 +++------------- module.xml | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1df61..3ee33bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,30 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased - 1.1.x] +## [1.1.0] - 2022-12-06 ### Added - Automatic tweaks have been reintroduced (after being removed due to breaking issues) - Pulled in a variety of minor changes from internal development -### Changed -- - ### Fixed - Bracket matching for automatic tweaks now works - Configuration method doesn't prompt for an indentation string if automatic indentation is disabled - Unit tests described in module.xml - Added unit tests! - module.xml works with latest package manager version(s) and git-source-control - for some reason, Directory is needed. (This smells like a package manager bug, but the change is backward-compatible.) - -### Security -- - -### Removed -- - -### Deprecated -- +- Fixed `` error parsing triggers +- Fixed SQL plan options for earlier IRIS version without $System.SQL.Explain (#25) ## [1.0.3] - 2022-07-19 ### Fixed diff --git a/module.xml b/module.xml index f31b12f..25f61bc 100644 --- a/module.xml +++ b/module.xml @@ -2,7 +2,7 @@ isc.codetidy - 1.1.0+snapshot + 1.1.0 module