Skip to content

Commit

Permalink
Remove insert SQL escape character with MonetDB in TPCCLoader.java
Browse files Browse the repository at this point in the history
  • Loading branch information
edman committed Nov 25, 2015
1 parent 82160dd commit adf155a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/com/oltpbenchmark/benchmarks/tpcc/TPCCLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
import com.oltpbenchmark.catalog.Table;
import com.oltpbenchmark.util.SQLUtil;

//woonhak, for postgres (make insert statement wihtout escaped char),
//need to know current dbType
//woonhak, for postgres and monetdb (make insert statement wihtout escaped char),
//need to know current dbType
import com.oltpbenchmark.types.DatabaseType;

public class TPCCLoader extends Loader{
Expand Down Expand Up @@ -98,15 +98,17 @@ public TPCCLoader(TPCCBenchmark benchmark, Connection c) {
private static long lastTimeMS = 0;

private static final int FIRST_UNPROCESSED_O_ID = 2101;

private PreparedStatement getInsertStatement(String tableName) throws SQLException {
Table catalog_tbl = this.getTableCatalog(tableName);
assert(catalog_tbl != null);

//woonhak, if current dbType is postgres then make insertSQL without escaped character.
// if current dbType is either postgres or monetdb make insertSQL
// without escaped character.
String sql = null;

if(this.getDatabaseType()== DatabaseType.POSTGRES )
if (this.getDatabaseType() == DatabaseType.POSTGRES
|| this.getDatabaseType() == DatabaseType.MONETDB)
sql = SQLUtil.getInsertSQL(catalog_tbl, false);
else
sql = SQLUtil.getInsertSQL(catalog_tbl);
Expand Down

0 comments on commit adf155a

Please sign in to comment.