[CONJ-621] wrong escaping when having curly bracket in table/field name Created: 2018-06-27  Updated: 2018-07-06  Resolved: 2018-06-27

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: None
Fix Version/s: 2.2.6

Type: Bug Priority: Major
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

Initially from https://stackoverflow.com/questions/50875308/mariadb-jdbc-chokes-on-column-name-containing-curly-brackets

There is a wrong escaping when having "{}" in table/field name.
Example :

try (Connection conn = DriverManager.getConnection("jdbc:mariadb://localhost/testj?user=root&log=true")) {
    Statement stmt = conn.createStatement();
    //will throw java.sql.SQLException: unknown escape sequence {tt1}
    stmt.execute("CREATE TEMPORARY TABLE `{tt1}`(`{Document id}` int, tt text)");
}


Generated at Thu Feb 08 03:17:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.