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

Data types.

上级 39085e19
......@@ -10,15 +10,13 @@ import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Types;
import org.h2.value.DataType;
/**
* A column of a table.
*/
class Column {
private static final int[] TYPES = { Types.INTEGER, Types.VARCHAR, Types.DECIMAL, Types.DATE, Types.TIME,
Types.TIMESTAMP, DataType.TYPE_BOOLEAN, Types.BINARY, Types.VARBINARY, Types.CLOB, Types.BLOB,
Types.TIMESTAMP, Types.BOOLEAN, Types.BINARY, Types.VARBINARY, Types.CLOB, Types.BLOB,
Types.DOUBLE, Types.BIGINT, Types.TIMESTAMP, Types.BIT, };
private TestSynth config;
......@@ -61,7 +59,7 @@ class Column {
case Types.REAL:
case Types.OTHER:
case Types.BIT:
case DataType.TYPE_BOOLEAN:
case Types.BOOLEAN:
break;
default:
throw new AssertionError("type=" + type);
......@@ -92,7 +90,7 @@ class Column {
case Types.TIMESTAMP:
case Types.DOUBLE:
case Types.BIGINT:
case DataType.TYPE_BOOLEAN:
case Types.BOOLEAN:
case Types.BIT:
return true;
case Types.BINARY:
......@@ -151,7 +149,7 @@ class Column {
return "DOUBLE";
case Types.BIGINT:
return "BIGINT";
case DataType.TYPE_BOOLEAN:
case Types.BOOLEAN:
case Types.BIT:
return "BOOLEAN";
default:
......
......@@ -15,8 +15,6 @@ import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import org.h2.value.DataType;
/**
* Represents a simple value.
*/
......@@ -65,7 +63,7 @@ public class Value {
return getTimeSQL((Time) data);
case Types.TIMESTAMP:
return getTimestampSQL((Timestamp) data);
case DataType.TYPE_BOOLEAN:
case Types.BOOLEAN:
case Types.BIT:
return (String) data;
default:
......@@ -184,7 +182,7 @@ public class Value {
case Types.NULL:
data = null;
break;
case DataType.TYPE_BOOLEAN:
case Types.BOOLEAN:
case Types.BIT:
data = rs.getBoolean(index) ? "TRUE" : "FALSE";
break;
......@@ -243,7 +241,7 @@ public class Value {
case Types.INTEGER:
data = randomInt(config);
break;
case DataType.TYPE_BOOLEAN:
case Types.BOOLEAN:
case Types.BIT:
data = config.random().getBoolean(50) ? "TRUE" : "FALSE";
break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论