[MDEV-15031] Parameter metadata Created: 2018-01-22 Updated: 2024-01-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Binary Protocol |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Diego Dupin | Assignee: | Diego Dupin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
COM_STMT_PREPARE protocol send parameter metadata : JDBC API permits access to that information (Implementation is done), but the server doesn't fill any useful data. JDBC API: https://docs.oracle.com/javase/9/docs/api/java/sql/ParameterMetaData.html
Example : |
| Comments |
| Comment by Pali [ 2018-06-04 ] | |||
|
Perl's DBI interface also provides way to tell types, see: https://metacpan.org/pod/DBI#ParamTypes | |||
| Comment by Pali [ 2019-06-18 ] | |||
|
Is implementation for metadata parameters planned? | |||
| Comment by Sergei Golubchik [ 2019-08-26 ] | |||
|
Not yet, as far as I know | |||
| Comment by Pali [ 2023-12-25 ] | |||
|
Was something changes in this area about metadata parameters after years? | |||
| Comment by Sergei Golubchik [ 2023-12-25 ] | |||
|
I'm not quite sure what metadata the server should return. Even in the "simple" case like in the description,
a parameter can basically be anything.
is a valid query and will be executed just fine.
what is the expected metadata here? | |||
| Comment by Pali [ 2023-12-25 ] | |||
|
In my opinion the metadata should be for the type when no implicit casting is needed. So for:
I'm expecting that it returns metadata for columns username and age. But your section example is really ambiguous.
For the first placeholder I would expect metadata of column a, but second is ambiguous as it can be anything nullable. diego dupin Do you have any idea? I guess that this JDBC API is already implemented by more databases and so I would expect that this question was already answered / solved, and it would be a good idea to follow what JDBC expects. |