[CONJ-934] MariaDbDataSource is sensitive to the order of setting of username and password Created: 2022-02-20 Updated: 2022-03-03 Resolved: 2022-03-03 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | configuration |
| Affects Version/s: | 3.0.3 |
| Fix Version/s: | 3.0.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Chris Selwyn | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Payara 5.2022.1 |
||
| Description |
|
If the password happens to be set first before the user then the connection will fail. The problem occurs in the config() method...
If the password is set before the user (i.e. user is null when config() is called) then the statement
overwrites the password with null (assuming that there is no password in the URL). In Payara/Glassfish the order of setting of the connection properties is governed by the code in com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject() which uses reflection to discover the driver's properties. The methods are invoked in the (arbitrary) order of discovery, so the order is not controllable by the user. |
| Comments |
| Comment by Diego Dupin [ 2022-03-03 ] |
|
corrected with commit https://github.com/mariadb-corporation/mariadb-connector-j/commit/abc89b6adbfe00e1ffe75de0e8ebd92cde2973b5 |