Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.3.0, 2.2.6
-
None
Description
In the following description it is not possible to write two backslashes after each other. That's why I wrote '\ \' with space between in meaning two following backslashes without space.
Commit https://github.com/MariaDB/mariadb-connector-j/commit/e9e8acc400d5935082b9d4d5255d5e735eae7a8f
causes problems if SELECT or WHERE contains backspace(s) without following ' or "
Simple Select doesn't work any more without ...?sessionVariables=sql_mode=NO_BACKSLASH_ESCAPES
getSession().createSQLQuery("SELECT CONCAT('\\\\', '') FROM (SELECT '') AS a WHERE :q = 1").setParameter("q", 1).list();
Caused by: java.sql.SQLException: Could not set parameter at position 1 (values was 1)
Query - conn:1180011(M) - "SELECT CONCAT('\ \', '') FROM (SELECT '') AS a WHERE ? = 1"
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getSqlException(ExceptionMapper.java:211)
at org.mariadb.jdbc.MariaDbPreparedStatementClient.setParameter(MariaDbPreparedStatementClient.java:438)
at org.mariadb.jdbc.BasePrepareStatement.setInt(BasePrepareStatement.java:1436)
...