Skip to content

Commit

Permalink
Merge pull request pentaho#1322 from SergeyTravin/PDI-12123
Browse files Browse the repository at this point in the history
PDI-12123 - Field quoting of reserved database words can cause SQL fa…
  • Loading branch information
Nick Hudak committed Dec 8, 2015
2 parents c93ca0b + a099ad3 commit 001a0ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ public void setSupportsTimestampDataType( boolean b ) {
*/
@Override
public boolean preserveReservedCase() {
String usePool = attributes.getProperty( ATTRIBUTE_PRESERVE_RESERVED_WORD_CASE, "N" );
String usePool = attributes.getProperty( ATTRIBUTE_PRESERVE_RESERVED_WORD_CASE, "Y" );
return "Y".equalsIgnoreCase( usePool );
}

Expand Down
9 changes: 9 additions & 0 deletions test/org/pentaho/di/core/database/BaseDatabaseMetaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,20 @@
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

import java.util.Properties;

/**
* User: RFellows Date: 3/4/13
*/
public class BaseDatabaseMetaTest {

@Test
public void testPreserveReservedCase() {
BaseDatabaseMeta meta = mock( BaseDatabaseMeta.class, Mockito.CALLS_REAL_METHODS );
meta.setAttributes( new Properties() );
assertTrue( "Default value of 'preserve reserved words case' attribute is FALSE", meta.preserveReservedCase() );
}

@Test
public void testGetSafeFieldname_space() throws Exception {
BaseDatabaseMeta meta = mock( BaseDatabaseMeta.class, Mockito.CALLS_REAL_METHODS );
Expand Down

0 comments on commit 001a0ab

Please sign in to comment.