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

Support full SQL standard binary string literal syntax [CORE5311] #5588

Closed
firebird-automations opened this issue Jul 15, 2016 · 4 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

firebird-automations commented Jul 15, 2016

Submitted by: @mrotteveel

Is related to CORE5312

Currently Firebird supports a limited form of the binary string literal, please add support for the full syntax defined in the SQL standard.

In SQL:2011 binary string literal is defined as:

<binary string literal> ::=
X <quote> [ <space>... ] [ { <hexit> [ <space>... ] <hexit> [ <space>... ] }... ] <quote>
[ { <separator> <quote> [ <space>... ] [ { <hexit> [ <space>... ]
<hexit> [ <space>... ] }... ] <quote> }... ]

<hexit> ::=
<digit> | A | B | C | D | E | F | a | b | c | d | e | f

<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<separator> ::=
{ <comment> | <white space> }...

This means that the below samples are all valid binary string literals according to the standard, Firebird only supports the first:

* X'01AB'
* X' 0 1 a b'
* X'01' 'ab'
* X'01'/*comment*/'a b'
* X'01' 'ab' /*comment*/ 'ff00'
* X'01' -- comment and newline
'ab'

x'  a  b  c d   '  'ab'/*x*/''
'ab' ' '

etc.

See also CORE5312 for character string literal

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

Component: Engine [ 10000 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

description: Currently Firebird supports a limited form of the binary string literal, please add support for the full syntax defined in the SQL standard.

In SQL:2011 binary string literal is defined as:

<binary string literal> ::=
X <quote> [ <space>... ] [ { <hexit> [ <space>... ] <hexit> [ <space>... ] }... ] <quote>
[ { <separator> <quote> [ <space>... ] [ { <hexit> [ <space>... ]
<hexit> [ <space>... ] }... ] <quote> }... ]

<hexit> ::=
<digit> | A | B | C | D | E | F | a | b | c | d | e | f

<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<separator> ::=
{ <comment> | <white space> }...

This means that the below samples are all valid binary string literals according to the standard, Firebird only supports the first:

* X'01AB'
* X' 0 1 a b'
* X'01' 'ab'
* X'01'/*comment*/'a b'
* X'01' 'ab' /*comment*/ 'ff00'
* X'01' -- comment and newline
'ab'

etc.

=>

Currently Firebird supports a limited form of the binary string literal, please add support for the full syntax defined in the SQL standard.

In SQL:2011 binary string literal is defined as:

<binary string literal> ::=
X <quote> [ <space>... ] [ { <hexit> [ <space>... ] <hexit> [ <space>... ] }... ] <quote>
[ { <separator> <quote> [ <space>... ] [ { <hexit> [ <space>... ]
<hexit> [ <space>... ] }... ] <quote> }... ]

<hexit> ::=
<digit> | A | B | C | D | E | F | a | b | c | d | e | f

<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<separator> ::=
{ <comment> | <white space> }...

This means that the below samples are all valid binary string literals according to the standard, Firebird only supports the first:

* X'01AB'
* X' 0 1 a b'
* X'01' 'ab'
* X'01'/*comment*/'a b'
* X'01' 'ab' /*comment*/ 'ff00'
* X'01' -- comment and newline
'ab'

etc.

See also CORE5312 for character string literal

@firebird-automations
Copy link
Collaborator Author

Modified by: @mrotteveel

Link: This issue is related to CORE5312 [ CORE5312 ]

@mrotteveel
Copy link
Member

@asfernandes you might be able to combine this with #5589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment