Skip to content

Commit

Permalink
Merge pull request #30553 from tsegismont/more_mysql_config
Browse files Browse the repository at this point in the history
Add MySQL/MariaDB pipelining-limit and use-affected-rows config properties
  • Loading branch information
geoand authored Jan 23, 2023
2 parents cd3bb03 + 42f003d commit ed47ae6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,18 @@ public class DataSourceReactiveMySQLConfig {
*/
@ConfigItem(defaultValueDocumentation = "default")
public Optional<MySQLAuthenticationPlugin> authenticationPlugin = Optional.empty();

/**
* The maximum number of inflight database commands that can be pipelined.
* By default, pipelining is disabled.
*/
@ConfigItem
public OptionalInt pipeliningLimit = OptionalInt.empty();

/**
* Whether to return the number of rows matched by the <em>WHERE</em> clause in <em>UPDATE</em> statements, instead of the
* number of rows actually changed.
*/
@ConfigItem(defaultValueDocumentation = "false")
public Optional<Boolean> useAffectedRows = Optional.empty();
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ private MySQLConnectOptions toMySQLConnectOptions(DataSourceRuntimeConfig dataSo
mysqlConnectOptions.setCollation(dataSourceReactiveMySQLConfig.collation.get());
}

if (dataSourceReactiveMySQLConfig.pipeliningLimit.isPresent()) {
mysqlConnectOptions.setPipeliningLimit(dataSourceReactiveMySQLConfig.pipeliningLimit.getAsInt());
}

if (dataSourceReactiveMySQLConfig.useAffectedRows.isPresent()) {
mysqlConnectOptions.setUseAffectedRows(dataSourceReactiveMySQLConfig.useAffectedRows.get());
}

if (dataSourceReactiveMySQLConfig.sslMode.isPresent()) {
final SslMode sslMode = dataSourceReactiveMySQLConfig.sslMode.get();
mysqlConnectOptions.setSslMode(sslMode);
Expand Down

0 comments on commit ed47ae6

Please sign in to comment.