[ 
https://issues.apache.org/jira/browse/CALCITE-7700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18103167#comment-18103167
 ] 

Julian Hyde commented on CALCITE-7700:
--------------------------------------

You wrote "The STRING type family includes both STRING and BINARY types". I 
think you meant "The STRING type family includes both CHARACTER and BINARY 
types".

The underlying problem is that in every programming language created since 1975 
"string" means "character string". Everyone is going to confuse the terms - I 
assume that this bug is caused by the developer of the CONCAT function getting 
confused when writing the error or the type signature.

I wonder whether we should just stop using the term STRING in this confusing 
way and adopt a less ambiguous term like CHARACTER OR BINARY STRING. What do 
other databases do, especially those that try to comply with the SQL standard?

> Error messages involving the STRING type family are confusing
> -------------------------------------------------------------
>
>                 Key: CALCITE-7700
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7700
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.42.0
>            Reporter: Mihai Budiu
>            Assignee: krooswu
>            Priority: Minor
>
> The STRING type family includes both STRING and BINARY types.
> This produces confusing errors for functions that may support both types of 
> arguments:
> {code:sql}
> SELECT CONCAT('a', x'0a');
> {code}
> produces
> {noformat}
> Cannot apply 'CONCAT' to arguments of type 'CONCAT(<CHAR(1)>, <BINARY(1)>)'.
> Supported form(s): 'CONCAT(<STRING>, <STRING>)'
> {noformat}
> But CONCAT does support BINARY arguments!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to