Bug #112083 `java.sql.Statement.enquoteIdentifier` bad behavior
Submitted: 16 Aug 2023 10:40 Modified: 14 Apr 14:34
Reporter: A B Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:8.1.0 OS:Any
Assigned to: CPU Architecture:Any

[16 Aug 2023 10:40] A B
Description:
`enquoteIdentifier` not implemented.
java-sql's default behavior doesn't work in MySQL

How to repeat:
Snippet:
```java
Connection conn = DriverManager.getConnection("jdbc:mysql://...", "...", "...");
Statement stmt = conn.createStatement();
String identifier = stmt.enquoteIdentifier("bla", true);
System.out.println(identifier);
```

prints `"bla"` instead of `\`bla\``

Suggested fix:
Implement the function
[17 Aug 2023 8:26] MySQL Verification Team
Hello!

Thank you for the report and feedback.
Verifying as a feature request.

regards,
Umesh
[14 Apr 14:34] Edward Gilmore
Posted by developer:
 
 Added the following note to the MySQL Connector/J 9.7.0 release notes:		
 
 Connector/J now implements the following java.sql.Statement methods:

    enquoteIdentifier(String identifier, boolean alwaysQuote)

    enquoteLiteral(String val)

    enquoteNCharLiteral(String val)

    isSimpleIdentifier(String identifier)