Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
3488d9e6
提交
3488d9e6
authored
6 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update ValueResultSet format for temporary storages
上级
3a91dec0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
15 行删除
+16
-15
ValueDataType.java
h2/src/main/org/h2/mvstore/db/ValueDataType.java
+7
-7
Data.java
h2/src/main/org/h2/store/Data.java
+9
-8
没有找到文件。
h2/src/main/org/h2/mvstore/db/ValueDataType.java
浏览文件 @
3488d9e6
...
...
@@ -24,7 +24,6 @@ import org.h2.result.SimpleResult;
import
org.h2.result.SortOrder
;
import
org.h2.store.DataHandler
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.Utils
;
import
org.h2.value.CompareMode
;
import
org.h2.value.Value
;
...
...
@@ -408,10 +407,12 @@ public class ValueDataType implements DataType {
int
columnCount
=
result
.
getVisibleColumnCount
();
buff
.
putVarInt
(
columnCount
);
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
writeString
(
buff
,
result
.
getAlias
(
i
));
writeString
(
buff
,
result
.
getColumnName
(
i
));
buff
.
putVarInt
(
org
.
h2
.
value
.
DataType
.
getDataType
(
result
.
getColumnType
(
i
)).
sqlType
).
putVarInt
(
MathUtils
.
convertLongToInt
(
result
.
getColumnPrecision
(
i
))).
putVarInt
(
result
.
getColumnScale
(
i
));
buff
.
putVarInt
(
result
.
getColumnType
(
i
)).
putVarLong
(
result
.
getColumnPrecision
(
i
)).
putVarInt
(
result
.
getColumnScale
(
i
)).
putVarInt
(
result
.
getDisplaySize
(
i
));
}
while
(
result
.
next
())
{
buff
.
put
((
byte
)
1
);
...
...
@@ -621,9 +622,8 @@ public class ValueDataType implements DataType {
SimpleResult
rs
=
new
SimpleResult
();
int
columns
=
readVarInt
(
buff
);
for
(
int
i
=
0
;
i
<
columns
;
i
++)
{
String
name
=
readString
(
buff
);
rs
.
addColumn
(
name
,
name
,
org
.
h2
.
value
.
DataType
.
convertSQLTypeToValueType
(
readVarInt
(
buff
)),
readVarInt
(
buff
),
readVarInt
(
buff
),
Integer
.
MAX_VALUE
);
rs
.
addColumn
(
readString
(
buff
),
readString
(
buff
),
readVarInt
(
buff
),
readVarLong
(
buff
),
readVarInt
(
buff
),
readVarInt
(
buff
));
}
while
(
buff
.
get
()
!=
0
)
{
Value
[]
o
=
new
Value
[
columns
];
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/Data.java
浏览文件 @
3488d9e6
...
...
@@ -27,7 +27,6 @@ import org.h2.util.DateTimeUtils;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.Utils
;
import
org.h2.value.DataType
;
import
org.h2.value.Value
;
import
org.h2.value.ValueArray
;
import
org.h2.value.ValueBoolean
;
...
...
@@ -634,10 +633,12 @@ public class Data {
int
columnCount
=
result
.
getVisibleColumnCount
();
writeVarInt
(
columnCount
);
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
writeString
(
result
.
getAlias
(
i
));
writeString
(
result
.
getColumnName
(
i
));
writeVarInt
(
DataType
.
getDataType
(
result
.
getColumnType
(
i
)).
sqlType
);
writeVar
Int
(
MathUtils
.
convertLongToInt
(
result
.
getColumnPrecision
(
i
)
));
writeVarInt
(
result
.
getColumnType
(
i
)
);
writeVar
Long
(
result
.
getColumnPrecision
(
i
));
writeVarInt
(
result
.
getColumnScale
(
i
));
writeVarInt
(
result
.
getDisplaySize
(
i
));
}
while
(
result
.
next
())
{
writeByte
((
byte
)
1
);
...
...
@@ -859,9 +860,7 @@ public class Data {
SimpleResult
rs
=
new
SimpleResult
();
int
columns
=
readVarInt
();
for
(
int
i
=
0
;
i
<
columns
;
i
++)
{
String
name
=
readString
();
rs
.
addColumn
(
name
,
name
,
DataType
.
convertSQLTypeToValueType
(
readVarInt
()),
readVarInt
(),
readVarInt
(),
Integer
.
MAX_VALUE
);
rs
.
addColumn
(
readString
(),
readString
(),
readVarInt
(),
readVarLong
(),
readVarInt
(),
readVarInt
());
}
while
(
readByte
()
!=
0
)
{
Value
[]
o
=
new
Value
[
columns
];
...
...
@@ -1097,10 +1096,12 @@ public class Data {
int
columnCount
=
result
.
getVisibleColumnCount
();
len
+=
getVarIntLen
(
columnCount
);
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
len
+=
getStringLen
(
result
.
getAlias
(
i
));
len
+=
getStringLen
(
result
.
getColumnName
(
i
));
len
+=
getVarIntLen
(
DataType
.
getDataType
(
result
.
getColumnType
(
i
)).
sqlType
);
len
+=
getVar
IntLen
(
MathUtils
.
convertLongToInt
(
result
.
getColumnPrecision
(
i
)
));
len
+=
getVarIntLen
(
result
.
getColumnType
(
i
)
);
len
+=
getVar
LongLen
(
result
.
getColumnPrecision
(
i
));
len
+=
getVarIntLen
(
result
.
getColumnScale
(
i
));
len
+=
getVarIntLen
(
result
.
getDisplaySize
(
i
));
}
while
(
result
.
next
())
{
len
++;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论