Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function column out doesn't resolve to SqlOutParameter #31550

Closed
hladysz opened this issue Nov 3, 2023 · 4 comments
Closed

Function column out doesn't resolve to SqlOutParameter #31550

hladysz opened this issue Nov 3, 2023 · 4 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@hladysz
Copy link

hladysz commented Nov 3, 2023

Affects: <Spring Framework version> All

Only procedure column out resolves to the SqlOutParameter. No mention of function column out. Causes issues with pgjdbc driver from version 42.2.11+ and for Postgres server 11+.

if (meta.getParameterType() == DatabaseMetaData.procedureColumnOut) {

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 3, 2023
@snicoll snicoll changed the title [spring-jdbc] Function column out doesn't resolve to SqlOutParameter Function column out doesn't resolve to SqlOutParameter Nov 3, 2023
@snicoll
Copy link
Member

snicoll commented Nov 3, 2023

@hladysz thanks for the report. Can you share a small sample that demonstrates the issue you've described? You can attach a zip to this issue or push the code to a separate GitHub repository.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Nov 3, 2023
@hladysz
Copy link
Author

hladysz commented Nov 4, 2023

No time atm but got a piece of code used:

  private SimpleJdbcCall prepareClearingCall;
  private void initialiseCalls() {
    prepareClearingCall = new SimpleJdbcCall(jdbcTemplate)
        .withProcedureName("test_function");
  }
 
 public void call() {
   Map<String, Object> procedureResult = prepareClearingCall.execute();
 }
CREATE OR REPLACE FUNCTION public.test_function(
    OUT __result integer,
    OUT __result_message varchar
)
    RETURNS record
    LANGUAGE plpgsql
AS
$function$
    BEGIN
        __result = 0;
        __result_message = 'OK';
    END;
$function$;

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 4, 2023
@snicoll snicoll added in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Nov 6, 2023
@snicoll snicoll added this to the 6.1.x milestone Nov 6, 2023
@snicoll
Copy link
Member

snicoll commented Nov 6, 2023

See also #25399

@jhoeller
Copy link
Contributor

jhoeller commented Nov 6, 2023

Related to #25588, this requires a similar function-specific check there since the JDBC constant values are unfortunately different.

@jhoeller jhoeller modified the milestones: 6.1.x, 6.0.14 Nov 6, 2023
@jhoeller jhoeller added the for: backport-to-5.3.x Marks an issue as a candidate for backport to 5.3.x label Nov 6, 2023
@github-actions github-actions bot added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.3.x Marks an issue as a candidate for backport to 5.3.x labels Nov 6, 2023
jhoeller added a commit that referenced this issue Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants