Skip to content

Commit

Permalink
Merge pull request #648 from telefonicaid/fix/preseelct
Browse files Browse the repository at this point in the history
fix keep preselect if not insert (hotfix: master)
  • Loading branch information
fgalan authored Mar 16, 2022
2 parents ef4174c + c36b2f0 commit 4088e86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix: preselect in ruleWithContext (#630)
22 changes: 18 additions & 4 deletions lib/myutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,15 @@ function ruleWithContext(rule) {
const ruleText = removeCRLFchars(rule.text);
// PreContext
const preSelectMatch = ruleText.match(/.+?(?=\bselect )/i);
const preInsertMatch = preSelectMatch ? preSelectMatch[0].match(/.+?(?=\insert )/i) : null;
const insertionPreContext = preInsertMatch ? preInsertMatch[0] : '';
var preInsertMatch;
var insertionPreContext;
if (preSelectMatch) {
preInsertMatch = preSelectMatch[0].match(/.+?(?=\insert )/i);
insertionPreContext = preInsertMatch ? preInsertMatch[0] : preSelectMatch[0];
} else {
preInsertMatch = null;
insertionPreContext = '';
}
// PostContext
const InsertMatch = ruleText.match(/\binsert .*/i);
var insertionPostContext;
Expand All @@ -341,8 +348,15 @@ function ruleWithContextTimedRule(rule) {
const ruleText = removeCRLFchars(rule.text);
// PreContext
const preSelectMatch = ruleText.match(/.+?(?=\bselect )/i);
const preInsertMatch = preSelectMatch ? preSelectMatch[0].match(/.+?(?=\insert )/i) : null;
const insertionPreContext = preInsertMatch ? preInsertMatch[0] : '';
var preInsertMatch;
var insertionPreContext;
if (preSelectMatch) {
preInsertMatch = preSelectMatch[0].match(/.+?(?=\insert )/i);
insertionPreContext = preInsertMatch ? preInsertMatch[0] : preSelectMatch[0];
} else {
preInsertMatch = null;
insertionPreContext = '';
}
// PostContext
const InsertMatch = ruleText.match(/\binsert .*/i);
var insertionPostContext;
Expand Down

0 comments on commit 4088e86

Please sign in to comment.