Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
40fbf134
提交
40fbf134
authored
8月 10, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Parse BINARY VARYING, BINARY LARGE OBJECT, and CHARACTER LARGE OBJECT
上级
bb8a5362
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
136 行增加
和
15 行删除
+136
-15
help.csv
h2/src/docsrc/help/help.csv
+7
-4
Parser.java
h2/src/main/org/h2/command/Parser.java
+16
-6
DataType.java
h2/src/main/org/h2/value/DataType.java
+5
-5
binary.sql
h2/src/test/org/h2/test/scripts/datatypes/binary.sql
+19
-0
blob.sql
h2/src/test/org/h2/test/scripts/datatypes/blob.sql
+19
-0
char.sql
h2/src/test/org/h2/test/scripts/datatypes/char.sql
+15
-0
clob.sql
h2/src/test/org/h2/test/scripts/datatypes/clob.sql
+21
-0
varchar-ignorecase.sql
...test/org/h2/test/scripts/datatypes/varchar-ignorecase.sql
+13
-0
varchar.sql
h2/src/test/org/h2/test/scripts/datatypes/varchar.sql
+21
-0
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
40fbf134
...
@@ -2757,7 +2757,8 @@ TIMESTAMP WITH TIME ZONE
...
@@ -2757,7 +2757,8 @@ TIMESTAMP WITH TIME ZONE
"
"
"Data Types","BINARY Type","
"Data Types","BINARY Type","
{ BINARY | VARBINARY | LONGVARBINARY | RAW | BYTEA }
{ BINARY | VARBINARY | BINARY VARYING
| LONGVARBINARY | RAW | BYTEA }
[ ( precisionInt ) ]
[ ( precisionInt ) ]
","
","
Represents a byte array. For very long arrays, use BLOB.
Represents a byte array. For very long arrays, use BLOB.
...
@@ -2786,7 +2787,7 @@ OTHER
...
@@ -2786,7 +2787,7 @@ OTHER
"
"
"Data Types","VARCHAR Type","
"Data Types","VARCHAR Type","
{ VARCHAR | LONGVARCHAR | VARCHAR2 | NVARCHAR
{ VARCHAR |
CHARACTER VARYING |
LONGVARCHAR | VARCHAR2 | NVARCHAR
| NVARCHAR2 | VARCHAR_CASESENSITIVE} [ ( precisionInt ) ]
| NVARCHAR2 | VARCHAR_CASESENSITIVE} [ ( precisionInt ) ]
","
","
A Unicode String.
A Unicode String.
...
@@ -2839,7 +2840,8 @@ CHAR(10)
...
@@ -2839,7 +2840,8 @@ CHAR(10)
"
"
"Data Types","BLOB Type","
"Data Types","BLOB Type","
{ BLOB | TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID }
{ BLOB | BINARY LARGE OBJECT
| TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID }
[ ( precisionInt ) ]
[ ( precisionInt ) ]
","
","
Like BINARY, but intended for very large values such as files or images. Unlike
Like BINARY, but intended for very large values such as files or images. Unlike
...
@@ -2853,7 +2855,8 @@ BLOB
...
@@ -2853,7 +2855,8 @@ BLOB
"
"
"Data Types","CLOB Type","
"Data Types","CLOB Type","
{ CLOB | TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB }
{ CLOB | CHARACTER LARGE OBJECT
| TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB }
[ ( precisionInt ) ]
[ ( precisionInt ) ]
","
","
CLOB is like VARCHAR, but intended for very large values. Unlike when using
CLOB is like VARCHAR, but intended for very large values. Unlike when using
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
40fbf134
...
@@ -4688,15 +4688,25 @@ public class Parser {
...
@@ -4688,15 +4688,25 @@ public class Parser {
int
originalScale
=
-
1
;
int
originalScale
=
-
1
;
if
(
readIf
(
"LONG"
))
{
if
(
readIf
(
"LONG"
))
{
if
(
readIf
(
"RAW"
))
{
if
(
readIf
(
"RAW"
))
{
original
+=
"
RAW"
;
original
=
"LONG
RAW"
;
}
}
}
else
if
(
readIf
(
"DOUBLE"
))
{
}
else
if
(
readIf
(
"DOUBLE"
))
{
if
(
readIf
(
"PRECISION"
))
{
if
(
readIf
(
"PRECISION"
))
{
original
+=
"
PRECISION"
;
original
=
"DOUBLE
PRECISION"
;
}
}
}
else
if
(
readIf
(
"CHARACTER"
))
{
}
else
if
(
readIf
(
"CHARACTER"
))
{
if
(
readIf
(
"VARYING"
))
{
if
(
readIf
(
"VARYING"
))
{
original
+=
" VARYING"
;
original
=
"CHARACTER VARYING"
;
}
else
if
(
readIf
(
"LARGE"
))
{
read
(
"OBJECT"
);
original
=
"CHARACTER LARGE OBJECT"
;
}
}
else
if
(
readIf
(
"BINARY"
))
{
if
(
readIf
(
"VARYING"
))
{
original
=
"BINARY VARYING"
;
}
else
if
(
readIf
(
"LARGE"
))
{
read
(
"OBJECT"
);
original
=
"BINARY LARGE OBJECT"
;
}
}
}
else
if
(
readIf
(
"TIME"
))
{
}
else
if
(
readIf
(
"TIME"
))
{
if
(
readIf
(
OPEN_PAREN
))
{
if
(
readIf
(
OPEN_PAREN
))
{
...
@@ -4709,7 +4719,7 @@ public class Parser {
...
@@ -4709,7 +4719,7 @@ public class Parser {
if
(
readIf
(
"WITHOUT"
))
{
if
(
readIf
(
"WITHOUT"
))
{
read
(
"TIME"
);
read
(
"TIME"
);
read
(
"ZONE"
);
read
(
"ZONE"
);
original
+=
"
WITHOUT TIME ZONE"
;
original
=
"TIME
WITHOUT TIME ZONE"
;
}
}
}
else
if
(
readIf
(
"TIMESTAMP"
))
{
}
else
if
(
readIf
(
"TIMESTAMP"
))
{
if
(
readIf
(
OPEN_PAREN
))
{
if
(
readIf
(
OPEN_PAREN
))
{
...
@@ -4726,11 +4736,11 @@ public class Parser {
...
@@ -4726,11 +4736,11 @@ public class Parser {
if
(
readIf
(
WITH
))
{
if
(
readIf
(
WITH
))
{
read
(
"TIME"
);
read
(
"TIME"
);
read
(
"ZONE"
);
read
(
"ZONE"
);
original
+=
"
WITH TIME ZONE"
;
original
=
"TIMESTAMP
WITH TIME ZONE"
;
}
else
if
(
readIf
(
"WITHOUT"
))
{
}
else
if
(
readIf
(
"WITHOUT"
))
{
read
(
"TIME"
);
read
(
"TIME"
);
read
(
"ZONE"
);
read
(
"ZONE"
);
original
+=
"
WITHOUT TIME ZONE"
;
original
=
"TIMESTAMP
WITHOUT TIME ZONE"
;
}
}
}
else
{
}
else
{
regular
=
true
;
regular
=
true
;
...
...
h2/src/main/org/h2/value/DataType.java
浏览文件 @
40fbf134
...
@@ -192,8 +192,8 @@ public class DataType {
...
@@ -192,8 +192,8 @@ public class DataType {
);
);
add
(
Value
.
STRING
,
Types
.
VARCHAR
,
add
(
Value
.
STRING
,
Types
.
VARCHAR
,
createString
(
true
),
createString
(
true
),
new
String
[]{
"VARCHAR"
,
"VARCHAR2"
,
"NVARCHAR"
,
"NVARCHAR2"
,
new
String
[]{
"VARCHAR"
,
"
CHARACTER VARYING"
,
"
VARCHAR2"
,
"NVARCHAR"
,
"NVARCHAR2"
,
"VARCHAR_CASESENSITIVE"
,
"
CHARACTER VARYING"
,
"
TID"
},
"VARCHAR_CASESENSITIVE"
,
"TID"
},
// 24 for ValueString, 24 for String
// 24 for ValueString, 24 for String
48
48
);
);
...
@@ -319,7 +319,7 @@ public class DataType {
...
@@ -319,7 +319,7 @@ public class DataType {
);
);
add
(
Value
.
BYTES
,
Types
.
VARBINARY
,
add
(
Value
.
BYTES
,
Types
.
VARBINARY
,
createString
(
false
),
createString
(
false
),
new
String
[]{
"VARBINARY"
},
new
String
[]{
"VARBINARY"
,
"BINARY VARYING"
},
32
32
);
);
add
(
Value
.
BYTES
,
Types
.
BINARY
,
add
(
Value
.
BYTES
,
Types
.
BINARY
,
...
@@ -345,14 +345,14 @@ public class DataType {
...
@@ -345,14 +345,14 @@ public class DataType {
);
);
add
(
Value
.
BLOB
,
Types
.
BLOB
,
add
(
Value
.
BLOB
,
Types
.
BLOB
,
createLob
(),
createLob
(),
new
String
[]{
"BLOB"
,
"TINYBLOB"
,
"MEDIUMBLOB"
,
new
String
[]{
"BLOB"
,
"
BINARY LARGE OBJECT"
,
"
TINYBLOB"
,
"MEDIUMBLOB"
,
"LONGBLOB"
,
"IMAGE"
,
"OID"
},
"LONGBLOB"
,
"IMAGE"
,
"OID"
},
// 80 for ValueLob, 24 for String
// 80 for ValueLob, 24 for String
104
104
);
);
add
(
Value
.
CLOB
,
Types
.
CLOB
,
add
(
Value
.
CLOB
,
Types
.
CLOB
,
createLob
(),
createLob
(),
new
String
[]{
"CLOB"
,
"TINYTEXT"
,
"TEXT"
,
"MEDIUMTEXT"
,
new
String
[]{
"CLOB"
,
"
CHARACTER LARGE OBJECT"
,
"
TINYTEXT"
,
"TEXT"
,
"MEDIUMTEXT"
,
"LONGTEXT"
,
"NTEXT"
,
"NCLOB"
},
"LONGTEXT"
,
"NTEXT"
,
"NCLOB"
},
// 80 for ValueLob, 24 for String
// 80 for ValueLob, 24 for String
104
104
...
...
h2/src/test/org/h2/test/scripts/datatypes/binary.sql
浏览文件 @
40fbf134
...
@@ -2,3 +2,22 @@
...
@@ -2,3 +2,22 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
B1
VARBINARY
,
B2
BINARY
VARYING
,
B3
BINARY
,
B4
RAW
,
B5
BYTEA
,
B6
LONG
RAW
,
B7
LONGVARBINARY
);
>
ok
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
>
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_TYPE
>
----------- --------- --------- --------------
>
B1
-
3
VARBINARY
VARBINARY
>
B2
-
3
VARBINARY
BINARY
VARYING
>
B3
-
3
VARBINARY
BINARY
>
B4
-
3
VARBINARY
RAW
>
B5
-
3
VARBINARY
BYTEA
>
B6
-
3
VARBINARY
LONG
RAW
>
B7
-
3
VARBINARY
LONGVARBINARY
>
rows
(
ordered
):
7
DROP
TABLE
TEST
;
>
ok
h2/src/test/org/h2/test/scripts/datatypes/blob.sql
浏览文件 @
40fbf134
...
@@ -2,3 +2,22 @@
...
@@ -2,3 +2,22 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
B1
BLOB
,
B2
BINARY
LARGE
OBJECT
,
B3
TINYBLOB
,
B4
MEDIUMBLOB
,
B5
LONGBLOB
,
B6
IMAGE
,
B7
OID
);
>
ok
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
>
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_TYPE
>
----------- --------- --------- -------------------
>
B1
2004
BLOB
BLOB
>
B2
2004
BLOB
BINARY
LARGE
OBJECT
>
B3
2004
BLOB
TINYBLOB
>
B4
2004
BLOB
MEDIUMBLOB
>
B5
2004
BLOB
LONGBLOB
>
B6
2004
BLOB
IMAGE
>
B7
2004
BLOB
OID
>
rows
(
ordered
):
7
DROP
TABLE
TEST
;
>
ok
h2/src/test/org/h2/test/scripts/datatypes/char.sql
浏览文件 @
40fbf134
...
@@ -2,3 +2,18 @@
...
@@ -2,3 +2,18 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
C1
CHAR
,
C2
CHARACTER
,
C3
NCHAR
);
>
ok
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
>
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_TYPE
>
----------- --------- --------- -----------
>
C1
1
CHAR
CHAR
>
C2
1
CHAR
CHARACTER
>
C3
1
CHAR
NCHAR
>
rows
(
ordered
):
3
DROP
TABLE
TEST
;
>
ok
h2/src/test/org/h2/test/scripts/datatypes/clob.sql
浏览文件 @
40fbf134
...
@@ -2,3 +2,24 @@
...
@@ -2,3 +2,24 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
C1
CLOB
,
C2
CHARACTER
LARGE
OBJECT
,
C3
TINYTEXT
,
C4
TEXT
,
C5
MEDIUMTEXT
,
C6
LONGTEXT
,
C7
NTEXT
,
C8
NCLOB
);
>
ok
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
>
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_TYPE
>
----------- --------- --------- ----------------------
>
C1
2005
CLOB
CLOB
>
C2
2005
CLOB
CHARACTER
LARGE
OBJECT
>
C3
2005
CLOB
TINYTEXT
>
C4
2005
CLOB
TEXT
>
C5
2005
CLOB
MEDIUMTEXT
>
C6
2005
CLOB
LONGTEXT
>
C7
2005
CLOB
NTEXT
>
C8
2005
CLOB
NCLOB
>
rows
(
ordered
):
8
DROP
TABLE
TEST
;
>
ok
h2/src/test/org/h2/test/scripts/datatypes/varchar-ignorecase.sql
浏览文件 @
40fbf134
...
@@ -2,3 +2,16 @@
...
@@ -2,3 +2,16 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
C1
VARCHAR_IGNORECASE
);
>
ok
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
>
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_TYPE
>
----------- --------- ------------------ ------------------
>
C1
12
VARCHAR_IGNORECASE
VARCHAR_IGNORECASE
>
rows
(
ordered
):
1
DROP
TABLE
TEST
;
>
ok
h2/src/test/org/h2/test/scripts/datatypes/varchar.sql
浏览文件 @
40fbf134
...
@@ -2,3 +2,24 @@
...
@@ -2,3 +2,24 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
C1
VARCHAR
,
C2
CHARACTER
VARYING
,
C3
VARCHAR2
,
C4
NVARCHAR
,
C5
NVARCHAR2
,
C6
VARCHAR_CASESENSITIVE
,
C7
LONGVARCHAR
,
C8
TID
);
>
ok
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
>
COLUMN_NAME
DATA_TYPE
TYPE_NAME
COLUMN_TYPE
>
----------- --------- --------- ---------------------
>
C1
12
VARCHAR
VARCHAR
>
C2
12
VARCHAR
CHARACTER
VARYING
>
C3
12
VARCHAR
VARCHAR2
>
C4
12
VARCHAR
NVARCHAR
>
C5
12
VARCHAR
NVARCHAR2
>
C6
12
VARCHAR
VARCHAR_CASESENSITIVE
>
C7
12
VARCHAR
LONGVARCHAR
>
C8
12
VARCHAR
TID
>
rows
(
ordered
):
8
DROP
TABLE
TEST
;
>
ok
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论