Skip to content

Mysql Worker panic when bind value is not provided for bind parameter #77

@stephanievu

Description

@stephanievu

What I Did
The code below does not provide bind value for 2nd bind parameter
String bitustr = "update JAVA2OCC_2 set helix_bit = ?, helix_char = ? where ID = 5";
PreparedStatement pstu2 = oc.prepareStatement(bitustr);
pstu2.setBoolean(1, true);
pstu2.execute();
oc.commit();

What I Expected
I would get error from hera server

What I Saw Instead
Worker panic with error in log
17:10:13.365878 debug: [WORKER 1 cmdprocessor.go:186] process command 86:25 update JAVA2OCC_2 set helix_bit = :helix_bit, helix_char = :helix_char where ID = 5,
17:10:13.365929 verbose: [WORKER 1 cmdprocessor.go:214] Preparing: update JAVA2OCC_2 set helix_bit = ?, helix_char = ? where ID = 5
17:10:13.384405 verbose: [WORKER 1 workerservice.go:199] worker_sp0 : worker read <<< 11:2 helix_bit,
17:10:13.384431 debug: [WORKER 1 cmdprocessor.go:186] process command 11:2 helix_bit,
17:10:13.384458 verbose: [WORKER 1 workerservice.go:199] worker_sp0 : worker read <<< 3:3 ^A,
17:10:13.384472 debug: [WORKER 1 cmdprocessor.go:186] process command 3:3 ^A,
17:10:13.384515 verbose: [WORKER 1 cmdprocessor.go:325] BindValue: :helix_bit : 0 : {^A true}
17:10:13.384536 verbose: [WORKER 1 workerservice.go:199] worker_sp0 : worker read <<< 1:4,
17:10:13.384549 debug: [WORKER 1 cmdprocessor.go:186] process command 1:4,
17:10:13.384570 debug: [WORKER 1 cmdprocessor.go:381] Executing true
17:10:13.384593 debug: [WORKER 1 cmdprocessor.go:382] BINDS [{^A true}]
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.(*mysqlAdapter).ProcessError(0x9c4e80, 0x69d280, 0xc42007a9f0, 0xc4200f6980, 0xc4200f6960)
/x/hudson/workspace/occmux_with_go_bin_build64/gomux/src/github.com/paypal/hera/worker/mysqlworker/adapter.go:181 +0x65f
github.com/paypal/hera/worker/shared.(*CmdProcessor).ProcessCmd(0xc4200f6840, 0xc420094280, 0xc42012e150, 0x3)
/x/hudson/workspace/occmux_with_go_bin_build64/gomux/src/github.com/paypal/hera/worker/shared/cmdprocessor.go:401 +0x1c0c
github.com/paypal/hera/worker/shared.runworker(0xc42000e080, 0xc4200f6840, 0xc420085da8)
/x/hudson/workspace/occmux_with_go_bin_build64/gomux/src/github.com/paypal/hera/worker/shared/workerservice.go:204 +0x6f6
github.com/paypal/hera/worker/shared.Start(0x69fa00, 0x9c4e80)
/x/hudson/workspace/occmux_with_go_bin_build64/gomux/src/github.com/paypal/hera/worker/shared/workerservice.go:130 +0x73b
main.main()
/x/hudson/workspace/occmux_with_go_bin_build64/gomux/src/github.com/paypal/hera/worker/mysqlworker/main.go:62 +0x61b
17:10:13.387799 warn: [PROXY workerclient.go:758] workerclient pid= 1421 read error: EOF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions