Skip to content

Commit

Permalink
Merge pull request #7952 from AdamKorcz/fuzz10
Browse files Browse the repository at this point in the history
Planbuilder: Fix fuzzer
  • Loading branch information
systay authored May 4, 2021
2 parents 017c412 + 4a70d3d commit e030ea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions go/test/fuzzing/oss_fuzz_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ compile_go_fuzzer ./go/test/fuzzing FuzzParser parser_fuzzer
compile_go_fuzzer ./go/mysql FuzzWritePacket write_packet_fuzzer
compile_go_fuzzer ./go/mysql FuzzHandleNextCommand handle_next_command_fuzzer
compile_go_fuzzer ./go/mysql FuzzReadQueryResults read_query_results_fuzzer


compile_go_fuzzer ./go/mysql FuzzTLSServer fuzz_tls
compile_go_fuzzer ./go/vt/vtgate/grpcvtgateconn Fuzz grpc_vtgate_fuzzer
compile_go_fuzzer ./go/vt/vtgate/planbuilder FuzzAnalyse planbuilder_fuzzer

mv ./go/vt/vtgate/engine/fake_vcursor_test.go \
./go/vt/vtgate/engine/fake_vcursor.go
Expand Down
7 changes: 6 additions & 1 deletion go/vt/vtgate/planbuilder/fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func FuzzAnalyse(data []byte) int {
if err != nil {
return 0
}
_, _ = createQGFromSelect(tree.(*sqlparser.Select), semTable)
switch stmt := tree.(type) {
case *sqlparser.Select:
_, _ = createQGFromSelect(stmt, semTable)
default:
return 0
}
return 1
}

0 comments on commit e030ea5

Please sign in to comment.