diff --git a/.gitignore b/.gitignore index 0662ee8f3..56585839c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ .attach_pid* hs_err_pid*.log *.sh +.idea +*.iml diff --git a/src/main/core-api/java/com/mysql/cj/QueryInfo.java b/src/main/core-api/java/com/mysql/cj/QueryInfo.java index 4dd0e1bb4..4d023d1ab 100644 --- a/src/main/core-api/java/com/mysql/cj/QueryInfo.java +++ b/src/main/core-api/java/com/mysql/cj/QueryInfo.java @@ -59,7 +59,7 @@ public class QueryInfo { private static final String AS_CLAUSE = "AS"; private static final String[] ODKU_CLAUSE = new String[] { "ON", "DUPLICATE", "KEY", "UPDATE" }; private static final String LAST_INSERT_ID_FUNC = "LAST_INSERT_ID"; - private static final String INTO_CLAUSE = "INTO"; + private static final String INTO_CLAUSE = " INTO "; private QueryInfo baseQueryInfo = null; diff --git a/src/test/java/testsuite/regression/StatementRegressionTest.java b/src/test/java/testsuite/regression/StatementRegressionTest.java index 96014d2e3..6cd030113 100644 --- a/src/test/java/testsuite/regression/StatementRegressionTest.java +++ b/src/test/java/testsuite/regression/StatementRegressionTest.java @@ -14660,4 +14660,16 @@ public void testBug107543_IntoFile() throws Exception { } } + /** + * Tests fix for Bug#119245, INTO should be allowed + * + * @throws Exception + */ + @Test + public void testBug119245_IntoInsideVar() throws Exception { + createTable("testbug119245Table", "(id INT AUTO_INCREMENT PRIMARY KEY, margintotal VARCHAR(255))"); + + // Test 1: execute() with INTO @var + assertEquals(0, this.stmt.executeQuery("SELECT margintotal FROM testbug119245Table").getFetchSize()); + } }