Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
.attach_pid*
hs_err_pid*.log
*.sh
.idea
*.iml
2 changes: 1 addition & 1 deletion src/main/core-api/java/com/mysql/cj/QueryInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 ";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A regex would be nice but the whole comparing logic does not support that. Now '\nINTO ...' will be missed


private QueryInfo baseQueryInfo = null;

Expand Down
12 changes: 12 additions & 0 deletions src/test/java/testsuite/regression/StatementRegressionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}