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

Double ' && ' in JavaScript FUNCTIONs are converted to single ' & ' breaking the logic #2066

Open
simonepm opened this issue Feb 13, 2025 · 0 comments
Labels
bug Something isn't working sql

Comments

@simonepm
Copy link

simonepm commented Feb 13, 2025

SnowCLI version

3.3.0

Python version

3.11

Platform

Win11

What happened

Hello, please,

we notice a bug while creating a FUNCTION via snow sql --filename function_creation_statement.sql

All the occurrences of ' && ' are applied as ' & ' instead, breaking the JavaScript logic inside the CREATE FUNCTION $$ ... $$ statements.

Thanks!

How to reproduce

  1. Create a function_creation_statement.sql file with the following content:
CREATE FUNCTION TEST_AMPERSAND() RETURNS BOOLEAN LANGUAGE JAVASCRIPT AS $$
  return true && false;
$$;
  1. Run: snow sql --filename function_creation_statement.sql

  2. Execute: SELECT GET_DDL('FUNCTION', 'TEST_AMPERSAND');

CREATE FUNCTION TEST_AMPERSAND() RETURNS BOOLEAN LANGUAGE JAVASCRIPT AS $$
  return true & false;
$$;
@simonepm simonepm changed the title ' && ' in javascript procedure are converted to ' & ' breaking the logic Double ' && ' in JavaScript FUNCTIONs are converted to single ' & ' breaking the logic Feb 13, 2025
@sfc-gh-mraba sfc-gh-mraba added bug Something isn't working sql labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql
Projects
None yet
Development

No branches or pull requests

2 participants