Skip to content

Commit

Permalink
Fix for StatementRegressionTest.testLikeWithBackslashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
fjssilva committed Nov 16, 2017
1 parent 0537c86 commit 714c64b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/testsuite/regression/StatementRegressionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2983,8 +2983,8 @@ public void testLikeWithBackslashes() throws Exception {

noBackslashEscapesConn = getConnectionWithProps(props);

createTable("X_TEST",
"(userName varchar(32) not null, ivalue integer, CNAME varchar(255), bvalue CHAR(1), svalue varchar(255), ACTIVE CHAR(1), primary key (userName))");
createTable("X_TEST", "(userName varchar(32) not null, ivalue integer, CNAME varchar(255), bvalue CHAR(1), svalue varchar(255), ACTIVE CHAR(1), "
+ "primary key (userName)) DEFAULT CHARSET=latin1");

String insert_sql = "insert into X_TEST (ivalue, CNAME, bvalue, svalue, ACTIVE, userName) values (?, ?, ?, ?, ?, ?)";

Expand All @@ -2997,11 +2997,12 @@ public void testLikeWithBackslashes() throws Exception {
this.pstmt.setString(6, "c:\\jetson");
this.pstmt.execute();

String select_sql = "select user0_.userName as userName0_0_, user0_.ivalue as ivalue0_0_, user0_.CNAME as CNAME0_0_, user0_.bvalue as bvalue0_0_, user0_.svalue as svalue0_0_, user0_.ACTIVE as ACTIVE0_0_ from X_TEST user0_ where user0_.userName like ?";
String select_sql = "select user0_.userName as userName0_0_, user0_.ivalue as ivalue0_0_, user0_.CNAME as CNAME0_0_, user0_.bvalue as bvalue0_0_, "
+ "user0_.svalue as svalue0_0_, user0_.ACTIVE as ACTIVE0_0_ from X_TEST user0_ where user0_.userName like ?";
this.pstmt = noBackslashEscapesConn.prepareStatement(select_sql);
this.pstmt.setString(1, "c:\\j%");
// if we comment out the previous line and uncomment the following, the like clause matches
// this.pstmt.setString(1,"c:\\\\j%");
// this.pstmt.setString(1, "c:\\\\j%");
System.out.println("about to execute query " + select_sql);
this.rs = this.pstmt.executeQuery();
assertTrue(this.rs.next());
Expand Down

0 comments on commit 714c64b

Please sign in to comment.