Skip to content

Commit 45161de

Browse files
committed
#909 revise and rename jdp-2026-03
1 parent 112204c commit 45161de

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

devdoc/jdp/jdp-2026-03-jdbc-escape-disabled-processing.adoc renamed to devdoc/jdp/jdp-2026-03-jdbc-escape-to-disable-escape-processing.adoc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= jdp-2026-03: JDBC escape disabled processing
1+
= jdp-2026-03: JDBC escape to disable escape processing
22

33
// SPDX-FileCopyrightText: Copyright 2026 Mark Rotteveel
44
// SPDX-License-Identifier: LicenseRef-PDL-1.0
@@ -18,27 +18,30 @@ JDBC 4.5, to be introduced with Java 26, features a new JDBC escape which can be
1818
For details, see also chapter 6 in https://jcp.org/aboutJava/communityprocess/maintenance/jsr221/JDBC4.5MR-November_2025.pdf[JDBC 4.5 List of proposed changes].
1919

2020
Unfortunately, the proposed syntax for this escape has an ambiguity, and discussion with the JDBC spec lead and others did not resolve that ambiguity.
21-
This design proposal serves to document our interpretation of the "`escape disabled`" escape, identify the ambiguity, and document our decision how to handle it.
21+
This design proposal serves to document our interpretation of the "`disable escape processing`" escape or "`disabled escape`" (referenced as _the escape_ in the remainder of this document), identify the ambiguity, and document our decision how to handle it.
2222

23-
=== The "`escape disabled`" escape
23+
=== The "`disable escape processing`" escape
2424

25-
The "`escape disabled`" escape (referred to below as "`the escape`") starts with `++{\++` and ends with `++\}++`.
25+
The escape starts with `++{\++` and ends with `++\}++`.
2626
As a Java literal, it's `"++{\\ \\}++"`.
2727

2828
Within the escape:
2929

3030
* Other JDBC escapes are to be ignored (i.e. added to the resulting statement text without processing).
31-
* For drivers that need it, processing/transformation of parameter placeholders (`?`) should not be performed (i.e. the question mark should remain a question mark n the resulting statement text).
32-
* Any occurrence of `\` (backslash) that are not part of the end of the escape must be escaped by doubling, even in comments, literals and delimited identifiers.
31+
* For drivers that need it, processing/transformation of parameter placeholders (`?`) should not be performed.
32+
That is, the question mark should remain a question mark in the resulting statement text.
33+
+
34+
Jaybird doesn't need this, as processing of question marks is handled by Firebird.
35+
* Any occurrence of `\` (backslash) that are not part of the end of the escape must be escaped by doubling, even in comments, literals, and delimited identifiers (quoted identifiers).
3336
+
3437
See also the examples (sometimes badly formatted) in chapter 6 of https://jcp.org/aboutJava/communityprocess/maintenance/jsr221/JDBC4.5MR-November_2025.pdf[JDBC 4.5 List of proposed changes].
3538

36-
The fact the backslash must be escaped everywhere inside the escape, except for the end of escape marker gives rise to the ambiguity as we see it.
39+
The fact the backslash must be escaped everywhere inside the escape, except for the end of escape marker gives rise to an ambiguity, in our opinion.
3740
Other JDBC escapes are not processed inside comments, literals, and identifiers.
3841
The presence of `++\}++` ends the escape, and that -- in our opinion -- means that it's unescaped presence inside a comment, literal or delimited identifier would also end the escape.
3942
Otherwise, it shouldn't be necessary to escape the backslash inside comments, literals. and identifiers, and the proposed change explicitly shows it must be escaped everywhere.
4043

41-
For example, the statement text `++{\'ends in \}literal'++`, this could be parsed in several ways:
44+
For example, the statement text `++{\'ends in \}literal'++` could be parsed in several ways:
4245

4346
. Allow the escape to end inside the literal: ``'ends in literal'``
4447
. Raise an error (e.g. "`unescaped backslash: end of escape disabled (++\}++) not allowed in literal`")
@@ -58,7 +61,7 @@ Option one seems to be the most literal interpretation of the specification, but
5861
== Decision
5962

6063
We choose option two, raising an error if the escape ends within a comment, literal, or identifier.
61-
It will be less confusing, and it prevents unexpected problems, especially with literals containing values the developer did not intend.
64+
It will be less confusing, and it prevents unexpected problems, especially with literals containing values after processing that the developer did not intend.
6265

6366
The documentation in release notes and the Jaybird manual will contain a warning about the ambiguity and recommendations how to avoid it.
6467

@@ -75,7 +78,7 @@ The contents of this Documentation are subject to the Public Documentation Licen
7578
you may only use this Documentation if you comply with the terms of this License.
7679
A copy of the License is available at https://firebirdsql.org/en/public-documentation-license/.
7780

78-
The Original Documentation is "`jdp-2026-03: JDBC escape disabled processing".
81+
The Original Documentation is "`jdp-2026-03: JDBC escape to disable escape processing`".
7982
The Initial Writer of the Original Documentation is Mark Rotteveel, Copyright © 2026.
8083
All Rights Reserved.
8184
(Initial Writer contact(s): mark (at) lawinegevaar (dot) nl).

0 commit comments

Comments
 (0)