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

Wrong parameters order in EXECUTE USING when using with clause #16347

Open
va663 opened this issue Jun 28, 2021 · 2 comments
Open

Wrong parameters order in EXECUTE USING when using with clause #16347

va663 opened this issue Jun 28, 2021 · 2 comments
Labels

Comments

@va663
Copy link

va663 commented Jun 28, 2021

env

Presto Version: 0.256
JDBC jar Version: 0.256

If using with clause

PREPARE s1 FROM 
WITH t_a AS (
	SELECT
		*
	FROM table1
	WHERE name = ?
)
SELECT
	*
FROM t_a
WHERE id > ?

JdbcTemplate and Mybatis handle with left-to-right as they appear

EXECUTE s1 USING 'user',  12

But Presto is expecting

EXECUTE s1 USING 12, 'USER'

If without with clause

PREPARE s1 FROM
SELECT
	*
FROM(
	SELECT
		*
	from table1
	where name = ?
)src
where
	id > ?

Presto is expecting the same order as mybatis is generated

EXECUTE s1 USING 'user', 12

Similar issue in trino has been proposed Wrong parameters order in EXECUTE USING when using with clause

@rubenssoto
Copy link

@va663 Do you have any Solution to that?

@va663
Copy link
Author

va663 commented Dec 9, 2021

@va663 Do you have any Solution to that?

No, an alternative was used ><!

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

No branches or pull requests

3 participants