Description
I use spring-r2dbc and (latest 2.1.23) jasync-r2dbc-mysql for my project, and there are a few inner join queries.
But when I use databaseClient.sql("~").fetch().all()~
for joining tables which have column with the same names (ex> id, create_time, update_time) and retrieving the columns, I get unexpected results. The returned rows (maps) have mismatched column names and values!
The reason is that (jasync) getColumnMetadatas()
executed in ColumnMapRowMapper
in spring-r2dbc returns missing columns.
I debugged some codes, and figured out that this is because of implementation of JasyncMetadata
of like below.
private val metadata: Map<String, ColumnMetadata> = columnNames.map { it to JasyncColumnMetadata(it) }.toMap()
Also I checked the implementation of the r2dbc-spi interface RowMetadata
of the latest version of r2dbc-mariadb doesn't have this issue. It returned all columns regardless of the same names.
Actually, in jasync-r2dbc-mysql versions compatible with r2dbc-spi versions below 1 (which used getColumnNames()
), there was no issue like it.
If I'm right, can I try to fix this issue? However, if you think the context related with this issue is too difficult or complex for a new contributor, please tell me.