#1483 - Invalid SQL with allQuotedIdentifiers true - where t0.[t0.[COND]] in (?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

This commit is contained in:
Rob Bygrave committed 2018-09-20 23:12:26 +12:00
1 parent be24e11b91
commit 42f9e74d91
4 files changed
+56 -3

No files matched your search

@@ -3,6 +3,7 @@ package io.ebeaninternal.server.deploy;
import io.ebean.BaseTestCase;
import org.junit.Test;
import org.tests.model.basic.Address;
import org.tests.model.basic.BWithQIdent;
import org.tests.model.basic.Customer;
import static org.assertj.core.api.Assertions.assertThat;
@@ -14,6 +15,8 @@ public class DeployPropertyParserTest extends BaseTestCase {
private final BeanDescriptor<Address> addressBeanDescriptor = getBeanDescriptor(Address.class);
private final BeanDescriptor<BWithQIdent> bWithQIdentDescriptor = getBeanDescriptor(BWithQIdent.class);
@Test
public void from_prefix_expect_unchanged() {
assertThat(parser().parse("(select x from status join status)")).isEqualTo("(select x from status join status)");
@@ -49,6 +52,12 @@ public class DeployPropertyParserTest extends BaseTestCase {
assertThat(addressParser().parse("concat(line1, line2, '-EA')")).isEqualTo("concat(${}line_1, ${}line_2, '-EA')");
}
@Test
public void withQuote_when_match() {
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}\"Name\" like ?");
assertThat(withQuoteParser().parse("t0.\"CODE\" like ?")).isEqualTo("t0.\"CODE\" like ?");
}
@Test
public void unknown_path() {
assertThat(parser().parse(" foo ")).isEqualTo(" foo ");
@@ -62,4 +71,8 @@ public class DeployPropertyParserTest extends BaseTestCase {
return addressBeanDescriptor.parser();
}
private DeployPropertyParser withQuoteParser() {
return bWithQIdentDescriptor.parser();
}
}