Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
soremi
oceanbase
提交
6af7f9ae
O
oceanbase
项目概览
soremi
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6af7f9ae
编写于
11月 01, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bugfix] forbid integer improvement ddl and serialize column obj type to column header
上级
c21b5fca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
6 deletion
+20
-6
src/share/schema/ob_table_schema.cpp
src/share/schema/ob_table_schema.cpp
+5
-0
src/storage/blocksstable/encoding/ob_icolumn_encoder.h
src/storage/blocksstable/encoding/ob_icolumn_encoder.h
+1
-1
src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp
src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp
+2
-2
src/storage/blocksstable/ob_block_sstable_struct.h
src/storage/blocksstable/ob_block_sstable_struct.h
+12
-3
未找到文件。
src/share/schema/ob_table_schema.cpp
浏览文件 @
6af7f9ae
...
...
@@ -3826,6 +3826,11 @@ int ObTableSchema::check_alter_column_type(const ObColumnSchemaV2 &src_column,
||
(
src_meta
.
is_varbinary
()
&&
dst_meta
.
is_blob
())
||
(
src_meta
.
is_text
()
&&
(
dst_meta
.
is_text
()
||
dst_meta
.
is_varchar
()))
||
(
src_meta
.
is_blob
()
&&
(
dst_meta
.
is_blob
()
||
dst_meta
.
is_varbinary
()))))
{
if
(
src_meta
.
is_integer_type
()
&&
dst_meta
.
is_integer_type
())
{
ret
=
OB_NOT_SUPPORTED
;
LOG_WARN
(
"Type increment of integer type is not supported"
,
K
(
ret
),
K
(
src_meta
),
K
(
dst_meta
));
LOG_USER_ERROR
(
OB_NOT_SUPPORTED
,
"Type increment of integer type is"
);
}
// online, do nothing
}
else
{
is_offline
=
true
;
...
...
src/storage/blocksstable/encoding/ob_icolumn_encoder.h
浏览文件 @
6af7f9ae
...
...
@@ -75,7 +75,7 @@ public:
EncoderDesc
&
get_desc
()
{
return
desc_
;
}
ObColumnHeader
&
get_column_header
()
{
return
column_header_
;
}
ObObjType
get_obj_type
()
{
return
column_type_
.
get_type
();
}
// var data store only
virtual
int
set_data_pos
(
const
int64_t
offset
,
const
int64_t
length
)
{
...
...
src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp
浏览文件 @
6af7f9ae
...
...
@@ -521,15 +521,15 @@ int ObMicroBlockEncoder::store_encoding_meta_and_fix_cols(int64_t &encoding_meta
if
(
OB_FAIL
(
encoders_
.
at
(
i
)
->
store_meta
(
data_buffer_
)))
{
LOG_WARN
(
"store encoding meta failed"
,
K
(
ret
));
}
else
{
ObColumnHeader
&
ch
=
encoders_
.
at
(
i
)
->
get_column_header
();
if
(
data_buffer_
.
pos
()
>
pos_bak
)
{
ObColumnHeader
&
ch
=
encoders_
.
at
(
i
)
->
get_column_header
();
ch
.
offset_
=
static_cast
<
uint32_t
>
(
pos_bak
-
encoding_meta_offset
);
ch
.
length_
=
static_cast
<
uint32_t
>
(
data_buffer_
.
pos
()
-
pos_bak
);
}
else
if
(
ObColumnHeader
::
RAW
==
encoders_
.
at
(
i
)
->
get_type
())
{
// column header offset records the start pos of the fix data, if needed
ObColumnHeader
&
ch
=
encoders_
.
at
(
i
)
->
get_column_header
();
ch
.
offset_
=
static_cast
<
uint32_t
>
(
pos_bak
-
encoding_meta_offset
);
}
ch
.
obj_type_
=
static_cast
<
uint8_t
>
(
encoders_
.
at
(
i
)
->
get_obj_type
());
}
if
(
OB_SUCC
(
ret
)
&&
!
desc
.
is_var_data_
&&
desc
.
need_data_store_
)
{
...
...
src/storage/blocksstable/ob_block_sstable_struct.h
浏览文件 @
6af7f9ae
...
...
@@ -291,7 +291,7 @@ struct ObColumnHeader
int8_t
version_
;
int8_t
type_
;
int8_t
attr_
;
int8_t
reserved
_
;
uint8_t
obj_type
_
;
union
{
uint32_t
extend_value_offset_
;
// for var column null-bitmap stored continuously
uint32_t
extend_value_index_
;
...
...
@@ -299,9 +299,16 @@ struct ObColumnHeader
uint32_t
offset_
;
uint32_t
length_
;
static_assert
(
UINT8_MAX
>=
ObObjType
::
ObMaxType
,
"ObObjType is stored in ObColumnHeader with 1 byte"
);
ObColumnHeader
()
{
reuse
();
}
void
reuse
()
{
memset
(
this
,
0
,
sizeof
(
*
this
));
}
bool
is_valid
()
const
{
return
version_
==
OB_COLUMN_HEADER_V1
&&
type_
>=
0
&&
type_
<
MAX_TYPE
;
}
bool
is_valid
()
const
{
return
version_
==
OB_COLUMN_HEADER_V1
&&
type_
>=
0
&&
type_
<
MAX_TYPE
&&
obj_type_
<
ObObjType
::
ObMaxType
;
}
inline
bool
is_fix_length
()
const
{
return
attr_
&
FIX_LENGTH
;
}
inline
bool
has_extend_value
()
const
{
return
attr_
&
HAS_EXTEND_VALUE
;
}
...
...
@@ -316,6 +323,7 @@ struct ObColumnHeader
{
return
COLUMN_EQUAL
==
type
||
COLUMN_SUBSTR
==
type
;
}
inline
ObObjType
get_store_obj_type
()
const
{
return
static_cast
<
ObObjType
>
(
obj_type_
);
}
inline
void
set_fix_lenght_attr
()
{
attr_
|=
FIX_LENGTH
;
}
inline
void
set_has_extend_value_attr
()
{
attr_
|=
HAS_EXTEND_VALUE
;
}
...
...
@@ -323,7 +331,8 @@ struct ObColumnHeader
inline
void
set_last_var_field_attr
()
{
attr_
|=
LAST_VAR_FIELD
;
}
inline
void
set_out_row
()
{
attr_
|=
OUT_ROW
;
}
TO_STRING_KV
(
K_
(
version
),
K_
(
type
),
K_
(
attr
),
K_
(
extend_value_offset
),
K_
(
offset
),
K_
(
length
));
TO_STRING_KV
(
K_
(
version
),
K_
(
type
),
K_
(
attr
),
K_
(
obj_type
),
K_
(
extend_value_offset
),
K_
(
offset
),
K_
(
length
));
}
__attribute__
((
packed
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录