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

Allowing duplicate named parameters in sql #591

Open
oldshensheep opened this issue May 15, 2024 · 0 comments
Open

Allowing duplicate named parameters in sql #591

oldshensheep opened this issue May 15, 2024 · 0 comments

Comments

@oldshensheep
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
create table

create table if not exists abc
(
    id      serial8 primary key,
    a bigint not null,
    b bigint not null,
    enabled bool   not null
);

run code

      My.addSqlChange(ctx -> {
        "[.sql/] insert into abc(a,b,enabled) values (:q,:q,:c)".execute(ctx, 1L, 1L, true);
      });

compiler error

error: variable q is already defined in method execute(SqlChangeCtx,Long,Long,Boolean)
  default int execute(SqlChangeCtx ctx, java.lang.Long q, java.lang.Long q, java.lang.Boolean c) throws java.sql.SQLException {

Expected behavior
should only bind :q once

      My.addSqlChange(ctx -> {
        "[.sql/] insert into abc(a,b,enabled) values (:q,:q,:c)".execute(ctx, 1L, true);
      });

Screenshots
If applicable, add screenshots to help explain your problem (drag/drop them here).

Desktop (please complete the following information):

  • OS Type & Version:
  • Java/JDK version: 21
  • IDE version (IntelliJ IDEA or Android Studio): IntelliJ IDEA
  • Manifold version: 2024.1.15
  • Manifold IntelliJ plugin version: 2024.1.0

Additional context
Add any other context about the problem here.

Stack trace
Please include a stack trace if applicable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants