diff --git a/manifold-deps-parent/manifold-sql-inproc-test/src/test/resources/samples/ddl/h2-sakila-ddl.sql b/manifold-deps-parent/manifold-sql-inproc-test/src/test/resources/samples/ddl/h2-sakila-ddl.sql index 98f5388e7..0ebfa32f8 100644 --- a/manifold-deps-parent/manifold-sql-inproc-test/src/test/resources/samples/ddl/h2-sakila-ddl.sql +++ b/manifold-deps-parent/manifold-sql-inproc-test/src/test/resources/samples/ddl/h2-sakila-ddl.sql @@ -112,6 +112,14 @@ create table all_types (-- SQL Type JDBC ); +-- +-- Test table having SQL keywords for table name and column names +-- +create table "select" ( + "order" IDENTITY NOT NULL PRIMARY KEY, + "where" VARCHAR(12) NOT NULL +); + -- -- Table structure for table `actor` -- diff --git a/manifold-deps-parent/manifold-sql/src/main/java/manifold/sql/schema/type/SchemaParentType.java b/manifold-deps-parent/manifold-sql/src/main/java/manifold/sql/schema/type/SchemaParentType.java index a1f140ce0..07f4c3065 100644 --- a/manifold-deps-parent/manifold-sql/src/main/java/manifold/sql/schema/type/SchemaParentType.java +++ b/manifold-deps-parent/manifold-sql/src/main/java/manifold/sql/schema/type/SchemaParentType.java @@ -1293,7 +1293,7 @@ private String makeJoinWhere( SchemaColumn fkToMe ) { StringBuilder sb = new StringBuilder(); SchemaColumn refCol = fkToMe.getForeignKey(); - sb.append( fkToMe.getOwner().getName() ).append( '.' ).append( fkToMe.getEscapedName() ).append( " = ?" ); + sb.append( fkToMe.getOwner().getEscapedName() ).append( '.' ).append( fkToMe.getEscapedName() ).append( " = ?" ); return sb.toString(); }