-
Notifications
You must be signed in to change notification settings - Fork 315
fix JDBC's SQLCommenter not taking into account semicolons #9915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
After adding the new always append comment feature in #9798, a customer found a bug that was present in our SQL Commenter since a long time. Basically, JDBC always split queries to send to the DB on the semicolon. If a comment is after a semicolon, JDBC will still split the queries, and return multiple ResultSet. This provoked exceptions like this one: ``` org.postgresql.util.PSQLException: Multiple ResultSets were returned by the query ``` SDBM-2100
|
🎯 Code Coverage 🔗 Commit SHA: b9bd6fb | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 12 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.049 s) : 0, 1049417
Total [baseline] (10.81 s) : 0, 10809537
Agent [candidate] (1.056 s) : 0, 1056239
Total [candidate] (10.885 s) : 0, 10885324
section appsec
Agent [baseline] (1.232 s) : 0, 1231657
Total [baseline] (10.945 s) : 0, 10945077
Agent [candidate] (1.224 s) : 0, 1224491
Total [candidate] (10.822 s) : 0, 10822158
section iast
Agent [baseline] (1.18 s) : 0, 1179513
Total [baseline] (11.134 s) : 0, 11133716
Agent [candidate] (1.178 s) : 0, 1177801
Total [candidate] (11.146 s) : 0, 11145519
section profiling
Agent [baseline] (1.192 s) : 0, 1191766
Total [baseline] (10.886 s) : 0, 10886138
Agent [candidate] (1.203 s) : 0, 1203008
Total [candidate] (10.961 s) : 0, 10960904
gantt
title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.458 ms) : 0, 1458
crashtracking [candidate] (1.468 ms) : 0, 1468
BytebuddyAgent [baseline] (706.138 ms) : 0, 706138
BytebuddyAgent [candidate] (711.007 ms) : 0, 711007
GlobalTracer [baseline] (246.23 ms) : 0, 246230
GlobalTracer [candidate] (247.905 ms) : 0, 247905
AppSec [baseline] (32.461 ms) : 0, 32461
AppSec [candidate] (32.747 ms) : 0, 32747
Debugger [baseline] (6.437 ms) : 0, 6437
Debugger [candidate] (6.469 ms) : 0, 6469
Remote Config [baseline] (714.24 µs) : 0, 714
Remote Config [candidate] (721.123 µs) : 0, 721
Telemetry [baseline] (14.596 ms) : 0, 14596
Telemetry [candidate] (12.414 ms) : 0, 12414
Flare Poller [baseline] (6.628 ms) : 0, 6628
Flare Poller [candidate] (8.679 ms) : 0, 8679
section appsec
crashtracking [baseline] (1.482 ms) : 0, 1482
crashtracking [candidate] (1.458 ms) : 0, 1458
BytebuddyAgent [baseline] (734.993 ms) : 0, 734993
BytebuddyAgent [candidate] (731.443 ms) : 0, 731443
GlobalTracer [baseline] (238.743 ms) : 0, 238743
GlobalTracer [candidate] (237.997 ms) : 0, 237997
AppSec [baseline] (176.6 ms) : 0, 176600
AppSec [candidate] (174.75 ms) : 0, 174750
Debugger [baseline] (6.123 ms) : 0, 6123
Debugger [candidate] (5.994 ms) : 0, 5994
Remote Config [baseline] (669.016 µs) : 0, 669
Remote Config [candidate] (652.394 µs) : 0, 652
Telemetry [baseline] (8.733 ms) : 0, 8733
Telemetry [candidate] (8.473 ms) : 0, 8473
Flare Poller [baseline] (4.108 ms) : 0, 4108
Flare Poller [candidate] (3.966 ms) : 0, 3966
IAST [baseline] (25.153 ms) : 0, 25153
IAST [candidate] (24.887 ms) : 0, 24887
section iast
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.455 ms) : 0, 1455
BytebuddyAgent [baseline] (827.769 ms) : 0, 827769
BytebuddyAgent [candidate] (826.957 ms) : 0, 826957
GlobalTracer [baseline] (234.836 ms) : 0, 234836
GlobalTracer [candidate] (234.241 ms) : 0, 234241
AppSec [baseline] (29.703 ms) : 0, 29703
AppSec [candidate] (27.704 ms) : 0, 27704
Debugger [baseline] (6.055 ms) : 0, 6055
Debugger [candidate] (5.996 ms) : 0, 5996
Remote Config [baseline] (605.179 µs) : 0, 605
Remote Config [candidate] (599.043 µs) : 0, 599
Telemetry [baseline] (8.455 ms) : 0, 8455
Telemetry [candidate] (8.444 ms) : 0, 8444
Flare Poller [baseline] (4.226 ms) : 0, 4226
Flare Poller [candidate] (4.182 ms) : 0, 4182
IAST [baseline] (31.515 ms) : 0, 31515
IAST [candidate] (33.534 ms) : 0, 33534
section profiling
crashtracking [baseline] (1.438 ms) : 0, 1438
crashtracking [candidate] (1.444 ms) : 0, 1444
BytebuddyAgent [baseline] (728.226 ms) : 0, 728226
BytebuddyAgent [candidate] (734.662 ms) : 0, 734662
GlobalTracer [baseline] (221.375 ms) : 0, 221375
GlobalTracer [candidate] (223.175 ms) : 0, 223175
AppSec [baseline] (32.163 ms) : 0, 32163
AppSec [candidate] (32.371 ms) : 0, 32371
Debugger [baseline] (6.726 ms) : 0, 6726
Debugger [candidate] (7.523 ms) : 0, 7523
Remote Config [baseline] (682.301 µs) : 0, 682
Remote Config [candidate] (1.427 ms) : 0, 1427
Telemetry [baseline] (16.32 ms) : 0, 16320
Telemetry [candidate] (14.734 ms) : 0, 14734
Flare Poller [baseline] (4.127 ms) : 0, 4127
Flare Poller [candidate] (4.206 ms) : 0, 4206
ProfilingAgent [baseline] (111.038 ms) : 0, 111038
ProfilingAgent [candidate] (113.109 ms) : 0, 113109
Profiling [baseline] (111.689 ms) : 0, 111689
Profiling [candidate] (113.78 ms) : 0, 113780
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055480
Total [baseline] (8.692 s) : 0, 8691998
Agent [candidate] (1.048 s) : 0, 1047740
Total [candidate] (8.635 s) : 0, 8635434
section iast
Agent [baseline] (1.178 s) : 0, 1178397
Total [baseline] (9.326 s) : 0, 9325667
Agent [candidate] (1.179 s) : 0, 1179076
Total [candidate] (9.269 s) : 0, 9269004
gantt
title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.483 ms) : 0, 1483
crashtracking [candidate] (1.446 ms) : 0, 1446
BytebuddyAgent [baseline] (710.507 ms) : 0, 710507
BytebuddyAgent [candidate] (704.641 ms) : 0, 704641
GlobalTracer [baseline] (247.186 ms) : 0, 247186
GlobalTracer [candidate] (245.981 ms) : 0, 245981
AppSec [baseline] (32.842 ms) : 0, 32842
AppSec [candidate] (32.585 ms) : 0, 32585
Debugger [baseline] (6.532 ms) : 0, 6532
Debugger [candidate] (6.414 ms) : 0, 6414
Remote Config [baseline] (715.068 µs) : 0, 715
Remote Config [candidate] (707.129 µs) : 0, 707
Telemetry [baseline] (12.462 ms) : 0, 12462
Telemetry [candidate] (14.093 ms) : 0, 14093
Flare Poller [baseline] (8.907 ms) : 0, 8907
Flare Poller [candidate] (7.273 ms) : 0, 7273
section iast
crashtracking [baseline] (1.461 ms) : 0, 1461
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (827.445 ms) : 0, 827445
BytebuddyAgent [candidate] (827.964 ms) : 0, 827964
GlobalTracer [baseline] (234.243 ms) : 0, 234243
GlobalTracer [candidate] (234.662 ms) : 0, 234662
AppSec [baseline] (26.845 ms) : 0, 26845
AppSec [candidate] (28.54 ms) : 0, 28540
Debugger [baseline] (5.988 ms) : 0, 5988
Debugger [candidate] (5.975 ms) : 0, 5975
Remote Config [baseline] (598.982 µs) : 0, 599
Remote Config [candidate] (601.226 µs) : 0, 601
Telemetry [baseline] (8.371 ms) : 0, 8371
Telemetry [candidate] (8.408 ms) : 0, 8408
Flare Poller [baseline] (4.138 ms) : 0, 4138
Flare Poller [candidate] (4.1 ms) : 0, 4100
IAST [baseline] (34.684 ms) : 0, 34684
IAST [candidate] (32.636 ms) : 0, 32636
LoadParameters
See matching parameters
SummaryFound 4 performance improvements and 1 performance regressions! Performance is the same for 7 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section baseline
no_agent (1.291 ms) : 1279, 1304
. : milestone, 1291,
iast (3.218 ms) : 3174, 3262
. : milestone, 3218,
iast_FULL (5.7 ms) : 5644, 5756
. : milestone, 5700,
iast_GLOBAL (3.549 ms) : 3492, 3605
. : milestone, 3549,
profiling (2.077 ms) : 2059, 2095
. : milestone, 2077,
tracing (1.811 ms) : 1796, 1826
. : milestone, 1811,
section candidate
no_agent (1.285 ms) : 1271, 1298
. : milestone, 1285,
iast (3.324 ms) : 3284, 3364
. : milestone, 3324,
iast_FULL (5.814 ms) : 5755, 5874
. : milestone, 5814,
iast_GLOBAL (3.759 ms) : 3699, 3818
. : milestone, 3759,
profiling (1.994 ms) : 1976, 2011
. : milestone, 1994,
tracing (1.786 ms) : 1771, 1800
. : milestone, 1786,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section baseline
no_agent (17.951 ms) : 17763, 18138
. : milestone, 17951,
appsec (19.314 ms) : 19112, 19517
. : milestone, 19314,
code_origins (17.68 ms) : 17502, 17857
. : milestone, 17680,
iast (17.637 ms) : 17462, 17811
. : milestone, 17637,
profiling (18.593 ms) : 18408, 18777
. : milestone, 18593,
tracing (18.724 ms) : 18537, 18910
. : milestone, 18724,
section candidate
no_agent (17.326 ms) : 17152, 17500
. : milestone, 17326,
appsec (18.514 ms) : 18326, 18702
. : milestone, 18514,
code_origins (18.081 ms) : 17900, 18262
. : milestone, 18081,
iast (17.702 ms) : 17526, 17877
. : milestone, 17702,
profiling (18.416 ms) : 18230, 18601
. : milestone, 18416,
tracing (17.727 ms) : 17548, 17907
. : milestone, 17727,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section baseline
no_agent (15.467 s) : 15467000, 15467000
. : milestone, 15467000,
appsec (15.212 s) : 15212000, 15212000
. : milestone, 15212000,
iast (18.66 s) : 18660000, 18660000
. : milestone, 18660000,
iast_GLOBAL (17.772 s) : 17772000, 17772000
. : milestone, 17772000,
profiling (15.634 s) : 15634000, 15634000
. : milestone, 15634000,
tracing (14.533 s) : 14533000, 14533000
. : milestone, 14533000,
section candidate
no_agent (15.5 s) : 15500000, 15500000
. : milestone, 15500000,
appsec (15.351 s) : 15351000, 15351000
. : milestone, 15351000,
iast (18.554 s) : 18554000, 18554000
. : milestone, 18554000,
iast_GLOBAL (18.209 s) : 18209000, 18209000
. : milestone, 18209000,
profiling (15.55 s) : 15550000, 15550000
. : milestone, 15550000,
tracing (14.922 s) : 14922000, 14922000
. : milestone, 14922000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~b9bd6fb8ef, baseline=1.56.0-SNAPSHOT~434b694acb
dateFormat X
axisFormat %s
section baseline
no_agent (1.484 ms) : 1472, 1496
. : milestone, 1484,
appsec (2.521 ms) : 2467, 2575
. : milestone, 2521,
iast (2.216 ms) : 2152, 2280
. : milestone, 2216,
iast_GLOBAL (2.264 ms) : 2200, 2328
. : milestone, 2264,
profiling (2.09 ms) : 2037, 2143
. : milestone, 2090,
tracing (2.045 ms) : 1996, 2095
. : milestone, 2045,
section candidate
no_agent (1.489 ms) : 1477, 1500
. : milestone, 1489,
appsec (3.736 ms) : 3518, 3955
. : milestone, 3736,
iast (2.232 ms) : 2167, 2297
. : milestone, 2232,
iast_GLOBAL (2.252 ms) : 2188, 2316
. : milestone, 2252,
profiling (2.088 ms) : 2035, 2141
. : milestone, 2088,
tracing (2.053 ms) : 2003, 2103
. : milestone, 2053,
|
Motivation
After adding the new always append comment feature in #9798, a customer found a bug that was present in our SQL Commenter since a long time. Basically, JDBC always split queries to send to the DB on the semicolon. If a comment is after a semicolon, JDBC will still split the queries, and return multiple ResultSet. This provoked exceptions like this one:
What Does This Do
The SQL Commenter now correctly handles queries that ends with a semicolon. Instead of injecting the comment at the end, it will inject the comment before the semicolon.
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: SDBM-2100