Fix ClassCastException when mssql inserting data (#10741) (#524)

This commit is contained in:
破晓长空 2023-05-05 17:05:59 +08:00 committed by GitHub
parent dc9f7d130d
commit e09809f318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Release Notes.
* Support clickhouse-jdbc-plugin trace sql parameters
* Support monitor jetty server work thread pool metric
* Support Jersey REST framework
* Fix ClassCastException when SQLServer inserts data
#### Documentation

View File

@ -26,6 +26,7 @@ import org.apache.skywalking.apm.plugin.jdbc.define.Constants;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.none;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_IGNORABLE_SETTERS;
import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_SETTERS;
@ -43,7 +44,7 @@ public class PSSetterDefinitionOfJDBCInstrumentation implements InstanceMethodsI
// remove TRACE_SQL_PARAMETERS judgement for dynamic config
final Set<String> setters = ignorable ? PS_IGNORABLE_SETTERS : PS_SETTERS;
for (String setter : setters) {
matcher = matcher.or(named(setter));
matcher = matcher.or(named(setter).and(isPublic()));
}
return matcher;