Commit e125ff7
authored
Prevent crash in SQL Server's JDBC when tracing execute methods with generated keys (#9321)
* Prevent crash in SQL Server JDBC when tracing execute methods with generated keys
When tracing the JDBC statement execute methods, we prepend a comment to
the SQL query used for DBM trace propagation.
However, there is a bug in the SQL Server JDBC driver that prevents the
generated keys from being returned when the SQL comment is prepended to
the SQL query.
I decided to only append the comment in this specific case to avoid the
comment from being truncated.
@see microsoft/mssql-jdbc#2729
* remove dynamic typing when packing all the JDBC arguments
* move JDBC test on injection with generated keys to SQL Server file
* remove useless constant in StatementAdvice1 parent db0df01 commit e125ff7
File tree
2 files changed
+32
-3
lines changed- dd-java-agent/instrumentation/jdbc/src
- main/java/datadog/trace/instrumentation/jdbc
- test/groovy
2 files changed
+32
-3
lines changedLines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
| |||
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
130 | 144 | | |
131 | 145 | | |
132 | 146 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
39 | 54 | | |
0 commit comments