Skip to content

Commit

Permalink
patched oracle script parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Jul 15, 2019
1 parent 9812ee2 commit 830073f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## July 10 2019 - v0.10.1
* Patched oracel script parseing

## July 10 2019 - v0.10.0
* Added checkSchema

Expand Down
2 changes: 1 addition & 1 deletion script/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ outer:
pending += match.Matched
case plSQLBlock:
pending += string(match.Matched[:len(match.Matched)-1])
appendMatched("")
appendMatched(";")
case invalidToken:
break outer
case commandTerminator:
Expand Down
6 changes: 3 additions & 3 deletions script/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SELECT 2;`,
`SELECT 1`,
`BEGIN
SELECT 1;
END`,
END;`,
`SELECT 2`,
},
},
Expand Down Expand Up @@ -63,7 +63,7 @@ WHEN OTHERS THEN
IF SQLCODE != -942 THEN
RAISE;
END IF;
END`,
END;`,
`INSERT INTO DUMMY(ID, NAME) VALUES(1, 'abc')`,
`CREATE OR REPLACE TRIGGER users_before_insert
BEFORE INSERT ON users
Expand All @@ -72,7 +72,7 @@ BEGIN
SELECT users_seq.NEXTVAL
INTO :new.id
FROM dual;
END`,
END;`,
`INSERT INTO DUMMY(ID, NAME) VALUES(2, 'xyz')`,
},
},
Expand Down

0 comments on commit 830073f

Please sign in to comment.