提交 33d135d2 authored 作者: Noel Grandin's avatar Noel Grandin

javadoc and formatting

上级 d7adee0b
...@@ -123,34 +123,34 @@ MERGE INTO TEST KEY(ID) VALUES(2, 'World') ...@@ -123,34 +123,34 @@ MERGE INTO TEST KEY(ID) VALUES(2, 'World')
" "
"Commands (DML)","MERGE USING"," "Commands (DML)","MERGE USING","
MERGE INTO targetTableName [ [AS] targetAlias] MERGE INTO targetTableName [ [AS] targetAlias]
USING { ( select ) | sourceTableName }[ [AS] sourceAlias ] USING { ( select ) | sourceTableName }[ [AS] sourceAlias ]
ON ( expression ) ON ( expression )
[ WHEN MATCHED THEN [ update ] [ delete] ] [ WHEN MATCHED THEN [ update ] [ delete] ]
[ WHEN NOT MATCHED THEN insert ] [ WHEN NOT MATCHED THEN insert ]
"," ","
Updates or deletes existing rows, and insert rows that don't exist. The ON clause Updates or deletes existing rows, and insert rows that don't exist. The ON clause
specifies the matching column expression and must be specified. If more than one row specifies the matching column expression and must be specified. If more than one row
is updated per input row, an exception is thrown. is updated per input row, an exception is thrown.
If the source data contains duplicate rows (specifically those columns used in the If the source data contains duplicate rows (specifically those columns used in the
row matching ON clause), then an exception is thrown to prevent two updates applying row matching ON clause), then an exception is thrown to prevent two updates applying
to the same target row. The embedded update, delete or insert statements can not re-specify to the same target row. The embedded update, delete or insert statements can not re-specify
the target table name. the target table name.
"," ","
MERGE INTO TARGET_TABLE AS T USING SOURCE_TABLE AS S MERGE INTO TARGET_TABLE AS T USING SOURCE_TABLE AS S
ON (T.ID = S.ID) ON (T.ID = S.ID)
WHEN MATCHED THEN WHEN MATCHED THEN
UPDATE SET T.COL1 = S.COL1 WHERE T.COL2<>'FINAL' UPDATE SET T.COL1 = S.COL1 WHERE T.COL2<>'FINAL'
DELETE WHERE T.COL2='FINAL' DELETE WHERE T.COL2='FINAL'
WHEN NOT MATCHED THEN WHEN NOT MATCHED THEN
INSERT (ID,COL1,COL2) VALUES(S.ID,S.COL1,S.COL2) INSERT (ID,COL1,COL2) VALUES(S.ID,S.COL1,S.COL2)
MERGE INTO TARGET_TABLE AS T USING (SELECT * FROM SOURCE_TABLE) AS S MERGE INTO TARGET_TABLE AS T USING (SELECT * FROM SOURCE_TABLE) AS S
ON (T.ID = S.ID) ON (T.ID = S.ID)
WHEN MATCHED THEN WHEN MATCHED THEN
UPDATE SET T.COL1 = S.COL1 WHERE T.COL2<>'FINAL' UPDATE SET T.COL1 = S.COL1 WHERE T.COL2<>'FINAL'
DELETE WHERE T.COL2='FINAL' DELETE WHERE T.COL2='FINAL'
WHEN NOT MATCHED THEN WHEN NOT MATCHED THEN
INSERT (ID,COL1,COL2) VALUES(S.ID,S.COL1,S.COL2) INSERT (ID,COL1,COL2) VALUES(S.ID,S.COL1,S.COL2)
" "
"Commands (DML)","RUNSCRIPT"," "Commands (DML)","RUNSCRIPT","
......
...@@ -47,7 +47,7 @@ Change Log ...@@ -47,7 +47,7 @@ Change Log
</li> </li>
<li>Issue #585: MySQL mode DELETE statements compatibility <li>Issue #585: MySQL mode DELETE statements compatibility
</li> </li>
<li>PR #586: remove extra tx preparation <li>PR #586: remove extra tx preparation
</li> </li>
<li>PR #568: Implement MetaData.getColumns() for synonyms. <li>PR #568: Implement MetaData.getColumns() for synonyms.
</li> </li>
...@@ -55,7 +55,7 @@ Change Log ...@@ -55,7 +55,7 @@ Change Log
</li> </li>
<li>Fix a deadlock in the TransactionStore <li>Fix a deadlock in the TransactionStore
</li> </li>
<li>PR #579: Disallow BLOB type in PostgreSQL mode <li>PR #579: Disallow BLOB type in PostgreSQL mode
</li> </li>
<li>Issue #576: Common Table Expression (CTE): WITH supports INSERT, UPDATE, MERGE, DELETE, CREATE TABLE ... <li>Issue #576: Common Table Expression (CTE): WITH supports INSERT, UPDATE, MERGE, DELETE, CREATE TABLE ...
</li> </li>
...@@ -71,7 +71,7 @@ Change Log ...@@ -71,7 +71,7 @@ Change Log
</li> </li>
<li>Issue #549: Removed UNION ALL requirements for CTE <li>Issue #549: Removed UNION ALL requirements for CTE
</li> </li>
<li>Issue #548: Table synonym support <li>Issue #548: Table synonym support
</li> </li>
<li>Issue #531: Rollback and delayed meta save. <li>Issue #531: Rollback and delayed meta save.
</li> </li>
......
...@@ -1137,9 +1137,13 @@ public class Parser { ...@@ -1137,9 +1137,13 @@ public class Parser {
String[] querySQLOutput = new String[]{null}; String[] querySQLOutput = new String[]{null};
List<Column> columnTemplateList = createQueryColumnTemplateList(null, command.getQuery(), querySQLOutput); List<Column> columnTemplateList = createQueryColumnTemplateList(null, command.getQuery(), querySQLOutput);
TableView temporarySourceTableView = createTemporarySessionView(command.getQueryAlias(), querySQLOutput[0], columnTemplateList, false/*no recursion*/, false/* do not add to session*/); TableView temporarySourceTableView = createTemporarySessionView(
TableFilter sourceTableFilter = new TableFilter(session, temporarySourceTableView, command.getQueryAlias(), rightsChecked, command.getQueryAlias(), querySQLOutput[0],
(Select) command.getQuery(), 0, null); columnTemplateList, false/* no recursion */,
false/* do not add to session */);
TableFilter sourceTableFilter = new TableFilter(session,
temporarySourceTableView, command.getQueryAlias(),
rightsChecked, (Select) command.getQuery(), 0, null);
command.setSourceTableFilter(sourceTableFilter); command.setSourceTableFilter(sourceTableFilter);
} }
else{ else{
...@@ -1193,31 +1197,18 @@ public class Parser { ...@@ -1193,31 +1197,18 @@ public class Parser {
setSQL(command, "MERGE", start); setSQL(command, "MERGE", start);
// build and prepare the targetMatchQuery ready to test each rows existence in the target table (using source row to match) // build and prepare the targetMatchQuery ready to test each rows
StringBuffer targetMatchQuerySQL = new StringBuffer("SELECT _ROWID_ FROM "+command.getTargetTable().getName()); // existence in the target table (using source row to match)
if(command.getTargetTableFilter().getTableAlias()!=null){ StringBuffer targetMatchQuerySQL = new StringBuffer(
targetMatchQuerySQL.append(" AS "+command.getTargetTableFilter().getTableAlias()); "SELECT _ROWID_ FROM " + command.getTargetTable().getName());
} if (command.getTargetTableFilter().getTableAlias() != null) {
targetMatchQuerySQL.append(" WHERE "+command.getOnCondition().getSQL()); targetMatchQuerySQL.append(
// Select preparedTargetMatchQuery = new Select(session); " AS " + command.getTargetTableFilter().getTableAlias());
// preparedTargetMatchQuery.addTableFilter(command.getTargetTableFilter(), true/*isTop*/); }
// preparedTargetMatchQuery.addTableFilter(command.getSourceTableFilter(), false/*isTop - not top table scan*/); targetMatchQuerySQL
// preparedTargetMatchQuery.setSQL(targetMatchQuerySQL.toString()); .append(" WHERE " + command.getOnCondition().getSQL());
// ArrayList<Expression> selectList = New.arrayList(); command.setTargetMatchQuery(
// //Database db = session == null ? null : session.getDatabase(); (Select) parse(targetMatchQuerySQL.toString()));
// selectList.add(new ExpressionColumn(session.getDatabase(), command.getTargetTableFilter().getTable().getRowIdColumn()));
// preparedTargetMatchQuery.setExpressions(selectList);
// preparedTargetMatchQuery.init();
command.setTargetMatchQuery((Select)parse(targetMatchQuerySQL.toString()));
// Select command = new Select(session);
// currentSelect = command;
// TableFilter filter = parseValuesTable(0);
// ArrayList<Expression> list = New.arrayList();
// list.add(new Wildcard(null, null));
// command.setExpressions(list);
// command.addTableFilter(filter, true);
// command.init();
return command; return command;
} }
...@@ -3422,7 +3413,8 @@ public class Parser { ...@@ -3422,7 +3413,8 @@ public class Parser {
return s; return s;
} }
// TODO: why does this function allow defaultSchemaName=null - which resets the parser schemaName for everyone ? // TODO: why does this function allow defaultSchemaName=null - which resets
// the parser schemaName for everyone ?
private String readIdentifierWithSchema(String defaultSchemaName) { private String readIdentifierWithSchema(String defaultSchemaName) {
if (currentTokenType != IDENTIFIER) { if (currentTokenType != IDENTIFIER) {
throw DbException.getSyntaxError(sqlCommand, parseIndex, throw DbException.getSyntaxError(sqlCommand, parseIndex,
...@@ -5251,39 +5243,48 @@ public class Parser { ...@@ -5251,39 +5243,48 @@ public class Parser {
} finally { } finally {
session.removeLocalTempTable(recursiveTable); session.removeLocalTempTable(recursiveTable);
} }
TableView view = createTemporarySessionView(tempViewName, querySQLOutput[0], columnTemplateList,true/*allowRecursiveQueryDetection*/, true); TableView view = createTemporarySessionView(tempViewName,
querySQLOutput[0], columnTemplateList,
true/* allowRecursiveQueryDetection */, true);
return view; return view;
} }
/** /**
* Creates a list of column templates from a query (usually from WITH query, but could be any query) * Creates a list of column templates from a query (usually from WITH query,
* @param cols - an optional list of column names (can be specified by WITH clause overriding usual select names) * but could be any query)
*
* @param cols - an optional list of column names (can be specified by WITH
* clause overriding usual select names)
* @param theQuery - the query object we want the column list for * @param theQuery - the query object we want the column list for
* @param querySQLOutput - array of length 1 to receive extra 'output' field in addition to return value * @param querySQLOutput - array of length 1 to receive extra 'output' field
* - containing the SQL query of the Query object * in addition to return value - containing the SQL query of the
* Query object
* @return a list of column object returned by withQuery * @return a list of column object returned by withQuery
*/ */
private List<Column> createQueryColumnTemplateList(String[] cols, Query theQuery, String[] querySQLOutput) { private static List<Column> createQueryColumnTemplateList(String[] cols,
Query theQuery, String[] querySQLOutput) {
List<Column> columnTemplateList = new ArrayList<Column>(); List<Column> columnTemplateList = new ArrayList<Column>();
theQuery.prepare(); theQuery.prepare();
// array of length 1 to receive extra 'output' field in addition to return value // array of length 1 to receive extra 'output' field in addition to
// return value
querySQLOutput[0] = StringUtils.cache(theQuery.getPlanSQL()); querySQLOutput[0] = StringUtils.cache(theQuery.getPlanSQL());
ArrayList<Expression> withExpressions = theQuery.getExpressions(); ArrayList<Expression> withExpressions = theQuery.getExpressions();
for (int i = 0; i < withExpressions.size(); ++i) { for (int i = 0; i < withExpressions.size(); ++i) {
Expression columnExp = withExpressions.get(i); Expression columnExp = withExpressions.get(i);
// use the passed in column name if supplied, otherwise use alias (if found) otherwise use column name /*
// derived from column expression * Use the passed in column name if supplied, otherwise use alias
* (if found) otherwise use column name derived from column
* expression.
*/
String columnName; String columnName;
if (cols != null){ if (cols != null) {
columnName = cols[i]; columnName = cols[i];
} else if (columnExp.getAlias()!=null){ } else if (columnExp.getAlias() != null) {
columnName = columnExp.getAlias(); columnName = columnExp.getAlias();
} else {
columnName = columnExp.getColumnName();
} }
else{ columnTemplateList.add(new Column(columnName, columnExp.getType()));
columnName = columnExp.getColumnName();
}
columnTemplateList.add(new Column(columnName,
columnExp.getType()));
} }
return columnTemplateList; return columnTemplateList;
} }
...@@ -6114,16 +6115,16 @@ public class Parser { ...@@ -6114,16 +6115,16 @@ public class Parser {
readIf("COLUMN"); readIf("COLUMN");
String columnName = readColumnIdentifier(); String columnName = readColumnIdentifier();
if ((isToken("NOT") || isToken("NULL"))) { if ((isToken("NOT") || isToken("NULL"))) {
AlterTableAlterColumn command = new AlterTableAlterColumn( AlterTableAlterColumn command = new AlterTableAlterColumn(
session, schema); session, schema);
command.setTableName(tableName); command.setTableName(tableName);
command.setIfTableExists(ifTableExists); command.setIfTableExists(ifTableExists);
Column column = columnIfTableExists(schema, tableName, columnName, ifTableExists); Column column = columnIfTableExists(schema, tableName, columnName, ifTableExists);
command.setOldColumn(column); command.setOldColumn(column);
if (readIf("NOT")) { if (readIf("NOT")) {
command.setType(CommandInterface.ALTER_TABLE_ALTER_COLUMN_NOT_NULL); command.setType(CommandInterface.ALTER_TABLE_ALTER_COLUMN_NOT_NULL);
} else { } else {
read("NULL"); read("NULL");
command.setType(CommandInterface.ALTER_TABLE_ALTER_COLUMN_NULL); command.setType(CommandInterface.ALTER_TABLE_ALTER_COLUMN_NULL);
} }
return command; return command;
......
...@@ -535,8 +535,8 @@ public class Session extends SessionWithState { ...@@ -535,8 +535,8 @@ public class Session extends SessionWithState {
* *
* @param sql the SQL statement * @param sql the SQL statement
* @param rightsChecked true if the rights have already been checked * @param rightsChecked true if the rights have already been checked
* @param literalsChecked true if the sql string has already been checked for literals (only used if * @param literalsChecked true if the sql string has already been checked
* ALLOW_LITERALS NONE is set). * for literals (only used if ALLOW_LITERALS NONE is set).
* @return the prepared statement * @return the prepared statement
*/ */
public Prepared prepare(String sql, boolean rightsChecked, boolean literalsChecked) { public Prepared prepare(String sql, boolean rightsChecked, boolean literalsChecked) {
......
...@@ -750,7 +750,7 @@ public class FullText { ...@@ -750,7 +750,7 @@ public class FullText {
* @param table the table name * @param table the table name
*/ */
private static void createTrigger(Connection conn, String schema, private static void createTrigger(Connection conn, String schema,
String table) throws SQLException { String table) throws SQLException {
createOrDropTrigger(conn, schema, table, true); createOrDropTrigger(conn, schema, table, true);
} }
...@@ -792,11 +792,11 @@ public class FullText { ...@@ -792,11 +792,11 @@ public class FullText {
* @param table the table name * @param table the table name
*/ */
private static void indexExistingRows(Connection conn, String schema, private static void indexExistingRows(Connection conn, String schema,
String table) throws SQLException { String table) throws SQLException {
FullText.FullTextTrigger existing = new FullText.FullTextTrigger(); FullText.FullTextTrigger existing = new FullText.FullTextTrigger();
existing.init(conn, schema, null, table, false, Trigger.INSERT); existing.init(conn, schema, null, table, false, Trigger.INSERT);
String sql = "SELECT * FROM " + StringUtils.quoteIdentifier(schema) + String sql = "SELECT * FROM " + StringUtils.quoteIdentifier(schema)
"." + StringUtils.quoteIdentifier(table); + "." + StringUtils.quoteIdentifier(table);
ResultSet rs = conn.createStatement().executeQuery(sql); ResultSet rs = conn.createStatement().executeQuery(sql);
int columnCount = rs.getMetaData().getColumnCount(); int columnCount = rs.getMetaData().getColumnCount();
while (rs.next()) { while (rs.next()) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
package org.h2.fulltext; package org.h2.fulltext;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DatabaseMetaData; import java.sql.DatabaseMetaData;
...@@ -15,17 +16,25 @@ import java.sql.Statement; ...@@ -15,17 +16,25 @@ import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.DateTools; import org.apache.lucene.document.DateTools;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term; import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.Version;
import org.h2.api.Trigger; import org.h2.api.Trigger;
import org.h2.command.Parser; import org.h2.command.Parser;
import org.h2.engine.Session; import org.h2.engine.Session;
...@@ -37,16 +46,6 @@ import org.h2.util.New; ...@@ -37,16 +46,6 @@ import org.h2.util.New;
import org.h2.util.StatementBuilder; import org.h2.util.StatementBuilder;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
import org.h2.util.Utils; import org.h2.util.Utils;
import java.io.File;
import java.util.Map;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.Version;
import org.apache.lucene.index.IndexWriter;
/** /**
* This class implements the full text search based on Apache Lucene. * This class implements the full text search based on Apache Lucene.
...@@ -256,7 +255,7 @@ public class FullTextLucene extends FullText { ...@@ -256,7 +255,7 @@ public class FullTextLucene extends FullText {
* @param table the table name * @param table the table name
*/ */
private static void createTrigger(Connection conn, String schema, private static void createTrigger(Connection conn, String schema,
String table) throws SQLException { String table) throws SQLException {
createOrDropTrigger(conn, schema, table, true); createOrDropTrigger(conn, schema, table, true);
} }
...@@ -344,11 +343,11 @@ public class FullTextLucene extends FullText { ...@@ -344,11 +343,11 @@ public class FullTextLucene extends FullText {
* @param table the table name * @param table the table name
*/ */
private static void indexExistingRows(Connection conn, String schema, private static void indexExistingRows(Connection conn, String schema,
String table) throws SQLException { String table) throws SQLException {
FullTextLucene.FullTextTrigger existing = new FullTextLucene.FullTextTrigger(); FullTextLucene.FullTextTrigger existing = new FullTextLucene.FullTextTrigger();
existing.init(conn, schema, null, table, false, Trigger.INSERT); existing.init(conn, schema, null, table, false, Trigger.INSERT);
String sql = "SELECT * FROM " + StringUtils.quoteIdentifier(schema) + String sql = "SELECT * FROM " + StringUtils.quoteIdentifier(schema)
"." + StringUtils.quoteIdentifier(table); + "." + StringUtils.quoteIdentifier(table);
ResultSet rs = conn.createStatement().executeQuery(sql); ResultSet rs = conn.createStatement().executeQuery(sql);
int columnCount = rs.getMetaData().getColumnCount(); int columnCount = rs.getMetaData().getColumnCount();
while (rs.next()) { while (rs.next()) {
...@@ -429,9 +428,9 @@ public class FullTextLucene extends FullText { ...@@ -429,9 +428,9 @@ public class FullTextLucene extends FullText {
if (limit == 0) { if (limit == 0) {
limit = docs.totalHits; limit = docs.totalHits;
} }
for (int i = 0, len = docs.scoreDocs.length; for (int i = 0, len = docs.scoreDocs.length; i < limit
i < limit && i + offset < docs.totalHits && i + offset < docs.totalHits
&& i + offset < len; i++) { && i + offset < len; i++) {
ScoreDoc sd = docs.scoreDocs[i + offset]; ScoreDoc sd = docs.scoreDocs[i + offset];
Document doc = searcher.doc(sd.doc); Document doc = searcher.doc(sd.doc);
float score = sd.score; float score = sd.score;
...@@ -442,17 +441,14 @@ public class FullTextLucene extends FullText { ...@@ -442,17 +441,14 @@ public class FullTextLucene extends FullText {
Session session = (Session) c.getSession(); Session session = (Session) c.getSession();
Parser p = new Parser(session); Parser p = new Parser(session);
String tab = q.substring(0, idx); String tab = q.substring(0, idx);
ExpressionColumn expr = (ExpressionColumn) p.parseExpression(tab); ExpressionColumn expr = (ExpressionColumn) p
.parseExpression(tab);
String schemaName = expr.getOriginalTableAliasName(); String schemaName = expr.getOriginalTableAliasName();
String tableName = expr.getColumnName(); String tableName = expr.getColumnName();
q = q.substring(idx + " WHERE ".length()); q = q.substring(idx + " WHERE ".length());
Object[][] columnData = parseKey(conn, q); Object[][] columnData = parseKey(conn, q);
result.addRow( result.addRow(schemaName, tableName, columnData[0],
schemaName, columnData[1], score);
tableName,
columnData[0],
columnData[1],
score);
} else { } else {
result.addRow(q, score); result.addRow(q, score);
} }
......
...@@ -80,7 +80,10 @@ public class TableView extends Table { ...@@ -80,7 +80,10 @@ public class TableView extends Table {
String oldQuerySQL = this.querySQL; String oldQuerySQL = this.querySQL;
Column[] oldColumnTemplates = this.columnTemplates; Column[] oldColumnTemplates = this.columnTemplates;
boolean oldRecursive = this.recursive; boolean oldRecursive = this.recursive;
init(querySQL, null, newColumnTemplates == null ? this.columnTemplates : newColumnTemplates, session, recursive, literalsChecked); init(querySQL, null,
newColumnTemplates == null ? this.columnTemplates
: newColumnTemplates,
session, recursive, literalsChecked);
DbException e = recompile(session, force, true); DbException e = recompile(session, force, true);
if (e != null) { if (e != null) {
init(oldQuerySQL, null, oldColumnTemplates, session, oldRecursive, literalsChecked); init(oldQuerySQL, null, oldColumnTemplates, session, oldRecursive, literalsChecked);
......
...@@ -5,22 +5,20 @@ ...@@ -5,22 +5,20 @@
*/ */
package org.h2.tools; package org.h2.tools;
import java.io.IOException;
import java.io.PipedReader;
import java.io.PipedWriter;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.engine.Constants; import org.h2.engine.Constants;
import org.h2.util.IOUtils; import org.h2.util.IOUtils;
import org.h2.util.JdbcUtils; import org.h2.util.JdbcUtils;
import org.h2.util.Tool; import org.h2.util.Tool;
import java.io.PipedReader;
import java.io.PipedWriter;
import java.io.IOException;
import java.sql.ResultSet;
/** /**
* Creates a cluster from a standalone database. * Creates a cluster from a standalone database.
* <br /> * <br />
...@@ -105,7 +103,7 @@ public class CreateCluster extends Tool { ...@@ -105,7 +103,7 @@ public class CreateCluster extends Tool {
Connection connSource = null, connTarget = null; Connection connSource = null, connTarget = null;
Statement statSource = null, statTarget = null; Statement statSource = null, statTarget = null;
PipedReader pipeReader = null; PipedReader pipeReader = null;
try { try {
org.h2.Driver.load(); org.h2.Driver.load();
...@@ -146,19 +144,23 @@ public class CreateCluster extends Tool { ...@@ -146,19 +144,23 @@ public class CreateCluster extends Tool {
statSource.execute("SET EXCLUSIVE 2"); statSource.execute("SET EXCLUSIVE 2");
pipeReader = new PipedReader(); pipeReader = new PipedReader();
try { try {
// Pipe writer is used + closed in the inner class, in a separate thread (needs to be final). /*
// It should be initialized within try{} so an exception could be caught if creation fails. * Pipe writer is used + closed in the inner class, in a
// In that scenario, the the writer should be null and needs no closing, * separate thread (needs to be final). It should be initialized
// and the main goal is that finally{} should bring the source DB * within try{} so an exception could be caught if creation
// out of exclusive mode, and close the reader. * fails. In that scenario, the the writer should be null and
* needs no closing, and the main goal is that finally{} should
* bring the source DB out of exclusive mode, and close the
* reader.
*/
final PipedWriter pipeWriter = new PipedWriter(pipeReader); final PipedWriter pipeWriter = new PipedWriter(pipeReader);
// Backup data from source database in script form. // Backup data from source database in script form.
// Start writing to pipe writer in separate thread. // Start writing to pipe writer in separate thread.
final ResultSet rs = statSource.executeQuery("SCRIPT"); final ResultSet rs = statSource.executeQuery("SCRIPT");
// Delete the target database first. // Delete the target database first.
connTarget = DriverManager.getConnection( connTarget = DriverManager.getConnection(
urlTarget + ";CLUSTER=''", user, password); urlTarget + ";CLUSTER=''", user, password);
...@@ -166,7 +168,7 @@ public class CreateCluster extends Tool { ...@@ -166,7 +168,7 @@ public class CreateCluster extends Tool {
statTarget.execute("DROP ALL OBJECTS DELETE FILES"); statTarget.execute("DROP ALL OBJECTS DELETE FILES");
connTarget.close(); connTarget.close();
new Thread( new Thread(
new Runnable(){ new Runnable(){
public void run() { public void run() {
...@@ -184,7 +186,7 @@ public class CreateCluster extends Tool { ...@@ -184,7 +186,7 @@ public class CreateCluster extends Tool {
} }
} }
).start(); ).start();
// Read data from pipe reader, restore on target. // Read data from pipe reader, restore on target.
connTarget = DriverManager.getConnection(urlTarget, user, password); connTarget = DriverManager.getConnection(urlTarget, user, password);
RunScript.execute(connTarget,pipeReader); RunScript.execute(connTarget,pipeReader);
...@@ -193,7 +195,7 @@ public class CreateCluster extends Tool { ...@@ -193,7 +195,7 @@ public class CreateCluster extends Tool {
// set the cluster to the serverList on both databases // set the cluster to the serverList on both databases
statSource.executeUpdate("SET CLUSTER '" + serverList + "'"); statSource.executeUpdate("SET CLUSTER '" + serverList + "'");
statTarget.executeUpdate("SET CLUSTER '" + serverList + "'"); statTarget.executeUpdate("SET CLUSTER '" + serverList + "'");
} catch (IOException ex) { } catch (IOException ex) {
throw new SQLException(ex); throw new SQLException(ex);
} finally { } finally {
......
...@@ -568,7 +568,8 @@ public abstract class Value { ...@@ -568,7 +568,8 @@ public abstract class Value {
* @param precision the precision of the column to convert this value to. * @param precision the precision of the column to convert this value to.
* The special constant <code>-1</code> is used to indicate that * The special constant <code>-1</code> is used to indicate that
* the precision plays no role when converting the value * the precision plays no role when converting the value
* @param column the column that contains the ENUM datatype enumerators, for dealing with ENUM conversions * @param column the column that contains the ENUM datatype enumerators,
* for dealing with ENUM conversions
* @return the converted value * @return the converted value
*/ */
public Value convertTo(int targetType, int precision, Mode mode, Column column) { public Value convertTo(int targetType, int precision, Mode mode, Column column) {
......
...@@ -175,8 +175,8 @@ public class TestScalability implements Database.DatabaseTest { ...@@ -175,8 +175,8 @@ public class TestScalability implements Database.DatabaseTest {
// calls garbage collection // calls garbage collection
TestBase.getMemoryUsed(); TestBase.getMemoryUsed();
Database db = dbs.get(i); Database db = dbs.get(i);
System.out.println("Testing the performance of " + db.getName() + System.out.println("Testing the performance of " + db.getName()
" (" + db.getThreadsCount() + " threads)"); + " (" + db.getThreadsCount() + " threads)");
db.startServer(); db.startServer();
Connection conn = db.openNewConnection(); Connection conn = db.openNewConnection();
DatabaseMetaData meta = conn.getMetaData(); DatabaseMetaData meta = conn.getMetaData();
......
...@@ -137,7 +137,8 @@ public class TestScript extends TestBase { ...@@ -137,7 +137,8 @@ public class TestScript extends TestBase {
private void testScript(String scriptFileName) throws Exception { private void testScript(String scriptFileName) throws Exception {
deleteDb("script"); deleteDb("script");
// Reset all the state in case there is anything left over from the previous file we processed. // Reset all the state in case there is anything left over from the previous file
// we processed.
conn = null; conn = null;
stat = null; stat = null;
in = null; in = null;
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
CREATE VIEW TEST_VIEW(A) AS SELECT 'a'; CREATE VIEW TEST_VIEW(A) AS SELECT 'a';
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
---------------- ----------------
--- ENUM support --- ENUM support
---------------- ----------------
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
call utf8tostring(decrypt('AES', '00000000000000000000000000000000', 'dbd42d55d4b923c4b03eba0396fac98e')); call utf8tostring(decrypt('AES', '00000000000000000000000000000000', 'dbd42d55d4b923c4b03eba0396fac98e'));
> 'Hello World Test' > 'Hello World Test'
> ------------------ > ------------------
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
call encrypt('AES', '00000000000000000000000000000000', stringtoutf8('Hello World Test')); call encrypt('AES', '00000000000000000000000000000000', stringtoutf8('Hello World Test'));
> X'dbd42d55d4b923c4b03eba0396fac98e' > X'dbd42d55d4b923c4b03eba0396fac98e'
> ----------------------------------- > -----------------------------------
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
call hash('SHA256', stringtoutf8('Hello'), 1); call hash('SHA256', stringtoutf8('Hello'), 1);
> X'185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969' > X'185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969'
> ------------------------------------------------------------------- > -------------------------------------------------------------------
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
-- Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create memory table test(id int primary key, name varchar(255)); create memory table test(id int primary key, name varchar(255));
> ok > ok
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论