Skip to content

Commit

Permalink
TEIID-2754 updating the flag to report as views by default
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Oct 13, 2015
1 parent 97a0f1d commit 548ed7a
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 139 deletions.
Expand Up @@ -45,7 +45,8 @@ <h2><a name="Compatibility">Compatibility Issues</a></h2>

<h4>from 8.x</h4>
<ul>
<li>TEIID-3601 changed the rowCount field on CommandLogMessages from Integer to Long.
<li>TEIID-2754 view are reported as VIEW table type in the metadata. Use the connection property reportAsViews=false to restore the old behavior.</li>
<li>TEIID-3601 changed the rowCount field on CommandLogMessages from Integer to Long.</li>
</ul>

<h4>from 8.11</h4>
Expand Down
Expand Up @@ -305,7 +305,7 @@ final private static class RUNTIME_MODEL{
*/
DatabaseMetaDataImpl(ConnectionImpl connection) {
this.driverConnection = connection;
if (PropertiesUtils.getBooleanProperty(connection.getConnectionProps(), REPORT_AS_VIEWS, false)) {
if (PropertiesUtils.getBooleanProperty(connection.getConnectionProps(), REPORT_AS_VIEWS, true)) {
TABLE_TYPE = "CASE WHEN IsSystem = 'true' and UCASE(Type) = 'TABLE' THEN 'SYSTEM TABLE' WHEN IsPhysical <> 'true' AND UCASE(Type) = 'TABLE' THEN 'VIEW' ELSE UCASE(Type) END"; //$NON-NLS-1$
} else {
TABLE_TYPE = "CASE WHEN IsSystem = 'true' and UCASE(Type) = 'TABLE' THEN 'SYSTEM TABLE' ELSE UCASE(Type) END"; //$NON-NLS-1$
Expand Down
Expand Up @@ -94,7 +94,7 @@ public class TestCase3473 {
ResultSet rs1 = dbmd.getTables(null, "%foo", null, null); //$NON-NLS-1$
ResultSet rs2 = dbmd.getTables("foo", "%foo", null, null); //$NON-NLS-1$ //$NON-NLS-2$
TestMMDatabaseMetaData.compareResultSet(rs, rs1, rs2);
assertFalse(dbmd.getTables(null, null, null, new String[] {"VIEW"}).next());
assertTrue(dbmd.getTables(null, null, null, new String[] {"VIEW"}).next());

Properties p = new Properties();
p.setProperty(DatabaseMetaDataImpl.REPORT_AS_VIEWS, "true");
Expand Down
Expand Up @@ -35,9 +35,9 @@ test pg_catalog
test pg_catalog pg_trigger SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog pg_type SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog pg_user SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test test all_databases TABLE <null> <null> <null> <null> <null> <null> false
test test all_models TABLE <null> <null> <null> <null> <null> <null> false
test test all_tables TABLE <null> <null> <null> <null> <null> <null> false
test test all_databases VIEW <null> <null> <null> <null> <null> <null> false
test test all_models VIEW <null> <null> <null> <null> <null> <null> false
test test all_tables VIEW <null> <null> <null> <null> <null> <null> false
Row Count : 38
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 test java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false false 1 true true false false
Expand Down

0 comments on commit 548ed7a

Please sign in to comment.