提交 b6ee16fa authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 0677dc95
...@@ -36,7 +36,7 @@ public class FullTextSettings { ...@@ -36,7 +36,7 @@ public class FullTextSettings {
return ignoreList; return ignoreList;
} }
public HashMap getWordList() { HashMap getWordList() {
return words; return words;
} }
...@@ -48,7 +48,7 @@ public class FullTextSettings { ...@@ -48,7 +48,7 @@ public class FullTextSettings {
indexes.put(ObjectUtils.getLong(index.id), index); indexes.put(ObjectUtils.getLong(index.id), index);
} }
public String convertWord(String word) { String convertWord(String word) {
// TODO this is locale specific, document // TODO this is locale specific, document
word = word.toUpperCase(); word = word.toUpperCase();
if (ignoreList.contains(word)) { if (ignoreList.contains(word)) {
...@@ -79,19 +79,19 @@ public class FullTextSettings { ...@@ -79,19 +79,19 @@ public class FullTextSettings {
return path; return path;
} }
public PreparedStatement getPrepSelectMapByWordId() { PreparedStatement getPrepSelectMapByWordId() {
return prepSelectMapByWordId; return prepSelectMapByWordId;
} }
public void setPrepSelectMapByWordId(PreparedStatement prepSelectMapByWordId) { void setPrepSelectMapByWordId(PreparedStatement prepSelectMapByWordId) {
this.prepSelectMapByWordId = prepSelectMapByWordId; this.prepSelectMapByWordId = prepSelectMapByWordId;
} }
public PreparedStatement getPrepSelectRowById() { PreparedStatement getPrepSelectRowById() {
return prepSelectRowById; return prepSelectRowById;
} }
public void setPrepSelectRowById(PreparedStatement prepSelectRowById) { void setPrepSelectRowById(PreparedStatement prepSelectRowById) {
this.prepSelectRowById = prepSelectRowById; this.prepSelectRowById = prepSelectRowById;
} }
......
...@@ -31,11 +31,11 @@ public class BtreeHead extends Record { ...@@ -31,11 +31,11 @@ public class BtreeHead extends Record {
consistent = s.readInt() == 1; consistent = s.readInt() == 1;
} }
public boolean getConsistent() { boolean getConsistent() {
return consistent; return consistent;
} }
public void setConsistent(boolean b) { void setConsistent(boolean b) {
this.consistent = b; this.consistent = b;
} }
......
...@@ -138,7 +138,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader { ...@@ -138,7 +138,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
storage.addRecord(session, p, Storage.ALLOCATE_POS); storage.addRecord(session, p, Storage.ALLOCATE_POS);
} }
public BtreePage getPage(Session session, int i) throws SQLException { BtreePage getPage(Session session, int i) throws SQLException {
return (BtreePage) storage.getRecord(session, i); return (BtreePage) storage.getRecord(session, i);
} }
...@@ -280,7 +280,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader { ...@@ -280,7 +280,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
return rows; return rows;
} }
public Row getRow(Session session, int pos) throws SQLException { Row getRow(Session session, int pos) throws SQLException {
return tableData.getRow(session, pos); return tableData.getRow(session, pos);
} }
...@@ -316,7 +316,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader { ...@@ -316,7 +316,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
return needRebuild; return needRebuild;
} }
public int getRecordOverhead() { int getRecordOverhead() {
return storage.getRecordOverhead(); return storage.getRecordOverhead();
} }
......
...@@ -60,7 +60,7 @@ public class BtreeNode extends BtreePage { ...@@ -60,7 +60,7 @@ public class BtreeNode extends BtreePage {
this.pageData = pageData; this.pageData = pageData;
} }
protected SearchRow getData(int i) throws SQLException { SearchRow getData(int i) throws SQLException {
SearchRow r = (SearchRow) pageData.get(i); SearchRow r = (SearchRow) pageData.get(i);
if (r == null) { if (r == null) {
int p = pageChildren.get(i + 1); int p = pageChildren.get(i + 1);
......
...@@ -53,16 +53,34 @@ public class IndexCondition { ...@@ -53,16 +53,34 @@ public class IndexCondition {
private Expression expression; private Expression expression;
private int compareType; private int compareType;
/**
* Create an index condition with the given parameters.
*
* @param compareType the comparison type
* @param column the column
* @param expression the expression
*/
public IndexCondition(int compareType, ExpressionColumn column, Expression expression) { public IndexCondition(int compareType, ExpressionColumn column, Expression expression) {
this.compareType = compareType; this.compareType = compareType;
this.column = column == null ? null : column.getColumn(); this.column = column == null ? null : column.getColumn();
this.expression = expression; this.expression = expression;
} }
/**
* Get the current value of the expression.
*
* @param session the session
* @return the value
*/
public Value getCurrentValue(Session session) throws SQLException { public Value getCurrentValue(Session session) throws SQLException {
return expression.getValue(session); return expression.getValue(session);
} }
/**
* Get the SQL snippet of this comparison.
*
* @return the SQL snippet
*/
public String getSQL() { public String getSQL() {
if (compareType == Comparison.FALSE) { if (compareType == Comparison.FALSE) {
return "FALSE"; return "FALSE";
...@@ -92,6 +110,11 @@ public class IndexCondition { ...@@ -92,6 +110,11 @@ public class IndexCondition {
return buff.toString(); return buff.toString();
} }
/**
* Get the comparison bit mask.
*
* @return the mask
*/
public int getMask() { public int getMask() {
switch (compareType) { switch (compareType) {
case Comparison.FALSE: case Comparison.FALSE:
...@@ -109,10 +132,21 @@ public class IndexCondition { ...@@ -109,10 +132,21 @@ public class IndexCondition {
} }
} }
/**
* Check if the result is always false.
*
* @return true if the result will always be false
*/
public boolean isAlwaysFalse() { public boolean isAlwaysFalse() {
return compareType == Comparison.FALSE; return compareType == Comparison.FALSE;
} }
/**
* Check if this index condition is of the type column larger or equal to
* value.
*
* @return true if this is a start condition
*/
public boolean isStart() { public boolean isStart() {
switch (compareType) { switch (compareType) {
case Comparison.EQUAL: case Comparison.EQUAL:
...@@ -124,6 +158,12 @@ public class IndexCondition { ...@@ -124,6 +158,12 @@ public class IndexCondition {
} }
} }
/**
* Check if this index condition is of the type column smaller or equal to
* value.
*
* @return true if this is a end condition
*/
public boolean isEnd() { public boolean isEnd() {
switch (compareType) { switch (compareType) {
case Comparison.EQUAL: case Comparison.EQUAL:
...@@ -135,10 +175,20 @@ public class IndexCondition { ...@@ -135,10 +175,20 @@ public class IndexCondition {
} }
} }
/**
* Get the referenced column.
*
* @return the column
*/
public Column getColumn() { public Column getColumn() {
return column; return column;
} }
/**
* Check if the expression can be evaluated.
*
* @return true if it can be evaluated
*/
public boolean isEvaluatable() { public boolean isEvaluatable() {
return expression.isEverything(ExpressionVisitor.EVALUATABLE); return expression.isEverything(ExpressionVisitor.EVALUATABLE);
} }
......
...@@ -13,6 +13,13 @@ public class IndexType { ...@@ -13,6 +13,13 @@ public class IndexType {
private boolean isPrimaryKey, isPersistent, isUnique, isHash, isScan; private boolean isPrimaryKey, isPersistent, isUnique, isHash, isScan;
private boolean belongsToConstraint; private boolean belongsToConstraint;
/**
* Create a primary key index.
*
* @param persistent if the index is persistent
* @param hash if a hash index should be used
* @return the index type
*/
public static IndexType createPrimaryKey(boolean persistent, boolean hash) { public static IndexType createPrimaryKey(boolean persistent, boolean hash) {
IndexType type = new IndexType(); IndexType type = new IndexType();
type.isPrimaryKey = true; type.isPrimaryKey = true;
...@@ -22,6 +29,13 @@ public class IndexType { ...@@ -22,6 +29,13 @@ public class IndexType {
return type; return type;
} }
/**
* Create a unique index.
*
* @param persistent if the index is persistent
* @param hash if a hash index should be used
* @return the index type
*/
public static IndexType createUnique(boolean persistent, boolean hash) { public static IndexType createUnique(boolean persistent, boolean hash) {
IndexType type = new IndexType(); IndexType type = new IndexType();
type.isUnique = true; type.isUnique = true;
...@@ -30,12 +44,24 @@ public class IndexType { ...@@ -30,12 +44,24 @@ public class IndexType {
return type; return type;
} }
/**
* Create a non-unique index.
*
* @param persistent if the index is persistent
* @return the index type
*/
public static IndexType createNonUnique(boolean persistent) { public static IndexType createNonUnique(boolean persistent) {
IndexType type = new IndexType(); IndexType type = new IndexType();
type.isPersistent = persistent; type.isPersistent = persistent;
return type; return type;
} }
/**
* Create a scan pseudo-index.
*
* @param persistent if the index is persistent
* @return the index type
*/
public static IndexType createScan(boolean persistent) { public static IndexType createScan(boolean persistent) {
IndexType type = new IndexType(); IndexType type = new IndexType();
type.isPersistent = persistent; type.isPersistent = persistent;
...@@ -43,27 +69,66 @@ public class IndexType { ...@@ -43,27 +69,66 @@ public class IndexType {
return type; return type;
} }
/**
* Sets if this index belongs to a constraint.
*
* @param belongsToConstraint if the index belongs to a constraint
*/
public void setBelongsToConstraint(boolean belongsToConstraint) { public void setBelongsToConstraint(boolean belongsToConstraint) {
this.belongsToConstraint = belongsToConstraint; this.belongsToConstraint = belongsToConstraint;
} }
/**
* If the index is created because of a constraint. Such indexes are to be
* dropped once the constraint is dropped.
*
* @return if the index belongs to a constraint
*/
public boolean belongsToConstraint() { public boolean belongsToConstraint() {
return belongsToConstraint; return belongsToConstraint;
} }
/**
* Is this a hash index?
*
* @return true if it is a hash index
*/
public boolean isHash() { public boolean isHash() {
return isHash; return isHash;
} }
/**
* Is this index persistent?
*
* @return true if it is persistent
*/
public boolean isPersistent() { public boolean isPersistent() {
return isPersistent; return isPersistent;
} }
/**
* Does this index belong to a primary key constraint?
*
* @return true if it references a primary key constraint
*/
public boolean isPrimaryKey() { public boolean isPrimaryKey() {
return isPrimaryKey; return isPrimaryKey;
} }
/**
* Is this a unique index?
*
* @return true if it is
*/
public boolean isUnique() { public boolean isUnique() {
return isUnique; return isUnique;
} }
/**
* Get the SQL snipped to create such an index.
*
* @return the SQL snipped
*/
public String getSQL() { public String getSQL() {
StringBuffer buff = new StringBuffer(); StringBuffer buff = new StringBuffer();
if (isPrimaryKey) { if (isPrimaryKey) {
...@@ -83,6 +148,11 @@ public class IndexType { ...@@ -83,6 +148,11 @@ public class IndexType {
return buff.toString(); return buff.toString();
} }
/**
* Is this a table scan pseudo-index?
*
* @return true if it is
*/
public boolean isScan() { public boolean isScan() {
return isScan; return isScan;
} }
......
...@@ -193,6 +193,14 @@ public class LinkedIndex extends BaseIndex { ...@@ -193,6 +193,14 @@ public class LinkedIndex extends BaseIndex {
} }
} }
/**
* Update a row using a UPDATE statement. This method is to be called if the
* emit updates option is enabled.
*
* @param session the session
* @param oldRow the old data
* @param newRow the new data
*/
public void update(Session session, Row oldRow, Row newRow) throws SQLException { public void update(Session session, Row oldRow, Row newRow) throws SQLException {
StringBuffer buff = new StringBuffer("UPDATE "); StringBuffer buff = new StringBuffer("UPDATE ");
buff.append(targetTableName).append(" SET "); buff.append(targetTableName).append(" SET ");
......
...@@ -92,6 +92,13 @@ public class ScanIndex extends BaseIndex { ...@@ -92,6 +92,13 @@ public class ScanIndex extends BaseIndex {
} }
} }
/**
* Get the row at the given position.
*
* @param session the session
* @param key the position
* @return the row
*/
public Row getRow(Session session, int key) throws SQLException { public Row getRow(Session session, int key) throws SQLException {
if (storage != null) { if (storage != null) {
return (Row) storage.getRecord(session, key); return (Row) storage.getRecord(session, key);
......
...@@ -329,7 +329,7 @@ public class TreeIndex extends BaseIndex { ...@@ -329,7 +329,7 @@ public class TreeIndex extends BaseIndex {
return x; return x;
} }
public TreeNode previous(TreeNode x) { TreeNode previous(TreeNode x) {
if (x == null) { if (x == null) {
return null; return null;
} }
......
...@@ -1761,6 +1761,25 @@ Aggregates are only allowed in select statements. ...@@ -1761,6 +1761,25 @@ Aggregates are only allowed in select statements.
"," ","
AVG(X) AVG(X)
" "
"Functions (Aggregate)","BOOL_AND","
BOOL_AND(boolean): boolean
","
Returns true if all expressions are true.
Aggregates are only allowed in select statements.
","
BOOL_AND(ID>10)
"
"Functions (Aggregate)","BOOL_OR","
BOOL_OR(boolean): boolean
","
Returns true if any expression is true.
Aggregates are only allowed in select statements.
","
BOOL_OR(NAME LIKE 'W%')
"
"Functions (Aggregate)","COUNT"," "Functions (Aggregate)","COUNT","
COUNT(*) | COUNT([DISTINCT] expression): int COUNT(*) | COUNT([DISTINCT] expression): int
"," ","
...@@ -1769,6 +1788,7 @@ Aggregates are only allowed in select statements. ...@@ -1769,6 +1788,7 @@ Aggregates are only allowed in select statements.
"," ","
COUNT(*) COUNT(*)
" "
"Functions (Aggregate)","GROUP_CONCAT"," "Functions (Aggregate)","GROUP_CONCAT","
GROUP_CONCAT([DISTINCT] string [ORDER BY {expression [ASC|DESC]}[,...]] [SEPARATOR expression]): string GROUP_CONCAT([DISTINCT] string [ORDER BY {expression [ASC|DESC]}[,...]] [SEPARATOR expression]): string
"," ","
...@@ -1777,6 +1797,7 @@ Aggregates are only allowed in select statements. ...@@ -1777,6 +1797,7 @@ Aggregates are only allowed in select statements.
"," ","
GROUP_CONCAT(NAME ORDER BY ID SEPARATOR ', ') GROUP_CONCAT(NAME ORDER BY ID SEPARATOR ', ')
" "
"Functions (Aggregate)","MAX"," "Functions (Aggregate)","MAX","
MAX(value): value MAX(value): value
"," ","
...@@ -1785,6 +1806,7 @@ Aggregates are only allowed in select statements. ...@@ -1785,6 +1806,7 @@ Aggregates are only allowed in select statements.
"," ","
MAX(NAME) MAX(NAME)
" "
"Functions (Aggregate)","MIN"," "Functions (Aggregate)","MIN","
MIN(value): value MIN(value): value
"," ","
...@@ -1793,6 +1815,7 @@ Aggregates are only allowed in select statements. ...@@ -1793,6 +1815,7 @@ Aggregates are only allowed in select statements.
"," ","
MIN(NAME) MIN(NAME)
" "
"Functions (Aggregate)","SUM"," "Functions (Aggregate)","SUM","
SUM([DISTINCT] {int | long | decimal | double}): value SUM([DISTINCT] {int | long | decimal | double}): value
"," ","
...@@ -1801,6 +1824,7 @@ Aggregates are only allowed in select statements. ...@@ -1801,6 +1824,7 @@ Aggregates are only allowed in select statements.
"," ","
SUM(X) SUM(X)
" "
"Functions (Aggregate)","SELECTIVITY"," "Functions (Aggregate)","SELECTIVITY","
SELECTIVITY(value): int SELECTIVITY(value): int
"," ","
...@@ -1812,6 +1836,7 @@ Aggregates are only allowed in select statements. ...@@ -1812,6 +1836,7 @@ Aggregates are only allowed in select statements.
"," ","
SELECT SELECTIVITY(FIRSTNAME), SELECTIVITY(NAME) FROM TEST WHERE ROWNUM()<100000 SELECT SELECTIVITY(FIRSTNAME), SELECTIVITY(NAME) FROM TEST WHERE ROWNUM()<100000
" "
"Functions (Aggregate)","STDDEV_POP"," "Functions (Aggregate)","STDDEV_POP","
STDDEV_POP([DISTINCT] double): double STDDEV_POP([DISTINCT] double): double
"," ","
...@@ -1820,6 +1845,7 @@ Aggregates are only allowed in select statements. ...@@ -1820,6 +1845,7 @@ Aggregates are only allowed in select statements.
"," ","
STDDEV_POP(X) STDDEV_POP(X)
" "
"Functions (Aggregate)","STDDEV_SAMP"," "Functions (Aggregate)","STDDEV_SAMP","
STDDEV_SAMP([DISTINCT] double): double STDDEV_SAMP([DISTINCT] double): double
"," ","
...@@ -1828,6 +1854,7 @@ Aggregates are only allowed in select statements. ...@@ -1828,6 +1854,7 @@ Aggregates are only allowed in select statements.
"," ","
STDDEV(X) STDDEV(X)
" "
"Functions (Aggregate)","VAR_POP"," "Functions (Aggregate)","VAR_POP","
VAR_POP([DISTINCT] double): double VAR_POP([DISTINCT] double): double
"," ","
...@@ -1836,6 +1863,7 @@ Aggregates are only allowed in select statements. ...@@ -1836,6 +1863,7 @@ Aggregates are only allowed in select statements.
"," ","
VAR_POP(X) VAR_POP(X)
" "
"Functions (Aggregate)","VAR_SAMP"," "Functions (Aggregate)","VAR_SAMP","
VAR_SAMP([DISTINCT] double): double VAR_SAMP([DISTINCT] double): double
"," ","
......
...@@ -31,15 +31,32 @@ import org.h2.util.SortedProperties; ...@@ -31,15 +31,32 @@ import org.h2.util.SortedProperties;
/** /**
* The file lock is used to lock a database so that only one process can write * The file lock is used to lock a database so that only one process can write
* to it. Usually a .lock.db file is used, but locking by creating a socket is * to it. It uses a cooperative locking protocol. Usually a .lock.db file is
* supported as well. * used, but locking by creating a socket is supported as well.
*/ */
public class FileLock { public class FileLock {
/**
* This locking method means no locking is used at all.
*/
public static final int LOCK_NO = 0;
public static final int LOCK_NO = 0, LOCK_FILE = 1, LOCK_SOCKET = 2; /**
* This locking method means the cooperative file locking protocol should be
* used.
*/
public static final int LOCK_FILE = 1;
/**
* This locking method means a socket is created on the given machine.
*/
public static final int LOCK_SOCKET = 2;
// TODO lock: maybe not so secure! what if tread does not have chance to run? // TODO lock: maybe not so secure! what if tread does not have chance to run?
// TODO lock: implement locking method using java 1.4 FileLock // TODO lock: implement locking method using java 1.4 FileLock
// TODO log / messages: use translatable messages
// private java.nio.channels.FileLock fileLock;
private static final String MAGIC = "FileLock"; private static final String MAGIC = "FileLock";
private static final String FILE = "file", SOCKET = "socket"; private static final String FILE = "file", SOCKET = "socket";
private static final int RANDOM_BYTES = 16; private static final int RANDOM_BYTES = 16;
...@@ -56,13 +73,25 @@ public class FileLock { ...@@ -56,13 +73,25 @@ public class FileLock {
private boolean locked; private boolean locked;
private Trace trace; private Trace trace;
// private java.nio.channels.FileLock fileLock; /**
* Create a new file locking object.
*
* @param traceSystem the trace system to use
* @param sleep the number of milliseconds to sleep
*/
public FileLock(TraceSystem traceSystem, int sleep) { public FileLock(TraceSystem traceSystem, int sleep) {
this.trace = traceSystem.getTrace(Trace.FILE_LOCK); this.trace = traceSystem.getTrace(Trace.FILE_LOCK);
this.sleep = sleep; this.sleep = sleep;
} }
/**
* Lock the file if possible. A file may only be locked once.
*
* @param fileName the name of the properties file to use
* @param allowSocket if the socket locking protocol should be used if
* possible
* @throws SQLException if locking was not successful
*/
public synchronized void lock(String fileName, boolean allowSocket) throws SQLException { public synchronized void lock(String fileName, boolean allowSocket) throws SQLException {
this.fs = FileSystem.getInstance(fileName); this.fs = FileSystem.getInstance(fileName);
this.fileName = fileName; this.fileName = fileName;
...@@ -76,24 +105,11 @@ public class FileLock { ...@@ -76,24 +105,11 @@ public class FileLock {
} }
locked = true; locked = true;
} }
protected void finalize() { /**
if (!SysProperties.runFinalize) { * Unlock the file. The watchdog thread is stopped. This method does nothing
return; * if the file is already unlocked.
} */
if (locked) {
unlock();
}
}
// void kill() {
// socket = null;
// file = null;
// locked = false;
// trace("killed", null);
// }
// TODO log / messages: use translatable messages!
public synchronized void unlock() { public synchronized void unlock() {
if (!locked) { if (!locked) {
return; return;
...@@ -115,7 +131,26 @@ public class FileLock { ...@@ -115,7 +131,26 @@ public class FileLock {
locked = false; locked = false;
} }
void save() throws SQLException { /**
* This finalizer unlocks the file if necessary.
*/
protected void finalize() {
if (!SysProperties.runFinalize) {
return;
}
if (locked) {
unlock();
}
}
// void kill() {
// socket = null;
// file = null;
// locked = false;
// trace("killed", null);
// }
private void save() throws SQLException {
try { try {
OutputStream out = fs.openFileOutputStream(fileName, false); OutputStream out = fs.openFileOutputStream(fileName, false);
try { try {
...@@ -317,6 +352,13 @@ public class FileLock { ...@@ -317,6 +352,13 @@ public class FileLock {
return Message.getSQLException(ErrorCode.DATABASE_ALREADY_OPEN_1, reason); return Message.getSQLException(ErrorCode.DATABASE_ALREADY_OPEN_1, reason);
} }
/**
* Get the file locking method type given a method name.
*
* @param method the method name
* @return the method type
* @throws SQLException if the method name is unknown
*/
public static int getFileLockMethod(String method) throws SQLException { public static int getFileLockMethod(String method) throws SQLException {
if (method == null || method.equalsIgnoreCase("FILE")) { if (method == null || method.equalsIgnoreCase("FILE")) {
return FileLock.LOCK_FILE; return FileLock.LOCK_FILE;
......
...@@ -160,46 +160,15 @@ java org.h2.test.TestAll timer ...@@ -160,46 +160,15 @@ java org.h2.test.TestAll timer
/* /*
create table test(d number(1, -84));
MySQL:
CREATE TABLE user (
id int(25) NOT NULL auto_increment,
name varchar(25) NOT NULL,
PRIMARY KEY (id,name)
)
I've created a linked table to an oracle database, and tried:
create table person as select * from ora_person
This gives me:
Invalid value -127 for parameter scale [90008-71] 90008/90008
Doing a column-by-column select, I get the exception when I try to
create table as select one of the NUMBER fields with unspecified
lengths.
Here's a simpler example:
create table t as select sysadmin from ora_person;
(sysadmin is a NUMBER column)
This works:
create table t as select cast(sysadmin as int) sysadmin from
ora_person
But, it's clunky. Is this something that can be fixed in a future
version?
download PostgreSQL docs download PostgreSQL docs
BIT_AND, BIT_OR, BIT_XOR
SOME, EVERY: HSQLDB compatibility
add tests for SOME, EVERY (SOME is used in Parser.java
for something else; test this; maybe use BOOL_AND / BOOL_OR)
document SOME, EVERY
in help.csv, use complete examples for functions; add a test case in help.csv, use complete examples for functions; add a test case
upload and test javadoc/index.html upload and test javadoc/index.html
improve javadocs improve javadocs
write complete page right after checkpoint option to write complete page right after checkpoint
upload jazoon upload jazoon
...@@ -254,6 +223,10 @@ History: ...@@ -254,6 +223,10 @@ History:
Roadmap: Roadmap:
Negative scale values for DECIMAL or NUMBER columns are not supported Negative scale values for DECIMAL or NUMBER columns are not supported
in regular tables and in linked tables. in regular tables and in linked tables.
MySQL compatibility: auto_increment column are no longer automatically
converted to primary key columns.
PostgreSQL compatibility: support for BOOL_OR and BOOL_AND
aggregate functions.
*/ */
if (args.length > 0) { if (args.length > 0) {
......
--- special grammar and test cases --------------------------------------------------------------------------------------------- --- special grammar and test cases ---------------------------------------------------------------------------------------------
CREATE TABLE test (id int(25) NOT NULL auto_increment, name varchar NOT NULL, PRIMARY KEY (id,name));
> ok
drop table test;
> ok
CREATE MEMORY TABLE TEST(ID INT, D DOUBLE, F FLOAT); CREATE MEMORY TABLE TEST(ID INT, D DOUBLE, F FLOAT);
> ok > ok
...@@ -6734,9 +6740,9 @@ select * from s; ...@@ -6734,9 +6740,9 @@ select * from s;
> rows: 1 > rows: 1
select some(y>10), every(y>10), min(y), max(y) from t; select some(y>10), every(y>10), min(y), max(y) from t;
> SOME(Y > 10.0) EVERY(Y > 10.0) MIN(Y) MAX(Y) > BOOL_OR(Y > 10.0) BOOL_AND(Y > 10.0) MIN(Y) MAX(Y)
> -------------- --------------- ------ ------ > ----------------- ------------------ ------ ------
> null null null null > null null null null
> rows: 1 > rows: 1
insert into t values(1000000004, 4); insert into t values(1000000004, 4);
...@@ -6792,9 +6798,9 @@ stddev_pop(distinct y) s_py, stddev_samp(distinct y) s_sy, var_pop(distinct y) v ...@@ -6792,9 +6798,9 @@ stddev_pop(distinct y) s_py, stddev_samp(distinct y) s_sy, var_pop(distinct y) v
> rows: 1 > rows: 1
select some(y>10), every(y>10), min(y), max(y) from t; select some(y>10), every(y>10), min(y), max(y) from t;
> SOME(Y > 10.0) EVERY(Y > 10.0) MIN(Y) MAX(Y) > BOOL_OR(Y > 10.0) BOOL_AND(Y > 10.0) MIN(Y) MAX(Y)
> -------------- --------------- ------ ------ > ----------------- ------------------ ------ ------
> TRUE FALSE 4.0 16.0 > TRUE FALSE 4.0 16.0
> rows: 1 > rows: 1
drop view s; drop view s;
......
SELECT SOME(X>4) FROM SYSTEM_RANGE(1,6);
> TRUE;
SELECT EVERY(X>4) FROM SYSTEM_RANGE(1,6);
> FALSE;
SELECT BOOL_OR(X>4) FROM SYSTEM_RANGE(1,6);
> TRUE;
SELECT BOOL_AND(X>4) FROM SYSTEM_RANGE(1,6);
> FALSE;
CREATE TABLE TEST(ID IDENTITY); CREATE TABLE TEST(ID IDENTITY);
ALTER TABLE TEST ALTER COLUMN ID RESTART WITH ? {1:10}; ALTER TABLE TEST ALTER COLUMN ID RESTART WITH ? {1:10};
INSERT INTO TEST VALUES(NULL); INSERT INTO TEST VALUES(NULL);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论