提交 9b4ca4a4 authored 作者: StuMc's avatar StuMc 提交者: GitHub

Merge branch 'master' into Issue#628

...@@ -124,10 +124,10 @@ MERGE INTO TEST KEY(ID) VALUES(2, 'World') ...@@ -124,10 +124,10 @@ 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
......
...@@ -703,7 +703,7 @@ public class Parser { ...@@ -703,7 +703,7 @@ public class Parser {
return getSchema(schemaName); return getSchema(schemaName);
} }
/* /*
* Gets the current schema for scenarios that need a guranteed, non-null schema object. * Gets the current schema for scenarios that need a guaranteed, non-null schema object.
* *
* This routine is solely here * This routine is solely here
* because of the function readIdentifierWithSchema(String defaultSchemaName) - which * because of the function readIdentifierWithSchema(String defaultSchemaName) - which
...@@ -1138,9 +1138,13 @@ public class Parser { ...@@ -1138,9 +1138,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{
...@@ -1194,31 +1198,18 @@ public class Parser { ...@@ -1194,31 +1198,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;
} }
...@@ -3423,7 +3414,8 @@ public class Parser { ...@@ -3423,7 +3414,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,
...@@ -3536,7 +3528,7 @@ public class Parser { ...@@ -3536,7 +3528,7 @@ public class Parser {
return false; return false;
} }
private boolean equalsTokenIgnoreCase(String a, String b) { private static boolean equalsTokenIgnoreCase(String a, String b) {
if (a == null) { if (a == null) {
return b == null; return b == null;
} else if (a.equals(b)) { } else if (a.equals(b)) {
...@@ -5252,22 +5244,30 @@ public class Parser { ...@@ -5252,22 +5244,30 @@ 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,
List<Column> columnTemplateList = new ArrayList<Column>(); Query theQuery, String[] querySQLOutput) {
List<Column> columnTemplateList = new ArrayList<>();
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) {
...@@ -5277,6 +5277,7 @@ public class Parser { ...@@ -5277,6 +5277,7 @@ public class Parser {
String columnName = ColumnNamer.getColumnName(columnExp,i,cols).replace("\n", " ").replace("\r", " "); String columnName = ColumnNamer.getColumnName(columnExp,i,cols).replace("\n", " ").replace("\r", " ");
columnTemplateList.add(new Column(columnName, columnTemplateList.add(new Column(columnName,
columnExp.getType())); columnExp.getType()));
} }
return columnTemplateList; return columnTemplateList;
} }
......
...@@ -537,8 +537,8 @@ public class Session extends SessionWithState { ...@@ -537,8 +537,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) {
......
...@@ -23,7 +23,6 @@ import java.util.HashSet; ...@@ -23,7 +23,6 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.UUID; import java.util.UUID;
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;
...@@ -266,7 +265,7 @@ public class FullText { ...@@ -266,7 +265,7 @@ public class FullText {
removeAllTriggers(conn, TRIGGER_PREFIX); removeAllTriggers(conn, TRIGGER_PREFIX);
FullTextSettings setting = FullTextSettings.getInstance(conn); FullTextSettings setting = FullTextSettings.getInstance(conn);
setting.removeAllIndexes(); setting.removeAllIndexes();
setting.clearInored(); setting.clearIgnored();
setting.clearWordList(); setting.clearWordList();
} }
...@@ -796,8 +795,8 @@ public class FullText { ...@@ -796,8 +795,8 @@ public class FullText {
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()) {
...@@ -1151,8 +1150,8 @@ public class FullText { ...@@ -1151,8 +1150,8 @@ public class FullText {
return buff.toString(); return buff.toString();
} }
private PreparedStatement getStatement(Connection conn, int indx) throws SQLException { private PreparedStatement getStatement(Connection conn, int index) throws SQLException {
return useOwnConnection ? conn.prepareStatement(SQL[indx]) : prepStatements[indx]; return useOwnConnection ? conn.prepareStatement(SQL[index]) : prepStatements[index];
} }
} }
......
...@@ -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.
...@@ -347,8 +346,8 @@ public class FullTextLucene extends FullText { ...@@ -347,8 +346,8 @@ public class FullTextLucene extends FullText {
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,8 +428,8 @@ public class FullTextLucene extends FullText { ...@@ -429,8 +428,8 @@ 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);
...@@ -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);
} }
......
...@@ -13,7 +13,6 @@ import java.sql.Statement; ...@@ -13,7 +13,6 @@ import java.sql.Statement;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.h2.util.New; import org.h2.util.New;
import org.h2.util.SoftHashMap; import org.h2.util.SoftHashMap;
...@@ -69,7 +68,7 @@ final class FullTextSettings { ...@@ -69,7 +68,7 @@ final class FullTextSettings {
/** /**
* Clear set of ignored words * Clear set of ignored words
*/ */
public void clearInored() { public void clearIgnored() {
synchronized (ignoreList) { synchronized (ignoreList) {
ignoreList.clear(); ignoreList.clear();
} }
...@@ -274,7 +273,7 @@ final class FullTextSettings { ...@@ -274,7 +273,7 @@ final class FullTextSettings {
return whitespaceChars; return whitespaceChars;
} }
private String normalizeWord(String word) { private static String normalizeWord(String word) {
// TODO this is locale specific, document // TODO this is locale specific, document
return word.toUpperCase(); return word.toUpperCase();
} }
......
...@@ -81,7 +81,10 @@ public class TableView extends Table { ...@@ -81,7 +81,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 />
...@@ -100,7 +98,7 @@ public class CreateCluster extends Tool { ...@@ -100,7 +98,7 @@ public class CreateCluster extends Tool {
process(urlSource, urlTarget, user, password, serverList); process(urlSource, urlTarget, user, password, serverList);
} }
private void process(String urlSource, String urlTarget, private static void process(String urlSource, String urlTarget,
String user, String password, String serverList) throws SQLException { String user, String password, String serverList) throws SQLException {
Connection connSource = null, connTarget = null; Connection connSource = null, connTarget = null;
Statement statSource = null, statTarget = null; Statement statSource = null, statTarget = null;
...@@ -148,11 +146,15 @@ public class CreateCluster extends Tool { ...@@ -148,11 +146,15 @@ public class CreateCluster extends Tool {
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.
...@@ -169,6 +171,7 @@ public class CreateCluster extends Tool { ...@@ -169,6 +171,7 @@ public class CreateCluster extends Tool {
new Thread( new Thread(
new Runnable(){ new Runnable(){
@Override
public void run() { public void run() {
try { try {
while (rs.next()) { while (rs.next()) {
......
...@@ -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();
......
...@@ -168,7 +168,7 @@ public class TestSetCollation extends TestBase { ...@@ -168,7 +168,7 @@ public class TestSetCollation extends TestBase {
} }
} }
private void insertValues(Connection con, String[] values, int startId) throws SQLException { private static void insertValues(Connection con, String[] values, int startId) throws SQLException {
PreparedStatement ps = con.prepareStatement("INSERT INTO charsettable VALUES (?, ?)"); PreparedStatement ps = con.prepareStatement("INSERT INTO charsettable VALUES (?, ?)");
int id = startId; int id = startId;
for (String value : values) { for (String value : values) {
...@@ -179,7 +179,7 @@ public class TestSetCollation extends TestBase { ...@@ -179,7 +179,7 @@ public class TestSetCollation extends TestBase {
ps.close(); ps.close();
} }
private List<String> loadTableValues(Connection con) throws SQLException { private static List<String> loadTableValues(Connection con) throws SQLException {
List<String> results = new ArrayList<>(); List<String> results = new ArrayList<>();
Statement statement = con.createStatement(); Statement statement = con.createStatement();
ResultSet resultSet = statement.executeQuery("select testvalue from charsettable order by testvalue"); ResultSet resultSet = statement.executeQuery("select testvalue from charsettable order by testvalue");
......
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
*/ */
package org.h2.test.db; package org.h2.test.db;
import org.h2.engine.Constants;
import org.h2.jdbc.JdbcSQLException;
import org.h2.test.TestBase;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import org.h2.engine.Constants;
import org.h2.jdbc.JdbcSQLException;
import org.h2.test.TestBase;
/** /**
* Tests for table synonyms. * Tests for table synonyms.
...@@ -248,7 +247,7 @@ public class TestSynonymForTable extends TestBase { ...@@ -248,7 +247,7 @@ public class TestSynonymForTable extends TestBase {
conn.close(); conn.close();
} }
private void deleteFromSynonym(Connection conn, int id) throws SQLException { private static void deleteFromSynonym(Connection conn, int id) throws SQLException {
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"DELETE FROM testsynonym WHERE id = ?"); "DELETE FROM testsynonym WHERE id = ?");
prep.setInt(1, id); prep.setInt(1, id);
...@@ -307,21 +306,21 @@ public class TestSynonymForTable extends TestBase { ...@@ -307,21 +306,21 @@ public class TestSynonymForTable extends TestBase {
assertFalse(rs.next()); assertFalse(rs.next());
} }
private void insertIntoSynonym(Connection conn, int id) throws SQLException { private static void insertIntoSynonym(Connection conn, int id) throws SQLException {
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"INSERT INTO testsynonym VALUES(?)"); "INSERT INTO testsynonym VALUES(?)");
prep.setInt(1, id); prep.setInt(1, id);
prep.execute(); prep.execute();
} }
private void insertIntoBackingTable(Connection conn, int id) throws SQLException { private static void insertIntoBackingTable(Connection conn, int id) throws SQLException {
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"INSERT INTO backingtable VALUES(?)"); "INSERT INTO backingtable VALUES(?)");
prep.setInt(1, id); prep.setInt(1, id);
prep.execute(); prep.execute();
} }
private void createTableWithSynonym(Connection conn) throws SQLException { private static void createTableWithSynonym(Connection conn) throws SQLException {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("CREATE TABLE IF NOT EXISTS backingtable(id INT PRIMARY KEY)"); stat.execute("CREATE TABLE IF NOT EXISTS backingtable(id INT PRIMARY KEY)");
stat.execute("CREATE OR REPLACE SYNONYM testsynonym FOR backingtable"); stat.execute("CREATE OR REPLACE SYNONYM testsynonym FOR backingtable");
......
...@@ -5,6 +5,15 @@ ...@@ -5,6 +5,15 @@
*/ */
package org.h2.test.jdbc; package org.h2.test.jdbc;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.text.DecimalFormat;
import java.util.Locale;
import org.h2.api.CustomDataTypesHandler; import org.h2.api.CustomDataTypesHandler;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.message.DbException; import org.h2.message.DbException;
...@@ -20,16 +29,6 @@ import org.h2.value.ValueDouble; ...@@ -20,16 +29,6 @@ import org.h2.value.ValueDouble;
import org.h2.value.ValueJavaObject; import org.h2.value.ValueJavaObject;
import org.h2.value.ValueString; import org.h2.value.ValueString;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.text.DecimalFormat;
import java.util.Locale;
/** /**
* Tests {@link CustomDataTypesHandler}. * Tests {@link CustomDataTypesHandler}.
*/ */
...@@ -300,7 +299,7 @@ public class TestCustomDataTypesHandler extends TestBase { ...@@ -300,7 +299,7 @@ public class TestCustomDataTypesHandler extends TestBase {
} }
/** Constructs data type instance for complex number type */ /** Constructs data type instance for complex number type */
private DataType createComplex() { private static DataType createComplex() {
DataType result = new DataType(); DataType result = new DataType();
result.type = COMPLEX_DATA_TYPE_ID; result.type = COMPLEX_DATA_TYPE_ID;
result.name = COMPLEX_DATA_TYPE_NAME; result.name = COMPLEX_DATA_TYPE_NAME;
......
...@@ -115,7 +115,7 @@ public class TestScript extends TestBase { ...@@ -115,7 +115,7 @@ public class TestScript extends TestBase {
for (String s : new String[] { "array-contains", "array-get", for (String s : new String[] { "array-contains", "array-get",
"array-length", "autocommit", "cancel-session", "casewhen", "array-length", "autocommit", "cancel-session", "casewhen",
"cast", "coalesce", "convert", "csvread", "csvwrite", "currval", "cast", "coalesce", "convert", "csvread", "csvwrite", "currval",
"database-path", "datebase", "decode", "disk-space-used", "database-path", "database", "decode", "disk-space-used",
"file-read", "file-write", "greatest", "h2version", "identity", "file-read", "file-write", "greatest", "h2version", "identity",
"ifnull", "least", "link-schema", "lock-mode", "lock-timeout", "ifnull", "least", "link-schema", "lock-mode", "lock-timeout",
"memory-free", "memory-used", "nextval", "nullif", "nvl2", "memory-free", "memory-used", "nextval", "nullif", "nvl2",
...@@ -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
--
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论