File path: /sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/util/DBUtil.java | File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java | |||
Method name: String getSelectQuery(SessionInfoProvider, String, ITableInfo)
|
Method name: String getSelectQuery(SessionInfoProvider, String, ITableInfo)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | StringBuilder result = new StringBuilder("select ");↵ | 1 | StringBuilder result = new StringBuilder("select ");↵ | |
2 | result.append(columnList);↵ | 2 | result.append(columnList);↵ | |
3 | result.append(" from ");↵ | 3 | result.append(" from ");↵ | |
4 | ISession sourceSession = prov.getDiffSourceSession();↵ | 4 | ISession sourceSession = prov.getCopySourceSession();↵ | |
5 | // String sourceSchema = null;↵ | 5 | String ↵ | |
6 | // MySQL uses catalogs instead of schemas↵ | |||
7 | /*↵ | |||
8 | if (DialectFactory.isMySQLSession(sourceSession)) {↵ | |||
9 | if (log.isDebugEnabled()) {↵ | |||
10 | String catalog = ↵ | |||
11 | prov.getSourceSelectedDatabaseObjects()[0].getCatalogName();↵ | |||
12 | String schema =↵ | |||
13 | prov.getSourceSelectedDatabaseObjects()[0].getSchemaName();↵ | |||
14 | log.debug("Detected MySQL, using catalog ("+catalog+") " +↵ | |||
15 | "instead of schema ("+schema+")");↵ | |||
16 | }↵ | |||
17 | sourceSchema = ↵ | |||
18 | prov.getSourceSelectedDatabaseObjects()[0].getCatalogName();↵ | 6 | tableName = getQualifiedObjectName(↵ | |
19 | } else {↵ | 7 | ↵ | |
20 | sourceSchema = ↵ | |||
21 | prov.getSourceSelectedDatabaseObjects()[0].getSchemaName();↵ | |||
22 | }↵ | |||
23 | */↵ | |||
24 | String tableName =↵ | |||
25 | getQualifiedObjectName(sourceSession, ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(),↵ | 8 | sourceSession, ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(),↵ | |
26 | DialectFactory.SOURCE_TYPE);↵ | 9 | DialectFactory.SOURCE_TYPE);↵ | |
27 | result.append(tableName);↵ | 10 | result.append(tableName);↵ | |
28 | return result.toString(); | 11 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 37 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | StringBuilder result = new StringBuilder("select "); | 1 | StringBuilder result = new StringBuilder("select "); | |||||||||||||||
2 | result.append(columnList); | 2 | result.append(columnList); | |||||||||||||||
3 | result.append(" from "); | 3 | result.append(" from "); | |||||||||||||||
4 | ISession sourceSession = prov.getDiffSourceSession(); |
| 4 | ISession sourceSession = prov.getCopySourceSession(); | ||||||||||||||
5 | String tableName = getQualifiedObjectName(sourceSession, ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(), DialectFactory.SOURCE_TYPE); | 5 | String tableName = getQualifiedObjectName(sourceSession, ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(), DialectFactory.SOURCE_TYPE); | |||||||||||||||
6 | result.append(tableName); | 6 | result.append(tableName); | |||||||||||||||
7 | return result.toString(); | 7 | return result.toString(); |
Row | Violation |
---|---|
1 | Type net.sourceforge.squirrel_sql.plugins.dbdiff.SessionInfoProvider of variable prov does not match with type net.sourceforge.squirrel_sql.plugins.dbcopy.SessionInfoProvider of variable prov |