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
SQL: CONCAT should return NULL when the field involved has a NULL value? #36169
Comments
Pinging @elastic/es-search |
CC @bpintea |
Generally I'd do what PostgreSQL does unless PostgreSQL is being crazy. It looks like PostgreSQL is fairly reasonable:
This looks like what SQL Server does by default too. That warning in the PostgreSQL docs seem to be about if you end up with a |
Weirdly enough for the
|
I would vote to stick with PostgreSQL behaviour as well here. |
+1. Let's go with Postgres. |
SQL Server 2017, by default, will consider
null
values inCONCAT()
function as empty strings and return a non-null value. But, it also offers the option of changing this setting by usingCONCAT_NULL_YIELDS_NULL
setting. They do warn, though, that this option will beON
in a future version of SQL Server: https://docs.microsoft.com/en-us/sql/t-sql/statements/set-concat-null-yields-null-transact-sql?view=sql-server-ver15. The preview docs for SQL Server 2019 does still have the option default asOFF
(sonull
is considered empty string).PostgreSQL will also "ignore" null values and treat them as empty strings: https://www.postgresql.org/docs/11/functions-string.html
The text was updated successfully, but these errors were encountered: