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

Fix NULL parameters in Tuples/Maps/Arrays #377

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

slvrtrn
Copy link
Contributor

@slvrtrn slvrtrn commented Jan 15, 2025

Summary

Resolves #374
There was a similar issue with Array/Map types, too - JS null and undefined should be printed as the NULL keyword instead of \N there, as \N can be used only for non-nested types, e.g. for something like Nullable(Int32).

See

curl "http://localhost:8123?param_tup=%5B'foo',NULL%5D" --data-binary "SELECT {tup: Array(Nullable(String))} t" 
['foo',NULL]
curl "http://localhost:8123?param_tup=%5B'foo',\N%5D" --data-binary "SELECT {tup: Array(Nullable(String))} t"
Code: 26. DB::Exception: Cannot parse quoted string: expected opening quote ''', got '\': value ['foo',\N] cannot be parsed as Array(Nullable(String)) for query parameter 'tup'. (CANNOT_PARSE_QUOTED_STRING) (version 24.12.2.29 (official build))

But

curl "http://localhost:8123?param_tup=\N" --data-binary "SELECT {tup: Nullable(String)} t"  
\N

Checklist

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

@slvrtrn
Copy link
Contributor Author

slvrtrn commented Jan 15, 2025

The tests should be green when we update the JWT credentials.

@slvrtrn slvrtrn requested a review from mshustov January 15, 2025 15:15
@slvrtrn slvrtrn merged commit d94753c into main Jan 16, 2025
22 of 26 checks passed
@slvrtrn slvrtrn deleted the fix-null-parameters-in-tuples-and-maps branch January 16, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tuple(Nullable(...)) as param does not work
2 participants