[CONJ-1069] DatabaseMetaData#getProcedureColumns reports incorrect data after executing a stored procedure Created: 2023-04-11 Updated: 2023-06-07 Resolved: 2023-06-07 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | stored procedure |
| Affects Version/s: | 2.7.2, 3.1.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Julian Bui | Assignee: | Diego Dupin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
mac, mariadb server 10.6.9, java 8, used dbeaver to create/replace the stored procedures |
||
| Issue Links: |
|
||||||||
| Description |
|
Noteworthy:
REPRO: 1) Create a stored procedure with two parameters:
2. In the java code (found down below) replace the jdbcUrl, userName, password, and spName (e.g., value = test) variables and then run the application. The application will execute the stored procedure then call getProcedureColumns in a loop forever. Observe that it reports the correct number of stored procedure parameters parameters/columns (in this case, 2). 3. Remove one of the parameters of the stored procedure and then replace the procedure of step 1.
4. ----------- Repro java application of step 2:
|
| Comments |
| Comment by Diego Dupin [ 2023-04-17 ] |
|
mysql connector implementation completly differ from mariadb connector : mysql try to use mysql.proc first, and if not working (mysql 8 has removed that table) use SHOW PROCEDURE STATUS to find procedures, then runs SHOW CREATE PROCEDURE command to get procedure code and extract parameters. mariadb use directly INFORMATION_SCHEMA.parameters that is way faster. Problem (reproduced) is that if a connection has called a procedure and that procedure is changed by another connections, then metadata is then wrong. |
| Comment by Diego Dupin [ 2023-06-07 ] |
|
closing since this will not be corrected connector side but server side with https://jira.mariadb.org/browse/MDEV-31064 |