Skip to content

Commit

Permalink
Adding workaround to an overflow error in CE SQL parser (#748)
Browse files Browse the repository at this point in the history
* Update antlr4 dependency of cesql

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* add an int overflow workaround to cesql parser

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
  • Loading branch information
devguyio committed Dec 27, 2021
1 parent 7772a06 commit 7601392
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Empty file added sql/v2/Makefile
Empty file.
5 changes: 5 additions & 0 deletions sql/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ To regenerate the parser, make sure you have [ANTLR4 installed](https://github.c
```shell
antlr4 -Dlanguage=Go -package gen -o gen -visitor -no-listener CESQLParser.g4
```

Then you need to run this sed command as a workaround until this ANTLR [issue](https://github.com/antlr/antlr4/issues/2433) is resolved. Without this, building for 32bit platforms will throw an int overflow error:
```shell
sed -i 's/(1<</(int64(1)<</g' gen/cesqlparser_parser.go
```
8 changes: 4 additions & 4 deletions sql/v2/gen/cesqlparser_parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sql/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/cloudevents/sdk-go/sql/v2
go 1.14

require (
github.com/antlr/antlr4 v0.0.0-20210105192202-5c2b686f95e1
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211221011931-643d94fcab96
github.com/cloudevents/sdk-go/v2 v2.5.0
github.com/stretchr/testify v1.5.1
sigs.k8s.io/yaml v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions sql/v2/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/antlr/antlr4 v0.0.0-20210105192202-5c2b686f95e1 h1:9K5yytxEEQc4yIn6c1rvQD6qQilQn9mYIF7pXKPT8i4=
github.com/antlr/antlr4 v0.0.0-20210105192202-5c2b686f95e1/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y=
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211221011931-643d94fcab96 h1:2P/dm3KbCLnRHQN/Ma50elhMx1Si9loEZe5hOrsuvuE=
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211221011931-643d94fcab96/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down

0 comments on commit 7601392

Please sign in to comment.