forked from openGauss-Ecosystem/openGauss-server
Compare commits
175 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
14ed467a73 | |
|
|
ec27718103 | |
|
|
f36f72c88a | |
|
|
a26f670fa5 | |
|
|
3299128dcd | |
|
|
2262a009cf | |
|
|
8782ab8f1d | |
|
|
c17b1f2b61 | |
|
|
eb492fb3df | |
|
|
a452732a6d | |
|
|
fa6df03368 | |
|
|
d10d4cc3d2 | |
|
|
f0d02cd292 | |
|
|
8deef3fa1e | |
|
|
0b7992f889 | |
|
|
84b92e54c9 | |
|
|
7d9c5df17e | |
|
|
538bf517cf | |
|
|
25602f4079 | |
|
|
788274ba24 | |
|
|
45352f8e26 | |
|
|
3a6e24dd42 | |
|
|
7c40d789b1 | |
|
|
95421580c4 | |
|
|
3db81583c3 | |
|
|
7683deb42f | |
|
|
c883406e78 | |
|
|
d5dab2f8e3 | |
|
|
a9d16cae4e | |
|
|
c943a592e7 | |
|
|
041b338788 | |
|
|
e025e2b018 | |
|
|
e7e3ccb0e1 | |
|
|
69348ac2c2 | |
|
|
91594ce000 | |
|
|
6e13bb8517 | |
|
|
7bebe1e789 | |
|
|
63bb0fd266 | |
|
|
5ac138d548 | |
|
|
7f7ac666a6 | |
|
|
84cc71d10e | |
|
|
80f61fafad | |
|
|
8d7e8763bf | |
|
|
1419ab8ef5 | |
|
|
f8ff9f3afe | |
|
|
3a4a64bfda | |
|
|
e32e7daed3 | |
|
|
233ccd0218 | |
|
|
63313bed87 | |
|
|
5bacdb5bbc | |
|
|
cf7c73619c | |
|
|
4d8aec12ae | |
|
|
497547faa9 | |
|
|
0d264cebad | |
|
|
37d263e5b9 | |
|
|
fabd0159e4 | |
|
|
66748cf39d | |
|
|
460b3d15b5 | |
|
|
640a73772e | |
|
|
e9f02d394b | |
|
|
e20304beae | |
|
|
565cc85196 | |
|
|
1ae5fbfc0e | |
|
|
589734a686 | |
|
|
dc3b2db447 | |
|
|
94b084b2cf | |
|
|
5eba530510 | |
|
|
63bf4c2b3a | |
|
|
6ceebeb770 | |
|
|
18639107af | |
|
|
f9905e4724 | |
|
|
a2cd79b36d | |
|
|
809e2ebbae | |
|
|
f21869b87a | |
|
|
ebbf5ec8b2 | |
|
|
164d34c2a2 | |
|
|
8a6e620831 | |
|
|
cf96c5fa83 | |
|
|
964fac0c6f | |
|
|
1e78dbcdc5 | |
|
|
b665aea10c | |
|
|
709e1dadf5 | |
|
|
26a00db02d | |
|
|
9c9864a283 | |
|
|
0bae05818b | |
|
|
20cad27c28 | |
|
|
3b36e1dc68 | |
|
|
5b0f39d6bb | |
|
|
60ecb35543 | |
|
|
350dc97148 | |
|
|
d0b4b7834e | |
|
|
7b39c6f636 | |
|
|
2011dccec7 | |
|
|
ecc17c2faf | |
|
|
3cdbf57624 | |
|
|
e717a1ead8 | |
|
|
b79be12ee3 | |
|
|
d4a2ea2050 | |
|
|
6ecf784271 | |
|
|
ca5f9c1067 | |
|
|
07f7ca2df8 | |
|
|
786262989d | |
|
|
d03aeeb37e | |
|
|
d82f611310 | |
|
|
46b157373a | |
|
|
004748b0d7 | |
|
|
a872c9b739 | |
|
|
3fdb245d5a | |
|
|
6c4b32aa33 | |
|
|
4396131a82 | |
|
|
661c7ca0ff | |
|
|
2fb21c8701 | |
|
|
6f7eef3db6 | |
|
|
13d6b03c17 | |
|
|
3c9568f172 | |
|
|
32dbfa6463 | |
|
|
1d710b6ce7 | |
|
|
f4a7e8251f | |
|
|
aa42cd0664 | |
|
|
55a8dc30ed | |
|
|
45303e42f1 | |
|
|
5e62b6d33a | |
|
|
6604fd498c | |
|
|
ee9e1c03af | |
|
|
47793df932 | |
|
|
8ab353cce1 | |
|
|
5bbebb308d | |
|
|
a79e1d54fa | |
|
|
ad4088f131 | |
|
|
7f040a0e40 | |
|
|
d2b84ee198 | |
|
|
39ef9fee30 | |
|
|
eab31941d1 | |
|
|
8f829f0ff3 | |
|
|
13da8d6725 | |
|
|
a8de00f253 | |
|
|
91f6f93819 | |
|
|
df1bc33e83 | |
|
|
ec375cf00e | |
|
|
dc952af4a8 | |
|
|
bc287c614c | |
|
|
d77491d25d | |
|
|
9cb7462667 | |
|
|
a68f029622 | |
|
|
a239637118 | |
|
|
830340def0 | |
|
|
202045e11d | |
|
|
32acc25fdd | |
|
|
fba0ec6143 | |
|
|
72c07837ab | |
|
|
529f5e505e | |
|
|
cbdb7d0e0e | |
|
|
ed746739c2 | |
|
|
7941581269 | |
|
|
ef4092ff09 | |
|
|
8d4f0c4164 | |
|
|
e2be91e0c0 | |
|
|
1052c12246 | |
|
|
9e9fe453bf | |
|
|
aff104a2ac | |
|
|
e0870fb47a | |
|
|
53541c813b | |
|
|
9d0d29044b | |
|
|
38a87bdb66 | |
|
|
c028907375 | |
|
|
3a42dc9c8b | |
|
|
9d891410f9 | |
|
|
85a773b916 | |
|
|
c17fdb15b1 | |
|
|
51da7c4d17 | |
|
|
fb197cfea6 | |
|
|
fe358bcb2d | |
|
|
80eab2aa8d | |
|
|
c72fd89343 | |
|
|
96383be785 |
|
|
@ -1,24 +1,23 @@
|
|||
<!-- 感谢您提交Pull Reqeust -->
|
||||
|
||||
<!-- 提交说明: 请按照以下的模板提交PR,下列内容均为必填项。如果未补充对应内容,不允许提交PR。 -->
|
||||
|
||||
<!-- 提交说明: 请简单说明PR实现内容和修改逻辑 -->
|
||||
<!-- 关联issue: 请添加上关联issue的链接,如果没有关联issue,请先创建issue -->
|
||||
【标题】(请简要描述下实现的内容)
|
||||
|
||||
【实现内容】:
|
||||
|
||||
【根因分析】:
|
||||
|
||||
【实现方案】:
|
||||
【修改方案】:
|
||||
1. xxx
|
||||
2. xxx
|
||||
|
||||
【关联需求或issue】:
|
||||
【关联issue】:
|
||||
|
||||
【开发自验报告】:
|
||||
1. 请附上自验结果(内容或者截图)
|
||||
2. 是否可以添加fastcheck测试用例,如是,请补充fastcheck用例
|
||||
3. 是否涉及资料修改,如是,在docs仓库补充资料
|
||||
4. 是否考虑升级场景(系统表修改、日志持久化以及修改执行态数据格式)
|
||||
5. 是否考虑在线扩容等扩展场景
|
||||
4. 是否考虑支撑升级和在线扩容等扩展场景
|
||||
5. 是否考虑异常场景/并发场景/前向兼容/性能场景
|
||||
6. 是否对其他模块产生影响
|
||||
|
||||
【其他说明】:
|
||||
6. 是否对其他模块产生影响
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
[submodule "openGauss-Custom-function"]
|
||||
path = openGauss-Custom-function
|
||||
url = ../openGauss-Custom-function.git
|
||||
[submodule "openGauss-Query-select"]
|
||||
path = openGauss-Query-select
|
||||
url = ../openGauss-Query-select.git
|
||||
[submodule "openGauss-Security-control"]
|
||||
path = openGauss-Security-control
|
||||
url = ../openGauss-Security-control.git
|
||||
[submodule "openGauss-Stored-Procedure"]
|
||||
path = openGauss-Stored-Procedure
|
||||
url = ../openGauss-Stored-Procedure.git
|
||||
[submodule "openGauss-basic-operation"]
|
||||
path = openGauss-basic-operation
|
||||
url = ../openGauss-basic-operation.git
|
||||
[submodule "openGauss-transaction"]
|
||||
path = openGauss-transaction
|
||||
url = ../openGauss-transaction.git
|
||||
[submodule "openGauss-trigger"]
|
||||
path = openGauss-trigger
|
||||
url = ../openGauss-trigger.git
|
||||
[submodule "openGauss-competition"]
|
||||
path = openGauss-competition
|
||||
url = ../openGauss-competition.git
|
||||
|
|
@ -52,6 +52,7 @@ set(PROJECT_OPENGS_DIR ${PROJECT_TRUNK_DIR}/${openGauss} CACHE INTERNAL "")
|
|||
set(PROJECT_SRC_DIR ${PROJECT_OPENGS_DIR}/src CACHE INTERNAL "")
|
||||
|
||||
set(3RD_PATH $ENV{THIRD_BIN_PATH})
|
||||
execute_process(COMMAND sh ${PROJECT_SRC_DIR}/get_PlatForm_str.sh OUTPUT_VARIABLE PLAT_FORM_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(prefix_home $ENV{PREFIX_HOME})
|
||||
set(CMAKE_INSTALL_PREFIX ${prefix_home} CACHE INTERNAL "")
|
||||
if("$ENV{GCC_VERSION}" STREQUAL "")
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ install:
|
|||
$(MAKE) install_pldebugger
|
||||
$(MAKE) -C contrib/postgres_fdw $@
|
||||
$(MAKE) -C contrib/hstore $@
|
||||
$(MAKE) -C contrib/dblink $@
|
||||
@if test -d contrib/dolphin; then $(MAKE) -C contrib/dolphin $@; fi
|
||||
+@echo "openGauss installation complete."
|
||||
endif
|
||||
|
|
@ -154,6 +153,16 @@ redochecksmall: all
|
|||
|
||||
redischeck: all
|
||||
|
||||
dfsredischeck: all
|
||||
|
||||
orccheckxian: all
|
||||
|
||||
orccheckusa: all
|
||||
|
||||
orcchecksmall: all
|
||||
|
||||
dfscheck: all
|
||||
|
||||
obscheck: all
|
||||
|
||||
obsorccheck: all
|
||||
|
|
@ -162,7 +171,7 @@ securitycheck: all
|
|||
|
||||
parquetchecksmall: all
|
||||
|
||||
check fastcheck fastcheck_inplace fastcheck_parallel_initdb qunitcheck redischeck redocheck redochecksmall orccheckxian orccheckusa orcchecksmall parquetchecksmall obscheck obsorccheck securitycheck installcheck installcheck-parallel 2pccheck:
|
||||
check fastcheck fastcheck_inplace fastcheck_parallel_initdb qunitcheck redischeck redocheck redochecksmall orccheckxian orccheckusa orcchecksmall parquetchecksmall dfscheck obscheck obsorccheck securitycheck dfsredischeck installcheck installcheck-parallel 2pccheck:
|
||||
$(MAKE) -C $(root_builddir)/distribute/test/regress $@
|
||||
|
||||
#llt include all low level test
|
||||
|
|
|
|||
|
|
@ -82,13 +82,23 @@ redochecksmall: all
|
|||
|
||||
redischeck: all
|
||||
|
||||
dfsredischeck: all
|
||||
|
||||
orccheckxian: all
|
||||
|
||||
orccheckusa: all
|
||||
|
||||
orcchecksmall: all
|
||||
|
||||
dfscheck: all
|
||||
|
||||
obscheck: all
|
||||
|
||||
obsorccheck: all
|
||||
|
||||
securitycheck: all
|
||||
|
||||
check fastcheck fastcheck_inplace fastcheck_parallel_initdb qunitcheck redischeck redocheck redochecksmall orccheckxian orccheckusa orcchecksmall obscheck obsorccheck securitycheck installcheck installcheck-parallel 2pccheck:
|
||||
check fastcheck fastcheck_inplace fastcheck_parallel_initdb qunitcheck redischeck redocheck redochecksmall orccheckxian orccheckusa orcchecksmall dfscheck obscheck obsorccheck securitycheck dfsredischeck installcheck installcheck-parallel 2pccheck:
|
||||
$(MAKE) -C src/test/regress $@
|
||||
|
||||
#llt include all low level test
|
||||
|
|
|
|||
1
License
1
License
|
|
@ -1,3 +1,4 @@
|
|||
木兰宽松许可证, 第2版
|
||||
木兰宽松许可证, 第2版
|
||||
|
||||
2020年1月 http://license.coscl.org.cn/MulanPSL2
|
||||
|
|
|
|||
35
README.md
35
README.md
|
|
@ -413,10 +413,7 @@ https://opengauss.org/zh/
|
|||
| 2.0.0 2.0.1 | https://opengauss.obs.cn-south-1.myhuaweicloud.com/2.0.0/openGauss-third_party_binarylibs.tar.gz |
|
||||
| 2.1.0 | https://opengauss.obs.cn-south-1.myhuaweicloud.com/2.1.0/openGauss-third_party_binarylibs.tar.gz |
|
||||
| 3.0.0 | https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.0.0/openGauss-third_party_binarylibs.tar.gz |
|
||||
| 3.1.0 | **openEuler_arm:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/openGauss-third_party_binarylibs_openEuler_arm.tar.gz <br/> **openEuler_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/openGauss-third_party_binarylibs_openEuler_x86_64.tar.gz<br/> **Centos_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/openGauss-third_party_binarylibs_Centos7.6_x86_64.tar.gz |
|
||||
| 3.1.1 | **openEuler_arm:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.1.1/binarylibs/openGauss-third_party_binarylibs_openEuler_arm.tar.gz <br/> **openEuler_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.1.1/binarylibs/openGauss-third_party_binarylibs_openEuler_x86_64.tar.gz<br/> **Centos_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.1.1/binarylibs/openGauss-third_party_binarylibs_Centos7.6_x86_64.tar.gz |
|
||||
| 5.0.0 | **openEuler_arm:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/binarylibs/openGauss-third_party_binarylibs_openEuler_arm.tar.gz <br/> **openEuler_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/binarylibs/openGauss-third_party_binarylibs_openEuler_x86_64.tar.gz<br/> **Centos_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/binarylibs/openGauss-third_party_binarylibs_Centos7.6_x86_64.tar.gz |
|
||||
| master | **openEuler_arm:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/openGauss-third_party_binarylibs_openEuler_arm.tar.gz <br/> **openEuler_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/openGauss-third_party_binarylibs_openEuler_x86_64.tar.gz<br/> **Centos_x86:** https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/openGauss-third_party_binarylibs_Centos7.6_x86_64.tar.gz |
|
||||
| master | https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/openGauss-third_party_binarylibs.tar.gz |
|
||||
|
||||
现在我们已经拥有完整的openGauss代码,把它存储在以下目录中(以sda为例)。
|
||||
|
||||
|
|
@ -482,18 +479,24 @@ openGauss-server中的build.sh是编译过程中的重要脚本工具。该工
|
|||
|
||||
##### 使用命令编译代码
|
||||
|
||||
1.获取对应的开源三方库二进制文件:
|
||||
1.执行以下脚本获取系统版本号:
|
||||
|
||||
从3.1.0版本开始,对于不同的环境提供不同的开源三方库二进制文件。 目前社区提供Centos_x86_64, openEuler_aarch64, openEuler_x86_64三种平台的三方库二进制。
|
||||
可以从对应地址下载 [下载openGauss](#下载opengauss)
|
||||
```
|
||||
[user@linux openGauss-server]$ sh src/get_PlatForm_str.sh
|
||||
```
|
||||
|
||||
2.配置环境变量
|
||||
> **注意**
|
||||
>
|
||||
> - 命令回显信息即为openGauss支持的操作系统。目前openGauss支持的操作系统为centos7.6_x86_64和openeuler_aarch64。
|
||||
> - 如果显示**Failed**或其他版本,表示openGauss不支持当前操作系统。
|
||||
|
||||
2.配置环境变量,根据代码下载位置添加**____**,并将***替换为上一步的结果。
|
||||
|
||||
```
|
||||
export CODE_BASE=________ # Path of the openGauss-server file
|
||||
export BINARYLIBS=________ # Path of the binarylibs file
|
||||
export GAUSSHOME=$CODE_BASE/dest/
|
||||
export GCC_PATH=$BINARYLIBS/buildtools/gcc7.3/
|
||||
export GCC_PATH=$BINARYLIBS/buildtools/***/gcc7.3/
|
||||
export CC=$GCC_PATH/gcc/bin/gcc
|
||||
export CXX=$GCC_PATH/gcc/bin/g++
|
||||
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$GCC_PATH/gcc/lib64:$GCC_PATH/isl/lib:$GCC_PATH/mpc/lib/:$GCC_PATH/mpfr/lib/:$GCC_PATH/gmp/lib/:$LD_LIBRARY_PATH
|
||||
|
|
@ -501,6 +504,20 @@ openGauss-server中的build.sh是编译过程中的重要脚本工具。该工
|
|||
|
||||
```
|
||||
|
||||
例如,在CENTOS X86-64平台上,binarylibs目录被作为openGauss-server目录的兄弟目录。
|
||||
在openGauss-server目录下执行以下命令。
|
||||
|
||||
```
|
||||
export CODE_BASE=`pwd`
|
||||
export BINARYLIBS=`pwd`/../binarylibs
|
||||
export GAUSSHOME=$CODE_BASE/dest/
|
||||
export GCC_PATH=$BINARYLIBS/buildtools/centos7.6_x86_64/gcc7.3/
|
||||
export CC=$GCC_PATH/gcc/bin/gcc
|
||||
export CXX=$GCC_PATH/gcc/bin/g++
|
||||
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$GCC_PATH/gcc/lib64:$GCC_PATH/isl/lib:$GCC_PATH/mpc/lib/:$GCC_PATH/mpfr/lib/:$GCC_PATH/gmp/lib/:$LD_LIBRARY_PATH
|
||||
export PATH=$GAUSSHOME/bin:$GCC_PATH/gcc/bin:$PATH
|
||||
|
||||
```
|
||||
3.选择一个版本进行配置。
|
||||
|
||||
**debug**版本:
|
||||
|
|
|
|||
1
build.sh
1
build.sh
|
|
@ -90,5 +90,6 @@ then
|
|||
else
|
||||
./package_opengauss.sh -3rd ${build_binarylib_dir} -m ${build_version_mode} -f ${config_file}
|
||||
fi
|
||||
|
||||
fi
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -41,8 +41,12 @@
|
|||
./share/postgresql/extension/file_fdw.control
|
||||
./share/postgresql/extension/hstore--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/hstore--1.0--1.1.sql
|
||||
./share/postgresql/extension/hdfs_fdw--1.0.sql
|
||||
./share/postgresql/extension/hdfs_fdw.control
|
||||
./share/postgresql/extension/log_fdw--1.0.sql
|
||||
./share/postgresql/extension/log_fdw.control
|
||||
./share/postgresql/extension/postgres_fdw--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -630,7 +634,6 @@
|
|||
./share/postgresql/timezone/Navajo
|
||||
./share/postgresql/timezone/GMT
|
||||
./share/postgresql/system_views.sql
|
||||
./share/postgresql/private_system_views.sql
|
||||
./share/postgresql/performance_views.sql
|
||||
./share/postgresql/sql_features.txt
|
||||
./share/postgresql/pg_cast_oid.txt
|
||||
|
|
@ -670,25 +673,46 @@
|
|||
./share/postgresql/timezonesets/Etc.txt
|
||||
./share/postgresql/postgres.bki
|
||||
./share/sslcert/gsql/openssl.cnf
|
||||
./lib/libnuma.so*
|
||||
./share/sslcert/grpc/openssl.cnf
|
||||
./lib/libnuma.so
|
||||
./lib/libnuma.so.1
|
||||
./lib/libnuma.so.1.0.0
|
||||
./lib/libpq.so
|
||||
./lib/libpq.so.5
|
||||
./lib/libpq.so.5.5
|
||||
./lib/libssl.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libcgroup.so*
|
||||
./lib/libz.so*
|
||||
./lib/liblz4.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libcjson_utils.so*
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libcgroup.so
|
||||
./lib/libcgroup.so.1
|
||||
./lib/libz.so
|
||||
./lib/libz.so.1
|
||||
./lib/libz.so.1.2.11
|
||||
./lib/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.2
|
||||
./lib/libcjson.so
|
||||
./lib/libcjson.so.1
|
||||
./lib/libcjson.so.1.7.14
|
||||
./lib/libcjson_utils.so
|
||||
./lib/libcjson_utils.so.1
|
||||
./lib/libcjson_utils.so.1.7.14
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libgcc_s.so.1
|
||||
./lib/libgomp.so*
|
||||
./lib/libgomp.so
|
||||
./lib/libgomp.so.1
|
||||
./lib/libgomp.so.1.0.0
|
||||
./lib/libdcf.so
|
||||
./lib/libzstd.so*
|
||||
./lib/libcurl.so*
|
||||
./lib/libzstd.so
|
||||
./lib/libzstd.so.1
|
||||
./lib/libzstd.so.1.5.0
|
||||
./lib/libcurl.so
|
||||
./lib/libcurl.so.4
|
||||
./lib/libcurl.so.4.7.0
|
||||
./lib/libxgboost.so
|
||||
./lib/libpagecompression.so*
|
||||
./lib/libpagecompression.so
|
||||
./lib/libpagecompression.so.1
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/postgresql/euc_kr_and_mic.so
|
||||
|
|
@ -705,7 +729,6 @@
|
|||
./lib/postgresql/utf8_and_sjis.so
|
||||
./lib/postgresql/utf8_and_cyrillic.so
|
||||
./lib/postgresql/hstore.so
|
||||
./lib/postgresql/packages.so
|
||||
./lib/postgresql/utf8_and_euc_kr.so
|
||||
./lib/postgresql/ascii_and_mic.so
|
||||
./lib/postgresql/utf8_and_iso8859_1.so
|
||||
|
|
@ -720,20 +743,17 @@
|
|||
./lib/postgresql/utf8_and_euc2004.so
|
||||
./lib/postgresql/utf8_and_big5.so
|
||||
./lib/postgresql/mppdb_decoding.so
|
||||
./lib/postgresql/sql_decoding.so
|
||||
./lib/postgresql/pg_plugin
|
||||
./lib/postgresql/proc_srclib
|
||||
./lib/postgresql/security_plugin.so
|
||||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/postgresql/pgoutput.so
|
||||
./lib/libxgboost.so
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
./include/postgresql/server/pgtime.h
|
||||
./include/postgresql/server/datatypes.h
|
||||
./include/postgresql/server/client_logic/client_logic_enums.h
|
||||
./include/postgresql/server/libpq/libpq-fs.h
|
||||
./include/postgresql/server/nodes/primnodes.h
|
||||
./include/postgresql/server/nodes/parsenodes.h
|
||||
./include/postgresql/server/nodes/parsenodes_common.h
|
||||
|
|
@ -882,15 +902,15 @@
|
|||
./include/postgresql/server/lib/ilist.h
|
||||
./include/postgresql/server/pgxc/locator.h
|
||||
./include/postgresql/server/gstrace/gstrace_infra.h
|
||||
./include/postgresql/server/db4ai/db4ai.h
|
||||
[libpq]
|
||||
./lib/libpq.so
|
||||
./lib/libpq.so.5
|
||||
./lib/libpq.so.5.5
|
||||
./lib/libcrypto.so*
|
||||
./lib/libssl.so*
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
[header]
|
||||
./include/libpq/libpq-fs.h
|
||||
./include/libpq-fe.h
|
||||
./include/postgres_ext.h
|
||||
./include/gs_thread.h
|
||||
|
|
@ -904,4 +924,4 @@
|
|||
./include/pqcomm.h
|
||||
./include/pqexpbuffer.h
|
||||
[version]
|
||||
5.0.0
|
||||
3.0.0
|
||||
|
|
@ -1,10 +1,4 @@
|
|||
[server]
|
||||
./bin/dsscmd
|
||||
./bin/dssserver
|
||||
./bin/perctrl
|
||||
./bin/dms_contrl.sh
|
||||
./bin/dss_clear.sh
|
||||
./bin/dss_contrl.sh
|
||||
./bin/gsql
|
||||
./bin/gaussdb
|
||||
./bin/gstrace
|
||||
|
|
@ -40,8 +34,8 @@
|
|||
./bin/kadmin.local
|
||||
./bin/lz4
|
||||
./bin/kadmind
|
||||
./bin/dbmind
|
||||
./bin/gs_dbmind
|
||||
./bin/constant
|
||||
./bin/server.key.cipher
|
||||
./bin/server.key.rand
|
||||
./bin/gs_plan_simulator.sh
|
||||
|
|
@ -77,15 +71,14 @@
|
|||
./share/postgresql/extension/file_fdw.control
|
||||
./share/postgresql/extension/hstore--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/hstore--1.0--1.1.sql
|
||||
./share/postgresql/extension/hdfs_fdw--1.0.sql
|
||||
./share/postgresql/extension/hdfs_fdw.control
|
||||
./share/postgresql/extension/log_fdw--1.0.sql
|
||||
./share/postgresql/extension/log_fdw.control
|
||||
./share/postgresql/extension/mot_fdw--1.0.sql
|
||||
./share/postgresql/extension/mot_fdw.control
|
||||
./share/postgresql/extension/postgres_fdw--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw.control
|
||||
./share/postgresql/extension/dblink--1.0.sql
|
||||
./share/postgresql/extension/dblink--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/dblink.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -731,6 +724,7 @@
|
|||
./lib/postgresql/pgxs/src/Makefile.port
|
||||
./lib/postgresql/pgxs/src/nls-global.mk
|
||||
./lib/postgresql/pgxs/src/Makefile.global
|
||||
./lib/postgresql/pgxs/src/get_PlatForm_str.sh
|
||||
./lib/postgresql/pgxs/config/install-sh
|
||||
./lib/postgresql/euc_cn_and_mic.so
|
||||
./lib/postgresql/latin_and_mic.so
|
||||
|
|
@ -760,7 +754,6 @@
|
|||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/java/pljava.jar
|
||||
./lib/postgresql/postgres_fdw.so
|
||||
./lib/postgresql/dblink.so
|
||||
./lib/postgresql/pgoutput.so
|
||||
./lib/libpljava.so
|
||||
./lib/libpq.a
|
||||
|
|
@ -771,14 +764,18 @@
|
|||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libnuma.so
|
||||
./lib/libnuma.so.1
|
||||
./lib/libnuma.so.1.0.0
|
||||
./lib/libcgroup.so*
|
||||
./lib/libcom_err_gauss.so*
|
||||
./lib/libatomic.so*
|
||||
./lib/libcgroup.so
|
||||
./lib/libcgroup.so.1
|
||||
./lib/libcom_err_gauss.so
|
||||
./lib/libcom_err_gauss.so.3
|
||||
./lib/libcom_err_gauss.so.3.0
|
||||
./lib/libatomic.so
|
||||
./lib/libatomic.so.1
|
||||
./lib/libatomic.so.1.2.0
|
||||
./lib/libmasstree.so
|
||||
./lib/libupb.so*
|
||||
./lib/libupb.so
|
||||
./lib/libupb.so.9
|
||||
./lib/libupb.so.9.0.0
|
||||
./lib/libabsl_str_format_internal.so
|
||||
./lib/libabsl_strings.so
|
||||
./lib/libabsl_throw_delegate.so
|
||||
|
|
@ -792,28 +789,61 @@
|
|||
./lib/libabsl_log_severity.so
|
||||
./lib/libaddress_sorting.so
|
||||
./lib/libaddress_sorting.so.9
|
||||
./lib/libgssapi_krb5_gauss.so*
|
||||
./lib/libgssrpc_gauss.so*
|
||||
./lib/libk5crypto_gauss.so*
|
||||
./lib/libgssapi_krb5_gauss.so
|
||||
./lib/libgssapi_krb5_gauss.so.2
|
||||
./lib/libgssapi_krb5_gauss.so.2.2
|
||||
./lib/libgssrpc_gauss.so
|
||||
./lib/libgssrpc_gauss.so.4
|
||||
./lib/libgssrpc_gauss.so.4.2
|
||||
./lib/libk5crypto_gauss.so
|
||||
./lib/libk5crypto_gauss.so.3
|
||||
./lib/libk5crypto_gauss.so.3.1
|
||||
./lib/libkadm5clnt.so
|
||||
./lib/libkadm5clnt_mit.so*
|
||||
./lib/libkadm5clnt_mit.so
|
||||
./lib/libkadm5clnt_mit.so.11
|
||||
./lib/libkadm5clnt_mit.so.11.0
|
||||
./lib/libkadm5clnt_mit.so.12
|
||||
./lib/libkadm5clnt_mit.so.12.0
|
||||
./lib/libkadm5srv.so
|
||||
./lib/libkadm5srv_mit.so*
|
||||
./lib/libkdb5.so*
|
||||
./lib/libkrad.so*
|
||||
./lib/libkrb5_gauss.so*
|
||||
./lib/libkrb5support_gauss.so*
|
||||
./lib/libkadm5srv_mit.so
|
||||
./lib/libkadm5srv_mit.so.11
|
||||
./lib/libkadm5srv_mit.so.11.0
|
||||
./lib/libkadm5srv_mit.so.12
|
||||
./lib/libkadm5srv_mit.so.12.0
|
||||
./lib/libkdb5.so
|
||||
./lib/libkdb5.so.9
|
||||
./lib/libkdb5.so.9.0
|
||||
./lib/libkdb5.so.10
|
||||
./lib/libkdb5.so.10.0
|
||||
./lib/libkrad.so
|
||||
./lib/libkrad.so.0
|
||||
./lib/libkrad.so.0.0
|
||||
./lib/libkrb5_gauss.so
|
||||
./lib/libkrb5_gauss.so.3
|
||||
./lib/libkrb5_gauss.so.3.3
|
||||
./lib/libkrb5support_gauss.so
|
||||
./lib/libkrb5support_gauss.so.0
|
||||
./lib/libkrb5support_gauss.so.0.1
|
||||
./lib/krb5/plugins/kdb/db2.so
|
||||
./lib/libverto.so*
|
||||
./lib/libverto.so
|
||||
./lib/libverto.so.0
|
||||
./lib/libverto.so.0.0
|
||||
./lib/libcurl.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libssl.so*
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libgcc_s.so.1
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libz.so*
|
||||
./lib/liblz4.so*
|
||||
./lib/libz.so
|
||||
./lib/libz.so.1
|
||||
./lib/libz.so.1.2.11
|
||||
./lib/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.2
|
||||
./lib/libcjson.so*
|
||||
./lib/libconfig.so*
|
||||
./lib/libconfig.so
|
||||
./lib/libconfig.so.4
|
||||
./lib/libpgport_tool.so
|
||||
./lib/libpgport_tool.so.1
|
||||
./share/llvmir/GaussDB_expr.ir
|
||||
|
|
@ -826,16 +856,22 @@
|
|||
./lib/libpcre.so*
|
||||
./lib/libsecurec.so
|
||||
./lib/libxml2.so*
|
||||
./lib/libparquet.so
|
||||
./lib/libparquet.so.14
|
||||
./lib/libparquet.so.14.1.0
|
||||
./lib/libarrow.so
|
||||
./lib/libarrow.so.14
|
||||
./lib/libarrow.so.14.1.0
|
||||
./lib/OBS.ini
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/libdcf.so
|
||||
./lib/libzstd.so*
|
||||
./lib/libzstd.so
|
||||
./lib/libzstd.so.1
|
||||
./lib/libzstd.so.1.5.0
|
||||
./lib/libxgboost.so
|
||||
./lib/libpagecompression.so*
|
||||
./lib/libdssapi.so
|
||||
./lib/libdms.so
|
||||
./lib/libodbc.so*
|
||||
./lib/libpagecompression.so
|
||||
./lib/libpagecompression.so.1
|
||||
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
|
|
@ -1019,7 +1055,6 @@
|
|||
./include/postgresql/server/knl/knl_guc/knl_instance_attr_resource.h
|
||||
./include/postgresql/server/knl/knl_guc/knl_session_attr_common.h
|
||||
./include/postgresql/server/knl/knl_guc/knl_instance_attr_common.h
|
||||
./include/postgresql/server/access/ustore/knl_uverify.h
|
||||
./include/postgresql/server/lib/circularqueue.h
|
||||
./include/postgresql/server/access/double_write_basic.h
|
||||
./include/postgresql/server/knl/knl_thread.h
|
||||
|
|
@ -1129,9 +1164,6 @@
|
|||
./include/postgresql/server/catalog/namespace.h
|
||||
./include/postgresql/server/commands/trigger.h
|
||||
./include/postgresql/server/executor/spi.h
|
||||
./include/postgresql/server/db4ai/db4ai.h
|
||||
./include/postgresql/server/instruments/gs_stack.h
|
||||
./include/postgresql/server/instruments/instr_mfchain.h
|
||||
./include/postgresql/server/access/ustore/undo/knl_uundotype.h
|
||||
./include/postgresql/server/access/ustore/undo/knl_uundoapi.h
|
||||
./include/postgresql/server/access/ustore/knl_uheap.h
|
||||
|
|
@ -1151,44 +1183,6 @@
|
|||
./include/postgresql/server/executor/exec/execdesc.h
|
||||
./include/postgresql/server/db4ai/matrix.h
|
||||
./include/postgresql/server/db4ai/scores.h
|
||||
./include/postgresql/server/access/multixact.h
|
||||
./include/postgresql/server/access/xlogutils.h
|
||||
./include/postgresql/server/executor/functions.h
|
||||
./include/postgresql/server/storage/lock/waitpolicy.h
|
||||
./include/postgresql/server/storage/page_compression.h
|
||||
./include/postgresql/server/storage/smgr/knl_usync.h
|
||||
./include/postgresql/server/storage/smgr/fd.h
|
||||
./include/postgresql/server/storage/smgr/smgr.h
|
||||
./include/postgresql/server/storage/sharedfileset.h
|
||||
./include/postgresql/server/utils/knl_globalsysdbcache.h
|
||||
./include/postgresql/server/utils/knl_globaldbstatmanager.h
|
||||
./include/postgresql/server/utils/knl_globalsyscache_common.h
|
||||
./include/postgresql/server/utils/knl_globalbucketlist.h
|
||||
./include/postgresql/server/utils/knl_globalsystabcache.h
|
||||
./include/postgresql/server/utils/knl_globalsystupcache.h
|
||||
./include/postgresql/server/utils/knl_globaltabdefcache.h
|
||||
./include/postgresql/server/utils/knl_globalbasedefcache.h
|
||||
./include/postgresql/server/utils/knl_globalpartdefcache.h
|
||||
./include/postgresql/server/utils/knl_globalrelmapcache.h
|
||||
./include/postgresql/server/utils/knl_localsysdbcache.h
|
||||
./include/postgresql/server/utils/knl_localsystabcache.h
|
||||
./include/postgresql/server/utils/knl_localsystupcache.h
|
||||
./include/postgresql/server/utils/knl_localsyscache_common.h
|
||||
./include/postgresql/server/utils/knl_localtabdefcache.h
|
||||
./include/postgresql/server/utils/knl_localbasedefcache.h
|
||||
./include/postgresql/server/utils/knl_localbucketlist.h
|
||||
./include/postgresql/server/utils/knl_localpartdefcache.h
|
||||
./include/postgresql/server/utils/pl_global_package_runtime_cache.h
|
||||
./include/postgresql/server/catalog/pg_tablespace.h
|
||||
./include/postgresql/server/catalog/pg_subscription.h
|
||||
./include/postgresql/server/catalog/pg_replication_origin.h
|
||||
./include/postgresql/server/postmaster/barrier_creator.h
|
||||
./include/postgresql/server/postmaster/pagerepair.h
|
||||
./include/postgresql/server/replication/libpqwalreceiver.h
|
||||
./include/postgresql/server/replication/worker_internal.h
|
||||
./include/postgresql/server/replication/origin.h
|
||||
./include/postgresql/server/parser/scanner.h
|
||||
./include/postgresql/server/parser/keywords.h
|
||||
./jre/ASSEMBLY_EXCEPTION
|
||||
./jre/bin/java
|
||||
./jre/bin/jjs
|
||||
|
|
@ -1374,19 +1368,33 @@
|
|||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libconfig.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libconfig.so
|
||||
./lib/libconfig.so.4
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libssl.so*
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libpgport_tool.so
|
||||
./lib/libpgport_tool.so.1
|
||||
./lib/libgssapi_krb5_gauss.so*
|
||||
./lib/libgssrpc_gauss.so*
|
||||
./lib/libk5crypto_gauss.so*
|
||||
./lib/libkrb5support_gauss.so*
|
||||
./lib/libkrb5_gauss.so*
|
||||
./lib/libcom_err_gauss.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libgssapi_krb5_gauss.so
|
||||
./lib/libgssapi_krb5_gauss.so.2
|
||||
./lib/libgssapi_krb5_gauss.so.2.2
|
||||
./lib/libgssrpc_gauss.so
|
||||
./lib/libgssrpc_gauss.so.4
|
||||
./lib/libgssrpc_gauss.so.4.2
|
||||
./lib/libk5crypto_gauss.so
|
||||
./lib/libk5crypto_gauss.so.3
|
||||
./lib/libk5crypto_gauss.so.3.1
|
||||
./lib/libkrb5support_gauss.so
|
||||
./lib/libkrb5support_gauss.so.0
|
||||
./lib/libkrb5support_gauss.so.0.1
|
||||
./lib/libkrb5_gauss.so
|
||||
./lib/libkrb5_gauss.so.3
|
||||
./lib/libkrb5_gauss.so.3.3
|
||||
./lib/libcom_err_gauss.so
|
||||
./lib/libcom_err_gauss.so.3
|
||||
./lib/libcom_err_gauss.so.3.0
|
||||
[libpq]
|
||||
./lib/libpq.a
|
||||
./lib/libpq.so
|
||||
|
|
@ -1396,19 +1404,33 @@
|
|||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libconfig.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libconfig.so
|
||||
./lib/libconfig.so.4
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libssl.so*
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libpgport_tool.so
|
||||
./lib/libpgport_tool.so.1
|
||||
./lib/libgssapi_krb5_gauss.so*
|
||||
./lib/libgssrpc_gauss.so*
|
||||
./lib/libk5crypto_gauss.so*
|
||||
./lib/libkrb5support_gauss.so*
|
||||
./lib/libkrb5_gauss.so*
|
||||
./lib/libcom_err_gauss.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libgssapi_krb5_gauss.so
|
||||
./lib/libgssapi_krb5_gauss.so.2
|
||||
./lib/libgssapi_krb5_gauss.so.2.2
|
||||
./lib/libgssrpc_gauss.so
|
||||
./lib/libgssrpc_gauss.so.4
|
||||
./lib/libgssrpc_gauss.so.4.2
|
||||
./lib/libk5crypto_gauss.so
|
||||
./lib/libk5crypto_gauss.so.3
|
||||
./lib/libk5crypto_gauss.so.3.1
|
||||
./lib/libkrb5support_gauss.so
|
||||
./lib/libkrb5support_gauss.so.0
|
||||
./lib/libkrb5support_gauss.so.0.1
|
||||
./lib/libkrb5_gauss.so
|
||||
./lib/libkrb5_gauss.so.3
|
||||
./lib/libkrb5_gauss.so.3.3
|
||||
./lib/libcom_err_gauss.so
|
||||
./lib/libcom_err_gauss.so.3
|
||||
./lib/libcom_err_gauss.so.3.0
|
||||
./include/gs_thread.h
|
||||
./include/gs_threadlocal.h
|
||||
./include/postgres_ext.h
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
#######################################################################
|
||||
# Copyright (c): 2020-2021, Huawei Tech. Co., Ltd.
|
||||
# descript: Compile opengauss
|
||||
# Return 0 means OK.
|
||||
# Return 1 means failed.
|
||||
# version: 1.0
|
||||
# date: 2020-11-28
|
||||
#######################################################################
|
||||
|
||||
# It is just a wrapper to package_internal.sh
|
||||
# Example: ./build_opengauss.sh -3rd path/third_party_binarylibs/
|
||||
# Example: ./build_opengauss.sh -3rd /path/to/your/third_party_binarylibs/
|
||||
|
||||
# change it to "N", if you want to build with original build system based on solely Makefiles
|
||||
declare CMAKE_PKG="N"
|
||||
declare SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)
|
||||
|
|
@ -25,7 +32,7 @@ function print_help()
|
|||
-pkg|--package provode type of installation packages, values parameter is server.
|
||||
-m|--version_mode this values of paramenter is debug, release, memcheck, the default value is release.
|
||||
-pm product mode, values parameter is opengauss.
|
||||
-mc|--make_check this values of paramenter is on or off, the default value is on.
|
||||
-mc|--make_check this values of paramenter is on or off, the default value is on.
|
||||
-s|--symbol_mode whether separate symbol in debug mode, the default value is on.
|
||||
-co|--cmake_opt more cmake options
|
||||
"
|
||||
|
|
@ -86,7 +93,7 @@ while [ $# -gt 0 ]; do
|
|||
fi
|
||||
product_mode=$2
|
||||
shift 2
|
||||
;;
|
||||
;;
|
||||
-mc|--make_check)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given make check values"
|
||||
|
|
@ -94,7 +101,7 @@ while [ $# -gt 0 ]; do
|
|||
fi
|
||||
make_check=$2
|
||||
shift 2
|
||||
;;
|
||||
;;
|
||||
-s|--symbol_mode)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given symbol parameter"
|
||||
|
|
@ -102,7 +109,7 @@ while [ $# -gt 0 ]; do
|
|||
fi
|
||||
separate_symbol=$2
|
||||
shift 2
|
||||
;;
|
||||
;;
|
||||
--cmake_opt)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no extra configure options provided"
|
||||
|
|
@ -118,7 +125,7 @@ while [ $# -gt 0 ]; do
|
|||
fi
|
||||
extra_config_opt=$2
|
||||
shift 2
|
||||
;;
|
||||
;;
|
||||
*)
|
||||
echo "Internal Error: option processing error: $1" 1>&2
|
||||
echo "please input right paramtenter, the following command may help you"
|
||||
|
|
@ -142,11 +149,7 @@ else
|
|||
echo "begin config cmake options:" >> "$LOG_FILE" 2>&1
|
||||
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
|
||||
declare CMAKE_BUILD_DIR=${ROOT_DIR}/tmp_build
|
||||
if [ "$product_mode"x == "lite"x ]; then
|
||||
declare CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_PRIVATEGAUSS=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_LITE_MODE=ON ${extra_cmake_opt}"
|
||||
else
|
||||
declare CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_MOT=ON ${extra_cmake_opt}"
|
||||
fi
|
||||
declare CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_MOT=ON ${extra_cmake_opt}"
|
||||
echo "[cmake options] cmake options is:${CMAKE_OPT}" >> "$LOG_FILE" 2>&1
|
||||
source $SCRIPT_DIR/utils/cmake_compile.sh || exit 1
|
||||
fi
|
||||
|
|
@ -161,5 +164,6 @@ function main()
|
|||
gaussdb_build
|
||||
}
|
||||
main
|
||||
|
||||
echo "now, all build has finished!"
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ elif [ X"$kernel" == X"centos" ]; then
|
|||
elif [ X"$kernel" == X"openeuler" ]; then
|
||||
dist_version="openEuler"
|
||||
else
|
||||
dist_version="Platform"
|
||||
echo "Only support EulerOS|Centos|openEuler platform."
|
||||
echo "Kernel is $kernel"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
show_package=false
|
||||
|
|
@ -289,6 +291,12 @@ declare symbol_package_name="${package_pre_name}-symbol.${install_package_format
|
|||
echo "[makemppdb] $(date +%y-%m-%d' '%T): script dir : ${SCRIPT_DIR}"
|
||||
ROOT_DIR=$(dirname "$SCRIPT_DIR")
|
||||
ROOT_DIR=$(dirname "$ROOT_DIR")
|
||||
PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh")
|
||||
if [ "${PLAT_FORM_STR}"x == "Failed"x ]
|
||||
then
|
||||
echo "Only support EulerOS openEuler platform."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CMAKE_BUILD_DIR=${ROOT_DIR}/tmp_build
|
||||
declare LOG_FILE="${ROOT_DIR}/build/script/makemppdb_pkg.log"
|
||||
|
|
@ -296,12 +304,12 @@ declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
|
|||
declare ERR_MKGS_FAILED=1
|
||||
declare MKGS_OK=0
|
||||
if [ "${binarylib_dir}" != 'None' ] && [ -d "${binarylib_dir}" ]; then
|
||||
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/"
|
||||
PLATFORM_PATH="${binarylib_dir}/kernel/platform/"
|
||||
BINARYLIBS_PATH="${binarylib_dir}/kernel/dependency"
|
||||
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/${PLAT_FORM_STR}"
|
||||
PLATFORM_PATH="${binarylib_dir}/platform/${PLAT_FORM_STR}"
|
||||
BINARYLIBS_PATH="${binarylib_dir}/dependency"
|
||||
else
|
||||
BUILD_TOOLS_PATH="${ROOT_DIR}/buildtools/"
|
||||
PLATFORM_PATH="${ROOT_DIR}/kernel/platform/"
|
||||
BUILD_TOOLS_PATH="${ROOT_DIR}/buildtools/${PLAT_FORM_STR}"
|
||||
PLATFORM_PATH="${ROOT_DIR}/platform/${PLAT_FORM_STR}"
|
||||
BINARYLIBS_PATH="${ROOT_DIR}/binarylibs"
|
||||
fi
|
||||
|
||||
|
|
@ -311,9 +319,9 @@ export CC="$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/gcc"
|
|||
export CXX="$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/g++"
|
||||
export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_PATH/gcc$gcc_version/isl/lib:$BUILD_TOOLS_PATH/gcc$gcc_version/mpc/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/mpfr/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/gmp/lib/:$LD_LIBRARY_PATH
|
||||
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
|
||||
jdkpath=${binarylib_dir}/kernel/platform/huaweijdk8/${PLATFORM_ARCH}/jdk
|
||||
jdkpath=${binarylib_dir}/platform/huaweijdk8/${PLATFORM_ARCH}/jdk
|
||||
if [ ! -d "${jdkpath}" ]; then
|
||||
jdkpath=${binarylib_dir}/kernel/platform/openjdk8/${PLATFORM_ARCH}/jdk
|
||||
jdkpath=${binarylib_dir}/platform/openjdk8/${PLATFORM_ARCH}/jdk
|
||||
fi
|
||||
export JAVA_HOME=${jdkpath}
|
||||
|
||||
|
|
@ -442,7 +450,6 @@ function install_gaussdb()
|
|||
export BUILD_TUPLE=${PLATFORM_ARCH}
|
||||
export THIRD_BIN_PATH="${binarylibs_path}"
|
||||
export PREFIX_HOME="${BUILD_DIR}"
|
||||
export ENABLE_LITE_MODE=ON
|
||||
|
||||
if [ "$version_mode"x == "release"x ]; then
|
||||
CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_PRIVATEGAUSS=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_LITE_MODE=ON"
|
||||
|
|
@ -455,10 +462,6 @@ function install_gaussdb()
|
|||
export DEBUG_TYPE=debug
|
||||
fi
|
||||
|
||||
if [[ -e "/etc/openEuler-release" && "$(cat /etc/openEuler-release | awk '{print $3}')" == "22.03" ]]; then
|
||||
CMAKE_OPT="$CMAKE_OPT -DENABLE_OPENEULER_MAJOR=ON"
|
||||
fi
|
||||
echo "CMAKE_OPT----> $CMAKE_OPT"
|
||||
echo "Begin run cmake for gaussdb server" >> "$LOG_FILE" 2>&1
|
||||
echo "CMake options: ${CMAKE_OPT}" >> "$LOG_FILE" 2>&1
|
||||
echo "CMake release: ${DEBUG_TYPE}" >> "$LOG_FILE" 2>&1
|
||||
|
|
@ -512,6 +515,21 @@ function install_gaussdb()
|
|||
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | cut -d ")" -f 1 | awk '{print $NF}')
|
||||
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
|
||||
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
|
||||
|
||||
cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/bin/iperf3 ${BUILD_DIR}/bin
|
||||
if [ $? -ne 0 ]; then
|
||||
die "cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/bin/iperf3 ${BUILD_DIR}/bin failed"
|
||||
fi
|
||||
|
||||
cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/lib/libiperf.so.0 ${BUILD_DIR}/lib
|
||||
if [ $? -ne 0 ]; then
|
||||
die "cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/lib/libiperf.so.0 ${BUILD_DIR}/lib failed"
|
||||
fi
|
||||
|
||||
cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/fio/comm/bin/fio ${BUILD_DIR}/bin
|
||||
if [ $? -ne 0 ]; then
|
||||
die "cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/fio/comm/bin/fio ${BUILD_DIR}/bin failed"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
PRODUCT=openGauss
|
||||
VERSION=5.0.0
|
||||
VERSION=3.0.0
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
./bin/kadmin.local
|
||||
./bin/lz4
|
||||
./bin/kadmind
|
||||
./bin/dbmind
|
||||
./bin/server.key.cipher
|
||||
./bin/server.key.rand
|
||||
./etc/kerberos/kadm5.acl
|
||||
|
|
@ -79,9 +80,6 @@
|
|||
./share/postgresql/extension/gsredistribute--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw.control
|
||||
./share/postgresql/extension/dblink--1.0.sql
|
||||
./share/postgresql/extension/dblink--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/dblink.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -755,7 +753,6 @@
|
|||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/java/pljava.jar
|
||||
./lib/postgresql/postgres_fdw.so
|
||||
./lib/postgresql/dblink.so
|
||||
./lib/libpljava.so
|
||||
./lib/libpq.a
|
||||
./lib/libpq.so
|
||||
|
|
@ -884,7 +881,6 @@
|
|||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/libhll.so
|
||||
./lib/libodbc.so*
|
||||
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
./bin/kadmin.local
|
||||
./bin/lz4
|
||||
./bin/kadmind
|
||||
./bin/gs_dbmind
|
||||
./bin/dbmind
|
||||
./bin/server.key.cipher
|
||||
./bin/server.key.rand
|
||||
./bin/gs_plan_simulator.sh
|
||||
|
|
@ -82,9 +82,6 @@
|
|||
./share/postgresql/extension/gsredistribute--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw.control
|
||||
./share/postgresql/extension/dblink--1.0.sql
|
||||
./share/postgresql/extension/dblink--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/dblink.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -758,7 +755,6 @@
|
|||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/java/pljava.jar
|
||||
./lib/postgresql/postgres_fdw.so
|
||||
./lib/postgresql/dblink.so
|
||||
./lib/libpljava.so
|
||||
./lib/libpq.a
|
||||
./lib/libpq.so
|
||||
|
|
@ -887,7 +883,6 @@
|
|||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/libhll.so
|
||||
./lib/libodbc.so*
|
||||
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
|
|
@ -1053,54 +1048,12 @@
|
|||
./include/postgresql/server/access/ustore/undo/knl_uundotxn.h
|
||||
./include/postgresql/server/access/ustore/undo/knl_uundozone.h
|
||||
./include/postgresql/server/access/ustore/undo/knl_uundospace.h
|
||||
./include/postgresql/server/access/ustore/knl_uverify.h
|
||||
./include/postgresql/server/communication/commproxy_basic.h
|
||||
./include/postgresql/server/access/parallel_recovery/page_redo.h
|
||||
./include/postgresql/server/access/parallel_recovery/spsc_blocking_queue.h
|
||||
./include/postgresql/server/executor/exec/execdesc.h
|
||||
./include/postgresql/server/db4ai/matrix.h
|
||||
./include/postgresql/server/db4ai/scores.h
|
||||
./include/postgresql/server/db4ai/db4ai.h
|
||||
./include/postgresql/server/instruments/gs_stack.h
|
||||
./include/postgresql/server/instruments/instr_mfchain.h
|
||||
./include/postgresql/server/access/multixact.h
|
||||
./include/postgresql/server/access/xlogutils.h
|
||||
./include/postgresql/server/executor/functions.h
|
||||
./include/postgresql/server/storage/lock/waitpolicy.h
|
||||
./include/postgresql/server/storage/page_compression.h
|
||||
./include/postgresql/server/storage/smgr/knl_usync.h
|
||||
./include/postgresql/server/storage/smgr/fd.h
|
||||
./include/postgresql/server/storage/smgr/smgr.h
|
||||
./include/postgresql/server/storage/sharedfileset.h
|
||||
./include/postgresql/server/utils/knl_globalsysdbcache.h
|
||||
./include/postgresql/server/utils/knl_globaldbstatmanager.h
|
||||
./include/postgresql/server/utils/knl_globalsyscache_common.h
|
||||
./include/postgresql/server/utils/knl_globalbucketlist.h
|
||||
./include/postgresql/server/utils/knl_globalsystabcache.h
|
||||
./include/postgresql/server/utils/knl_globalsystupcache.h
|
||||
./include/postgresql/server/utils/knl_globaltabdefcache.h
|
||||
./include/postgresql/server/utils/knl_globalbasedefcache.h
|
||||
./include/postgresql/server/utils/knl_globalpartdefcache.h
|
||||
./include/postgresql/server/utils/knl_globalrelmapcache.h
|
||||
./include/postgresql/server/utils/knl_localsysdbcache.h
|
||||
./include/postgresql/server/utils/knl_localsystabcache.h
|
||||
./include/postgresql/server/utils/knl_localsystupcache.h
|
||||
./include/postgresql/server/utils/knl_localsyscache_common.h
|
||||
./include/postgresql/server/utils/knl_localtabdefcache.h
|
||||
./include/postgresql/server/utils/knl_localbasedefcache.h
|
||||
./include/postgresql/server/utils/knl_localbucketlist.h
|
||||
./include/postgresql/server/utils/knl_localpartdefcache.h
|
||||
./include/postgresql/server/utils/pl_global_package_runtime_cache.h
|
||||
./include/postgresql/server/catalog/pg_tablespace.h
|
||||
./include/postgresql/server/catalog/pg_subscription.h
|
||||
./include/postgresql/server/catalog/pg_replication_origin.h
|
||||
./include/postgresql/server/postmaster/barrier_creator.h
|
||||
./include/postgresql/server/postmaster/pagerepair.h
|
||||
./include/postgresql/server/replication/libpqwalreceiver.h
|
||||
./include/postgresql/server/replication/worker_internal.h
|
||||
./include/postgresql/server/replication/origin.h
|
||||
./include/postgresql/server/parser/scanner.h
|
||||
./include/postgresql/server/parser/keywords.h
|
||||
./jre/ASSEMBLY_EXCEPTION
|
||||
./jre/bin/java
|
||||
./jre/bin/jjs
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
declare SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)
|
||||
declare ROOT_DIR=$(dirname "${SCRIPT_DIR}")
|
||||
declare ROOT_DIR=$(dirname "${ROOT_DIR}")
|
||||
|
||||
|
||||
declare package_type='server'
|
||||
declare product_mode='opengauss'
|
||||
declare version_mode='release'
|
||||
|
|
@ -33,6 +35,8 @@ declare cm_dir='None'
|
|||
declare show_package='false'
|
||||
declare install_package_format='tar'
|
||||
|
||||
|
||||
|
||||
function print_help()
|
||||
{
|
||||
echo "Usage: $0 [OPTION]
|
||||
|
|
@ -44,6 +48,7 @@ function print_help()
|
|||
"
|
||||
}
|
||||
|
||||
|
||||
if [ $# = 0 ] ; then
|
||||
echo "missing option"
|
||||
print_help
|
||||
|
|
@ -121,18 +126,10 @@ fi
|
|||
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
|
||||
declare PKG_TMP_DIR="${BUILD_DIR}/temp"
|
||||
|
||||
if [ "${product_mode}" == "lite" ]; then
|
||||
if [ -e "$SCRIPT_DIR/utils/internal_packages_lite.sh" ];then
|
||||
source $SCRIPT_DIR/utils/internal_packages_lite.sh
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
if [ -e "$SCRIPT_DIR/utils/internal_packages.sh" ];then
|
||||
source $SCRIPT_DIR/utils/internal_packages.sh
|
||||
else
|
||||
if [ -e "$SCRIPT_DIR/utils/internal_packages.sh" ];then
|
||||
source $SCRIPT_DIR/utils/internal_packages.sh
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function main()
|
||||
|
|
@ -144,4 +141,4 @@ function main()
|
|||
main
|
||||
|
||||
echo "now, all packages has finished!"
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
#######################################################################
|
||||
# Copyright (c): 2012-2019, Huawei Tech. Co., Ltd.
|
||||
# descript: Separate debug information
|
||||
# Return 0 means OK.
|
||||
# Return 1 means failed.
|
||||
# version: 2.0
|
||||
# date: 2019-1-6
|
||||
#######################################################################
|
||||
|
||||
DEPTH=$(pwd)
|
||||
INSTALL_DIR=$DEPTH/../../mppdb_temp_install
|
||||
|
|
@ -113,7 +119,7 @@ separate_symbol()
|
|||
chmod 755 "$INSTALL_DIR/${symbol_name}.symbol"
|
||||
mv $INSTALL_DIR/${symbol_name}.symbol $CPTODEST
|
||||
fi
|
||||
elif [[ "$x" = *".so" || "$x" = *".so."* ]]; then
|
||||
elif [[ "$x" = *".so" ]]; then
|
||||
if [[ "$platformname" = "Redhat" ]] || [[ "$platformname" = "Euler" ]]; then
|
||||
if [[ "$x" = "libkadm5clnt.so" ]]; then
|
||||
echo "$x is not a dynamically linked or not stripped, do not separate symbol"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
#######################################################################
|
||||
# Copyright (c): 2020-2021, Huawei Tech. Co., Ltd.
|
||||
# descript: Compile and pack openGauss
|
||||
# Return 0 means OK.
|
||||
# Return 1 means failed.
|
||||
# version: 2.0
|
||||
# date: 2020-08-08
|
||||
#######################################################################
|
||||
#######################################################################
|
||||
## Check the installation package production environment
|
||||
#######################################################################
|
||||
|
|
@ -21,10 +27,10 @@ function gaussdb_pkg_pre_clean()
|
|||
function read_gaussdb_version()
|
||||
{
|
||||
cd ${SCRIPT_DIR}
|
||||
echo "${product_name}-${version_number}" > version.cfg
|
||||
echo "${gaussdb_name_for_package}-${version_number}" > version.cfg
|
||||
#auto read the number from kernal globals.cpp, no need to change it here
|
||||
}
|
||||
|
||||
|
||||
###################################
|
||||
# get version number from globals.cpp
|
||||
##################################
|
||||
|
|
@ -90,7 +96,6 @@ function make_license_control()
|
|||
die "modify '$gaussdb_version_file' failed."
|
||||
fi
|
||||
}
|
||||
|
||||
function make_gaussdb_kernel()
|
||||
{
|
||||
export BUILD_TUPLE=${PLATFORM_ARCH}
|
||||
|
|
@ -120,10 +125,11 @@ function make_gaussdb_kernel()
|
|||
if [ $? -ne 0 ]; then
|
||||
die "make install failed."
|
||||
fi
|
||||
|
||||
|
||||
echo "End make install gaussdb server" >> "$LOG_FILE" 2>&1
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
##install gaussdb database contained server,client and libpq
|
||||
#######################################################################
|
||||
|
|
@ -142,14 +148,14 @@ function install_gaussdb()
|
|||
echo "WARNING: do not separate symbol in debug mode!"
|
||||
fi
|
||||
|
||||
if [ "$product_mode" != "opengauss" -a "$product_mode" != "lite" ]; then
|
||||
die "the product mode can only be opengauss, lite!"
|
||||
if [ "$product_mode" != "opengauss" ]; then
|
||||
die "the product mode can only be opengauss!"
|
||||
fi
|
||||
|
||||
echo "build gaussdb kernel." >> "$LOG_FILE" 2>&1
|
||||
make_gaussdb_kernel
|
||||
echo "build gaussdb kernel success." >> "$LOG_FILE" 2>&1
|
||||
|
||||
|
||||
chmod 444 ${BUILD_DIR}/bin/cluster_guc.conf
|
||||
dos2unix ${BUILD_DIR}/bin/cluster_guc.conf > /dev/null 2>&1
|
||||
|
||||
|
|
@ -157,6 +163,9 @@ function install_gaussdb()
|
|||
get_kernel_commitid
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#######################################################################
|
||||
##install gaussdb database and others
|
||||
##select to install something according to variables package_type need
|
||||
|
|
@ -175,4 +184,4 @@ function gaussdb_build()
|
|||
echo "please input right paramenter values server or libpq "
|
||||
exit 1
|
||||
esac
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
#######################################################################
|
||||
# Copyright (c): 2020-2025, Huawei Tech. Co., Ltd.
|
||||
# descript: Compile and pack openGauss
|
||||
# Return 0 means OK.
|
||||
# Return 1 means failed.
|
||||
# version: 2.0
|
||||
# date: 2020-08-08
|
||||
#######################################################################
|
||||
|
||||
declare LOG_FILE="${SCRIPT_DIR}/makemppdb_pkg.log"
|
||||
declare product_name='openGauss'
|
||||
declare gaussdb_version='openGauss'
|
||||
declare PLATFORM_ARCH=$(uname -p)
|
||||
declare package_path=${ROOT_DIR}/output
|
||||
declare install_package_format="tar"
|
||||
|
|
@ -38,14 +44,17 @@ function die()
|
|||
{
|
||||
log "$@"
|
||||
echo "$@"
|
||||
exit $ERR_FAILED
|
||||
exit $ERR_MKGS_FAILED
|
||||
}
|
||||
|
||||
|
||||
|
||||
#######################################################################
|
||||
##select package command accroding to install_package_format
|
||||
#######################################################################
|
||||
function select_package_command()
|
||||
{
|
||||
|
||||
case "$install_package_format" in
|
||||
tar)
|
||||
tar='tar'
|
||||
|
|
@ -56,65 +65,86 @@ function select_package_command()
|
|||
}
|
||||
select_package_command
|
||||
|
||||
|
||||
#######################################################################
|
||||
##get os dist version
|
||||
#######################################################################
|
||||
if [[ -f "/etc/openEuler-release" ]]; then
|
||||
os_name="openEuler"
|
||||
elif [[ -f "/etc/euleros-release" ]]; then
|
||||
os_name="EulerOS"
|
||||
elif [[ -f "/etc/centos-release" ]]; then
|
||||
os_name="CentOS"
|
||||
elif [[ -f "/etc/openEuler-release" ]]; then
|
||||
os_name="openEuler"
|
||||
elif [[ -f "/etc/FusionOS-release" ]]; then
|
||||
os_name="FusionOS"
|
||||
elif [[ -f "/etc/kylin-release" ]]; then
|
||||
os_name="Kylin"
|
||||
elif [[ -f "/etc/asianux-release" ]]; then
|
||||
os_name="Asianux"
|
||||
export PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh")
|
||||
if [ "${PLAT_FORM_STR}"x == "Failed"x -o "${PLAT_FORM_STR}"x == ""x ]
|
||||
then
|
||||
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), Asianux platform."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [[ "$PLAT_FORM_STR" =~ "euleros" ]]; then
|
||||
dist_version="EulerOS"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
elif [[ "$PLAT_FORM_STR" =~ "centos" ]]; then
|
||||
dist_version="CentOS"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
elif [[ "$PLAT_FORM_STR" =~ "openeuler" ]]; then
|
||||
dist_version="openEuler"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE"
|
||||
fi
|
||||
elif [[ "$PLAT_FORM_STR" =~ "kylin" ]]; then
|
||||
dist_version="Kylin"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
elif [[ "$PLAT_FORM_STR" =~ "asianux" ]]; then
|
||||
dist_version="Asianux"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
else
|
||||
os_name=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z | sed 's/.*/\L&/; s/[a-z]*/\u&/g')
|
||||
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), Asianux platform."
|
||||
echo "Kernel is $kernel"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
##add platform architecture information
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
||||
if [ "$os_name" != "openEuler" ] && [ "$os_name" != "EulerOS" ] && [ "$os_name" != "FusionOS" ] && [ "$os_name" != "Kylin" ] && [ "$dist_version" != "Asianux" ]; then
|
||||
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), FusionOS(aarch64), Kylin(aarch64), Asianux platform."
|
||||
if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "Asianux" ]; then
|
||||
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), Asianux platform."
|
||||
exit 1
|
||||
fi
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
|
||||
if [ "${binarylib_dir}" != 'None' ] && [ -d "${binarylib_dir}" ]; then
|
||||
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools"
|
||||
PLATFORM_PATH="${binarylib_dir}/kernel/platform"
|
||||
BINARYLIBS_PATH="${binarylib_dir}/kernel/dependency"
|
||||
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/${PLAT_FORM_STR}"
|
||||
PLATFORM_PATH="${binarylib_dir}/platform/${PLAT_FORM_STR}"
|
||||
BINARYLIBS_PATH="${binarylib_dir}/dependency"
|
||||
else
|
||||
die "${binarylib_dir} doesn't exist."
|
||||
die "${binarylib_dir} not exist"
|
||||
fi
|
||||
|
||||
declare INSTALL_TOOLS_DIR=${binarylib_dir}/install_tools
|
||||
declare UNIX_ODBC="${BINARYLIBS_PATH}/unixodbc"
|
||||
declare INSTALL_TOOLS_DIR=${BINARYLIBS_PATH}/install_tools_${PLAT_FORM_STR}
|
||||
declare UNIX_ODBC="${BINARYLIBS_PATH}/${PLAT_FORM_STR}/unixodbc"
|
||||
|
||||
# Comment 编译相关
|
||||
gcc_version="7.3"
|
||||
# Comment 编译相关
|
||||
gcc_version="7.3"
|
||||
ccache -V >/dev/null 2>&1 && USE_CCACHE="ccache " ENABLE_CCACHE="--enable-ccache"
|
||||
export CC="${USE_CCACHE}$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/gcc"
|
||||
export CXX="${USE_CCACHE}$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/g++"
|
||||
export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_PATH/gcc$gcc_version/isl/lib:$BUILD_TOOLS_PATH/gcc$gcc_version/mpc/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/mpfr/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/gmp/lib/:$LD_LIBRARY_PATH
|
||||
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
|
||||
export JAVA_HOME=${PLATFORM_PATH}/huaweijdk8/${PLATFORM_ARCH}/jdk
|
||||
export JAVA_HOME=${binarylib_dir}/platform/huaweijdk8/${PLATFORM_ARCH}/jdk
|
||||
|
||||
declare ERR_FAILED=1
|
||||
declare ERR_OK=0
|
||||
declare ERR_MKGS_FAILED=1
|
||||
declare MKGS_OK=0
|
||||
|
||||
gaussdb_200_file="${BUILD_TOOLS_PATH}/license_control/gaussdb.version.GaussDB200"
|
||||
gaussdb_300_file="${BUILD_TOOLS_PATH}/license_control/gaussdb.version.GaussDB300"
|
||||
gaussdb_200_standard_file="${BUILD_TOOLS_PATH}/license_control/gaussdb.license.GaussDB200_Standard"
|
||||
|
||||
gaussdb_200_file="${binarylib_dir}/buildtools/license_control/gaussdb.version.GaussDB200"
|
||||
gaussdb_300_file="${binarylib_dir}/buildtools/license_control/gaussdb.version.GaussDB300"
|
||||
gaussdb_200_standard_file="${binarylib_dir}/buildtools/license_control/gaussdb.license.GaussDB200_Standard"
|
||||
gaussdb_version_file="${ROOT_DIR}/src/gausskernel/process/postmaster/gaussdb_version.cpp"
|
||||
|
||||
|
||||
|
||||
if [ -f "$SCRIPT_DIR/gaussdb.ver" ];then
|
||||
declare version_number=$(cat ${SCRIPT_DIR}/gaussdb.ver | grep 'VERSION' | awk -F "=" '{print $2}')
|
||||
else
|
||||
|
|
@ -127,10 +157,13 @@ declare release_file_list="${PLATFORM_ARCH}_${product_mode}_list"
|
|||
#######################################################################
|
||||
## declare all package name
|
||||
#######################################################################
|
||||
declare version_string="${product_name}-${version_number}"
|
||||
declare package_pre_name="${version_string}-${os_name}-${PLATFORM}bit"
|
||||
declare gaussdb_name_for_package="$(echo ${gaussdb_version} | sed 's/ /-/g')"
|
||||
declare version_string="${gaussdb_name_for_package}-${version_number}"
|
||||
declare package_pre_name="${version_string}-${dist_version}-${PLATFORM}bit"
|
||||
declare libpq_package_name="${package_pre_name}-Libpq.tar.gz"
|
||||
declare tools_package_name="${package_pre_name}-tools.tar.gz"
|
||||
declare kernel_package_name="${package_pre_name}.tar.bz2"
|
||||
declare symbol_package_name="${package_pre_name}-symbol.tar.gz"
|
||||
declare sha256_name="${package_pre_name}.sha256"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
#############################################################################
|
||||
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
#
|
||||
# openGauss is licensed under Mulan PSL v2.
|
||||
# You can use this software according to the terms
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
# See the Mulan PSL v2 for more details.
|
||||
# ----------------------------------------------------------------------------
|
||||
# Description : gs_backup is a utility to back up or restore binary files and parameter files.
|
||||
#############################################################################
|
||||
|
||||
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,217 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
# descript: package opengauss lite
|
||||
|
||||
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
|
||||
|
||||
#######################################################################
|
||||
# move pkgs to output directory
|
||||
#######################################################################
|
||||
function deploy_pkgs()
|
||||
{
|
||||
mkdir -p $package_path
|
||||
for pkg in $@; do
|
||||
if [ -f "$pkg" ]; then
|
||||
mv $pkg $package_path/
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
# copy directory's files list to $2
|
||||
#######################################################################
|
||||
function copy_files_list()
|
||||
{
|
||||
for file in $(echo $1)
|
||||
do
|
||||
test -e $file && tar -cpf - $file | ( cd $2; tar -xpf - )
|
||||
done
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
##copy target file into temporary directory temp
|
||||
#######################################################################
|
||||
function target_file_copy()
|
||||
{
|
||||
cd ${BUILD_DIR}
|
||||
copy_files_list "$1" $2
|
||||
|
||||
sed -i '/^process_cpu_affinity|/d' $2/bin/cluster_guc.conf
|
||||
|
||||
#generate tar file
|
||||
echo "Begin generate ${kernel_package_name} tar file..." >> "$LOG_FILE" 2>&1
|
||||
cd $2
|
||||
${BUILD_TOOLS_PATH}/p7z/bin/7z a -t7z -sfx "${kernel_package_name}" ./* >> "$LOG_FILE" 2>&1
|
||||
cd '-'
|
||||
mv $2/"${kernel_package_name}" ./
|
||||
if [ $? -ne 0 ]; then
|
||||
die "generate ${kernel_package_name} failed."
|
||||
fi
|
||||
echo "End generate ${kernel_package_name} tar file" >> "$LOG_FILE" 2>&1
|
||||
|
||||
#generate sha256 file
|
||||
sha256_name="${sha256_name}"
|
||||
echo "Begin generate ${sha256_name} sha256 file..." >> "$LOG_FILE" 2>&1
|
||||
sha256sum "${kernel_package_name}" | awk -F" " '{print $1}' > "${sha256_name}"
|
||||
if [ $? -ne 0 ]; then
|
||||
die "generate sha256 file failed."
|
||||
fi
|
||||
echo "End generate ${sha256_name} sha256 file" >> "$LOG_FILE" 2>&1
|
||||
if [ -d "${2}" ]; then
|
||||
rm -rf ${2}
|
||||
fi
|
||||
}
|
||||
|
||||
function target_file_copy_for_non_server()
|
||||
{
|
||||
cd ${BUILD_DIR}
|
||||
copy_files_list "$1" $2
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
##function prep_dest_list parse release_file_list variable represent file
|
||||
#######################################################################
|
||||
function prep_dest_list()
|
||||
{
|
||||
cd $SCRIPT_DIR
|
||||
releasefile=$1
|
||||
pkgname=$2
|
||||
|
||||
local head=$(cat $releasefile | grep "\[$pkgname\]" -n | awk -F: '{print $1}')
|
||||
if [ ! -n "$head" ]; then
|
||||
die "error: ono find $pkgname in the $releasefile file "
|
||||
fi
|
||||
|
||||
local tail=$(cat $releasefile | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
|
||||
if [ ! -n "$tail" ]; then
|
||||
local all=$(cat $releasefile | wc -l)
|
||||
let tail=$all+1-$head
|
||||
fi
|
||||
|
||||
dest_list=$(cat $releasefile | awk "NR==$head+1,NR==$tail+$head-1")
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
##back to separate_debug_symbol.sh dir
|
||||
#######################################################################
|
||||
function separate_symbol()
|
||||
{
|
||||
cd $SCRIPT_DIR
|
||||
if [ "$version_mode" = "release" ]; then
|
||||
chmod +x ./separate_debug_information.sh
|
||||
./separate_debug_information.sh
|
||||
cd $SCRIPT_DIR
|
||||
mv symbols.tar.gz $symbol_package_name
|
||||
deploy_pkgs $symbol_package_name
|
||||
fi
|
||||
}
|
||||
|
||||
function make_package_srv()
|
||||
{
|
||||
echo "Begin package server"
|
||||
cd $SCRIPT_DIR
|
||||
prep_dest_list $release_file_list 'server'
|
||||
|
||||
rm -rf ${BUILD_DIR}/temp
|
||||
mkdir -p ${BUILD_DIR}/temp/etc
|
||||
target_file_copy "$dest_list" ${BUILD_DIR}/temp
|
||||
make_package_upgrade_sql
|
||||
cp ${SCRIPT_DIR}/version.cfg ${BUILD_DIR}/temp
|
||||
if [ $? -ne 0 ]; then
|
||||
die "copy ${SCRIPT_DIR}/version.cfg to ${BUILD_DIR}/temp failed"
|
||||
fi
|
||||
|
||||
# pkg install uninstall scripts:install.sh, uninstall.sh, opengauss_lite.conf, upgrade_errorcode.sh
|
||||
for filename in install.sh uninstall.sh opengauss_lite.conf
|
||||
do
|
||||
if ! cp ${ROOT_DIR}/liteom/${filename} ${BUILD_DIR}/temp ; then
|
||||
die "copy ${ROOT_DIR}/liteom/${filename} to ${BUILD_DIR}/temp failed"
|
||||
fi
|
||||
done
|
||||
chmod 500 ./install.sh ./uninstall.sh
|
||||
# pkg upgrade scripts:upgrade_GAUSSV5.sh, upgrade_common.sh, upgrade_config.sh, upgrade_errorcode.sh
|
||||
for filename in upgrade_GAUSSV5.sh upgrade_common.sh upgrade_config.sh upgrade_errorcode.sh
|
||||
do
|
||||
if ! cp ${ROOT_DIR}/liteom/${filename} ${BUILD_DIR}/temp ; then
|
||||
die "copy ${ROOT_DIR}/liteom/${filename} to ${BUILD_DIR}/temp failed"
|
||||
fi
|
||||
done
|
||||
chmod 500 ./upgrade_GAUSSV5.sh
|
||||
chmod 400 ./upgrade_common.sh upgrade_errorcode.sh
|
||||
chmod 600 ./opengauss_lite.conf upgrade_config.sh
|
||||
mkdir -p ${BUILD_DIR}/temp/dependency
|
||||
cp ${BUILD_DIR}/lib/libstdc++.so.6 ${BUILD_DIR}/temp/dependency
|
||||
cd ${BUILD_DIR}/temp
|
||||
cp ${BUILD_DIR}/"${kernel_package_name}" ./
|
||||
cp ${BUILD_DIR}/"${sha256_name}" ./
|
||||
tar -czf "${package_pre_name}.tar.gz" ./*
|
||||
deploy_pkgs "${package_pre_name}.tar.gz"
|
||||
echo "make server(all) package success!"
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
# Install all SQL files from src/distribute/include/catalog/upgrade_sql
|
||||
# to INSTALL_DIR/bin/script/upgrade_sql.
|
||||
# Package all SQL files and then verify them with SHA256.
|
||||
#######################################################################
|
||||
function make_package_upgrade_sql()
|
||||
{
|
||||
echo "Begin to install upgrade_sql files..."
|
||||
UPGRADE_SQL_TAR="upgrade_sql.tar.gz"
|
||||
UPGRADE_SQL_SHA256="upgrade_sql.sha256"
|
||||
cd $SCRIPT_DIR
|
||||
mkdir -p ${BUILD_DIR}
|
||||
cd ${BUILD_DIR}
|
||||
rm -rf temp
|
||||
mkdir temp
|
||||
cd ${BUILD_DIR}/temp
|
||||
cp -r "${UPGRADE_SQL_DIR}" ./upgrade_sql
|
||||
[ $? -ne 0 ] && die "Failed to cp upgrade_sql files"
|
||||
tar -czf ${UPGRADE_SQL_TAR} upgrade_sql
|
||||
[ $? -ne 0 ] && die "Failed to package ${UPGRADE_SQL_TAR}"
|
||||
rm -rf ./upgrade_sql > /dev/null 2>&1
|
||||
|
||||
sha256sum ${UPGRADE_SQL_TAR} | awk -F" " '{print $1}' > "${UPGRADE_SQL_SHA256}"
|
||||
[ $? -ne 0 ] && die "Failed to generate sha256 sum file for ${UPGRADE_SQL_TAR}"
|
||||
|
||||
chmod 600 ${UPGRADE_SQL_TAR}
|
||||
chmod 600 ${UPGRADE_SQL_SHA256}
|
||||
echo "Successfully packaged upgrade_sql files."
|
||||
}
|
||||
|
||||
function make_package_libpq()
|
||||
{
|
||||
cd $SCRIPT_DIR
|
||||
prep_dest_list $release_file_list 'libpq'
|
||||
|
||||
rm -rf ${BUILD_DIR}/temp
|
||||
mkdir -p ${BUILD_DIR}/temp
|
||||
|
||||
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
|
||||
|
||||
if [ "$version_mode" != "memcheck" ]; then
|
||||
# copy include file
|
||||
prep_dest_list $release_file_list 'header'
|
||||
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
|
||||
fi
|
||||
|
||||
cd ${BUILD_DIR}/temp
|
||||
echo "packaging libpq..."
|
||||
tar -zvcf "${libpq_package_name}" ./* >>"$LOG_FILE" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
die "$package_command ${libpq_package_name} failed"
|
||||
fi
|
||||
|
||||
deploy_pkgs ${libpq_package_name}
|
||||
echo "install $pkgname tools is ${libpq_package_name} of ${package_path} directory " >> "$LOG_FILE" 2>&1
|
||||
echo "success!"
|
||||
}
|
||||
|
||||
function gaussdb_pkg()
|
||||
{
|
||||
echo "Start package opengauss."
|
||||
separate_symbol
|
||||
make_package_srv
|
||||
make_package_libpq
|
||||
echo "End package opengauss."
|
||||
}
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2025. All rights reserved.
|
||||
#######################################################################
|
||||
# Copyright (c): 2020-2025, Huawei Tech. Co., Ltd.
|
||||
# descript: Compile and pack openGauss
|
||||
# Return 0 means OK.
|
||||
# Return 1 means failed.
|
||||
# version: 2.0
|
||||
# date: 2020-08-08
|
||||
#######################################################################
|
||||
#######################################################################
|
||||
## Check the installation package production environment
|
||||
#######################################################################
|
||||
|
|
@ -21,14 +27,16 @@ function gaussdb_pkg_pre_clean()
|
|||
function read_gaussdb_version()
|
||||
{
|
||||
cd ${SCRIPT_DIR}
|
||||
echo "${product_name}-${version_number}" > version.cfg
|
||||
echo "${gaussdb_name_for_package}-${version_number}" > version.cfg
|
||||
#auto read the number from kernal globals.cpp, no need to change it here
|
||||
}
|
||||
|
||||
|
||||
PG_REG_TEST_ROOT="${ROOT_DIR}"
|
||||
ROACH_DIR="${ROOT_DIR}/distribute/bin/roach"
|
||||
MPPDB_DECODING_DIR="${ROOT_DIR}/contrib/mppdb_decoding"
|
||||
|
||||
|
||||
###################################
|
||||
# get version number from globals.cpp
|
||||
##################################
|
||||
|
|
@ -55,6 +63,7 @@ function read_gaussdb_number()
|
|||
fi
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
##insert the commitid to version.cfg as the upgrade app path specification
|
||||
#######################################################################
|
||||
|
|
@ -67,6 +76,7 @@ function get_kernel_commitid()
|
|||
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
## generate the version file.
|
||||
#######################################################################
|
||||
|
|
@ -95,6 +105,7 @@ function make_license_control()
|
|||
fi
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
##back to separate_debug_symbol.sh dir
|
||||
#######################################################################
|
||||
|
|
@ -131,8 +142,8 @@ function install_gaussdb()
|
|||
echo "WARNING: do not separate symbol in debug mode!"
|
||||
fi
|
||||
|
||||
if [ "$product_mode" != "opengauss" -a "$product_mode" != "lite" ]; then
|
||||
die "the product mode can only be opengauss, lite!"
|
||||
if [ "$product_mode" != "opengauss" ]; then
|
||||
die "the product mode can only be opengauss!"
|
||||
fi
|
||||
|
||||
#configure
|
||||
|
|
@ -165,20 +176,6 @@ function install_gaussdb()
|
|||
else
|
||||
./configure $shared_opt CFLAGS="-O0 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --enable-debug --enable-cassert CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
|
||||
fi
|
||||
elif [ "$product_mode"x == "lite"x ]; then
|
||||
shared_opt="--gcc-version=${gcc_version}.0 --prefix="${BUILD_DIR}" --3rd=${binarylib_dir} --enable-thread-safety ${enable_readline} --without-zlib --without-gssapi --without-krb5"
|
||||
if [ "$version_mode"x == "release"x ]; then
|
||||
# configure -D__USE_NUMA -D__ARM_LSE with arm single mode
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
||||
echo "configure -D__USE_NUMA -D__ARM_LSE with arm single mode"
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE"
|
||||
fi
|
||||
./configure $shared_opt CFLAGS="-O2 -g3 ${GAUSSDB_EXTRA_FLAGS}" CC=g++ $extra_config_opt --enable-lite-mode >> "$LOG_FILE" 2>&1
|
||||
elif [ "$version_mode"x == "memcheck"x ]; then
|
||||
./configure $shared_opt CFLAGS='-O0' --enable-debug --enable-cassert --enable-memory-check CC=g++ $extra_config_opt --enable-lite-mode >> "$LOG_FILE" 2>&1
|
||||
else
|
||||
./configure $shared_opt CFLAGS="-O0 ${GAUSSDB_EXTRA_FLAGS}" --enable-debug --enable-cassert CC=g++ $extra_config_opt --enable-lite-mode>> "$LOG_FILE" 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
@ -261,9 +258,13 @@ function install_gaussdb()
|
|||
|
||||
chmod 444 ${BUILD_DIR}/bin/cluster_guc.conf
|
||||
dos2unix ${BUILD_DIR}/bin/cluster_guc.conf > /dev/null 2>&1
|
||||
|
||||
separate_symbol
|
||||
|
||||
get_kernel_commitid
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
##install gaussdb database and others
|
||||
##select to install something according to variables package_type need
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
./bin/gstrace
|
||||
./bin/gs_dump
|
||||
./bin/gs_dumpall
|
||||
./bin/gs_ctl
|
||||
./bin/gs_initdb
|
||||
./bin/gs_ctl
|
||||
./bin/gs_guc
|
||||
./bin/gs_restore
|
||||
./bin/pg_config
|
||||
|
|
@ -41,8 +41,12 @@
|
|||
./share/postgresql/extension/file_fdw.control
|
||||
./share/postgresql/extension/hstore--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/hstore--1.0--1.1.sql
|
||||
./share/postgresql/extension/hdfs_fdw--1.0.sql
|
||||
./share/postgresql/extension/hdfs_fdw.control
|
||||
./share/postgresql/extension/log_fdw--1.0.sql
|
||||
./share/postgresql/extension/log_fdw.control
|
||||
./share/postgresql/extension/postgres_fdw--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -630,7 +634,6 @@
|
|||
./share/postgresql/timezone/Navajo
|
||||
./share/postgresql/timezone/GMT
|
||||
./share/postgresql/system_views.sql
|
||||
./share/postgresql/private_system_views.sql
|
||||
./share/postgresql/performance_views.sql
|
||||
./share/postgresql/sql_features.txt
|
||||
./share/postgresql/pg_cast_oid.txt
|
||||
|
|
@ -673,21 +676,39 @@
|
|||
./lib/libpq.so
|
||||
./lib/libpq.so.5
|
||||
./lib/libpq.so.5.5
|
||||
./lib/libssl.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libcgroup.so*
|
||||
./lib/libz.so*
|
||||
./lib/liblz4.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libcjson_utils.so*
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libcgroup.so
|
||||
./lib/libcgroup.so.1
|
||||
./lib/libz.so
|
||||
./lib/libz.so.1
|
||||
./lib/libz.so.1.2.11
|
||||
./lib/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.2
|
||||
./lib/libcjson.so
|
||||
./lib/libcjson.so.1
|
||||
./lib/libcjson.so.1.7.14
|
||||
./lib/libcjson_utils.so
|
||||
./lib/libcjson_utils.so.1
|
||||
./lib/libcjson_utils.so.1.7.14
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libgcc_s.so.1
|
||||
./lib/libgomp.so*
|
||||
./lib/libgomp.so
|
||||
./lib/libgomp.so.1
|
||||
./lib/libgomp.so.1.0.0
|
||||
./lib/libdcf.so
|
||||
./lib/libzstd.so*
|
||||
./lib/libcurl.so*
|
||||
./lib/libzstd.so
|
||||
./lib/libzstd.so.1
|
||||
./lib/libzstd.so.1.5.0
|
||||
./lib/libcurl.so
|
||||
./lib/libcurl.so.4
|
||||
./lib/libcurl.so.4.7.0
|
||||
./lib/libxgboost.so
|
||||
./lib/libpagecompression.so*
|
||||
./lib/libpagecompression.so
|
||||
./lib/libpagecompression.so.1
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/postgresql/euc_kr_and_mic.so
|
||||
|
|
@ -704,7 +725,6 @@
|
|||
./lib/postgresql/utf8_and_sjis.so
|
||||
./lib/postgresql/utf8_and_cyrillic.so
|
||||
./lib/postgresql/hstore.so
|
||||
./lib/postgresql/packages.so
|
||||
./lib/postgresql/utf8_and_euc_kr.so
|
||||
./lib/postgresql/ascii_and_mic.so
|
||||
./lib/postgresql/utf8_and_iso8859_1.so
|
||||
|
|
@ -719,14 +739,11 @@
|
|||
./lib/postgresql/utf8_and_euc2004.so
|
||||
./lib/postgresql/utf8_and_big5.so
|
||||
./lib/postgresql/mppdb_decoding.so
|
||||
./lib/postgresql/sql_decoding.so
|
||||
./lib/postgresql/pg_plugin
|
||||
./lib/postgresql/proc_srclib
|
||||
./lib/postgresql/security_plugin.so
|
||||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/postgresql/pgoutput.so
|
||||
./lib/libxgboost.so
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
|
|
@ -881,15 +898,15 @@
|
|||
./include/postgresql/server/lib/ilist.h
|
||||
./include/postgresql/server/pgxc/locator.h
|
||||
./include/postgresql/server/gstrace/gstrace_infra.h
|
||||
./include/postgresql/server/db4ai/db4ai.h
|
||||
[libpq]
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libpq.so
|
||||
./lib/libpq.so.5
|
||||
./lib/libpq.so.5.5
|
||||
./lib/libcrypto.so*
|
||||
./lib/libssl.so*
|
||||
[header]
|
||||
./include/libpq/libpq-fs.h
|
||||
./include/libpq-fe.h
|
||||
./include/postgres_ext.h
|
||||
./include/gs_thread.h
|
||||
|
|
@ -903,4 +920,4 @@
|
|||
./include/pqcomm.h
|
||||
./include/pqexpbuffer.h
|
||||
[version]
|
||||
5.0.0
|
||||
3.0.0
|
||||
|
|
@ -1,10 +1,4 @@
|
|||
[server]
|
||||
./bin/dsscmd
|
||||
./bin/dssserver
|
||||
./bin/perctrl
|
||||
./bin/dms_contrl.sh
|
||||
./bin/dss_clear.sh
|
||||
./bin/dss_contrl.sh
|
||||
./bin/gsql
|
||||
./bin/gaussdb
|
||||
./bin/gstrace
|
||||
|
|
@ -40,8 +34,8 @@
|
|||
./bin/kadmin.local
|
||||
./bin/lz4
|
||||
./bin/kadmind
|
||||
./bin/dbmind
|
||||
./bin/gs_dbmind
|
||||
./bin/constant
|
||||
./bin/server.key.cipher
|
||||
./bin/server.key.rand
|
||||
./bin/gs_plan_simulator.sh
|
||||
|
|
@ -77,15 +71,14 @@
|
|||
./share/postgresql/extension/file_fdw.control
|
||||
./share/postgresql/extension/hstore--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/hstore--1.0--1.1.sql
|
||||
./share/postgresql/extension/hdfs_fdw--1.0.sql
|
||||
./share/postgresql/extension/hdfs_fdw.control
|
||||
./share/postgresql/extension/log_fdw--1.0.sql
|
||||
./share/postgresql/extension/log_fdw.control
|
||||
./share/postgresql/extension/mot_fdw--1.0.sql
|
||||
./share/postgresql/extension/mot_fdw.control
|
||||
./share/postgresql/extension/postgres_fdw--1.0.sql
|
||||
./share/postgresql/extension/postgres_fdw.control
|
||||
./share/postgresql/extension/dblink--1.0.sql
|
||||
./share/postgresql/extension/dblink--unpackaged--1.0.sql
|
||||
./share/postgresql/extension/dblink.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -731,6 +724,7 @@
|
|||
./lib/postgresql/pgxs/src/Makefile.port
|
||||
./lib/postgresql/pgxs/src/nls-global.mk
|
||||
./lib/postgresql/pgxs/src/Makefile.global
|
||||
./lib/postgresql/pgxs/src/get_PlatForm_str.sh
|
||||
./lib/postgresql/pgxs/config/install-sh
|
||||
./lib/postgresql/euc_cn_and_mic.so
|
||||
./lib/postgresql/latin_and_mic.so
|
||||
|
|
@ -760,7 +754,6 @@
|
|||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/java/pljava.jar
|
||||
./lib/postgresql/postgres_fdw.so
|
||||
./lib/postgresql/dblink.so
|
||||
./lib/postgresql/pgoutput.so
|
||||
./lib/libpljava.so
|
||||
./lib/libpq.a
|
||||
|
|
@ -771,11 +764,18 @@
|
|||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libcgroup.so*
|
||||
./lib/libcom_err_gauss.so*
|
||||
./lib/libatomic.so*
|
||||
./lib/libcgroup.so
|
||||
./lib/libcgroup.so.1
|
||||
./lib/libcom_err_gauss.so
|
||||
./lib/libcom_err_gauss.so.3
|
||||
./lib/libcom_err_gauss.so.3.0
|
||||
./lib/libatomic.so
|
||||
./lib/libatomic.so.1
|
||||
./lib/libatomic.so.1.2.0
|
||||
./lib/libmasstree.so
|
||||
./lib/libupb.so*
|
||||
./lib/libupb.so
|
||||
./lib/libupb.so.9
|
||||
./lib/libupb.so.9.0.0
|
||||
./lib/libabsl_str_format_internal.so
|
||||
./lib/libabsl_strings.so
|
||||
./lib/libabsl_throw_delegate.so
|
||||
|
|
@ -789,28 +789,61 @@
|
|||
./lib/libabsl_log_severity.so
|
||||
./lib/libaddress_sorting.so
|
||||
./lib/libaddress_sorting.so.9
|
||||
./lib/libgssapi_krb5_gauss.so*
|
||||
./lib/libgssrpc_gauss.so*
|
||||
./lib/libk5crypto_gauss.so*
|
||||
./lib/libgssapi_krb5_gauss.so
|
||||
./lib/libgssapi_krb5_gauss.so.2
|
||||
./lib/libgssapi_krb5_gauss.so.2.2
|
||||
./lib/libgssrpc_gauss.so
|
||||
./lib/libgssrpc_gauss.so.4
|
||||
./lib/libgssrpc_gauss.so.4.2
|
||||
./lib/libk5crypto_gauss.so
|
||||
./lib/libk5crypto_gauss.so.3
|
||||
./lib/libk5crypto_gauss.so.3.1
|
||||
./lib/libkadm5clnt.so
|
||||
./lib/libkadm5clnt_mit.so*
|
||||
./lib/libkadm5clnt_mit.so
|
||||
./lib/libkadm5clnt_mit.so.11
|
||||
./lib/libkadm5clnt_mit.so.11.0
|
||||
./lib/libkadm5clnt_mit.so.12
|
||||
./lib/libkadm5clnt_mit.so.12.0
|
||||
./lib/libkadm5srv.so
|
||||
./lib/libkadm5srv_mit.so*
|
||||
./lib/libkdb5.so*
|
||||
./lib/libkrad.so*
|
||||
./lib/libkrb5_gauss.so*
|
||||
./lib/libkrb5support_gauss.so*
|
||||
./lib/libkadm5srv_mit.so
|
||||
./lib/libkadm5srv_mit.so.11
|
||||
./lib/libkadm5srv_mit.so.11.0
|
||||
./lib/libkadm5srv_mit.so.12
|
||||
./lib/libkadm5srv_mit.so.12.0
|
||||
./lib/libkdb5.so
|
||||
./lib/libkdb5.so.9
|
||||
./lib/libkdb5.so.9.0
|
||||
./lib/libkdb5.so.10
|
||||
./lib/libkdb5.so.10.0
|
||||
./lib/libkrad.so
|
||||
./lib/libkrad.so.0
|
||||
./lib/libkrad.so.0.0
|
||||
./lib/libkrb5_gauss.so
|
||||
./lib/libkrb5_gauss.so.3
|
||||
./lib/libkrb5_gauss.so.3.3
|
||||
./lib/libkrb5support_gauss.so
|
||||
./lib/libkrb5support_gauss.so.0
|
||||
./lib/libkrb5support_gauss.so.0.1
|
||||
./lib/krb5/plugins/kdb/db2.so
|
||||
./lib/libverto.so*
|
||||
./lib/libverto.so
|
||||
./lib/libverto.so.0
|
||||
./lib/libverto.so.0.0
|
||||
./lib/libcurl.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libssl.so*
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libgcc_s.so.1
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libz.so*
|
||||
./lib/liblz4.so*
|
||||
./lib/libz.so
|
||||
./lib/libz.so.1
|
||||
./lib/libz.so.1.2.11
|
||||
./lib/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.2
|
||||
./lib/libcjson.so*
|
||||
./lib/libconfig.so*
|
||||
./lib/libconfig.so
|
||||
./lib/libconfig.so.4
|
||||
./lib/libpgport_tool.so
|
||||
./lib/libpgport_tool.so.1
|
||||
./share/llvmir/GaussDB_expr.ir
|
||||
|
|
@ -823,17 +856,22 @@
|
|||
./lib/libpcre.so*
|
||||
./lib/libsecurec.so
|
||||
./lib/libxml2.so*
|
||||
./lib/libparquet.so
|
||||
./lib/libparquet.so.14
|
||||
./lib/libparquet.so.14.1.0
|
||||
./lib/libarrow.so
|
||||
./lib/libarrow.so.14
|
||||
./lib/libarrow.so.14.1.0
|
||||
./lib/OBS.ini
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/libdcf.so
|
||||
./lib/libzstd.so*
|
||||
./lib/libzstd.so
|
||||
./lib/libzstd.so.1
|
||||
./lib/libzstd.so.1.5.0
|
||||
./lib/libxgboost.so
|
||||
./lib/libpagecompression.so*
|
||||
./lib/libdssapi.so
|
||||
./lib/libdms.so
|
||||
./lib/libodbc.so*
|
||||
|
||||
./lib/libpagecompression.so
|
||||
./lib/libpagecompression.so.1
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
./include/postgresql/server/pgtime.h
|
||||
|
|
@ -961,8 +999,8 @@
|
|||
./include/postgresql/server/storage/item/itemptr.h
|
||||
./include/postgresql/server/storage/lock/s_lock.h
|
||||
./include/postgresql/server/storage/backendid.h
|
||||
./include/postgresql/server/storage/lock/lock.h
|
||||
./include/postgresql/server/storage/lock/lwlock.h
|
||||
./include/postgresql/server/storage/lock.h
|
||||
./include/postgresql/server/storage/lwlock.h
|
||||
./include/postgresql/server/storage/lwlocknames.h
|
||||
./include/postgresql/server/storage/barrier.h
|
||||
./include/postgresql/server/storage/shmem.h
|
||||
|
|
@ -1016,7 +1054,6 @@
|
|||
./include/postgresql/server/knl/knl_guc/knl_instance_attr_resource.h
|
||||
./include/postgresql/server/knl/knl_guc/knl_session_attr_common.h
|
||||
./include/postgresql/server/knl/knl_guc/knl_instance_attr_common.h
|
||||
./include/postgresql/server/access/ustore/knl_uverify.h
|
||||
./include/postgresql/server/lib/circularqueue.h
|
||||
./include/postgresql/server/access/double_write_basic.h
|
||||
./include/postgresql/server/knl/knl_thread.h
|
||||
|
|
@ -1126,9 +1163,6 @@
|
|||
./include/postgresql/server/catalog/namespace.h
|
||||
./include/postgresql/server/commands/trigger.h
|
||||
./include/postgresql/server/executor/spi.h
|
||||
./include/postgresql/server/db4ai/db4ai.h
|
||||
./include/postgresql/server/instruments/gs_stack.h
|
||||
./include/postgresql/server/instruments/instr_mfchain.h
|
||||
./include/postgresql/server/access/ustore/undo/knl_uundotype.h
|
||||
./include/postgresql/server/access/ustore/undo/knl_uundoapi.h
|
||||
./include/postgresql/server/access/ustore/knl_uheap.h
|
||||
|
|
@ -1148,44 +1182,6 @@
|
|||
./include/postgresql/server/executor/exec/execdesc.h
|
||||
./include/postgresql/server/db4ai/matrix.h
|
||||
./include/postgresql/server/db4ai/scores.h
|
||||
./include/postgresql/server/access/multixact.h
|
||||
./include/postgresql/server/access/xlogutils.h
|
||||
./include/postgresql/server/executor/functions.h
|
||||
./include/postgresql/server/storage/lock/waitpolicy.h
|
||||
./include/postgresql/server/storage/page_compression.h
|
||||
./include/postgresql/server/storage/smgr/knl_usync.h
|
||||
./include/postgresql/server/storage/smgr/fd.h
|
||||
./include/postgresql/server/storage/smgr/smgr.h
|
||||
./include/postgresql/server/storage/sharedfileset.h
|
||||
./include/postgresql/server/utils/knl_globalsysdbcache.h
|
||||
./include/postgresql/server/utils/knl_globaldbstatmanager.h
|
||||
./include/postgresql/server/utils/knl_globalsyscache_common.h
|
||||
./include/postgresql/server/utils/knl_globalbucketlist.h
|
||||
./include/postgresql/server/utils/knl_globalsystabcache.h
|
||||
./include/postgresql/server/utils/knl_globalsystupcache.h
|
||||
./include/postgresql/server/utils/knl_globaltabdefcache.h
|
||||
./include/postgresql/server/utils/knl_globalbasedefcache.h
|
||||
./include/postgresql/server/utils/knl_globalpartdefcache.h
|
||||
./include/postgresql/server/utils/knl_globalrelmapcache.h
|
||||
./include/postgresql/server/utils/knl_localsysdbcache.h
|
||||
./include/postgresql/server/utils/knl_localsystabcache.h
|
||||
./include/postgresql/server/utils/knl_localsystupcache.h
|
||||
./include/postgresql/server/utils/knl_localsyscache_common.h
|
||||
./include/postgresql/server/utils/knl_localtabdefcache.h
|
||||
./include/postgresql/server/utils/knl_localbasedefcache.h
|
||||
./include/postgresql/server/utils/knl_localbucketlist.h
|
||||
./include/postgresql/server/utils/knl_localpartdefcache.h
|
||||
./include/postgresql/server/utils/pl_global_package_runtime_cache.h
|
||||
./include/postgresql/server/catalog/pg_tablespace.h
|
||||
./include/postgresql/server/catalog/pg_subscription.h
|
||||
./include/postgresql/server/catalog/pg_replication_origin.h
|
||||
./include/postgresql/server/postmaster/barrier_creator.h
|
||||
./include/postgresql/server/postmaster/pagerepair.h
|
||||
./include/postgresql/server/replication/libpqwalreceiver.h
|
||||
./include/postgresql/server/replication/worker_internal.h
|
||||
./include/postgresql/server/replication/origin.h
|
||||
./include/postgresql/server/parser/scanner.h
|
||||
./include/postgresql/server/parser/keywords.h
|
||||
./jre/ASSEMBLY_EXCEPTION
|
||||
./jre/bin/java
|
||||
./jre/bin/jjs
|
||||
|
|
@ -1371,19 +1367,33 @@
|
|||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libconfig.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libconfig.so
|
||||
./lib/libconfig.so.4
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libssl.so*
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libpgport_tool.so
|
||||
./lib/libpgport_tool.so.1
|
||||
./lib/libgssapi_krb5_gauss.so*
|
||||
./lib/libgssrpc_gauss.so*
|
||||
./lib/libk5crypto_gauss.so*
|
||||
./lib/libkrb5support_gauss.so*
|
||||
./lib/libkrb5_gauss.so*
|
||||
./lib/libcom_err_gauss.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libgssapi_krb5_gauss.so
|
||||
./lib/libgssapi_krb5_gauss.so.2
|
||||
./lib/libgssapi_krb5_gauss.so.2.2
|
||||
./lib/libgssrpc_gauss.so
|
||||
./lib/libgssrpc_gauss.so.4
|
||||
./lib/libgssrpc_gauss.so.4.2
|
||||
./lib/libk5crypto_gauss.so
|
||||
./lib/libk5crypto_gauss.so.3
|
||||
./lib/libk5crypto_gauss.so.3.1
|
||||
./lib/libkrb5support_gauss.so
|
||||
./lib/libkrb5support_gauss.so.0
|
||||
./lib/libkrb5support_gauss.so.0.1
|
||||
./lib/libkrb5_gauss.so
|
||||
./lib/libkrb5_gauss.so.3
|
||||
./lib/libkrb5_gauss.so.3.3
|
||||
./lib/libcom_err_gauss.so
|
||||
./lib/libcom_err_gauss.so.3
|
||||
./lib/libcom_err_gauss.so.3.0
|
||||
[libpq]
|
||||
./lib/libpq.a
|
||||
./lib/libpq.so
|
||||
|
|
@ -1393,19 +1403,33 @@
|
|||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libconfig.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libconfig.so
|
||||
./lib/libconfig.so.4
|
||||
./lib/libcrypto.so
|
||||
./lib/libcrypto.so.1.1
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libssl.so*
|
||||
./lib/libssl.so
|
||||
./lib/libssl.so.1.1
|
||||
./lib/libpgport_tool.so
|
||||
./lib/libpgport_tool.so.1
|
||||
./lib/libgssapi_krb5_gauss.so*
|
||||
./lib/libgssrpc_gauss.so*
|
||||
./lib/libk5crypto_gauss.so*
|
||||
./lib/libkrb5support_gauss.so*
|
||||
./lib/libkrb5_gauss.so*
|
||||
./lib/libcom_err_gauss.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libgssapi_krb5_gauss.so
|
||||
./lib/libgssapi_krb5_gauss.so.2
|
||||
./lib/libgssapi_krb5_gauss.so.2.2
|
||||
./lib/libgssrpc_gauss.so
|
||||
./lib/libgssrpc_gauss.so.4
|
||||
./lib/libgssrpc_gauss.so.4.2
|
||||
./lib/libk5crypto_gauss.so
|
||||
./lib/libk5crypto_gauss.so.3
|
||||
./lib/libk5crypto_gauss.so.3.1
|
||||
./lib/libkrb5support_gauss.so
|
||||
./lib/libkrb5support_gauss.so.0
|
||||
./lib/libkrb5support_gauss.so.0.1
|
||||
./lib/libkrb5_gauss.so
|
||||
./lib/libkrb5_gauss.so.3
|
||||
./lib/libkrb5_gauss.so.3.3
|
||||
./lib/libcom_err_gauss.so
|
||||
./lib/libcom_err_gauss.so.3
|
||||
./lib/libcom_err_gauss.so.3.0
|
||||
./include/gs_thread.h
|
||||
./include/gs_threadlocal.h
|
||||
./include/postgres_ext.h
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ ENDMACRO(CHECK_CC_ENABLE)
|
|||
|
||||
function(GET_VERSIONSTR_FROMGIT ret)
|
||||
set(PG_VERSION "9.2.4")
|
||||
set(OPENGAUSS_VERSION "5.0.0")
|
||||
set(OPENGAUSS_VERSION "3.0.0")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/${openGauss}/cmake/src/buildfunction.sh --s ${PROJECT_TRUNK_DIR} OUTPUT_VARIABLE GS_VERSION_STR)
|
||||
set(PG_VERSION "${PG_VERSION}" PARENT_SCOPE)
|
||||
|
|
|
|||
|
|
@ -17,12 +17,6 @@ if(NOT ${PGPORT})
|
|||
set(PGPORT 5432)
|
||||
endif()
|
||||
|
||||
#this is the default WAL segment size (MB), the old is --with-wal-segsize=16, now -DWAL_SEGSIZE=16
|
||||
option(WAL_SEGSIZE 16)
|
||||
if(NOT ${WAL_SEGSIZE})
|
||||
set(WAL_SEGSIZE 16)
|
||||
endif()
|
||||
|
||||
GET_VERSIONSTR_FROMGIT(GET_PG_VERSION_STR)
|
||||
|
||||
#CMake does not allow g++ to compile C files. They are two different languages. You should understand what you are doing.
|
||||
|
|
@ -58,13 +52,10 @@ option(ENABLE_PRIVATEGAUSS "enable privategauss,the old is --enable-pribategauss
|
|||
option(ENABLE_LITE_MODE "enable lite in single_node mode,the old is --enable-lite-mode" OFF)
|
||||
option(ENABLE_DEBUG "enable privategauss,the old is --enable-pribategauss" OFF)
|
||||
option(ENABLE_MOT "enable mot in single_node mode,the old is --enable-mot" OFF)
|
||||
option(ENABLE_NUMA "enable numa,the old is --enable-numa" ON)
|
||||
option(ENABLE_LSE "enable lse,the old is --enable-lse" ON)
|
||||
option(ENABLE_MYSQL_FDW "enable export or import data with mysql,the old is --enable-mysql-fdw" OFF)
|
||||
option(ENABLE_ORACLE_FDW "enable export or import data with oracle,the old is --enable-oracle-fdw" OFF)
|
||||
option(BUILD_BY_CMAKE "the BUILD_BY_CMAKE is new,used in distribute pg_regress.cpp" ON)
|
||||
option(DEBUG_UHEAP "collect USTORE statistics" OFF)
|
||||
option(MAX_ALLOC_SEGNUM "max alloc xlog seg num in extreme_rto" 4)
|
||||
|
||||
#No matter what to set, the old mppdb aways use ENABLE_THREAD_SAFETY=yes by default defined.
|
||||
option(ENABLE_THREAD_SAFETY "enable thread safety, the old is --enable-thread-safety" ON)
|
||||
|
|
@ -74,7 +65,7 @@ option(USE_BONJOUR "enable bonjour, the old is --with-bonjour" OFF)
|
|||
option(USE_LDAP "build with ldap, the old is --with-ldap" OFF)#ON
|
||||
option(USE_ETCD "build with etcd libs, new option for old mppdb, after 8.1 close it" OFF)
|
||||
option(USE_PROTOBUF "build with with protobuf's libs, we must need it" ON)
|
||||
option(USE_LIBXML "build with libxml, the old is --with-libxml" ON)
|
||||
option(USE_LIBXML "build with libxml, the old is --with-libxml" OFF)
|
||||
option(HAVE_LIBXML2 "build with libxml2, the old is --with-libxml2" OFF)
|
||||
option(USE_LIBXSLT "build with libxslt, the old is --with-libxslt" OFF)
|
||||
option(USE_PAM "build with pam, the old is --with-pam" OFF)
|
||||
|
|
@ -94,7 +85,6 @@ option(HAVE_LIBM "enable -lm, this set to default -lm" ON)
|
|||
option(HAVE_POSIX_SIGNALS "enable posix signals, this set to default" ON)
|
||||
option(HAVE_GCC_INT_ATOMICS "enable gcc buildin atomics operations, this set to default" ON)
|
||||
option(FLEXIBLE_ARRAY_MEMBER "pq_ce need" ON)
|
||||
option(ENABLE_OPENEULER_MAJOR "support openEuler 22.03 LTS, this set to default" OFF)
|
||||
|
||||
# we will differ compile flags and definitions by different vars
|
||||
set(DB_COMMON_DEFINE "")
|
||||
|
|
@ -110,7 +100,7 @@ elseif($ENV{DEBUG_TYPE} STREQUAL "release")
|
|||
#close something for release version.
|
||||
set(ENABLE_LLT OFF)
|
||||
set(ENABLE_UT OFF)
|
||||
set(OPTIMIZE_LEVEL -O2 -g3)
|
||||
set(OPTIMIZE_LEVEL -O2)
|
||||
elseif($ENV{DEBUG_TYPE} STREQUAL "memcheck")
|
||||
message("DEBUG_TYPE:$ENV{DEBUG_TYPE}")
|
||||
set(ENABLE_MEMORY_CHECK ON)
|
||||
|
|
@ -122,7 +112,7 @@ if($ENV{DEBUG_TYPE} STREQUAL "debug" OR $ENV{DEBUG_TYPE} STREQUAL "memcheck")
|
|||
endif()
|
||||
|
||||
if(${BUILD_TUPLE} STREQUAL "aarch64")
|
||||
if($ENV{DEBUG_TYPE} STREQUAL "release" AND ${ENABLE_MULTIPLE_NODES} STREQUAL "OFF" AND ${ENABLE_LSE} STREQUAL "ON")
|
||||
if($ENV{DEBUG_TYPE} STREQUAL "release" AND ${ENABLE_MULTIPLE_NODES} STREQUAL "OFF")
|
||||
set(DB_COMMON_DEFINE ${DB_COMMON_DEFINE} -D__ARM_LSE)
|
||||
set(OS_OPTIONS -march=armv8-a+crc+lse)
|
||||
else()
|
||||
|
|
@ -130,7 +120,7 @@ if(${BUILD_TUPLE} STREQUAL "aarch64")
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(${BUILD_TUPLE} STREQUAL "aarch64" AND ${ENABLE_NUMA} STREQUAL "ON")
|
||||
if(${BUILD_TUPLE} STREQUAL "aarch64")
|
||||
if(NOT $ENV{DEBUG_TYPE} STREQUAL "memcheck")
|
||||
set(DB_COMMON_DEFINE ${DB_COMMON_DEFINE} -D__USE_NUMA)
|
||||
endif()
|
||||
|
|
@ -140,29 +130,13 @@ if(${ENABLE_LITE_MODE} STREQUAL "ON")
|
|||
set(ENABLE_LLVM_COMPILE OFF)
|
||||
set(ENABLE_GSS OFF)
|
||||
set(KRB5 OFF)
|
||||
set(USE_LIBXML OFF)
|
||||
endif()
|
||||
|
||||
if(${ENABLE_OPENEULER_MAJOR} STREQUAL "ON")
|
||||
add_definitions(-DOPENEULER_MAJOR)
|
||||
endif()
|
||||
|
||||
set(PROTECT_OPTIONS -fwrapv -std=c++14 -fnon-call-exceptions ${OPTIMIZE_LEVEL})
|
||||
set(WARNING_OPTIONS -Wall -Wendif-labels -Wformat-security)
|
||||
set(OPTIMIZE_OPTIONS -pipe -pthread -fno-aggressive-loop-optimizations -fno-expensive-optimizations -fno-omit-frame-pointer -fno-strict-aliasing -freg-struct-return)
|
||||
set(WARNING_OPTIONS -Wall -Wendif-labels -Werror -Wformat-security)
|
||||
set(OPTIMIZE_OPTIONS -pipe -pthread -fno-aggressive-loop-optimizations -fno-strict-aliasing -freg-struct-return)
|
||||
set(CHECK_OPTIONS -Wmissing-format-attribute -Wno-attributes -Wno-unused-but-set-variable -Wno-write-strings -Wpointer-arith)
|
||||
set(MACRO_OPTIONS -D_GLIBCXX_USE_CXX11_ABI=0 -DENABLE_GSTRACE -D_GNU_SOURCE -DPGXC -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DSTREAMPLAN -D_THREAD_SAFE ${DB_COMMON_DEFINE})
|
||||
|
||||
# Set MAX_ALLOC_SEGNUM size in extreme_rto
|
||||
if(${WAL_SEGSIZE} LESS 256)
|
||||
set(MAX_ALLOC_SEGNUM 4)
|
||||
elseif(${WAL_SEGSIZE} GREATER_EQUAL 256 AND ${WAL_SEGSIZE} LESS 512)
|
||||
set(MAX_ALLOC_SEGNUM 2)
|
||||
elseif(${WAL_SEGSIZE} GREATER_EQUAL 512)
|
||||
set(MAX_ALLOC_SEGNUM 1)
|
||||
else()
|
||||
message(FATAL_ERROR "error: Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64,128,256,512.")
|
||||
endif()
|
||||
set(MACRO_OPTIONS -D_GLIBCXX_USE_CXX11_ABI=0 -D_GNU_SOURCE -DPGXC -D_POSIX_PTHREAD_SEMANTICS -DSTREAMPLAN ${DB_COMMON_DEFINE})
|
||||
|
||||
# libraries need secure options during compling
|
||||
set(LIB_SECURE_OPTIONS -fPIC -fno-common -fstack-protector)
|
||||
|
|
@ -197,7 +171,7 @@ set(MEMCHECK_LIBS "")
|
|||
set(MEMCHECK_LINK_DIRECTORIES "")
|
||||
if(${ENABLE_MEMORY_CHECK})
|
||||
set(MEMCHECK_FLAGS ${MEMCHECK_FLAGS} -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer)
|
||||
set(MEMCHECK_LIBS ${MEMCHECK_LIBS} -static-libasan)
|
||||
set(MEMCHECK_LIBS ${MEMCHECK_LIBS} libasan.a)
|
||||
set(MEMCHECK_LINK_DIRECTORIES ${MEMCHECK_LINK_DIRECTORIES} ${MEMCHECK_LIB_PATH})
|
||||
set(GAUSSDB_CONFIGURE "${GAUSSDB_CONFIGURE} -DENABLE_MEMORY_CHECK")
|
||||
list(REMOVE_ITEM LIB_SECURE_OPTIONS -fstack-protector)
|
||||
|
|
@ -209,7 +183,7 @@ set(THREAD_LIBS "")
|
|||
set(THREAD_LINK_DIRECTORIES "")
|
||||
if(${ENABLE_THREAD_CHECK})
|
||||
set(THREAD_FLAGS ${THREAD_FLAGS} -fsanitize=thread -fno-omit-frame-pointer)
|
||||
set(THREAD_LIBS ${THREAD_LIBS} -static-libtsan)
|
||||
set(THREAD_LIBS ${THREAD_LIBS} libtsan.a)
|
||||
set(THREAD_LINK_DIRECTORIES ${THREAD_LINK_DIRECTORIES} ${MEMCHECK_LIB_PATH})
|
||||
set(GAUSSDB_CONFIGURE "${GAUSSDB_CONFIGURE} -DENABLE_THREAD_CHECK")
|
||||
endif()
|
||||
|
|
@ -231,7 +205,6 @@ if(${USE_LIBXML})
|
|||
else()
|
||||
set(LIBS "${LIBS} -lxml")
|
||||
set(GAUSSDB_CONFIGURE "${GAUSSDB_CONFIGURE} -DUSE_LIBXML")
|
||||
set(CMAKE_CXX_FLAGS -l:liblzma.so.5)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
@ -271,7 +244,7 @@ add_definitions(-Wno-builtin-macro-redefined)
|
|||
SET_GCC_FLAGS(DB_COMMON_FLAGS "")
|
||||
|
||||
#hotpatch
|
||||
set(HOTPATCH_PLATFORM_LIST suse11_sp1_x86_64 suse12_sp5_x86_64 euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 euleros2.0_sp10_aarch64 euleros2.0_sp2_x86_64 euleros2.0_sp5_x86_64 euleros2.0_sp10_x86_64 kylinv10_sp1_aarch64 kylinv10_sp1_x86_64)
|
||||
set(HOTPATCH_PLATFORM_LIST suse11_sp1_x86_64 suse12_sp5_x86_64 euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 euleros2.0_sp10_aarch64 euleros2.0_sp2_x86_64 euleros2.0_sp5_x86_64 euleros2.0_sp10_x86_64 kylinv10_sp1_aarch64 kylinv10_sp1_x86_64_intel)
|
||||
set(HOTPATCH_ARM_LIST euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 euleros2.0_sp10_aarch64 kylinv10_sp1_aarch64)
|
||||
list(FIND HOTPATCH_PLATFORM_LIST "${PLAT_FORM_NAME}" RET_HOTPATCH)
|
||||
list(FIND HOTPATCH_ARM_LIST "${PLAT_FORM_NAME}" RET_ARM_HOTPATCH)
|
||||
|
|
@ -300,7 +273,6 @@ if(${ENABLE_LLVM_COMPILE} STREQUAL "ON")
|
|||
# LLVM version
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --version OUTPUT_VARIABLE LLVM_VERSION_STR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE "." ";" LLVM_VERSION_LIST ${LLVM_VERSION_STR})
|
||||
message(STATUS "status ENV{LLVM_VERSION_STR}" $ENV{LLVM_VERSION_STR})
|
||||
list(GET LLVM_VERSION_LIST 0 LLVM_MAJOR_VERSION)
|
||||
list(GET LLVM_VERSION_LIST 1 LLVM_MINOR_VERSION)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -116,9 +116,6 @@ function get_gs_version()
|
|||
debug_str="$DEBUG_TYPE"
|
||||
product=$(cat build/script/gaussdb.ver | grep 'PRODUCT' | awk -F "=" '{print $2}')
|
||||
version=$(cat build/script/gaussdb.ver | grep 'VERSION' | awk -F "=" '{print $2}')
|
||||
if [ "${ENABLE_LITE_MODE}" == "ON" ]; then
|
||||
product="$product-lite"
|
||||
fi
|
||||
if test "$enable_ccache" = yes; then
|
||||
default_gs_version="(${product} ${version} build 1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@
|
|||
#define PGXC_VERSION_NUM
|
||||
|
||||
/* openGauss version as a number string */
|
||||
#define OPENGAUSS_VERSION_NUM_STR "5.0.0"
|
||||
#define OPENGAUSS_VERSION_NUM_STR "3.0.0"
|
||||
|
||||
/* A string containing the version number, platform, and C compiler */
|
||||
#define PG_VERSION_STR "@PG_VERSION_STR@"
|
||||
|
|
@ -870,10 +870,7 @@
|
|||
/* XLOG_SEG_SIZE is the size of a single WAL file. This must be a power of 2
|
||||
* * and larger than XLOG_BLCKSZ (preferably, a great deal larger than
|
||||
* * XLOG_BLCKSZ). Changing XLOG_SEG_SIZE requires an initdb. */
|
||||
#define XLOG_SEG_SIZE (@WAL_SEGSIZE@ * 1024 * 1024)
|
||||
|
||||
/* Number of max alloc xlog segment in extreme_rto, default 4 */
|
||||
#define MAX_ALLOC_SEGNUM @MAX_ALLOC_SEGNUM@
|
||||
#define XLOG_SEG_SIZE (16 * 1024 * 1024)
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#cmakedefine _FILE_OFFSET_BITS
|
||||
|
|
@ -912,6 +909,8 @@
|
|||
* (--enable-multiple-nodes) */
|
||||
#cmakedefine ENABLE_MULTIPLE_NODES
|
||||
|
||||
#cmakedefine ENABLE_TRACE_COLUMN_DEFAULT_VALUE
|
||||
|
||||
/* Define to 1 if you want to generate gauss product as privategauss nodes.
|
||||
* * (--enable-privategauss) */
|
||||
#cmakedefine ENABLE_PRIVATEGAUSS
|
||||
|
|
|
|||
|
|
@ -878,9 +878,6 @@
|
|||
XLOG_BLCKSZ). Changing XLOG_SEG_SIZE requires an initdb. */
|
||||
#define XLOG_SEG_SIZE (16 * 1024 * 1024)
|
||||
|
||||
/* Number of max alloc xlog segment in extreme_rto, default 4 */
|
||||
#define MAX_ALLOC_SEGNUM 4
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
|
|
|
|||
|
|
@ -878,9 +878,6 @@
|
|||
XLOG_BLCKSZ). Changing XLOG_SEG_SIZE requires an initdb. */
|
||||
#define XLOG_SEG_SIZE (16 * 1024 * 1024)
|
||||
|
||||
/* Number of max alloc xlog segment in extreme_rto, default 4 */
|
||||
#define MAX_ALLOC_SEGNUM 4
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
|
|
|
|||
|
|
@ -695,7 +695,7 @@
|
|||
#define PG_VERSION "9.2.4"
|
||||
|
||||
/* openGauss version as a string */
|
||||
#define OPENGAUSS_VERSION "5.0.0"
|
||||
#define OPENGAUSS_VERSION "3.0.0"
|
||||
|
||||
/* Gaussdb version as a string*/
|
||||
#define DEF_GS_VERSION "(GaussDB A 8.0.0 build 21f07aff) compiled at 2020-03-17 10:59:07 commit 7431 last mr 12039 debug"
|
||||
|
|
@ -870,9 +870,6 @@
|
|||
* XLOG_BLCKSZ). Changing XLOG_SEG_SIZE requires an initdb. */
|
||||
#define XLOG_SEG_SIZE (16 * 1024 * 1024)
|
||||
|
||||
/* Number of max alloc xlog segment in extreme_rto, default 4 */
|
||||
#define MAX_ALLOC_SEGNUM 4
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ option(ENABLE_LLT "enable llt, current value is --enable-llt" OFF)
|
|||
option(ENABLE_UT "enable ut, current value is --enable-ut" OFF)
|
||||
option(WITH_OPENEULER_OS "Build openGauss rpm package on openEuler os" OFF)
|
||||
|
||||
execute_process(COMMAND sh ${PROJECT_SRC_DIR}/get_PlatForm_str.sh OUTPUT_VARIABLE PLAT_FORM_STR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
#############################################################################
|
||||
# get the depend lib path
|
||||
# 1. libedit, event, libcgroup, kerberos, zlib1.2.11, boost,
|
||||
# libxml are support parameter --enable-llt and --enable-ut;
|
||||
# libxml and protobuf are support parameter --enable-llt and --enable-ut;
|
||||
# $(LIB_SUPPORT_LLT)
|
||||
# 2. Huawei_Secure_C, gtest, mockcpp, unixodbc, libstd
|
||||
# and openssl not support parameter --enable-llt and --enable-ut;
|
||||
|
|
@ -35,11 +37,12 @@ endif()
|
|||
|
||||
set(LIB_UNIFIED_SUPPORT comm)
|
||||
set(MEMCHECK_BUILD_TYPE debug)
|
||||
set(DEPENDENCY_PATH ${3RD_PATH}/kernel/dependency)
|
||||
set(PLATFORM_PATH ${3RD_PATH}/kernel/platform)
|
||||
set(BUILDTOOLS_PATH ${3RD_PATH}/buildtools)
|
||||
set(COMPONENT_PATH ${3RD_PATH}/kernel/component)
|
||||
set(DEPENDENCY_PATH ${3RD_PATH}/dependency/${PLAT_FORM_STR})
|
||||
set(PLATFORM_PATH ${3RD_PATH}/platform/${PLAT_FORM_STR})
|
||||
set(BUILDTOOLS_PATH ${3RD_PATH}/buildtools/${PLAT_FORM_STR})
|
||||
set(COMPONENT_PATH ${3RD_PATH}/component/${PLAT_FORM_STR})
|
||||
|
||||
set(MEMCHECK_HOME ${DEPENDENCY_PATH}/memcheck/${MEMCHECK_BUILD_TYPE})
|
||||
set(CJSON_HOME ${DEPENDENCY_PATH}/cjson/${SUPPORT_LLT})
|
||||
set(ETCD_HOME ${DEPENDENCY_PATH}/etcd/${LIB_UNIFIED_SUPPORT})
|
||||
set(EVENT_HOME ${DEPENDENCY_PATH}/event/${LIB_UNIFIED_SUPPORT})
|
||||
|
|
@ -56,44 +59,46 @@ set(CGROUP_HOME ${DEPENDENCY_PATH}/libcgroup/${SUPPORT_LLT})
|
|||
set(CURL_HOME ${DEPENDENCY_PATH}/libcurl/${SUPPORT_LLT})
|
||||
set(EDIT_HOME ${DEPENDENCY_PATH}/libedit/${SUPPORT_LLT})
|
||||
set(OBS_HOME ${DEPENDENCY_PATH}/libobs/${LIB_UNIFIED_SUPPORT})
|
||||
set(ORC_HOME ${DEPENDENCY_PATH}/liborc/${SUPPORT_LLT})
|
||||
set(PARQUET_HOME ${DEPENDENCY_PATH}/libparquet/${SUPPORT_LLT})
|
||||
set(XML2_HOME ${DEPENDENCY_PATH}/libxml2/${SUPPORT_LLT})
|
||||
set(LLVM_HOME ${DEPENDENCY_PATH}/llvm/${LIB_UNIFIED_SUPPORT})
|
||||
set(LZ4_HOME ${DEPENDENCY_PATH}/lz4/${SUPPORT_LLT})
|
||||
set(NANOMSG_HOME ${DEPENDENCY_PATH}/nng/${LIB_UNIFIED_SUPPORT})
|
||||
set(NANOMSG_HOME ${DEPENDENCY_PATH}/nanomsg/${LIB_UNIFIED_SUPPORT})
|
||||
set(NCURSES_HOME ${DEPENDENCY_PATH}/ncurses/${SUPPORT_LLT})
|
||||
set(OPENSSL_HOME ${DEPENDENCY_PATH}/openssl/${LIB_UNIFIED_SUPPORT})
|
||||
set(PLJAVA_HOME ${DEPENDENCY_PATH}/pljava/${LIB_UNIFIED_SUPPORT})
|
||||
if (EXISTS "${PLATFORM_PATH}/openjdk8/${BUILD_TUPLE}/jdk")
|
||||
set(JAVA_HOME ${PLATFORM_PATH}/openjdk8/${BUILD_TUPLE}/jdk)
|
||||
if (EXISTS "${3RD_PATH}/platform/openjdk8/${BUILD_TUPLE}/jdk")
|
||||
set(JAVA_HOME ${3RD_PATH}/platform/openjdk8/${BUILD_TUPLE}/jdk)
|
||||
else()
|
||||
set(JAVA_HOME ${PLATFORM_PATH}/huaweijdk8/${BUILD_TUPLE}/jdk)
|
||||
set(JAVA_HOME ${3RD_PATH}/platform/huaweijdk8/${BUILD_TUPLE}/jdk)
|
||||
endif()
|
||||
set(PROTOBUF_HOME ${DEPENDENCY_PATH}/protobuf/${SUPPORT_LLT})
|
||||
set(THRIFT_HOME ${DEPENDENCY_PATH}/thrift)
|
||||
set(SNAPPY_HOME ${DEPENDENCY_PATH}/snappy/${LIB_UNIFIED_SUPPORT})
|
||||
set(ZLIB_HOME ${DEPENDENCY_PATH}/zlib1.2.11/${SUPPORT_LLT})
|
||||
set(XGBOOST_HOME ${DEPENDENCY_PATH}/xgboost/${SUPPORT_LLT})
|
||||
set(ZSTD_HOME ${DEPENDENCY_PATH}/zstd)
|
||||
set(LICENSE_HOME ${PLATFORM_PATH}/AdaptiveLM_C_V100R005C01SPC002/${SUPPORT_LLT})
|
||||
set(HOTPATCH_HOME ${PLATFORM_PATH}/hotpatch)
|
||||
set(SECURE_HOME ${PLATFORM_PATH}/Huawei_Secure_C/${LIB_UNIFIED_SUPPORT})
|
||||
set(SECUREDYNAMICLIB_HOME ${PLATFORM_PATH}/Huawei_Secure_C/Dynamic_Lib)
|
||||
set(DCF_HOME ${COMPONENT_PATH}/dcf)
|
||||
set(DMS_HOME ${COMPONENT_PATH}/dms)
|
||||
set(DSS_HOME ${COMPONENT_PATH}/dss)
|
||||
|
||||
set(MOCKCPP_HOME ${BUILDTOOLS_PATH}/mockcpp/${LIB_UNIFIED_SUPPORT})
|
||||
set(GTEST_HOME ${BUILDTOOLS_PATH}/gtest/${LIB_UNIFIED_SUPPORT})
|
||||
set(LIBSTD_HOME ${BUILDTOOLS_PATH}/gcc${GCC_VERSION_LIT}/${LIB_UNIFIED_SUPPORT})
|
||||
set(MASSTREE_HOME ${BUILDTOOLS_PATH}/masstree/${LIB_UNIFIED_SUPPORT})
|
||||
set(NUMA_HOME ${DEPENDENCY_PATH}/numactl/${SUPPORT_LLT})
|
||||
set(ARROW_HOME ${DEPENDENCY_PATH}/libparquet/${SUPPORT_LLT})
|
||||
set(BOOST_HOME ${DEPENDENCY_PATH}/boost/${SUPPORT_LLT})
|
||||
set(ODBC_HOME ${DEPENDENCY_PATH}/unixodbc)
|
||||
set(ODBC_HOME ${3RD_PATH}/dependency/${PLAT_FORM_STR}/unixodbc)
|
||||
set(MASSTREE_HOME ${DEPENDENCY_PATH}/masstree/${LIB_UNIFIED_SUPPORT})
|
||||
set(LCOV_HOME ${BUILDTOOLS_PATH}/gcc${GCC_VERSION_LIT}/gcc/lib/gcc/${HOST_TUPLE})
|
||||
set(GCC_LIB_PATH $ENV{GCC_INSTALL_HOME})
|
||||
set(MEMCHECK_LIB_PATH $ENV{GCC_INSTALL_HOME}/lib64/)
|
||||
if("${GCC_LIB_PATH}" STREQUAL "")
|
||||
set(GCC_LIB_PATH ${BUILDTOOLS_PATH}/gcc${GCC_VERSION_LIT}/gcc)
|
||||
set(MEMCHECK_HOME ${DEPENDENCY_PATH}/memcheck/${MEMCHECK_BUILD_TYPE})
|
||||
set(MEMCHECK_LIB_PATH ${MEMCHECK_HOME}/gcc${GCC_VERSION}/lib/)
|
||||
endif()
|
||||
|
||||
#############################################################################
|
||||
# memcheck
|
||||
#############################################################################
|
||||
set(MEMCHECK_LIB_PATH ${MEMCHECK_HOME}/gcc${GCC_VERSION}/lib/)
|
||||
|
||||
#############################################################################
|
||||
# lcov
|
||||
|
|
@ -200,6 +205,18 @@ set(LIBEDIT_LIB_PATH ${EDIT_HOME}/lib)
|
|||
set(LIBOBS_INCLUDE_PATH ${OBS_HOME}/include)
|
||||
set(LIBOBS_LIB_PATH ${OBS_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# orc component
|
||||
#############################################################################
|
||||
set(LIBORC_INCLUDE_PATH ${ORC_HOME}/include)
|
||||
set(LIBORC_LIB_PATH ${ORC_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# parquet component
|
||||
#############################################################################
|
||||
set(LIBPARQUET_INCLUDE_PATH ${PARQUET_HOME}/include)
|
||||
set(LIBPARQUET_LIB_PATH ${PARQUET_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# xml2 component
|
||||
#############################################################################
|
||||
|
|
@ -241,6 +258,25 @@ set(LIBOPENSSL_LIB_PATH ${OPENSSL_HOME}/lib)
|
|||
set(LIBOPENSSL_SSL_PATH ${OPENSSL_HOME}/ssl)
|
||||
set(LIBOPENSSL_INCLUDE_PATH ${OPENSSL_HOME}/include)
|
||||
|
||||
#############################################################################
|
||||
# protobuf component
|
||||
#############################################################################
|
||||
set(PROTOBUF_INCLUDE_PATH ${PROTOBUF_HOME}/include)
|
||||
set(PROTOBUF_LIB_PATH ${PROTOBUF_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# thrift component
|
||||
#############################################################################
|
||||
set(LIBTHRIFT_INCLUDE_PATH ${THRIFT_HOME}/include)
|
||||
set(LIBTHRIFT_LIB_PATH ${THRIFT_HOME}/lib)
|
||||
set(LIBTHRIFT_BIN_PATH ${THRIFT_HOME}/bin)
|
||||
|
||||
#############################################################################
|
||||
# snappy component
|
||||
#############################################################################
|
||||
set(SNAPPY_INCLUDE_PATH ${SNAPPY_HOME}/include)
|
||||
set(SNAPPY_LIB_PATH ${SNAPPY_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# zlib component
|
||||
#############################################################################
|
||||
|
|
@ -265,17 +301,6 @@ set(ZSTD_LIB_PATH ${ZSTD_HOME}/lib)
|
|||
set(DCF_INCLUDE_PATH ${DCF_HOME}/include)
|
||||
set(DCF_LIB_PATH ${DCF_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# dms component
|
||||
#############################################################################
|
||||
set(DMS_LIB_PATH ${DMS_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# dss component
|
||||
#############################################################################
|
||||
set(DSS_LIB_PATH ${DSS_HOME}/lib)
|
||||
set(DSS_BIN_PATH ${DSS_HOME}/bin)
|
||||
|
||||
#############################################################################
|
||||
# license manager compnent
|
||||
#############################################################################
|
||||
|
|
@ -302,6 +327,12 @@ set(SECURE_LIB_PATH ${SECURE_HOME}/lib)
|
|||
set(NUMA_INCLUDE_PATH ${NUMA_HOME}/include)
|
||||
set(NUMA_LIB_PATH ${NUMA_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# arrow component
|
||||
#############################################################################
|
||||
set(ARROW_INCLUDE_PATH ${ARROW_HOME}/include)
|
||||
set(ARROW_LIB_PATH ${ARROW_HOME}/lib)
|
||||
|
||||
#############################################################################
|
||||
# odbc component
|
||||
#############################################################################
|
||||
|
|
|
|||
|
|
@ -121,6 +121,30 @@ fi])# PGAC_C_FUNCNAME_SUPPORT
|
|||
|
||||
|
||||
|
||||
# PGAC_C_COMPUTED_GOTO
|
||||
# -----------------------
|
||||
# Check if the C compiler knows computed gotos (gcc extension, also
|
||||
# available in at least clang). If so, define HAVE_COMPUTED_GOTO.
|
||||
#
|
||||
# Checking whether computed gotos are supported syntax-wise ought to
|
||||
# be enough, as the syntax is otherwise illegal.
|
||||
AC_DEFUN([PGAC_C_COMPUTED_GOTO],
|
||||
[AC_CACHE_CHECK(for computed goto support, pgac_cv_computed_goto,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
|
||||
[[void *labeladdrs[] = {&&my_label};
|
||||
goto *labeladdrs[0];
|
||||
my_label:
|
||||
return 1;
|
||||
]])],
|
||||
[pgac_cv_computed_goto=yes],
|
||||
[pgac_cv_computed_goto=no])])
|
||||
if test x"$pgac_cv_computed_goto" = xyes ; then
|
||||
AC_DEFINE(HAVE_COMPUTED_GOTO, 1,
|
||||
[Define to 1 if your compiler handles computed gotos.])
|
||||
fi])# PGAC_C_COMPUTED_GOTO
|
||||
|
||||
|
||||
|
||||
# PGAC_CHECK_BUILTIN_FUNC
|
||||
# -----------------------
|
||||
# This is similar to AC_CHECK_FUNCS(), except that it will work for compiler
|
||||
|
|
@ -148,7 +172,6 @@ fi])# PGAC_CHECK_BUILTIN_FUNC
|
|||
|
||||
|
||||
|
||||
|
||||
# PGAC_PROG_CC_CFLAGS_OPT
|
||||
# -----------------------
|
||||
# Given a string, check if the compiler supports the string as a
|
||||
|
|
|
|||
|
|
@ -709,7 +709,6 @@ with_selinux
|
|||
krb_srvtab
|
||||
with_python
|
||||
with_openeuler_os
|
||||
with_openeuler_major
|
||||
enable_thread_safety
|
||||
INCLUDES
|
||||
TAS
|
||||
|
|
@ -829,7 +828,6 @@ enable_nls
|
|||
with_pgport
|
||||
with_gs_version
|
||||
with_openeuler_os
|
||||
with_openeuler_major
|
||||
enable_shared
|
||||
enable_rpath
|
||||
enable_jemalloc
|
||||
|
|
@ -2197,7 +2195,7 @@ PACKAGE_VERSION='9.2.4'
|
|||
# Postgres-XC 1.1devel is based on PostgreSQL 9.2.4
|
||||
PACKAGE_XC_VERSION='1.1'
|
||||
# openGauss is based on PostgreSQL 9.2.4 and it will be the Kernel of GaussDB database
|
||||
OPENGAUSS_VERSION='5.0.0'
|
||||
OPENGAUSS_VERSION='3.0.0'
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define PG_VERSION "$PACKAGE_VERSION"
|
||||
|
|
@ -2917,6 +2915,20 @@ _ACEOF
|
|||
|
||||
fi
|
||||
|
||||
if test "$enable_debug" = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define ENABLE_TRACE_COLUMN_DEFAULT_VALUE true
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define ENABLE_TRACE_COLUMN_DEFAULT_VALUE false
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# '-memory-check'-like feature can be enabled
|
||||
#
|
||||
|
|
@ -3274,9 +3286,6 @@ _ACEOF
|
|||
|
||||
fi
|
||||
|
||||
if [ "$(cat /etc/system-release)" == "openEuler release 22.03 LTS" ]; then
|
||||
with_openeuler_major=yes
|
||||
fi
|
||||
|
||||
#
|
||||
# --enable-coverage enables generation of code coverage metrics with gcov
|
||||
|
|
@ -3715,11 +3724,8 @@ case ${wal_segsize} in
|
|||
16) ;;
|
||||
32) ;;
|
||||
64) ;;
|
||||
128) ;;
|
||||
256) ;;
|
||||
512) ;;
|
||||
*) { { $as_echo "$as_me:$LINENO: error: Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64,128,256,512." >&5
|
||||
$as_echo "$as_me: error: Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64,128,256,512." >&2;}
|
||||
*) { { $as_echo "$as_me:$LINENO: error: Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64." >&5
|
||||
$as_echo "$as_me: error: Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
esac
|
||||
{ $as_echo "$as_me:$LINENO: result: ${wal_segsize}MB" >&5
|
||||
|
|
@ -3730,18 +3736,6 @@ cat >>confdefs.h <<_ACEOF
|
|||
#define XLOG_SEG_SIZE (${wal_segsize} * 1024 * 1024)
|
||||
_ACEOF
|
||||
|
||||
# Set number of MAX_ALLOC_SEGNUM in extreme_rto
|
||||
if test "${wal_segsize}" -lt 256; then
|
||||
MAX_ALLOC_SEGNUM=4
|
||||
elif test "${wal_segsize}" -ge 256 -a "${wal_segsize}" -lt 512; then
|
||||
MAX_ALLOC_SEGNUM=2
|
||||
else
|
||||
MAX_ALLOC_SEGNUM=1
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define MAX_ALLOC_SEGNUM ${MAX_ALLOC_SEGNUM}
|
||||
_ACEOF
|
||||
|
||||
#
|
||||
# C compiler
|
||||
|
|
@ -5910,7 +5904,8 @@ fi
|
|||
|
||||
llvm_version_str='10.0.0'
|
||||
if [[ ! -z "${with_3rdpartydir}" ]] && [[ "$enable_lite_mode" != yes ]]; then
|
||||
llvm_version_str=`${with_3rdpartydir}/kernel/dependency/llvm/comm/bin/llvm-config --version`
|
||||
platstr=$(sh src/get_PlatForm_str.sh)
|
||||
llvm_version_str=`${with_3rdpartydir}/dependency/${platstr}/llvm/comm/bin/llvm-config --version`
|
||||
fi
|
||||
llvm_major_version=$(echo $llvm_version_str | awk -F "." '{print $1}')
|
||||
llvm_minor_version=$(echo $llvm_version_str | awk -F "." '{print $2}')
|
||||
|
|
@ -6481,11 +6476,7 @@ fi
|
|||
# XML
|
||||
#
|
||||
|
||||
if [[ "$enable_lite_mode" != yes ]]; then
|
||||
with_libxml=yes
|
||||
else
|
||||
with_libxml=no
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-libxml was given.
|
||||
if test "${with_libxml+set}" = set; then
|
||||
|
|
@ -6513,11 +6504,10 @@ else
|
|||
|
||||
fi
|
||||
|
||||
xml2_cflag=${with_3rdpartydir}/kernel/dependency/libxml2/comm/include/libxml2
|
||||
xml2_lib=${with_3rdpartydir}/kernel/dependency/libxml2/comm/lib
|
||||
xml2_config=${with_3rdpartydir}/kernel/dependency/libxml2/comm/bin/xml2-config
|
||||
|
||||
|
||||
if test "$with_libxml" = yes ; then
|
||||
for ac_prog in ${xml2_config}
|
||||
for ac_prog in xml2-config
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
|
|
@ -6546,7 +6536,7 @@ IFS=$as_save_IFS
|
|||
|
||||
fi
|
||||
fi
|
||||
XML2_CONFIG=$xml2_config
|
||||
XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
|
||||
if test -n "$XML2_CONFIG"; then
|
||||
{ $as_echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5
|
||||
$as_echo "$XML2_CONFIG" >&6; }
|
||||
|
|
@ -6562,12 +6552,12 @@ done
|
|||
if test -n "$XML2_CONFIG"; then
|
||||
for pgac_option in `$XML2_CONFIG --cflags`; do
|
||||
case $pgac_option in
|
||||
-I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option -I${xml2_cflag}";;
|
||||
-I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
|
||||
esac
|
||||
done
|
||||
for pgac_option in `$XML2_CONFIG --libs`; do
|
||||
case $pgac_option in
|
||||
-L*) LDFLAGS="$LDFLAGS $pgac_option -L${xml2_lib}";;
|
||||
-L*) LDFLAGS="$LDFLAGS $pgac_option";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
|
@ -6646,17 +6636,18 @@ fi
|
|||
#
|
||||
with_jdk=''
|
||||
if [[ ! -z "${with_3rdpartydir}" ]] && [[ "$with_openeuler_os" != yes ]]; then
|
||||
platstr=$(sh src/get_PlatForm_str.sh)
|
||||
cpuarch=$(uname -m)
|
||||
for d in "openjdk8" "huaweijdk8"; do
|
||||
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/kernel/platform/${d}/${cpuarch}" >&5
|
||||
if [ ! -d "${with_3rdpartydir}/kernel/platform/${d}/${cpuarch}" ]; then
|
||||
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/platform/${d}/${cpuarch}" >&5
|
||||
if [ ! -d "${with_3rdpartydir}/platform/${d}/${cpuarch}" ]; then
|
||||
$as_echo "$as_me:$LINENO: result: no" >&5
|
||||
continue
|
||||
fi
|
||||
|
||||
for d2 in $(ls "${with_3rdpartydir}/kernel/platform/${d}/${cpuarch}" | sort -r 2>/dev/null); do
|
||||
if [ -f "${with_3rdpartydir}/kernel/platform/${d}/${cpuarch}/${d2}/jre/bin/java" ]; then
|
||||
with_jdk="${with_3rdpartydir}/kernel/platform/${d}/${cpuarch}/${d2}"
|
||||
for d2 in $(ls "${with_3rdpartydir}/platform/${d}/${cpuarch}" | sort -r 2>/dev/null); do
|
||||
if [ -f "${with_3rdpartydir}/platform/${d}/${cpuarch}/${d2}/jre/bin/java" ]; then
|
||||
with_jdk="${with_3rdpartydir}/platform/${d}/${cpuarch}/${d2}"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
|
@ -6666,15 +6657,15 @@ if [[ ! -z "${with_3rdpartydir}" ]] && [[ "$with_openeuler_os" != yes ]]; then
|
|||
break;
|
||||
fi
|
||||
|
||||
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/kernel/platform/${d}" >&5
|
||||
if [ ! -d "${with_3rdpartydir}/kernel/platform/${d}" ]; then
|
||||
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/platform/${platstr}/${d}" >&5
|
||||
if [ ! -d "${with_3rdpartydir}/platform/${platstr}/${d}" ]; then
|
||||
$as_echo "$as_me:$LINENO: result: no" >&5
|
||||
continue
|
||||
fi
|
||||
|
||||
for d2 in $(ls "${with_3rdpartydir}/kernel/platform/${d}" | sort -r 2>/dev/null); do
|
||||
if [ -f "${with_3rdpartydir}/kernel/platform/${d}/${d2}/jre/bin/java" ]; then
|
||||
with_jdk="${with_3rdpartydir}/kernel/platform/${d}/${d2}"
|
||||
for d2 in $(ls "${with_3rdpartydir}/platform/${platstr}/${d}" | sort -r 2>/dev/null); do
|
||||
if [ -f "${with_3rdpartydir}/platform/${platstr}/${d}/${d2}/jre/bin/java" ]; then
|
||||
with_jdk="${with_3rdpartydir}/platform/${platstr}/${d}/${d2}"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
|
@ -9851,7 +9842,7 @@ if test "${ac_cv_lib_xml2_xmlSaveToBuffer+set}" = set; then
|
|||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-L${xml2_lib} -lxml2 -lm -ldl $LIBS"
|
||||
LIBS="-lxml2 $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
|
|
@ -13443,7 +13434,6 @@ done
|
|||
fi
|
||||
|
||||
if test "$with_libxml" = yes ; then
|
||||
CPPFLAGS="-I${xml2_cflag} $CPPFLAGS"
|
||||
if test "${ac_cv_header_libxml_parser_h+set}" = set; then
|
||||
{ $as_echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
|
||||
$as_echo_n "checking for libxml/parser.h... " >&6; }
|
||||
|
|
@ -15559,6 +15549,42 @@ _ACEOF
|
|||
|
||||
fi
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for computed goto support" >&5
|
||||
$as_echo_n "checking for computed goto support... " >&6; }
|
||||
if ${pgac_cv_computed_goto+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
void *labeladdrs[] = {&&my_label};
|
||||
goto *labeladdrs[0];
|
||||
my_label:
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
pgac_cv_computed_goto=yes
|
||||
else
|
||||
pgac_cv_computed_goto=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_computed_goto" >&5
|
||||
$as_echo "$pgac_cv_computed_goto" >&6; }
|
||||
if test x"$pgac_cv_computed_goto" = xyes ; then
|
||||
|
||||
$as_echo "#define HAVE_COMPUTED_GOTO 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
|
||||
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
|
||||
if test "${ac_cv_struct_tm+set}" = set; then
|
||||
|
|
@ -18323,6 +18349,46 @@ _ACEOF
|
|||
;;
|
||||
esac
|
||||
|
||||
# We assume that we needn't test all widths of these explicitly:
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5
|
||||
$as_echo_n "checking for __builtin_clz... " >&6; }
|
||||
if ${pgac_cv__builtin_clz+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
call__builtin_clz(unsigned int x)
|
||||
{
|
||||
return __builtin_clz(x);
|
||||
}
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
pgac_cv__builtin_clz=yes
|
||||
else
|
||||
pgac_cv__builtin_clz=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_clz" >&5
|
||||
$as_echo "$pgac_cv__builtin_clz" >&6; }
|
||||
if test x"${pgac_cv__builtin_clz}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE__BUILTIN_CLZ 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
# Check largefile support. You might think this is a system service not a
|
||||
# compiler characteristic, but you'd be wrong. We must check this before
|
||||
# probing existence of related functions such as fseeko, since the largefile
|
||||
|
|
@ -30126,11 +30192,11 @@ CFLAGS="-DSTREAMPLAN $CFLAGS"
|
|||
# force set char to signed char
|
||||
CFLAGS="-fsigned-char $CFLAGS"
|
||||
|
||||
release_file=`find /etc/ -name "euleros-release"`
|
||||
is_euler=`echo $release_file | grep EulerOS`
|
||||
platform_version=`sh ./src/get_PlatForm_str.sh`
|
||||
is_euler=`echo $platform_version | grep euleros`
|
||||
# New gcc version should be compatible to old one
|
||||
if test "$CC_VERSION" = "$NEW_GCC"; then
|
||||
CFLAGS=" -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 $CFLAGS -fno-aggressive-loop-optimizations -Wno-attributes -fno-omit-frame-pointer -fno-expensive-optimizations"
|
||||
CFLAGS=" -D_GLIBCXX_USE_CXX11_ABI=0 $CFLAGS -Wno-attributes "
|
||||
CFLAGS="$CFLAGS -Wno-unused-but-set-variable"
|
||||
if test "$is_euler" != ""; then
|
||||
if test "${enable_cassert}" = no -o "${enable_memory_check}" = no -a "${enable_ut}" = no; then
|
||||
|
|
|
|||
15
configure.in
15
configure.in
|
|
@ -381,10 +381,7 @@ case ${wal_segsize} in
|
|||
16) ;;
|
||||
32) ;;
|
||||
64) ;;
|
||||
128) ;;
|
||||
256) ;;
|
||||
512) ;;
|
||||
*) AC_MSG_ERROR([Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64,128,256,512.])
|
||||
*) AC_MSG_ERROR([Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64.])
|
||||
esac
|
||||
AC_MSG_RESULT([${wal_segsize}MB])
|
||||
|
||||
|
|
@ -396,16 +393,6 @@ AC_DEFINE_UNQUOTED([XLOG_SEG_SIZE], [(${wal_segsize} * 1024 * 1024)], [
|
|||
Changing XLOG_SEG_SIZE requires an initdb.
|
||||
])
|
||||
|
||||
# Set number of MAX_ALLOC_SEGNUM in extreme_rto
|
||||
if test "${wal_segsize}" -lt 256; then
|
||||
MAX_ALLOC_SEGNUM=4
|
||||
elif test "${wal_segsize}" -ge 256 -a "${wal_segsize}" -lt 512; then
|
||||
MAX_ALLOC_SEGNUM=2
|
||||
else
|
||||
MAX_ALLOC_SEGNUM=1
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(MAX_ALLOC_SEGNUM, $MAX_ALLOC_SEGNUM, [Define the max alloc segnum in extreme_rto.])
|
||||
|
||||
#
|
||||
# C compiler
|
||||
#
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
|
|||
set(CMAKE_RULE_MESSAGES OFF)
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CJSON_INCLUDE_PATH} ${BOOST_INCLUDE_PATH})
|
||||
INCLUDE_DIRECTORIES(${LIBTHRIFT_INCLUDE_PATH} ${SNAPPY_INCLUDE_PATH} ${CJSON_INCLUDE_PATH} ${BOOST_INCLUDE_PATH})
|
||||
|
||||
set(CMAKE_MODULE_PATH
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/carbondata
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gsredistribute
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hstore
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_decoding
|
||||
|
|
@ -20,6 +21,7 @@ set(CMAKE_MODULE_PATH
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/pagehack
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pg_xlogdump
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/file_fdw
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hdfs_fdw
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/log_fdw
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gc_fdw
|
||||
)
|
||||
|
|
@ -38,6 +40,7 @@ add_subdirectory(dummy_seclabel)
|
|||
add_subdirectory(pagehack)
|
||||
add_subdirectory(pg_xlogdump)
|
||||
add_subdirectory(file_fdw)
|
||||
add_subdirectory(hdfs_fdw)
|
||||
add_subdirectory(log_fdw)
|
||||
if("${ENABLE_MULTIPLE_NODES}" STREQUAL "OFF")
|
||||
add_subdirectory(gc_fdw)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
PG_MODULE_MAGIC;
|
||||
|
||||
extern "C" void _PG_init(void);
|
||||
void _PG_init(void);
|
||||
|
||||
/* GUC Variables */
|
||||
static int auth_delay_milliseconds;
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ static ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
|
|||
#define auto_explain_enabled() \
|
||||
(auto_explain_log_min_duration >= 0 && (nesting_level == 0 || auto_explain_log_nested_statements))
|
||||
|
||||
extern "C" void _PG_init(void);
|
||||
extern "C" void _PG_fini(void);
|
||||
void _PG_init(void);
|
||||
void _PG_fini(void);
|
||||
|
||||
static void explain_ExecutorStart(QueryDesc* queryDesc, int eflags);
|
||||
static void explain_ExecutorRun(QueryDesc* queryDesc, ScanDirection direction, long count);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
MODULE_big = dblink
|
||||
OBJS = dblink.o
|
||||
PG_CPPFLAGS = -I$(libpq_srcdir)
|
||||
SHLIB_LINK = $(libpq) -L$(LIBODBC_LIB_PATH) -lodbc
|
||||
SHLIB_LINK = $(libpq)
|
||||
SHLIB_PREREQS = submake-libpq
|
||||
|
||||
EXTENSION = dblink
|
||||
|
|
|
|||
|
|
@ -221,8 +221,3 @@ CREATE FUNCTION dblink_get_notify(
|
|||
RETURNS setof record
|
||||
AS 'MODULE_PATHNAME', 'dblink_get_notify'
|
||||
LANGUAGE C STRICT;
|
||||
|
||||
CREATE FUNCTION dblink_get_drivername()
|
||||
RETURNS text
|
||||
AS 'MODULE_PATHNAME', 'dblink_get_drivername'
|
||||
LANGUAGE C STRICT;
|
||||
|
|
@ -44,4 +44,3 @@ ALTER EXTENSION dblink ADD function dblink_cancel_query(text);
|
|||
ALTER EXTENSION dblink ADD function dblink_error_message(text);
|
||||
ALTER EXTENSION dblink ADD function dblink_get_notify();
|
||||
ALTER EXTENSION dblink ADD function dblink_get_notify(text);
|
||||
ALTER EXTENSION dblink ADD function dblink_get_drivername();
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -35,113 +35,6 @@
|
|||
#define DBLINK_H
|
||||
|
||||
#include "fmgr.h"
|
||||
#include "sql.h"
|
||||
#include "sqlext.h"
|
||||
|
||||
|
||||
typedef struct ODBCconn {
|
||||
SQLHENV envHandle; /* Handle ODBC environment */
|
||||
SQLHDBC connHandle; /* Handle connection */
|
||||
SQLHSTMT stmt; /* Handle sql */
|
||||
} ODBCconn;
|
||||
|
||||
typedef struct storeInfo {
|
||||
FunctionCallInfo fcinfo;
|
||||
Tuplestorestate* tuplestore;
|
||||
AttInMetadata* attinmeta;
|
||||
MemoryContext tmpcontext;
|
||||
char** cstrs;
|
||||
/* temp storage for results to avoid leaks on exception */
|
||||
PGresult* last_res;
|
||||
PGresult* cur_res;
|
||||
} storeInfo;
|
||||
|
||||
typedef struct LinkInfo {
|
||||
SQLCHAR* username; /* odbc username */
|
||||
SQLCHAR* password; /* odbc password */
|
||||
SQLCHAR* drivername; /* odbc driver name */
|
||||
} LinkInfo;
|
||||
|
||||
class Linker : public BaseObject {
|
||||
public:
|
||||
virtual void finish() = 0;
|
||||
virtual text* exec(char* conname, const char* sql, bool fail) = 0;
|
||||
virtual char* errorMsg() = 0;
|
||||
virtual int isBusy() = 0;
|
||||
virtual char* cancel(PGcancel* cancel) = 0;
|
||||
virtual int sendQuery(char* sql) = 0;
|
||||
virtual char* open(char* conname, char* sql, bool fail) = 0;
|
||||
virtual char* close(char* conname, char* sql, bool fail) = 0;
|
||||
virtual void getResult(char* conname, FunctionCallInfo fcinfo, char* sql, bool fail) = 0;
|
||||
virtual void queryResult(ReturnSetInfo* rsinfo, const char* conname, storeInfo* sinfo, const char* sql, bool fail) = 0;
|
||||
virtual void fetch(char* conname, FunctionCallInfo fcinfo, const char* sql, bool fail, char* curname) = 0;
|
||||
virtual void getNotify(ReturnSetInfo* rsinfo) = 0;
|
||||
};
|
||||
|
||||
typedef struct remoteConn {
|
||||
Linker* linker;
|
||||
} remoteConn;
|
||||
|
||||
typedef struct dblink_session_context {
|
||||
remoteConn* pconn;
|
||||
HTAB* remoteConnHash;
|
||||
} dblink_session_context;
|
||||
|
||||
/*
|
||||
* Following is list that holds multiple remote connections.
|
||||
* Calling convention of each dblink function changes to accept
|
||||
* connection name as the first parameter. The connection list is
|
||||
* much like ecpg e.g. a mapping between a name and a PGconn object.
|
||||
*/
|
||||
|
||||
typedef struct remoteConnHashEnt {
|
||||
char name[NAMEDATALEN];
|
||||
remoteConn* rconn;
|
||||
} remoteConnHashEnt;
|
||||
|
||||
class PQLinker : public Linker {
|
||||
public:
|
||||
PGconn* conn;
|
||||
PGresult* res;
|
||||
int openCursorCount; /* The number of open cursors */
|
||||
bool newXactForCursor; /* Opened a transaction for a cursor */
|
||||
public:
|
||||
PQLinker(char* connstr);
|
||||
void finish();
|
||||
text* exec(char* conname, const char* sql, bool fail);
|
||||
char* errorMsg();
|
||||
int isBusy();
|
||||
char* cancel(PGcancel* cancel);
|
||||
int sendQuery(char* sql);
|
||||
char* open(char* conname, char* sql, bool fail);
|
||||
char* close(char* conname, char* sql, bool fail);
|
||||
void getResult(char* conname, FunctionCallInfo fcinfo, char* sql, bool fail);
|
||||
void queryResult(ReturnSetInfo* rsinfo, const char* conname, storeInfo* sinfo, const char* sql, bool fail);
|
||||
void fetch(char* conname, FunctionCallInfo fcinfo, const char* sql, bool fail, char* curname);
|
||||
void getNotify(ReturnSetInfo* rsinfo);
|
||||
};
|
||||
|
||||
|
||||
class ODBCLinker : public Linker {
|
||||
public:
|
||||
SQLHENV envHandle; /* Handle ODBC environment */
|
||||
SQLHDBC connHandle; /* Handle connection */
|
||||
SQLHSTMT stmt; /* Handle sql */
|
||||
public:
|
||||
ODBCLinker(char* connstr_or_name);
|
||||
void finish();
|
||||
text* exec(char* conname, const char* sql, bool fail);
|
||||
char* errorMsg();
|
||||
int isBusy();
|
||||
char* cancel(PGcancel* cancel);
|
||||
int sendQuery(char* sql);
|
||||
char* open(char* conname, char* sql, bool fail);
|
||||
char* close(char* conname, char* sql, bool fail);
|
||||
void getResult(char* conname, FunctionCallInfo fcinfo, char* sql, bool fail);
|
||||
void queryResult(ReturnSetInfo* rsinfo, const char* conname, storeInfo* sinfo, const char* sql, bool fail);
|
||||
void fetch(char* conname, FunctionCallInfo fcinfo, const char* sql, bool fail, char* curname);
|
||||
void getNotify(ReturnSetInfo* rsinfo);
|
||||
};
|
||||
|
||||
/*
|
||||
* External declarations
|
||||
|
|
@ -165,7 +58,6 @@ extern "C" Datum dblink_build_sql_delete(PG_FUNCTION_ARGS);
|
|||
extern "C" Datum dblink_build_sql_update(PG_FUNCTION_ARGS);
|
||||
extern "C" Datum dblink_current_query(PG_FUNCTION_ARGS);
|
||||
extern "C" Datum dblink_get_notify(PG_FUNCTION_ARGS);
|
||||
extern "C" Datum dblink_get_drivername(PG_FUNCTION_ARGS);
|
||||
extern "C" void set_extension_index(uint32 index);
|
||||
extern "C" void init_session_vars(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ PG_FUNCTION_INFO_V1(file_fdw_validator);
|
|||
*/
|
||||
static void fileGetForeignRelSize(PlannerInfo* root, RelOptInfo* baserel, Oid foreigntableid);
|
||||
static void fileGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid foreigntableid);
|
||||
static ForeignScan *fileGetForeignPlan(PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid,
|
||||
ForeignPath *best_path, List *tlist, List *scan_clauses, Plan *outer_plan);
|
||||
static ForeignScan* fileGetForeignPlan(PlannerInfo* root, RelOptInfo* baserel, Oid foreigntableid,
|
||||
ForeignPath* best_path, List* tlist, List* scan_clauses);
|
||||
static void fileExplainForeignScan(ForeignScanState* node, ExplainState* es);
|
||||
static void fileBeginForeignScan(ForeignScanState* node, int eflags);
|
||||
static TupleTableSlot* fileIterateForeignScan(ForeignScanState* node);
|
||||
|
|
@ -452,9 +452,8 @@ static void fileGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid fore
|
|||
startup_cost,
|
||||
total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no outer path either */
|
||||
NIL)); /* no fdw_private data */
|
||||
NULL, /* no outer rel either */
|
||||
NIL)); /* no fdw_private data */
|
||||
|
||||
/*
|
||||
* If data file was sorted, and we knew it somehow, we could insert
|
||||
|
|
@ -465,10 +464,10 @@ static void fileGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid fore
|
|||
|
||||
/*
|
||||
* fileGetForeignPlan
|
||||
* Create a ForeignScan plan node for scanning the foreign table
|
||||
* Create a ForeignScan plan node for scanning the foreign table
|
||||
*/
|
||||
static ForeignScan *fileGetForeignPlan(PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid,
|
||||
ForeignPath *best_path, List *tlist, List *scan_clauses, Plan *outer_plan)
|
||||
static ForeignScan* fileGetForeignPlan(
|
||||
PlannerInfo* root, RelOptInfo* baserel, Oid foreigntableid, ForeignPath* best_path, List* tlist, List* scan_clauses)
|
||||
{
|
||||
Index scan_relid = baserel->relid;
|
||||
|
||||
|
|
@ -486,11 +485,8 @@ static ForeignScan *fileGetForeignPlan(PlannerInfo *root, RelOptInfo *baserel, O
|
|||
scan_clauses,
|
||||
scan_relid,
|
||||
NIL, /* no expressions to evaluate */
|
||||
NIL, /* no private state either */
|
||||
NIL,
|
||||
NIL,
|
||||
NULL,
|
||||
EXEC_ON_DATANODES);
|
||||
EXEC_ON_DATANODES); /* no private state either */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -745,7 +745,7 @@ List* build_tlist_to_deparse(RelOptInfo* foreignrel)
|
|||
* We require columns specified in foreignrel->reltarget->exprs and those
|
||||
* required for evaluating the local conditions.
|
||||
*/
|
||||
tlist = foreignrel->reltarget->exprs;
|
||||
tlist = foreignrel->reltargetlist;
|
||||
|
||||
foreach (lc, fpinfo->local_conds) {
|
||||
RestrictInfo* rinfo = lfirst_node(RestrictInfo, lc);
|
||||
|
|
@ -1015,7 +1015,7 @@ static void gcDeparseLockingClause(deparse_expr_cxt* context)
|
|||
* that DECLARE CURSOR ... FOR UPDATE is supported, which it isn't
|
||||
* before 8.3.
|
||||
*/
|
||||
if (relid == linitial2_int(root->parse->resultRelations) &&
|
||||
if (relid == root->parse->resultRelation &&
|
||||
(root->parse->commandType == CMD_UPDATE || root->parse->commandType == CMD_DELETE)) {
|
||||
/* Relation is UPDATE/DELETE target, so use FOR UPDATE */
|
||||
appendStringInfoString(buf, " FOR UPDATE");
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ static void gcGetForeignRelSize(PlannerInfo* root, RelOptInfo* baserel, Oid fore
|
|||
* columns used in them. Doesn't seem worth detecting that case though.)
|
||||
*/
|
||||
fpinfo->attrs_used = NULL;
|
||||
pull_varattnos((Node*)baserel->reltarget->exprs, baserel->relid, &fpinfo->attrs_used);
|
||||
pull_varattnos((Node*)baserel->reltargetlist, baserel->relid, &fpinfo->attrs_used);
|
||||
foreach (lc, fpinfo->local_conds) {
|
||||
RestrictInfo* rinfo = lfirst_node(RestrictInfo, lc);
|
||||
|
||||
|
|
@ -390,7 +390,7 @@ static void gcGetForeignRelSize(PlannerInfo* root, RelOptInfo* baserel, Oid fore
|
|||
baserel->pages = 10;
|
||||
const int BLOCK_NUM = 10;
|
||||
baserel->tuples =
|
||||
(double)(BLOCK_NUM * BLCKSZ) / (baserel->reltarget->width + MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)));
|
||||
(double)(BLOCK_NUM * BLCKSZ) / (baserel->width + MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)));
|
||||
}
|
||||
|
||||
/* Estimate baserel size as best we can with local statistics. */
|
||||
|
|
@ -448,9 +448,8 @@ static void gcGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid foreig
|
|||
fpinfo->startup_cost,
|
||||
fpinfo->total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no outer path either */
|
||||
NIL, /* no fdw_private list */
|
||||
NULL, /* no outer rel either */
|
||||
NIL, /* no fdw_private list */
|
||||
u_sess->opt_cxt.query_dop);
|
||||
add_path(root, baserel, (Path*)path);
|
||||
}
|
||||
|
|
@ -460,7 +459,7 @@ static void gcGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid foreig
|
|||
* Create ForeignScan plan node which implements selected best path
|
||||
*/
|
||||
static ForeignScan* gcGetForeignPlan(PlannerInfo* root, RelOptInfo* foreignrel, Oid foreigntableid,
|
||||
ForeignPath* best_path, List* tlist, List* scan_clauses, Plan* outer_plan)
|
||||
ForeignPath* best_path, List* tlist, List* scan_clauses)
|
||||
{
|
||||
GcFdwRelationInfo* fpinfo = (GcFdwRelationInfo*)foreignrel->fdw_private;
|
||||
Index scan_relid;
|
||||
|
|
@ -618,8 +617,7 @@ static ForeignScan* gcGetForeignPlan(PlannerInfo* root, RelOptInfo* foreignrel,
|
|||
* field of the finished plan node; we can't keep them in private state
|
||||
* because then they wouldn't be subject to later planner processing.
|
||||
*/
|
||||
return make_foreignscan(tlist, local_exprs, scan_relid, params_list, fdw_private, NIL, NIL, NULL,
|
||||
EXEC_ON_DATANODES);
|
||||
return make_foreignscan(tlist, local_exprs, scan_relid, params_list, fdw_private, EXEC_ON_DATANODES);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -702,7 +700,7 @@ static void gcBeginForeignScan(ForeignScanState* node, int eflags)
|
|||
|
||||
for (int i = 0; i < list_length(fsstate->retrieved_attrs); i++) {
|
||||
int attidx = list_nth_int(fsstate->retrieved_attrs, i);
|
||||
Form_pg_attribute attr = &slot->tts_tupleDescriptor->attrs[attidx - 1];
|
||||
Form_pg_attribute attr = slot->tts_tupleDescriptor->attrs[attidx - 1];
|
||||
const char* attname = (const char*)(attr->attname.data);
|
||||
TupleDescInitEntry(scan_desc, i + 1, attname, attr->atttypid, attr->atttypmod, 0);
|
||||
}
|
||||
|
|
@ -1469,7 +1467,7 @@ static void gc_estimate_path_cost_size(PlannerInfo* root, RelOptInfo* foreignrel
|
|||
* between foreign relations.
|
||||
*/
|
||||
rows = foreignrel->rows;
|
||||
width = foreignrel->reltarget->width;
|
||||
width = foreignrel->width;
|
||||
|
||||
/* Back into an estimate of the number of retrieved rows. */
|
||||
retrieved_rows = clamp_row_est(rows / fpinfo->local_conds_sel);
|
||||
|
|
@ -2046,7 +2044,7 @@ static void prepare_query_params(PlanState* node, List* fdw_exprs, int numParams
|
|||
* benefit, and it'd require gc_fdw to know more than is desirable
|
||||
* about Param evaluation.)
|
||||
*/
|
||||
*param_exprs = (List *)ExecInitExpr((Expr *)fdw_exprs, node);
|
||||
*param_exprs = ExecInitExprList(fdw_exprs, node);
|
||||
|
||||
/* Allocate buffer for text form of query parameters. */
|
||||
*param_values = (const char **)palloc0(numParams * sizeof(char *));
|
||||
|
|
@ -2068,7 +2066,7 @@ static void process_query_params(
|
|||
bool isNull = false;
|
||||
|
||||
/* Evaluate the parameter expression */
|
||||
expr_value = ExecEvalExpr(expr_state, econtext, &isNull, NULL);
|
||||
expr_value = ExecEvalExpr(expr_state, econtext, &isNull);
|
||||
|
||||
/*
|
||||
* Get string representation of each parameter value by invoking
|
||||
|
|
|
|||
|
|
@ -72,8 +72,12 @@ static void gcGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid foreig
|
|||
return;
|
||||
}
|
||||
|
||||
static ForeignScan *gcGetForeignPlan(PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid,
|
||||
ForeignPath *best_path, List *tlist, List *scan_clauses, Plan *outer_plan)
|
||||
static ForeignScan *gcGetForeignPlan(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
Oid foreigntableid,
|
||||
ForeignPath *best_path,
|
||||
List *tlist,
|
||||
List *scan_clauses)
|
||||
{
|
||||
DISTRIBUTED_FEATURE_NOT_SUPPORTED();
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* option_single.cpp
|
||||
* option_single.cpp
|
||||
* FDW option handling for gc_fdw
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* contrib/gc_fdw/option_single.cpp
|
||||
* contrib/gc_fdw/option_single.cpp
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
*/
|
||||
#include "postgres.h"
|
||||
#include "knl/knl_variable.h"
|
||||
|
||||
|
|
@ -21,11 +21,11 @@
|
|||
#include "commands/extension.h"
|
||||
#include "foreign/foreign.h"
|
||||
#include "gaussdb_version.h"
|
||||
#include "utils/builtins.h"
|
||||
|
||||
PG_FUNCTION_INFO_V1(gc_fdw_validator);
|
||||
#include "utils/builtins.h"
|
||||
|
||||
PG_FUNCTION_INFO_V1(gc_fdw_validator);
|
||||
Datum gc_fdw_validator(PG_FUNCTION_ARGS)
|
||||
{
|
||||
{
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
#This is the main CMAKE for build all components.
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/orc.cpp
|
||||
COMMAND protoc-c --c_out=${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/orc.proto
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/orc.proto
|
||||
COMMENT "Now Generating orc.cpp"
|
||||
)
|
||||
|
||||
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TGT_hdfs_fdw_SRC)
|
||||
|
||||
set(TGT_hdfs_fdw_INC
|
||||
${LIBORC_INCLUDE_PATH}
|
||||
${PROJECT_SRC_DIR}/include
|
||||
${PROJECT_OPENGS_DIR}/contrib/hdfs_fdw/include
|
||||
${PROJECT_OPENGS_DIR}/contrib
|
||||
)
|
||||
|
||||
if("${ENABLE_MULTIPLE_NODES}" STREQUAL "ON")
|
||||
list(APPEND TGT_hdfs_fdw_INC ${PROJECT_TRUNK_DIR}/contrib/carbondata)
|
||||
endif()
|
||||
|
||||
set(hdfs_fdw_DEF_OPTIONS ${MACRO_OPTIONS})
|
||||
set(hdfs_fdw_COMPILE_OPTIONS ${OPTIMIZE_OPTIONS} ${OS_OPTIONS} ${PROTECT_OPTIONS} ${WARNING_OPTIONS} ${BIN_SECURE_OPTIONS} ${CHECK_OPTIONS})
|
||||
set(hdfs_fdw_LINK_OPTIONS ${BIN_LINK_OPTIONS})
|
||||
add_static_objtarget(contrib_hdfs_fdw TGT_hdfs_fdw_SRC TGT_hdfs_fdw_INC "${hdfs_fdw_DEF_OPTIONS}" "${hdfs_fdw_COMPILE_OPTIONS}" "${hdfs_fdw_LINK_OPTIONS}")
|
||||
if("${ENABLE_MULTIPLE_NODES}" STREQUAL "ON")
|
||||
add_dependencies(contrib_hdfs_fdw carbondata_static)
|
||||
endif()
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/hdfs_fdw.control
|
||||
DESTINATION share/postgresql/extension/
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/hdfs_fdw--1.0.sql
|
||||
DESTINATION share/postgresql/extension/
|
||||
)
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# contrib/hdfs_fdw/Makefile
|
||||
|
||||
MODULE_big = hdfs_fdw
|
||||
OBJS = hdfs_fdw.o scheduler.o
|
||||
SHLIB_LINK = -lz $(shell pkg-config --libs libprotobuf)
|
||||
top_builddir = ../..
|
||||
EXTENSION = hdfs_fdw
|
||||
DATA = hdfs_fdw--1.0.sql hdfs_fdw.control
|
||||
|
||||
REGRESS = hdfs_fdw
|
||||
|
||||
EXTRA_CLEAN = sql/hdfs_fdw.sql expected/hdfs_fdw.out
|
||||
|
||||
ifdef USE_PGXS
|
||||
PG_CONFIG = pg_config
|
||||
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
||||
include $(PGXS)
|
||||
else
|
||||
subdir = contrib/hdfs_fdw
|
||||
top_builddir = ../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
|
||||
include $(top_srcdir)/src/gausskernel/common.mk
|
||||
override CXXFLAGS += -I$(top_builddir)/contrib/hdfs_fdw/include -I$(LIBCARBONDATA_INCLUDE_PATH) -I$(LIBTHRIFT_INCLUDE_PATH)
|
||||
install:install-data
|
||||
|
||||
.PHONY: install-data
|
||||
install-data: installdirs
|
||||
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
|
||||
|
||||
installdirs:
|
||||
$(MKDIR_P) '$(DESTDIR)$(datadir)/extension'
|
||||
|
||||
uninstall:uninstall-data
|
||||
|
||||
.PHONY: uninstall-data
|
||||
uninstall-data:
|
||||
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))
|
||||
endif
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/* contrib/hdfs_fdw/hdfs_fdw--1.0.sql */
|
||||
|
||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||
\echo Use "CREATE EXTENSION hdfs_fdw" to load this file. \quit
|
||||
|
||||
CREATE FUNCTION pg_catalog.hdfs_fdw_handler()
|
||||
RETURNS fdw_handler
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C STRICT NOT FENCED;
|
||||
|
||||
CREATE FUNCTION pg_catalog.hdfs_fdw_validator(text[], oid)
|
||||
RETURNS void
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C STRICT NOT FENCED;
|
||||
|
||||
CREATE FOREIGN DATA WRAPPER hdfs_fdw
|
||||
HANDLER hdfs_fdw_handler
|
||||
VALIDATOR hdfs_fdw_validator;
|
||||
/* we define the unified FDW named dfs_fdw. The hdfs_fdw will be reserved */
|
||||
/* in order to compate with older version. */
|
||||
CREATE FOREIGN DATA WRAPPER dfs_fdw
|
||||
HANDLER hdfs_fdw_handler
|
||||
VALIDATOR hdfs_fdw_validator;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# hdfs_fdw extension
|
||||
comment = 'foreign-data wrapper for flat file access'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/hdfs_fdw'
|
||||
relocatable = true
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,75 @@
|
|||
#ifndef HDFS_FDW_h
|
||||
#define HDFS_FDW_h
|
||||
#include "access/dfs/dfs_am.h"
|
||||
#include "foreign/foreign.h"
|
||||
#include "nodes/execnodes.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
#define HDFS_TUPLE_COST_MULTIPLIER 5
|
||||
|
||||
typedef enum OptionType {
|
||||
T_INVALID_TYPE = 0x0000,
|
||||
T_SERVER_COMMON_OPTION = 0x0001 << 1,
|
||||
T_OBS_SERVER_OPTION = 0x0001 << 2,
|
||||
T_HDFS_SERVER_OPTION = 0x0001 << 3,
|
||||
T_DUMMY_SERVER_OPTION = 0x0001 << 4,
|
||||
T_FOREIGN_TABLE_COMMON_OPTION = 0x0001 << 5,
|
||||
T_FOREIGN_TABLE_OBS_OPTION = 0x0001 << 6,
|
||||
T_FOREIGN_TABLE_HDFS_OPTION = 0x0001 << 7,
|
||||
T_SERVER_TYPE_OPTION = 0x0001 << 8,
|
||||
T_FOREIGN_TABLE_TEXT_OPTION = 0x0001 << 9,
|
||||
T_FOREIGN_TABLE_CSV_OPTION = 0x0001 << 10
|
||||
} OptionType;
|
||||
|
||||
#define OBS_SERVER_OPTION (T_SERVER_COMMON_OPTION | T_OBS_SERVER_OPTION)
|
||||
#define HDFS_SERVER_OPTION (T_SERVER_COMMON_OPTION | T_HDFS_SERVER_OPTION)
|
||||
#define DUMMY_SERVER_OPTION (T_SERVER_COMMON_OPTION | T_DUMMY_SERVER_OPTION)
|
||||
#define OBS_FOREIGN_TABLE_OPTION \
|
||||
(T_FOREIGN_TABLE_COMMON_OPTION | T_FOREIGN_TABLE_OBS_OPTION | T_FOREIGN_TABLE_CSV_OPTION | \
|
||||
T_FOREIGN_TABLE_TEXT_OPTION)
|
||||
|
||||
#define HDFS_FOREIGN_TABLE_OPTION \
|
||||
(T_FOREIGN_TABLE_COMMON_OPTION | T_FOREIGN_TABLE_HDFS_OPTION | T_FOREIGN_TABLE_CSV_OPTION | \
|
||||
T_FOREIGN_TABLE_TEXT_OPTION)
|
||||
|
||||
#define SERVER_TYPE_OPTION (T_SERVER_TYPE_OPTION)
|
||||
|
||||
#define DFS_OPTION_ARRAY \
|
||||
(T_SERVER_COMMON_OPTION | T_HDFS_SERVER_OPTION | T_OBS_SERVER_OPTION | T_DUMMY_SERVER_OPTION | \
|
||||
HDFS_FOREIGN_TABLE_OPTION | OBS_FOREIGN_TABLE_OPTION)
|
||||
|
||||
#define SERVER_TYPE_OPTION_ARRAY (T_SERVER_TYPE_OPTION)
|
||||
|
||||
/*
|
||||
* HdfsValidOption keeps an option name and a context. When an option is passed
|
||||
* into hdfs_fdw objects (server and foreign table), we compare this option's
|
||||
* name and context against those of valid options.
|
||||
*/
|
||||
typedef struct HdfsValidOption {
|
||||
const char* optionName;
|
||||
uint32 optType;
|
||||
} HdfsValidOption;
|
||||
|
||||
/*
|
||||
* FDW-specific information for RelOptInfo.fdw_private.
|
||||
*/
|
||||
typedef struct HdfsFdwPlanState {
|
||||
double tuplesCount; /* estimate of number of rows in file */
|
||||
HdfsFdwOptions* hdfsFdwOptions;
|
||||
} HdfsFdwPlanState;
|
||||
|
||||
/*
|
||||
* HdfsFdwExecState keeps foreign data wrapper specific execution state that we
|
||||
* create and hold onto when executing the query.
|
||||
*/
|
||||
typedef struct HdfsFdwExecState {
|
||||
dfs::reader::ReaderState* readerState;
|
||||
|
||||
dfs::reader::Reader* fileReader;
|
||||
} HdfsFdwExecState;
|
||||
|
||||
/* Function declarations for foreign data wrapper */
|
||||
extern "C" Datum hdfs_fdw_handler(PG_FUNCTION_ARGS);
|
||||
extern "C" Datum hdfs_fdw_validator(PG_FUNCTION_ARGS);
|
||||
|
||||
#endif /* hdfs_fdw_H */
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
#ifndef SCHEDULER_H_
|
||||
#define SCHEDULER_H_
|
||||
#include "hdfs_fdw.h"
|
||||
#include "foreign/foreign.h"
|
||||
#include "nodes/execnodes.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define PGXC_NODE_ID 9015
|
||||
#define MAX_FOREIGN_PARTITIONKEY_NUM 4
|
||||
|
||||
#define MASK_HIGH_UINT32(x) (x & (uint64)0xFFFFFFFF)
|
||||
#define GETIP(x) ((uint32)(x & (uint64)0xFFFFFFFF))
|
||||
#define GETOID(x) ((uint32)(x >> 32))
|
||||
|
||||
#define LOCAL_IP "127.0.0.1"
|
||||
#define LOCAL_HOST "localhost"
|
||||
#define MAX_HOST_NAME_LENGTH 255
|
||||
#define EXTRA_IP_NUM 32
|
||||
#define MAX_ROUNDROBIN_AVAILABLE_DN_NUM 256
|
||||
#define MAX_UINT32 (0xFFFFFFFF)
|
||||
|
||||
typedef struct dnWork {
|
||||
Oid nodeOid;
|
||||
List* toDoList;
|
||||
} dnWork;
|
||||
|
||||
typedef struct dnInfoStat {
|
||||
uint32 ipAddr;
|
||||
uint32 Start;
|
||||
uint32 Cnt;
|
||||
} dnInfoStat;
|
||||
|
||||
/*
|
||||
* This is executed on CN to schedule the files to each dn for load balance and use cache.
|
||||
* add param isAnalyze because the func CNScheduling has called by foreign scan which get random dn for schedule,
|
||||
* the random dn also changed, we should get a determinded dn to get single stats for global stats in order to get
|
||||
* stable stats.
|
||||
*/
|
||||
List* CNScheduling(Oid foreignTableId, Index relId, List* columnList, List* scanClauses, List*& prunningResult,
|
||||
List*& partList, char locatorType, bool isAnalyze, List* allColumnList, int16 attrNum, int64* fileNum);
|
||||
|
||||
/* CNSchedulingForAnalyze
|
||||
* firstly calculate the files to be analyzed,and because we just do analyze in one datanode,
|
||||
* the analyze files is about (total files) /(datanode number)
|
||||
* we will find the suitable datanode to do the anlayze and return
|
||||
* add param isglbstats in order to discriminate the processing of single stats and global stats.
|
||||
* we only get files in one dn for single stats, and we must get files in all dns for global stats.
|
||||
*/
|
||||
List* CNSchedulingForAnalyze(unsigned int* totalFilesNum, unsigned int* numOfDns, Oid foreignTableId, bool isglbstats);
|
||||
|
||||
/*
|
||||
* Assign the list of splits scheduled by CN to the current data node.
|
||||
* @_in_param splitToDnMap: The list of all the splits which map to each data node.
|
||||
* @_in_out_param readerState: The state stores the splits of the current data node.
|
||||
* @_in_param conn: The connector of dfs(hdfs or obs)
|
||||
*/
|
||||
void AssignSplits(List* splitToDnMap, dfs::reader::ReaderState* readerState, dfs::DFSConnector* conn);
|
||||
|
||||
/*
|
||||
* Search the catalog pg_partition to build a partition list to return.
|
||||
*
|
||||
* @_in param relid: The oid of the foreign table by which we search the partition list from the
|
||||
* catalog.
|
||||
* @return Return the partition list we get.
|
||||
*/
|
||||
List* GetPartitionList(Oid relid);
|
||||
|
||||
#endif /* SCHEDULER_H_ */
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
#Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
#
|
||||
#openGauss is licensed under Mulan PSL v2.
|
||||
#You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
#You may obtain a copy of Mulan PSL v2 at:
|
||||
#
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# init.sh
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# contrib/hdfs_fdw/init.sh
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
protoc-c --c_out=. orc.proto
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
message IntegerStatistics {
|
||||
optional sint64 minimum = 1;
|
||||
optional sint64 maximum = 2;
|
||||
optional sint64 sum = 3;
|
||||
}
|
||||
|
||||
message DoubleStatistics {
|
||||
optional double minimum = 1;
|
||||
optional double maximum = 2;
|
||||
optional double sum = 3;
|
||||
}
|
||||
|
||||
message StringStatistics {
|
||||
optional string minimum = 1;
|
||||
optional string maximum = 2;
|
||||
}
|
||||
|
||||
message BucketStatistics {
|
||||
repeated uint64 count = 1 [packed=true];
|
||||
}
|
||||
|
||||
message DecimalStatistics {
|
||||
optional string minimum = 1;
|
||||
optional string maximum = 2;
|
||||
optional string sum = 3;
|
||||
}
|
||||
|
||||
message DateStatistics {
|
||||
// min,max values saved as days since epoch
|
||||
optional sint32 minimum = 1;
|
||||
optional sint32 maximum = 2;
|
||||
}
|
||||
|
||||
message ColumnStatistics {
|
||||
optional uint64 numberOfValues = 1;
|
||||
optional IntegerStatistics intStatistics = 2;
|
||||
optional DoubleStatistics doubleStatistics = 3;
|
||||
optional StringStatistics stringStatistics = 4;
|
||||
optional BucketStatistics bucketStatistics = 5;
|
||||
optional DecimalStatistics decimalStatistics = 6;
|
||||
optional DateStatistics dateStatistics = 7;
|
||||
}
|
||||
|
||||
message RowIndexEntry {
|
||||
repeated uint64 positions = 1 [packed=true];
|
||||
optional ColumnStatistics statistics = 2;
|
||||
}
|
||||
|
||||
message RowIndex {
|
||||
repeated RowIndexEntry entry = 1;
|
||||
}
|
||||
|
||||
message OrcStream {
|
||||
// if you add new index stream kinds, you need to make sure to update
|
||||
// StreamName to ensure it is added to the stripe in the right area
|
||||
enum Kind {
|
||||
PRESENT = 0;
|
||||
DATA = 1;
|
||||
LENGTH = 2;
|
||||
DICTIONARY_DATA = 3;
|
||||
DICTIONARY_COUNT = 4;
|
||||
SECONDARY = 5;
|
||||
ROW_INDEX = 6;
|
||||
}
|
||||
required Kind kind = 1;
|
||||
optional uint32 column = 2;
|
||||
optional uint64 length = 3;
|
||||
}
|
||||
|
||||
message ColumnEncoding {
|
||||
enum Kind {
|
||||
DIRECT = 0;
|
||||
DICTIONARY = 1;
|
||||
DIRECT_V2 = 2;
|
||||
DICTIONARY_V2 = 3;
|
||||
}
|
||||
required Kind kind = 1;
|
||||
optional uint32 dictionarySize = 2;
|
||||
}
|
||||
|
||||
message StripeFooter {
|
||||
repeated OrcStream streams = 1;
|
||||
repeated ColumnEncoding columns = 2;
|
||||
}
|
||||
|
||||
message FieldType {
|
||||
enum Kind {
|
||||
BOOLEAN = 0;
|
||||
BYTE = 1;
|
||||
SHORT = 2;
|
||||
INT = 3;
|
||||
LONG = 4;
|
||||
FLOAT = 5;
|
||||
DOUBLE = 6;
|
||||
STRING = 7;
|
||||
BINARY = 8;
|
||||
TIMESTAMP = 9;
|
||||
LIST = 10;
|
||||
MAP = 11;
|
||||
STRUCT = 12;
|
||||
UNION = 13;
|
||||
DECIMAL = 14;
|
||||
DATE = 15;
|
||||
}
|
||||
required Kind kind = 1;
|
||||
repeated uint32 subtypes = 2 [packed=true];
|
||||
repeated string fieldNames = 3;
|
||||
}
|
||||
|
||||
message StripeInformation {
|
||||
optional uint64 offset = 1;
|
||||
optional uint64 indexLength = 2;
|
||||
optional uint64 dataLength = 3;
|
||||
optional uint64 footerLength = 4;
|
||||
optional uint64 numberOfRows = 5;
|
||||
}
|
||||
|
||||
message UserMetadataItem {
|
||||
required string name = 1;
|
||||
required bytes value = 2;
|
||||
}
|
||||
|
||||
message Footer {
|
||||
optional uint64 headerLength = 1;
|
||||
optional uint64 contentLength = 2;
|
||||
repeated StripeInformation stripes = 3;
|
||||
repeated FieldType types = 4;
|
||||
repeated UserMetadataItem metadata = 5;
|
||||
optional uint64 numberOfRows = 6;
|
||||
repeated ColumnStatistics statistics = 7;
|
||||
optional uint32 rowIndexStride = 8;
|
||||
}
|
||||
|
||||
enum CompressionKind {
|
||||
NONE = 0;
|
||||
ZLIB = 1;
|
||||
SNAPPY = 2;
|
||||
LZO = 3;
|
||||
}
|
||||
|
||||
// Serialized length must be less that 255 bytes
|
||||
message PostScript {
|
||||
optional uint64 footerLength = 1;
|
||||
optional CompressionKind compression = 2;
|
||||
optional uint64 compressionBlockSize = 3;
|
||||
repeated uint32 version = 4 [packed = true];
|
||||
// Leave this last in the record
|
||||
optional string magic = 8000;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -285,12 +285,12 @@ static const unsigned int crc32tab[256] = {
|
|||
unsigned int crc32_sz(char* buf, int size)
|
||||
{
|
||||
unsigned int crc = ~((unsigned int)0);
|
||||
unsigned char* p = NULL;
|
||||
char* p = NULL;
|
||||
int len, nr;
|
||||
|
||||
len = 0;
|
||||
nr = size;
|
||||
for (len += nr, p = (unsigned char*)buf; nr--; ++p)
|
||||
for (len += nr, p = buf; nr--; ++p)
|
||||
_CRC32_(crc, *p);
|
||||
return ~crc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,7 +397,6 @@ Datum hstore_from_text(PG_FUNCTION_ARGS)
|
|||
|
||||
p.needfree = false;
|
||||
key = PG_GETARG_TEXT_PP(0);
|
||||
FUNC_CHECK_HUGE_POINTER(false, key, "tconvert()");
|
||||
p.key = VARDATA_ANY(key);
|
||||
p.keylen = hstoreCheckKeyLen(VARSIZE_ANY_EXHDR(key));
|
||||
|
||||
|
|
@ -406,7 +405,6 @@ Datum hstore_from_text(PG_FUNCTION_ARGS)
|
|||
p.isnull = true;
|
||||
} else {
|
||||
val = PG_GETARG_TEXT_PP(1);
|
||||
FUNC_CHECK_HUGE_POINTER(false, val, "tconvert()");
|
||||
p.val = VARDATA_ANY(val);
|
||||
p.vallen = hstoreCheckValLen(VARSIZE_ANY_EXHDR(val));
|
||||
p.isnull = false;
|
||||
|
|
|
|||
|
|
@ -2722,8 +2722,8 @@ static void log_rescan_foreign_scan(ForeignScanState* node)
|
|||
(void)MemoryContextSwitchTo(old_memcnxt);
|
||||
}
|
||||
|
||||
static ForeignScan* log_get_foreign_plan(PlannerInfo* root, RelOptInfo* baserel, Oid foreigntableid,
|
||||
ForeignPath* best_path, List* tlist, List* scan_clauses, Plan* outer_plan)
|
||||
static ForeignScan* log_get_foreign_plan(
|
||||
PlannerInfo* root, RelOptInfo* baserel, Oid foreigntableid, ForeignPath* best_path, List* tlist, List* scan_clauses)
|
||||
{
|
||||
Index scan_relid = baserel->relid;
|
||||
List* fdw_data = best_path->fdw_private;
|
||||
|
|
@ -2773,9 +2773,6 @@ static ForeignScan* log_get_foreign_plan(PlannerInfo* root, RelOptInfo* baserel,
|
|||
scan_relid,
|
||||
NIL, /* no expressions to evaluate */
|
||||
fdw_data,
|
||||
NIL,
|
||||
NIL,
|
||||
NULL,
|
||||
EXEC_ON_DATANODES); /* no private state either */
|
||||
|
||||
return fscan;
|
||||
|
|
@ -2799,7 +2796,6 @@ static void log_get_foreign_paths(PlannerInfo* root, RelOptInfo* baserel, Oid fo
|
|||
total_cost,
|
||||
NIL, /* no pathkeys */
|
||||
NULL, /* no outer rel either */
|
||||
NULL, /* no outer path either */
|
||||
NIL,
|
||||
1)); /* no fdw_private data */
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "access/gist.h"
|
||||
#include "access/skey.h"
|
||||
#include "port/pg_bitutils.h"
|
||||
|
||||
#include "crc32.h"
|
||||
#include "ltree.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -105,13 +105,6 @@ static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions*
|
|||
data->only_local = true;
|
||||
data->tableWhiteList = NIL;
|
||||
|
||||
/* read default option from GUC */
|
||||
DecodeOptionsDefault *defaultOption = LogicalDecodeGetOptionsDefault();
|
||||
if (defaultOption != NULL) {
|
||||
data->max_txn_in_memory = defaultOption->max_txn_in_memory;
|
||||
data->max_reorderbuffer_in_memory = defaultOption->max_reorderbuffer_in_memory;
|
||||
}
|
||||
|
||||
ctx->output_plugin_private = data;
|
||||
|
||||
opt->output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT;
|
||||
|
|
@ -226,8 +219,8 @@ static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id)
|
|||
}
|
||||
|
||||
/* print the tuple 'tuple' into the StringInfo s */
|
||||
static void TupleToJsoninfo(Relation relation, cJSON* cols_name, cJSON* cols_type, cJSON* cols_val, TupleDesc tupdesc,
|
||||
HeapTuple tuple, bool isOld)
|
||||
static void TupleToJsoninfo(
|
||||
cJSON* cols_name, cJSON* cols_type, cJSON* cols_val, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
|
||||
{
|
||||
if ((tuple->tupTableType == HEAP_TUPLE) && (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data) ||
|
||||
(int)HeapTupleHeaderGetNatts(tuple->t_data, tupdesc) > tupdesc->natts)) {
|
||||
|
|
@ -254,7 +247,7 @@ static void TupleToJsoninfo(Relation relation, cJSON* cols_name, cJSON* cols_typ
|
|||
* Don't print system columns, oid will already have been printed if
|
||||
* present.
|
||||
*/
|
||||
if (attr->attnum < 0 || (isOld && !IsRelationReplidentKey(relation, attr->attnum)))
|
||||
if (attr->attnum < 0)
|
||||
continue;
|
||||
|
||||
Oid typid = attr->atttypid; /* type of current attribute */
|
||||
|
|
@ -265,6 +258,8 @@ static void TupleToJsoninfo(Relation relation, cJSON* cols_name, cJSON* cols_typ
|
|||
} else {
|
||||
origval = uheap_getattr((UHeapTuple)tuple, natt + 1, tupdesc, &isnull);
|
||||
}
|
||||
if (isnull && skip_nulls)
|
||||
continue;
|
||||
|
||||
/* print attribute name */
|
||||
|
||||
|
|
@ -353,53 +348,53 @@ static void pg_decode_change(
|
|||
case REORDER_BUFFER_CHANGE_INSERT:
|
||||
op_type = cJSON_CreateString("INSERT");
|
||||
if (change->data.tp.newtuple != NULL) {
|
||||
TupleToJsoninfo(relation, columns_name, columns_type, columns_val, tupdesc,
|
||||
&change->data.tp.newtuple->tuple, false);
|
||||
TupleToJsoninfo(
|
||||
columns_name, columns_type, columns_val, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
}
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UPDATE:
|
||||
op_type = cJSON_CreateString("UPDATE");
|
||||
if (change->data.tp.oldtuple != NULL) {
|
||||
TupleToJsoninfo(relation, old_keys_name, old_keys_type, old_keys_val, tupdesc,
|
||||
&change->data.tp.oldtuple->tuple, true);
|
||||
TupleToJsoninfo(
|
||||
old_keys_name, old_keys_type, old_keys_val, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
}
|
||||
|
||||
if (change->data.tp.newtuple != NULL) {
|
||||
TupleToJsoninfo(relation, columns_name, columns_type, columns_val, tupdesc,
|
||||
&change->data.tp.newtuple->tuple, false);
|
||||
TupleToJsoninfo(
|
||||
columns_name, columns_type, columns_val, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
}
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_DELETE:
|
||||
op_type = cJSON_CreateString("DELETE");
|
||||
if (change->data.tp.oldtuple != NULL) {
|
||||
TupleToJsoninfo(relation, old_keys_name, old_keys_type, old_keys_val, tupdesc,
|
||||
&change->data.tp.oldtuple->tuple, true);
|
||||
TupleToJsoninfo(
|
||||
old_keys_name, old_keys_type, old_keys_val, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
}
|
||||
/* if there was no PK, we only know that a delete happened */
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UINSERT:
|
||||
op_type = cJSON_CreateString("INSERT");
|
||||
if (change->data.utp.newtuple != NULL) {
|
||||
TupleToJsoninfo(relation, columns_name, columns_type, columns_val, tupdesc,
|
||||
TupleToJsoninfo(columns_name, columns_type, columns_val, tupdesc,
|
||||
(HeapTuple)(&change->data.utp.newtuple->tuple), false);
|
||||
}
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UDELETE:
|
||||
op_type = cJSON_CreateString("DELETE");
|
||||
if (change->data.utp.oldtuple != NULL) {
|
||||
TupleToJsoninfo(relation, old_keys_name, old_keys_type, old_keys_val, tupdesc,
|
||||
TupleToJsoninfo(old_keys_name, old_keys_type, old_keys_val, tupdesc,
|
||||
(HeapTuple)(&change->data.utp.oldtuple->tuple), true);
|
||||
}
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UUPDATE:
|
||||
op_type = cJSON_CreateString("UPDATE");
|
||||
if (change->data.utp.oldtuple != NULL) {
|
||||
TupleToJsoninfo(relation, old_keys_name, old_keys_type, old_keys_val, tupdesc,
|
||||
TupleToJsoninfo(old_keys_name, old_keys_type, old_keys_val, tupdesc,
|
||||
(HeapTuple)(&change->data.utp.oldtuple->tuple), true);
|
||||
}
|
||||
|
||||
if (change->data.utp.newtuple != NULL) {
|
||||
TupleToJsoninfo(relation, columns_name, columns_type, columns_val, tupdesc,
|
||||
TupleToJsoninfo(columns_name, columns_type, columns_val, tupdesc,
|
||||
(HeapTuple)&change->data.utp.newtuple->tuple, false);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,46 +1,46 @@
|
|||
#
|
||||
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
#
|
||||
# openGauss is licensed under Mulan PSL v2.
|
||||
# You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
# You may obtain a copy of Mulan PSL v2 at:
|
||||
#
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
# ---------------------------------------------------------------------------------------
|
||||
#
|
||||
# Makefile
|
||||
# Makefile for the mysql_fdw
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# contrib/mysql_fdw/Makefile
|
||||
#
|
||||
# ---------------------------------------------------------------------------------------
|
||||
|
||||
all:mysql_fdw_target
|
||||
install:install-data
|
||||
|
||||
top_builddir ?= ../../
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
CODE_DIR=mysql_fdw
|
||||
|
||||
.PHONY: mysql_fdw_target
|
||||
mysql_fdw_target: prep_checked
|
||||
@make -C $(MYFDW_HOME) TOP_DIR=$(abs_top_srcdir)
|
||||
|
||||
prep_checked:
|
||||
@test -d $(MYFDW_HOME) || ( echo "ERROR: You need fetch and copy mysql_fdw from 'third_party' repo to 'third_party_binarylibs' repo and keep directory strucutre unchanged" && exit 1 )
|
||||
@test -d $(MYFDW_HOME) && date > prep_checked
|
||||
.PHONY: install-data
|
||||
install-data: mysql_fdw_target
|
||||
@make -C $(MYFDW_HOME) TOP_DIR=$(abs_top_srcdir) install
|
||||
uninstall distclean clean:
|
||||
@rm -rf $(MYFDW_HOME)/*.o
|
||||
@rm -rf $(MYFDW_HOME)/*.so
|
||||
@rm -f prep_checked
|
||||
|
||||
MYSQL_FDW_RELEVANT_SOURCES = connection.c deparse.c mysql_fdw.c mysql_query.c option.c
|
||||
#
|
||||
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
#
|
||||
# openGauss is licensed under Mulan PSL v2.
|
||||
# You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
# You may obtain a copy of Mulan PSL v2 at:
|
||||
#
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
# ---------------------------------------------------------------------------------------
|
||||
#
|
||||
# Makefile
|
||||
# Makefile for the mysql_fdw
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# contrib/mysql_fdw/Makefile
|
||||
#
|
||||
# ---------------------------------------------------------------------------------------
|
||||
|
||||
all:mysql_fdw_target
|
||||
install:install-data
|
||||
|
||||
top_builddir ?= ../../
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
CODE_DIR=mysql_fdw
|
||||
|
||||
.PHONY: mysql_fdw_target
|
||||
mysql_fdw_target: prep_checked
|
||||
@make -C $(MYFDW_HOME) TOP_DIR=$(abs_top_srcdir)
|
||||
|
||||
prep_checked:
|
||||
@test -d $(MYFDW_HOME) || ( echo "ERROR: You need fetch and copy mysql_fdw from 'third_party' repo to 'third_party_binarylibs' repo and keep directory strucutre unchanged" && exit 1 )
|
||||
@test -d $(MYFDW_HOME) && date > prep_checked
|
||||
.PHONY: install-data
|
||||
install-data: mysql_fdw_target
|
||||
@make -C $(MYFDW_HOME) TOP_DIR=$(abs_top_srcdir) install
|
||||
uninstall distclean clean:
|
||||
@rm -rf $(MYFDW_HOME)/*.o
|
||||
@rm -rf $(MYFDW_HOME)/*.so
|
||||
@rm -f prep_checked
|
||||
|
||||
MYSQL_FDW_RELEVANT_SOURCES = connection.c deparse.c mysql_fdw.c mysql_query.c option.c
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
extern char* optarg;
|
||||
|
||||
#include "libpq/libpq-fe.h"
|
||||
#include "libpq-fe.h"
|
||||
|
||||
/* an extensible array to keep track of elements to show */
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
#This is the main CMAKE for build all pagehack.
|
||||
# pagehack
|
||||
execute_process(
|
||||
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/dss/dss_adaptor.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dss_adaptor.cpp
|
||||
)
|
||||
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TGT_pagehack_SRC)
|
||||
set(TGT_pagehack_INC
|
||||
${TGT_pq_INC} ${ZSTD_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SRC_DIR}/lib/gstrace ${PROJECT_SRC_DIR}/lib/page_compression
|
||||
|
|
@ -14,13 +11,13 @@ if(${ENABLE_DEBUG} STREQUAL "ON")
|
|||
endif()
|
||||
set(pagehack_COMPILE_OPTIONS ${OS_OPTIONS} ${PROTECT_OPTIONS} ${WARNING_OPTIONS} ${CHECK_OPTIONS} ${BIN_SECURE_OPTIONS} ${OPTIMIZE_OPTIONS})
|
||||
set(pagehack_LINK_OPTIONS ${BIN_LINK_OPTIONS})
|
||||
set(pagehack_LINK_LIBS -lpgport -lcrypt -ldl -lm -ledit -lssl -lcrypto -l${SECURE_C_CHECK} -lrt -lz -lminiunz -lzstd -lpagecompression -llz4)
|
||||
set(pagehack_LINK_LIBS -lpgport -lcrypt -ldl -lm -ledit -lssl -lcrypto -lsecurec -lrt -lz -lminiunz -lzstd -lpagecompression)
|
||||
add_bintarget(pagehack TGT_pagehack_SRC TGT_pagehack_INC "${pagehack_DEF_OPTIONS}" "${pagehack_COMPILE_OPTIONS}" "${pagehack_LINK_OPTIONS}" "${pagehack_LINK_LIBS}")
|
||||
add_dependencies(pagehack pgport_static pagecompression)
|
||||
target_link_directories(pagehack PUBLIC
|
||||
${LIBOPENSSL_LIB_PATH} ${LIBCURL_LIB_PATH} ${SECURE_LIB_PATH}
|
||||
${LIBOPENSSL_LIB_PATH} ${PROTOBUF_LIB_PATH} ${LIBPARQUET_LIB_PATH} ${LIBCURL_LIB_PATH} ${SECURE_LIB_PATH}
|
||||
${ZLIB_LIB_PATH} ${LIBOBS_LIB_PATH} ${LIBEDIT_LIB_PATH} ${LIBCGROUP_LIB_PATH} ${CMAKE_BINARY_DIR}/lib
|
||||
${ZSTD_LIB_PATH} ${LZ4_LIB_PATH} ${PROJECT_SRC_DIR}/lib/page_compression
|
||||
${ZSTD_LIB_PATH} ${PROJECT_SRC_DIR}/lib/page_compression
|
||||
)
|
||||
install(TARGETS pagehack RUNTIME DESTINATION bin)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# contrib/pagehack/Makefile
|
||||
MODULE_big = pagehack
|
||||
OBJS = pagehack.o \
|
||||
$(top_builddir)/src/gausskernel/storage/dss/dss_adaptor.o
|
||||
OBJS = pagehack.o
|
||||
|
||||
# executable program, even there is no database server/client
|
||||
PROGRAM = pagehack
|
||||
|
|
@ -17,7 +16,7 @@ top_builddir = ../..
|
|||
include $(top_builddir)/src/Makefile.global
|
||||
override CPPFLAGS += -I${top_builddir}/src/lib/page_compression
|
||||
override LDFLAGS += -L${top_builddir}/src/lib/page_compression
|
||||
override CFLAGS += -lpagecompression -lzstd -llz4
|
||||
override CFLAGS += -lpagecompression -lzstd
|
||||
ifeq ($(enable_debug), yes)
|
||||
PG_CPPFLAGS += -DDEBUG
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <new>
|
||||
|
||||
#include "access/heapam.h"
|
||||
#include "access/htup.h"
|
||||
|
|
@ -80,8 +79,6 @@
|
|||
#include "storage/smgr/relfilenode.h"
|
||||
#include "storage/sinval.h"
|
||||
#include "storage/smgr/segment.h"
|
||||
#include "storage/dss/dss_adaptor.h"
|
||||
#include "storage/file/fio_device.h"
|
||||
#include "replication/bcm.h"
|
||||
#include "utils/datetime.h"
|
||||
#include "utils/memutils.h"
|
||||
|
|
@ -90,7 +87,6 @@
|
|||
#include "cstore.h"
|
||||
#include "common/build_query/build_query.h"
|
||||
#include <libgen.h>
|
||||
#include "tool_common.h"
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
#include "tsdb/utils/constant_def.h"
|
||||
#endif
|
||||
|
|
@ -103,7 +99,6 @@
|
|||
#define CLASS_TYPE_NUM 512
|
||||
#define TEN 10
|
||||
|
||||
|
||||
typedef unsigned char* binary;
|
||||
static const char* indents[] = { // 10 tab is enough to used.
|
||||
"",
|
||||
|
|
@ -146,15 +141,7 @@ static const char* PgHeapRelName[] = {"pg_class",
|
|||
"pg_am",
|
||||
"pg_statistic",
|
||||
"pg_toast"};
|
||||
|
||||
typedef enum SegmentType {
|
||||
SEG_HEAP,
|
||||
SEG_FSM,
|
||||
SEG_UHEAP,
|
||||
SEG_INDEX_BTREE,
|
||||
SEG_UNDO,
|
||||
SEG_UNKNOWN
|
||||
} SegmentType;
|
||||
typedef enum SegmentType { SEG_HEAP, SEG_FSM, SEG_UHEAP, SEG_INDEX_BTREE, SEG_UNDO, SEG_UNKNOWN } SegmentType;
|
||||
|
||||
static void ParsePgClassTupleData(binary tupdata, int len, binary nullBitmap, int natrrs);
|
||||
static void ParsePgIndexTupleData(binary tupdata, int len, binary nullBitmap, int nattrs);
|
||||
|
|
@ -196,7 +183,6 @@ static ParseHeapTupleData PgIndexRelTupleParser[] = {ParseToastIndexTupleData};
|
|||
static int PgHeapRelTupleParserCursor = -1;
|
||||
static int PgIndexRelTupleParserCursor = -1;
|
||||
|
||||
|
||||
/* For Assert(...) macros. */
|
||||
THR_LOCAL bool assert_enabled = true;
|
||||
|
||||
|
|
@ -205,7 +191,6 @@ bool only_vm = false;
|
|||
bool only_bcm = false;
|
||||
bool write_back = false;
|
||||
bool dirty_page = false;
|
||||
bool enable_dss = false;
|
||||
int start_item = 1;
|
||||
int num_item = 0;
|
||||
int SegNo = 0;
|
||||
|
|
@ -1020,9 +1005,6 @@ static void usage(const char* progname)
|
|||
" -d only for test, use 0xFF to fill the last half page[4k]\n"
|
||||
" -z only for undo space/group meta, dump the specified space/group\n"
|
||||
" -S heap file segment number\n"
|
||||
"\nDss options:\n"
|
||||
" -D enable shared storage mode\n"
|
||||
" -c SOCKETPATH dss connect socket file path\n"
|
||||
"\nCommon options:\n"
|
||||
" --help, -h show this help, then exit\n"
|
||||
" --version, -V output version information, then exit\n");
|
||||
|
|
@ -1073,8 +1055,7 @@ static void ParsePgCudescXXTupleData(binary tupdata, int len, binary nullBitmap,
|
|||
char* nextAttr = (char*)tupdata;
|
||||
|
||||
bool isnulls[nattrs];
|
||||
errno_t rc = memset_s(isnulls, nattrs, false, nattrs);
|
||||
securec_check_c(rc, "\0", "\0");
|
||||
memset(isnulls, false, nattrs);
|
||||
if (NULL != nullBitmap) {
|
||||
datlen = (nattrs + 7) / 8;
|
||||
int j = 0;
|
||||
|
|
@ -2379,14 +2360,12 @@ static void parse_uheap_item(const Item item, unsigned len, int blkno, int linen
|
|||
|
||||
indentLevel = 3;
|
||||
|
||||
errno_t rc = snprintf_s(buffer, 128, 127, "\t\t\txid:%u, td:%d locker_td:%d\n",
|
||||
utuple->xid, utuple->td_id, utuple->reserved);
|
||||
errno_t rc = snprintf_s(buffer, 128, 127, "\t\t\txid:%d, td:%d locker_td:%d\n",
|
||||
utuple->xid, utuple->td_id, utuple->locker_td_id);
|
||||
securec_check(rc, "\0", "\0");
|
||||
fprintf(stdout, "%s", buffer);
|
||||
fprintf(stdout, "\t\t\tNumber of columns: %d\n", UHeapTupleHeaderGetNatts(utuple));
|
||||
fprintf(stdout, "\t\t\tFlag: %d\n", utuple->flag);
|
||||
fprintf(stdout, "\t\t\tFlag2: %d\n", utuple->flag2);
|
||||
fprintf(stdout, "\t\t\tt_hoff: %d\n", utuple->t_hoff);
|
||||
|
||||
if (utuple->flag & UHEAP_HAS_NULL) {
|
||||
fprintf(stdout, "\t\t\tFlag: %s\n", "UHEAP_HASNULL ");
|
||||
|
|
@ -2726,7 +2705,7 @@ static void ParseUHeapPageHeader(const PageHeader page, int blkno, int blknum)
|
|||
fprintf(stdout, "\tpd_xid_base: %lu, pd_multi_base: %lu\n",
|
||||
upage->pd_xid_base, upage->pd_multi_base);
|
||||
if (upage->pd_upper < upage->pd_lower) {
|
||||
fprintf(stdout, "WARNING: INVALID PAGE!\n");
|
||||
fprintf(stdout, "WARNING: INVALID PAGE!");
|
||||
} else {
|
||||
freeSpace = upage->pd_upper - upage->pd_lower;
|
||||
g_freeMax = freeSpace > g_freeMax ? freeSpace : g_freeMax;
|
||||
|
|
@ -2911,7 +2890,7 @@ static void parse_heap_or_index_page(const char* buffer, int blkno, SegmentType
|
|||
}
|
||||
fprintf(stdout, "\n\tUHeap tuple information on this page\n");
|
||||
for (i = FirstOffsetNumber; i <= nline; i++) {
|
||||
rowptr = UPageGenerateRowPtr(buffer, i);
|
||||
rowptr = UPageGetRowPtr(buffer, i);
|
||||
if (RowPtrIsUsed(rowptr)) {
|
||||
if (RowPtrHasStorage(rowptr))
|
||||
nstorage++;
|
||||
|
|
@ -3079,7 +3058,7 @@ static int parse_a_page(const char* buffer, int blkno, int blknum, SegmentType t
|
|||
|
||||
if (PageIsNew(page)) {
|
||||
fprintf(stdout, "Page information of block %d/%d : new page\n\n", blkno, blknum);
|
||||
ParsePageHeader(page, blkno, blknum, type);
|
||||
ParseHeapPageHeader(page, blkno, blknum);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -3109,10 +3088,10 @@ static BlockNumber CalculateMaxBlockNumber(BlockNumber blknum, BlockNumber start
|
|||
{
|
||||
/* parse */
|
||||
if (start >= blknum) {
|
||||
(void)fprintf(stderr, "start point exceeds the total block number of relation.\n");
|
||||
fprintf(stderr, "start point exceeds the total block number of relation.\n");
|
||||
return InvalidBlockNumber;
|
||||
} else if ((start + number) > blknum) {
|
||||
(void)fprintf(stderr, "don't have %u blocks from block %u in the relation, only %u blocks\n", number, start,
|
||||
fprintf(stderr, "don't have %d blocks from block %d in the relation, only %d blocks\n", number, start,
|
||||
(blknum - start));
|
||||
number = blknum;
|
||||
} else if (number == 0) {
|
||||
|
|
@ -3125,26 +3104,22 @@ static BlockNumber CalculateMaxBlockNumber(BlockNumber blknum, BlockNumber start
|
|||
|
||||
static void MarkBufferDirty(char *buffer, size_t len)
|
||||
{
|
||||
size_t writeLen = len / 2;
|
||||
int writeLen = len / 2;
|
||||
unsigned char fill_byte[writeLen] = {0xFF};
|
||||
for (size_t i = 0; i < writeLen; i++)
|
||||
for (int i = 0; i < writeLen; i++)
|
||||
fill_byte[i] = 0xFF;
|
||||
auto rc = memcpy_s(buffer + writeLen, len - writeLen, fill_byte, writeLen);
|
||||
auto rc = memcpy_s(buffer + writeLen, BLCKSZ - writeLen, fill_byte, writeLen);
|
||||
securec_check(rc, "", "");
|
||||
}
|
||||
|
||||
static int parse_page_file(const char *filename, SegmentType type, const uint32 start_point, const uint32 number_read)
|
||||
{
|
||||
if (!IsCompressedFile(filename, strlen(filename))) {
|
||||
if (type != SEG_HEAP && type != SEG_INDEX_BTREE) {
|
||||
return parse_uncompressed_page_file(filename, type, start_point, number_read);
|
||||
}
|
||||
|
||||
PageCompression *pageCompression = new(std::nothrow) PageCompression();
|
||||
if (pageCompression == NULL) {
|
||||
fprintf(stderr, "compression page new failed\n");
|
||||
return false;
|
||||
}
|
||||
if (pageCompression->Init(filename, (BlockNumber)SegNo) != SUCCESS) {
|
||||
|
||||
auto pageCompression = new PageCompression();
|
||||
if (pageCompression->Init(filename, MAXPGPATH, SegNo) != SUCCESS) {
|
||||
delete pageCompression;
|
||||
return parse_uncompressed_page_file(filename, type, start_point, number_read);
|
||||
}
|
||||
|
|
@ -3159,16 +3134,15 @@ static int parse_page_file(const char *filename, SegmentType type, const uint32
|
|||
char compressed[BLCKSZ];
|
||||
char decompressed[BLCKSZ];
|
||||
while (start < number) {
|
||||
size_t compressedSize = pageCompression->ReadCompressedBuffer(start, compressed, BLCKSZ);
|
||||
if (compressedSize > MIN_COMPRESS_ERROR_RT) {
|
||||
fprintf(stderr, "read block %u failed, filename: %s: code: %lu %s\n",
|
||||
start, filename, compressedSize, strerror(errno));
|
||||
auto compressedSize = pageCompression->ReadCompressedBuffer(start, compressed, BLCKSZ);
|
||||
if (compressedSize == 0) {
|
||||
fprintf(stderr, "read block %d failed, filename: %s_pcd: %s\n", start, filename, strerror(errno));
|
||||
delete pageCompression;
|
||||
return false;
|
||||
}
|
||||
char *parseFile = NULL;
|
||||
if (compressedSize < BLCKSZ) {
|
||||
(void)pageCompression->DecompressedPage(compressed, decompressed);
|
||||
pageCompression->DecompressedPage(compressed, decompressed);
|
||||
parseFile = decompressed;
|
||||
} else {
|
||||
parseFile = compressed;
|
||||
|
|
@ -3183,7 +3157,7 @@ static int parse_page_file(const char *filename, SegmentType type, const uint32
|
|||
MarkBufferDirty(parseFile, BLCKSZ);
|
||||
}
|
||||
if (!pageCompression->WriteBackUncompressedData(compressed, compressedSize, parseFile, BLCKSZ, start)) {
|
||||
fprintf(stderr, "write back failed, filename: %s: %s\n", filename, strerror(errno));
|
||||
fprintf(stderr, "write back failed, filename: %s_pcd: %s\n", filename, strerror(errno));
|
||||
delete pageCompression;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3205,8 +3179,7 @@ static int parse_uncompressed_page_file(const char *filename, SegmentType type,
|
|||
BlockNumber number = number_read;
|
||||
size_t result;
|
||||
|
||||
fd = fopen(filename, "rb+");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb+"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3263,8 +3236,7 @@ static int parse_uncompressed_page_file(const char *filename, SegmentType type,
|
|||
unsigned char fill_byte[4096] = {0xFF};
|
||||
for (int i = 0; i < 4096; i++)
|
||||
fill_byte[i] = 0xFF;
|
||||
errno_t rc = memcpy_s(buffer + 4096, BLCKSZ - 4096, fill_byte, 4096);
|
||||
securec_check_c(rc, "\0", "\0");
|
||||
memcpy(buffer + 4096, fill_byte, 4096);
|
||||
}
|
||||
fseek(fd, (start * BLCKSZ), SEEK_SET);
|
||||
fwrite(buffer, 1, BLCKSZ, fd);
|
||||
|
|
@ -3433,8 +3405,7 @@ static bool parse_internal_init_file(char* filename)
|
|||
return false;
|
||||
}
|
||||
|
||||
fp = fopen(filename, "rb");
|
||||
if (fp == NULL) {
|
||||
if (NULL == (fp = fopen(filename, "rb"))) {
|
||||
result = false;
|
||||
fprintf(stderr, "IO error when opening %s: %s\n", filename, strerror(errno));
|
||||
goto read_failed;
|
||||
|
|
@ -3665,8 +3636,7 @@ static int parse_filenodemap_file(char* filename)
|
|||
}
|
||||
fill_filenode_map(pg_class_map);
|
||||
|
||||
fd = fopen(filename, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3748,11 +3718,9 @@ static int parse_cu_file(char* filename, uint64 offset)
|
|||
seg_num = offset / (RELSEG_SIZE * BLCKSZ);
|
||||
seg_offset = offset % (RELSEG_SIZE * BLCKSZ);
|
||||
|
||||
errno_t rc = snprintf_s(fullpath, sizeof(fullpath), sizeof(fullpath) - 1, "%s.%d", filename, seg_num);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
sprintf(fullpath, "%s.%d", filename, seg_num);
|
||||
|
||||
fd = fopen(fullpath, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(fullpath, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", fullpath, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3811,8 +3779,7 @@ static int parse_slot_file(char* filename)
|
|||
size_t readBytes = 0;
|
||||
pg_crc32 checksum = 0;
|
||||
|
||||
fd = fopen(filename, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3909,8 +3876,7 @@ static int parse_gaussdb_state_file(char* filename)
|
|||
char* BuildModeStr[] = {"node", "auto", "full", "incremental"};
|
||||
XLogRecPtr lsn;
|
||||
uint32 term;
|
||||
fd = fopen(filename, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3972,8 +3938,7 @@ static int parse_pg_control_file(char* filename)
|
|||
char sysident_str[32];
|
||||
const char* strftime_fmt = "%c";
|
||||
|
||||
fd = fopen(filename, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -4005,9 +3970,7 @@ static int parse_pg_control_file(char* filename)
|
|||
* Format system_identifier separately to keep platform-dependent format
|
||||
* code out of the translatable message string.
|
||||
*/
|
||||
errno_t rc = snprintf_s(sysident_str, sizeof(sysident_str), sizeof(sysident_str) - 1, UINT64_FORMAT,
|
||||
ControlFile.system_identifier);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
snprintf(sysident_str, sizeof(sysident_str), UINT64_FORMAT, ControlFile.system_identifier);
|
||||
|
||||
fprintf(stdout, "pg_control version number: %u\n", ControlFile.pg_control_version);
|
||||
|
||||
|
|
@ -4108,8 +4071,7 @@ static int parse_clog_file(char* filename)
|
|||
|
||||
xid = (uint64)segnum * segnum_xid;
|
||||
|
||||
fd = fopen(filename, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -4164,8 +4126,7 @@ static int parse_csnlog_file(char* filename)
|
|||
|
||||
xid = (uint64)segnum * segnum_xid;
|
||||
|
||||
fd = fopen(filename, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", filename, gs_strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -4405,36 +4366,26 @@ static bool parse_dw_file(const char* file_name, uint32 start_page, uint32 page_
|
|||
size_t result;
|
||||
uint32 dw_batch_page_num;
|
||||
dw_file_head_t file_head;
|
||||
char* meta_name;
|
||||
char meta_full_path[PATH_MAX];
|
||||
char meta_name_tmp[PATH_MAX];
|
||||
char meta_path[PATH_MAX];
|
||||
char cur_dir[PATH_MAX];
|
||||
dw_batch_meta_file* batch_meta_file;
|
||||
char* meta_buf = NULL;
|
||||
char* dw_buf = NULL;
|
||||
|
||||
/* copy the full path of dw file to meta_full_path */
|
||||
if (realpath(file_name, meta_full_path) == NULL && file_name[0] == '\0') {
|
||||
fprintf(stderr, "could not get correct path or the absolute path is too long!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* extract the path dir of dw file, which is the dir of meta file */
|
||||
(void)dirname(meta_full_path);
|
||||
|
||||
/* extract the meta name from DW_META_FILE */
|
||||
rc = strcpy_s(meta_name_tmp, PATH_MAX, T_DW_META_FILE);
|
||||
rc = strcpy_s(cur_dir, PATH_MAX, file_name);
|
||||
securec_check(rc, "", "");
|
||||
meta_name = basename(meta_name_tmp);
|
||||
|
||||
/* fetch the full meta path with above two parts */
|
||||
rc = strcat_s(meta_full_path, PATH_MAX, "/");
|
||||
(void)dirname(cur_dir);
|
||||
rc = strcpy_s(meta_path, PATH_MAX, cur_dir);
|
||||
securec_check(rc, "", "");
|
||||
rc = strcat_s(meta_full_path, PATH_MAX, meta_name);
|
||||
rc = strcat_s(meta_path, PATH_MAX, "\\");
|
||||
securec_check(rc, "", "");
|
||||
rc = strcat_s(meta_path, PATH_MAX, DW_META_FILE);
|
||||
securec_check(rc, "", "");
|
||||
|
||||
fd = fopen(meta_full_path, "rb+");
|
||||
fd = fopen(meta_path, "rb+");
|
||||
|
||||
if (fd == NULL) {
|
||||
fprintf(stderr, "%s: %s\n", meta_full_path, strerror(errno));
|
||||
fprintf(stderr, "%s: %s\n", meta_path, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -4449,7 +4400,7 @@ static bool parse_dw_file(const char* file_name, uint32 start_page, uint32 page_
|
|||
if (result != 1) {
|
||||
free(meta_buf);
|
||||
fclose(fd);
|
||||
fprintf(stderr, "read %s: %s\n", meta_full_path, strerror(errno));
|
||||
fprintf(stderr, "read %s: %s\n", meta_path, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -4598,7 +4549,8 @@ static bool parse_segment_head(char *filename, uint32 start_page)
|
|||
}
|
||||
|
||||
bool result;
|
||||
int fd = open(filename, O_RDONLY, S_IRUSR | S_IWUSR);
|
||||
|
||||
int fd = open(filename, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Failed to open %s: %s\n", filename, strerror(errno));
|
||||
free(buf);
|
||||
|
|
@ -4669,8 +4621,7 @@ static bool parse_dw_single_flush_file(const char* file_name)
|
|||
char *dw_block = (char *)TYPEALIGN(BLCKSZ, unaligned_buf2);
|
||||
PageHeader pghr = NULL;
|
||||
|
||||
fd = fopen(file_name, "rb");
|
||||
if (fd == NULL) {
|
||||
if (NULL == (fd = fopen(file_name, "rb"))) {
|
||||
fprintf(stderr, "%s: %s\n", file_name, gs_strerror(errno));
|
||||
free(item);
|
||||
free(unaligned_buf);
|
||||
|
|
@ -4871,15 +4822,11 @@ static int ParseUndoZoneMeta(const char *filename, int zid)
|
|||
uspMetaInfo = (UndoZoneMetaInfo *) (uspMetaBuffer + offset * sizeof(UndoZoneMetaInfo));
|
||||
if ((zid == INVALID_ZONE_ID) || (zid != INVALID_ZONE_ID && zid == zoneId)) {
|
||||
fprintf(stdout,
|
||||
"zid=%d, insertURecPtr=%lu, discardURecPtr=%lu, forcediscardURecPtr=%lu, allocateTSlotPtr=%lu, "
|
||||
"recycleTSlotPtr=%lu, recyclexid=%lu, lsn=%lu.\n",
|
||||
zoneId,
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->insertURecPtr),
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->discardURecPtr),
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->forceDiscardURecPtr),
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->allocateTSlotPtr),
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->recycleTSlotPtr),
|
||||
uspMetaInfo->recycleXid, uspMetaInfo->lsn);
|
||||
"zid=%d, insert=%lu, discard=%lu, forcediscard=%lu, allocate=%lu, recycle=%lu, recyclexid=%lu, "
|
||||
"lsn=%lu.\n",
|
||||
zoneId, UNDO_PTR_GET_OFFSET(uspMetaInfo->insert), UNDO_PTR_GET_OFFSET(uspMetaInfo->discard),
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->forceDiscard), UNDO_PTR_GET_OFFSET(uspMetaInfo->allocate),
|
||||
UNDO_PTR_GET_OFFSET(uspMetaInfo->recycle), uspMetaInfo->recycleXid, uspMetaInfo->lsn);
|
||||
|
||||
if (zid != INVALID_ZONE_ID) {
|
||||
break;
|
||||
|
|
@ -4981,7 +4928,6 @@ static int ParseUndoSlot(const char *filename)
|
|||
}
|
||||
|
||||
for (uint32 loop = 0; loop < UNDO_META_SEG_SIZE; loop++) {
|
||||
int flag = 0;
|
||||
seekpos = (off_t)BLCKSZ * loop;
|
||||
lseek(fd, seekpos, SEEK_SET);
|
||||
rc = memset_s(buffer, BLCKSZ, 0, BLCKSZ);
|
||||
|
|
@ -4996,32 +4942,13 @@ static int ParseUndoSlot(const char *filename)
|
|||
fprintf(stdout, "Block %u, LSN (%X/%X)\n", loop, (uint32)(PageGetLSN(buffer) >> 32),
|
||||
(uint32)PageGetLSN(buffer));
|
||||
|
||||
if (PageIsNew(buffer)) {
|
||||
continue;
|
||||
}
|
||||
for (uint32 offset = UNDO_LOG_BLOCK_HEADER_SIZE; offset < BLCKSZ - MAXALIGN(sizeof(TransactionSlot));
|
||||
offset += MAXALIGN(sizeof(TransactionSlot))) {
|
||||
slot = (TransactionSlot *) (buffer + offset);
|
||||
if (slot->XactId() != InvalidTransactionId || slot->StartUndoPtr() != INVALID_UNDO_REC_PTR) {
|
||||
if (flag > 0) {
|
||||
uint32 tempOffset = offset - (uint32)flag * MAXALIGN(sizeof(TransactionSlot));
|
||||
TransactionSlot *tempSlot = NULL;
|
||||
fprintf(stdout, "WARNING: invalid slot num %d.\n", flag);
|
||||
for (int i = 0; i < flag; i++) {
|
||||
tempOffset += MAXALIGN(sizeof(TransactionSlot));
|
||||
tempSlot = (TransactionSlot *) (buffer + tempOffset);
|
||||
fprintf(stdout,
|
||||
"offset=%u, xid=%lu, startptr=%lu, endptr=%lu, dbid=%u, rollback finish=%d.\n",
|
||||
tempOffset, tempSlot->XactId(), tempSlot->StartUndoPtr(), tempSlot->EndUndoPtr(),
|
||||
tempSlot->DbId(), !(tempSlot->NeedRollback()));
|
||||
}
|
||||
flag = 0;
|
||||
}
|
||||
fprintf(stdout, "offset=%u, xid=%lu, startptr=%lu, endptr=%lu, dbid=%u, rollback finish=%d.\n",
|
||||
offset, slot->XactId(), slot->StartUndoPtr(), slot->EndUndoPtr(),
|
||||
slot->DbId(), !(slot->NeedRollback()));
|
||||
} else {
|
||||
flag++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5037,40 +4964,26 @@ typedef struct UndoHeader {
|
|||
UndoRecordOldTd wtd_;
|
||||
UndoRecordPartition wpart_;
|
||||
UndoRecordTablespace wtspc_;
|
||||
StringInfoData rawdata_;
|
||||
} UndoHeader;
|
||||
|
||||
typedef struct UHeapDiskTupleDataHeader {
|
||||
ShortTransactionId xid;
|
||||
uint16 td_id : 8, reserved : 8; /* Locker as well as the last updater, 8 bits each */
|
||||
uint16 flag; /* Flag for tuple attributes */
|
||||
uint16 flag2; /* Number of attributes for now(11 bits) */
|
||||
uint8 t_hoff; /* header incl. bitmap, padding */
|
||||
} UHeapDiskTupleDataHeader;
|
||||
|
||||
char g_dir[MAX_PATH_LEN] = {0};
|
||||
char g_dir[100] = {0};
|
||||
|
||||
static int OpenUndoBlock(int zoneId, BlockNumber blockno)
|
||||
{
|
||||
char fileName[MAX_PATH_LEN] = {0};
|
||||
const int idLen = 13;
|
||||
char fileName[100] = {0};
|
||||
errno_t rc = EOK;
|
||||
int segno = blockno / UNDOSEG_SIZE;
|
||||
|
||||
rc = snprintf_s(fileName, sizeof(fileName), sizeof(fileName) - 1, g_dir);
|
||||
rc = snprintf_s(fileName, sizeof(fileName), sizeof(fileName), g_dir);
|
||||
securec_check(rc, "\0", "\0");
|
||||
if (strlen(g_dir) + idLen >= MAX_PATH_LEN) {
|
||||
fprintf(stdout, "ERROR: path is too long, MAX_PATH_LEN %d, path len %lu.\n", MAX_PATH_LEN, strlen(g_dir));
|
||||
}
|
||||
rc = snprintf_s(fileName + strlen(fileName), sizeof(fileName) - strlen(fileName),
|
||||
sizeof(fileName) - strlen(fileName) - 1, "%05X.%07zX", zoneId, segno);
|
||||
rc = snprintf_s(fileName + strlen(fileName), sizeof(fileName), sizeof(fileName), "%05X.%07zX", zoneId, segno);
|
||||
securec_check(rc, "\0", "\0");
|
||||
|
||||
int fd = open(fileName, O_RDONLY | PG_BINARY, S_IRUSR | S_IWUSR);
|
||||
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Open file(%s), return code desc(%s).\n", fileName, strerror(errno));
|
||||
return -1;
|
||||
fprintf(stderr, "Open file(%s), return code desc(%s).\n", UNDO_META_FILE, strerror(errno));
|
||||
return-1;
|
||||
}
|
||||
|
||||
return fd;
|
||||
|
|
@ -5144,191 +5057,69 @@ bool ReadUndoRecord(UndoHeader *urec, char *buffer, int startingByte, int *alrea
|
|||
&readptr, endptr, &myBytesRead, alreadyRead)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
urec->rawdata_.len = urec->wpay_.payloadlen;
|
||||
if (urec->rawdata_.len > 0) {
|
||||
if (urec->rawdata_.data == NULL) {
|
||||
urec->rawdata_.data = (char *)malloc(urec->rawdata_.len);
|
||||
if (NULL == urec->rawdata_.data) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!ReadUndoBytes((char *)urec->rawdata_.data, urec->rawdata_.len,
|
||||
&readptr, endptr, &myBytesRead, alreadyRead)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ParseUndoRecord(UndoRecPtr urp, bool forward = false)
|
||||
static bool ParseUndoRecord(UndoRecPtr urp)
|
||||
{
|
||||
do {
|
||||
char buffer[BLCKSZ] = {'\0'};
|
||||
BlockNumber blockno = UNDO_PTR_GET_BLOCK_NUM(urp);
|
||||
int zoneId = UNDO_PTR_GET_ZONE_ID(urp);
|
||||
int startingByte = UNDO_PTR_GET_PAGE_OFFSET(urp);
|
||||
int fd = -1;
|
||||
int alreadyRead = 0;
|
||||
off_t seekpos;
|
||||
errno_t rc = EOK;
|
||||
uint32 ret = 0;
|
||||
UndoHeader *urec = (UndoHeader *)malloc(sizeof(UndoHeader));
|
||||
UndoRecPtr blkprev = INVALID_UNDO_REC_PTR;
|
||||
const UndoRecordSize UNDO_RECORD_FIX_SIZE = SIZE_OF_UNDO_RECORD_HEADER + SIZE_OF_UNDO_RECORD_BLOCK;
|
||||
uint32 curSize = UNDO_RECORD_FIX_SIZE + sizeof(UndoRecordSize);
|
||||
PageHeader phdr;
|
||||
char buffer[BLCKSZ] = {'\0'};
|
||||
BlockNumber blockno = UNDO_PTR_GET_BLOCK_NUM(urp);
|
||||
int zoneId = UNDO_PTR_GET_ZONE_ID(urp);
|
||||
int startingByte = UNDO_PTR_GET_PAGE_OFFSET(urp);
|
||||
int fd = -1;
|
||||
int alreadyRead = 0;
|
||||
off_t seekpos;
|
||||
errno_t rc = EOK;
|
||||
uint32 ret = 0;
|
||||
UndoHeader *urec = (UndoHeader *)malloc(sizeof(UndoHeader));
|
||||
UndoRecPtr blkprev = INVALID_UNDO_REC_PTR;
|
||||
|
||||
rc = memset_s(urec, sizeof(UndoHeader), (0), sizeof(UndoHeader));
|
||||
rc = memset_s(urec, sizeof(UndoHeader), (0), sizeof(UndoHeader));
|
||||
securec_check(rc, "\0", "\0");
|
||||
|
||||
do {
|
||||
fd = OpenUndoBlock(zoneId, blockno);
|
||||
if (fd < 0) {
|
||||
free(urec);
|
||||
return false;
|
||||
}
|
||||
seekpos = (off_t)BLCKSZ * (blockno % ((BlockNumber)UNDOSEG_SIZE));
|
||||
lseek(fd, seekpos, SEEK_SET);
|
||||
rc = memset_s(buffer, BLCKSZ, 0, BLCKSZ);
|
||||
securec_check(rc, "\0", "\0");
|
||||
|
||||
do {
|
||||
fd = OpenUndoBlock(zoneId, blockno);
|
||||
if (fd < 0) {
|
||||
free(urec);
|
||||
return false;
|
||||
}
|
||||
seekpos = (off_t)BLCKSZ * (blockno % ((BlockNumber)UNDOSEG_SIZE));
|
||||
lseek(fd, seekpos, SEEK_SET);
|
||||
rc = memset_s(buffer, BLCKSZ, 0, BLCKSZ);
|
||||
securec_check(rc, "\0", "\0");
|
||||
|
||||
ret = read(fd, (char *)buffer, BLCKSZ);
|
||||
if (ret != BLCKSZ) {
|
||||
close(fd);
|
||||
free(urec);
|
||||
fprintf(stderr, "Read undo meta page failed, expect size(8192), real size(%u).\n", ret);
|
||||
return false;
|
||||
}
|
||||
phdr = (PageHeader)buffer;
|
||||
if (ReadUndoRecord(urec, buffer, startingByte, &alreadyRead)) {
|
||||
break;
|
||||
}
|
||||
|
||||
startingByte = UNDO_LOG_BLOCK_HEADER_SIZE;
|
||||
blockno++;
|
||||
ret = read(fd, (char *)buffer, BLCKSZ);
|
||||
if (ret != BLCKSZ) {
|
||||
close(fd);
|
||||
} while (true);
|
||||
|
||||
if (!TransactionIdIsValid(urec->whdr_.xid)) {
|
||||
free(urec);
|
||||
close(fd);
|
||||
return true;
|
||||
fprintf(stderr, "Read undo meta page failed, expect size(8192), real size(%u).\n", ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
fprintf(stdout, "DumpPageInfo: lsn:%X/%X, pd_checksum:%u, flags:%u, lower:%u, upper:%u, special:%u, "
|
||||
"pagesize_version:%u.\n",
|
||||
phdr->pd_lsn.xlogid, phdr->pd_lsn.xrecoff, (uint16)(phdr->pd_checksum), (uint16)(phdr->pd_flags),
|
||||
(uint16)(phdr->pd_lower), (uint16)(phdr->pd_upper), (uint16)(phdr->pd_special),
|
||||
(uint16)(phdr->pd_pagesize_version));
|
||||
|
||||
blkprev = urec->wblk_.blkprev;
|
||||
fprintf(stdout, "UndoRecPtr(%lu):\nwhdr = xid(%lu), cid(%u), reloid(%u), relfilenode(%u), utype(%u), "
|
||||
"uinfo(%u).\n", urp, urec->whdr_.xid, urec->whdr_.cid, urec->whdr_.reloid, urec->whdr_.relfilenode,
|
||||
urec->whdr_.utype, urec->whdr_.uinfo);
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_PAYLOAD) != 0) {
|
||||
fprintf(stdout, "flag_payload, size = %lu.\n", SIZE_OF_UNDO_RECORD_PAYLOAD);
|
||||
curSize += SIZE_OF_UNDO_RECORD_PAYLOAD;
|
||||
curSize += urec->rawdata_.len;
|
||||
}
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_TRANSAC) != 0) {
|
||||
fprintf(stdout, "flag_transac, size = %lu.\n", SIZE_OF_UNDO_RECORD_TRANSACTION);
|
||||
curSize += SIZE_OF_UNDO_RECORD_TRANSACTION;
|
||||
}
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_BLOCK) != 0) {
|
||||
fprintf(stdout, "flag_block, size = %lu.\n", SIZE_OF_UNDO_RECORD_BLOCK);
|
||||
}
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_OLDTD) != 0) {
|
||||
fprintf(stdout, "flag_oldtd, size = %lu.\n", SIZE_OF_UNDO_RECORD_OLDTD);
|
||||
curSize += SIZE_OF_UNDO_RECORD_OLDTD;
|
||||
}
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_CONTAINS_SUBXACT) != 0) {
|
||||
/* subxid is at the end of rawdata */
|
||||
char *end = (char *)(urec->rawdata_.data) + (urec->rawdata_.len - sizeof(SubTransactionId));
|
||||
SubTransactionId *subxid = (SubTransactionId *)end;
|
||||
fprintf(stdout, "flag_subxact, subxid = %lu.\n", *subxid);
|
||||
}
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_HAS_PARTOID) != 0) {
|
||||
fprintf(stdout, "flag_partoid, size = %lu.\n", SIZE_OF_UNDO_RECORD_PARTITION);
|
||||
curSize += SIZE_OF_UNDO_RECORD_PARTITION;
|
||||
}
|
||||
if ((urec->whdr_.uinfo & UNDO_UREC_INFO_HAS_TABLESPACEOID) != 0) {
|
||||
fprintf(stdout, "flag_tablespaceoid, size = %lu.\n", SIZE_OF_UNDO_RECORD_TABLESPACE);
|
||||
curSize += SIZE_OF_UNDO_RECORD_TABLESPACE;
|
||||
}
|
||||
fprintf(stdout, "wblk = blk_prev(%lu), blockno(%u), offset(%u).\n", urec->wblk_.blkprev, urec->wblk_.blkno,
|
||||
urec->wblk_.offset);
|
||||
fprintf(stdout, "wtxn = prevurp(%lu).\n", urec->wtxn_.prevurp);
|
||||
fprintf(stdout, "wpay = payloadlen(%u).\n", urec->wpay_.payloadlen);
|
||||
fprintf(stdout, "wtd = oldxactid(%lu).\n", urec->wtd_.oldxactid);
|
||||
fprintf(stdout, "wpart_ = partitionoid(%u).\n", urec->wpart_.partitionoid);
|
||||
fprintf(stdout, "wtspc_ = tablespace(%u).\n", urec->wtspc_.tablespace);
|
||||
fprintf(stdout, "len = alreadyRead(%u).\n", alreadyRead);
|
||||
|
||||
char prevLen[2];
|
||||
UndoRecordSize byteToRead = sizeof(UndoRecordSize);
|
||||
char *readptr = buffer + startingByte - byteToRead;
|
||||
for (auto i = 0; i < byteToRead; i++) {
|
||||
prevLen[i] = *readptr;
|
||||
readptr++;
|
||||
}
|
||||
UndoRecordSize prevRecLen = *(UndoRecordSize *)(prevLen);
|
||||
fprintf(stdout, "prevLen = prevLen(%u).\n", prevRecLen);
|
||||
|
||||
if (urec->whdr_.utype != UNDO_INSERT && urec->whdr_.utype != UNDO_MULTI_INSERT &&
|
||||
urec->rawdata_.len > 0 && urec->rawdata_.data != NULL) {
|
||||
UHeapDiskTupleDataHeader diskTuple;
|
||||
if (urec->whdr_.utype == UNDO_INPLACE_UPDATE) {
|
||||
Assert(urec->rawdata_.len >= (int)SizeOfUHeapDiskTupleData);
|
||||
uint8 *t_hoff_ptr = (uint8 *)(urec->rawdata_.data);
|
||||
uint8 t_hoff = *t_hoff_ptr;
|
||||
char *cur_undodata_ptr = NULL;
|
||||
fprintf(stdout, "t_hoff %u ", t_hoff);
|
||||
rc = memcpy_s((char *)&diskTuple + OffsetTdId, SizeOfUHeapDiskTupleHeaderExceptXid,
|
||||
urec->rawdata_.data + sizeof(uint8), SizeOfUHeapDiskTupleHeaderExceptXid);
|
||||
securec_check(rc, "", "");
|
||||
cur_undodata_ptr = urec->rawdata_.data + sizeof(uint8) + t_hoff - OffsetTdId;
|
||||
uint8* flags_ptr = (uint8 *)cur_undodata_ptr;
|
||||
uint8 flags = *flags_ptr;
|
||||
fprintf(stdout, "flags %u ", flags);
|
||||
cur_undodata_ptr += sizeof(uint8);
|
||||
if (flags & UREC_INPLACE_UPDATE_XOR_PREFIX) {
|
||||
uint16* prefixlen_ptr = (uint16 *)(cur_undodata_ptr);
|
||||
cur_undodata_ptr += sizeof(uint16);
|
||||
uint16 prefixlen = *prefixlen_ptr;
|
||||
fprintf(stdout, "PREFIXLEN %u ", prefixlen);
|
||||
}
|
||||
|
||||
if (flags & UREC_INPLACE_UPDATE_XOR_SUFFIX) {
|
||||
uint16* suffixlen_ptr = (uint16 *)(cur_undodata_ptr);
|
||||
cur_undodata_ptr += sizeof(uint16);
|
||||
uint16 suffixlen = *suffixlen_ptr;
|
||||
fprintf(stdout, "SUFFIXLEN %u ", suffixlen);
|
||||
}
|
||||
diskTuple.xid = (ShortTransactionId)InvalidTransactionId;
|
||||
} else {
|
||||
Assert(urec->rawdata_.len >= (int)SizeOfUHeapDiskTupleHeaderExceptXid);
|
||||
rc = memcpy_s(((char *)&diskTuple + OffsetTdId), SizeOfUHeapDiskTupleHeaderExceptXid,
|
||||
urec->rawdata_.data, SizeOfUHeapDiskTupleHeaderExceptXid);
|
||||
securec_check(rc, "", "");
|
||||
diskTuple.xid = (ShortTransactionId)InvalidTransactionId;
|
||||
}
|
||||
fprintf(stdout, "\ndiskTuple: td_id %u, reserved %u, flag %u, flag2 %u, t_hoff %u.\n",
|
||||
diskTuple.td_id, diskTuple.reserved, diskTuple.flag, diskTuple.flag2, diskTuple.t_hoff);
|
||||
fprintf(stdout, "current undo record size: %u\n\n", curSize);
|
||||
if (ReadUndoRecord(urec, buffer, startingByte, &alreadyRead)) {
|
||||
break;
|
||||
}
|
||||
|
||||
free(urec);
|
||||
close(fd);
|
||||
startingByte = UNDO_LOG_BLOCK_HEADER_SIZE;
|
||||
blockno++;
|
||||
} while (true);
|
||||
|
||||
if (!forward) {
|
||||
urp = blkprev;
|
||||
} else {
|
||||
urp = UNDO_LOG_OFFSET_PLUS_USABLE_BYTES(urp, curSize);
|
||||
}
|
||||
} while (urp != INVALID_UNDO_REC_PTR);
|
||||
blkprev = urec->wblk_.blkprev;
|
||||
fprintf(stderr, "UndoRecPtr(%lu):\nwhdr = xid(%lu), cid(%u), reloid(%u), relfilenode(%u), utype(%u).\n",
|
||||
urp, urec->whdr_.xid, urec->whdr_.cid, urec->whdr_.reloid, urec->whdr_.relfilenode, urec->whdr_.utype);
|
||||
fprintf(stderr, "wblk = blk_prev(%lu), blockno(%u), offset(%u).\n", urec->wblk_.blkprev, urec->wblk_.blkno,
|
||||
urec->wblk_.offset);
|
||||
fprintf(stderr, "wtxn = prevurp(%lu).\n", urec->wtxn_.prevurp);
|
||||
fprintf(stderr, "wpay = payloadlen(%u).\n", urec->wpay_.payloadlen);
|
||||
|
||||
free(urec);
|
||||
close(fd);
|
||||
|
||||
if (blkprev != INVALID_UNDO_REC_PTR) {
|
||||
ParseUndoRecord(blkprev);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -5384,7 +5175,6 @@ static void fill_filenode_map(char** class_map)
|
|||
{"pg_extension", 3079},
|
||||
{"pg_foreign_table", 3118},
|
||||
{"pg_enum", 3501},
|
||||
{"pg_set", 3516},
|
||||
{"pg_seclabel", 3596},
|
||||
{"pg_ts_dict", 3600},
|
||||
{"pg_ts_parser", 3601},
|
||||
|
|
@ -5436,7 +5226,6 @@ static void fill_filenode_map(char** class_map)
|
|||
{"pg_cast_source_target_index", 2661},
|
||||
{"pg_class_oid_index", 2662},
|
||||
{"pg_class_relname_nsp_index", 2663},
|
||||
{"pg_collation_enc_def_index", 3147},
|
||||
{"pg_collation_name_enc_nsp_index", 3164},
|
||||
{"pg_collation_oid_index", 3085},
|
||||
{"pg_constraint_conname_nsp_index", 2664},
|
||||
|
|
@ -5547,9 +5336,7 @@ static void fill_filenode_map(char** class_map)
|
|||
return;
|
||||
}
|
||||
if (NULL != cmap[i].class_name) {
|
||||
errno_t rc = EOK;
|
||||
rc = memcpy_s(name, 64 * sizeof(char), cmap[i].class_name, strlen(cmap[i].class_name) + 1);
|
||||
securec_check_c(rc, "\0", "\0");
|
||||
memcpy(name, cmap[i].class_name, strlen(cmap[i].class_name) + 1);
|
||||
class_map[cmap[i].ralation_id] = name;
|
||||
name = NULL;
|
||||
} else {
|
||||
|
|
@ -5588,7 +5375,6 @@ int main(int argc, char** argv)
|
|||
char* filename = NULL;
|
||||
char* env = NULL;
|
||||
const char* progname = NULL;
|
||||
const char* socketpath = NULL;
|
||||
uint32 start_point = 0;
|
||||
uint32 num_block = 0;
|
||||
uint64 cu_offset = 0;
|
||||
|
|
@ -5613,7 +5399,7 @@ int main(int argc, char** argv)
|
|||
setvbuf(stderr, NULL, _IONBF, 0);
|
||||
#endif
|
||||
|
||||
while ((c = getopt(argc, argv, "bc:Df:o:t:vs:z:n:r:i:I:N:uwdS:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "bf:o:t:vs:z:n:r:i:I:N:uwdS:")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
filename = optarg;
|
||||
|
|
@ -5719,15 +5505,6 @@ int main(int argc, char** argv)
|
|||
SegNo = (unsigned int)strtolSafe(optarg, 0);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
enable_dss = true;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
socketpath = optarg;
|
||||
enable_dss = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
|
||||
exit(1);
|
||||
|
|
@ -5750,16 +5527,6 @@ int main(int argc, char** argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (enable_dss && socketpath == NULL) {
|
||||
fprintf(stderr, "Socketpath cannot be NULL when enable dss.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (enable_dss && (filename[0] != '+' || strstr(filename, "/") == NULL)) {
|
||||
fprintf(stderr, "Filepath should be absolutely when enable dss.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (((start_point != 0) || (num_block != 0)) &&
|
||||
/* only heap/index/undo/dw */
|
||||
(hackingtype > HACKING_UNDO && hackingtype != HACKING_DW && hackingtype != HACKING_SEGMENT)) {
|
||||
|
|
@ -5788,13 +5555,6 @@ int main(int argc, char** argv)
|
|||
pgdata = env;
|
||||
}
|
||||
|
||||
// dss device init
|
||||
if (dss_device_init(socketpath, enable_dss) != DSS_SUCCESS) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
initDataPathStruct(false);
|
||||
|
||||
// if heap relation name is given (-r), force hackingtype to be HACKING_HEAP
|
||||
if (PgHeapRelTupleParserCursor >= 0) {
|
||||
hackingtype = HACKING_HEAP;
|
||||
|
|
@ -5935,14 +5695,8 @@ int main(int argc, char** argv)
|
|||
case HACKING_UNDO_RECORD:
|
||||
ret = snprintf_s(g_dir, sizeof(g_dir), sizeof(g_dir), filename);
|
||||
securec_check(ret, "\0", "\0");
|
||||
fprintf(stdout, "Parsing backward, urp %lu:\n", cu_offset);
|
||||
if (!ParseUndoRecord(cu_offset, false)) {
|
||||
fprintf(stderr, "Error during parsing undo group meta file %s backward\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
fprintf(stdout, "Parsing forward, urp %lu:\n", cu_offset);
|
||||
if (!ParseUndoRecord(cu_offset, true)) {
|
||||
fprintf(stderr, "Error during parsing undo group meta file %s forward\n", filename);
|
||||
if (!ParseUndoRecord(cu_offset)) {
|
||||
fprintf(stderr, "Error during parsing undo group meta file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ PG_MODULE_MAGIC;
|
|||
/* passwords shorter than this will be rejected */
|
||||
#define MIN_PWD_LENGTH 8
|
||||
|
||||
extern "C" void _PG_init(void);
|
||||
extern void _PG_init(void);
|
||||
|
||||
/*
|
||||
* check_password
|
||||
|
|
|
|||
|
|
@ -223,14 +223,12 @@ static void pgss_ExecutorStart(QueryDesc* queryDesc, int eflags);
|
|||
static void pgss_ExecutorRun(QueryDesc* queryDesc, ScanDirection direction, long count);
|
||||
static void pgss_ExecutorFinish(QueryDesc* queryDesc);
|
||||
static void pgss_ExecutorEnd(QueryDesc* queryDesc);
|
||||
static void pgss_ProcessUtility(processutility_context* processutility_cxt,
|
||||
static void pgss_ProcessUtility(Node* parsetree, const char* queryString, bool readOnlyTree, ParamListInfo params, bool isTopLevel,
|
||||
DestReceiver* dest,
|
||||
#ifdef PGXC
|
||||
bool sentToRemote,
|
||||
#endif /* PGXC */
|
||||
char* completionTag,
|
||||
ProcessUtilityContext context,
|
||||
bool isCTAS);
|
||||
char* completionTag);
|
||||
static uint32 pgss_hash_fn(const void* key, Size keysize);
|
||||
static int pgss_match_fn(const void* key1, const void* key2, Size keysize);
|
||||
static uint32 pgss_hash_string(const char* str);
|
||||
|
|
@ -724,17 +722,13 @@ static void pgss_ExecutorEnd(QueryDesc* queryDesc)
|
|||
/*
|
||||
* ProcessUtility hook
|
||||
*/
|
||||
static void pgss_ProcessUtility(processutility_context* processutility_cxt,
|
||||
static void pgss_ProcessUtility(Node* parsetree, const char* queryString, bool readOnlyTree, ParamListInfo params, bool isTopLevel,
|
||||
DestReceiver* dest,
|
||||
#ifdef PGXC
|
||||
bool sentToRemote,
|
||||
#endif /* PGXC */
|
||||
char* completionTag,
|
||||
ProcessUtilityContext context,
|
||||
bool isCTAS)
|
||||
char* completionTag)
|
||||
{
|
||||
Node* parsetree = processutility_cxt->parse_tree;
|
||||
const char* queryString = processutility_cxt->query_string;
|
||||
/*
|
||||
* If it's an EXECUTE statement, we don't track it and don't increment the
|
||||
* nesting level. This allows the cycles to be charged to the underlying
|
||||
|
|
@ -760,23 +754,27 @@ static void pgss_ProcessUtility(processutility_context* processutility_cxt,
|
|||
PG_TRY();
|
||||
{
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(processutility_cxt,
|
||||
prev_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
readOnlyTree,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
else
|
||||
standard_ProcessUtility(processutility_cxt,
|
||||
standard_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
readOnlyTree,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
nested_level--;
|
||||
}
|
||||
PG_CATCH();
|
||||
|
|
@ -821,23 +819,27 @@ static void pgss_ProcessUtility(processutility_context* processutility_cxt,
|
|||
pgss_store(queryString, queryId, INSTR_TIME_GET_MILLISEC(duration), rows, &bufusage, NULL);
|
||||
} else {
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(processutility_cxt,
|
||||
prev_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
readOnlyTree,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
else
|
||||
standard_ProcessUtility(processutility_cxt,
|
||||
standard_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
readOnlyTree,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ DATA = pg_trgm--1.0.sql pg_trgm--unpackaged--1.0.sql
|
|||
|
||||
REGRESS = pg_trgm
|
||||
|
||||
exclude_option = -fPIE
|
||||
override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||
|
||||
ifdef USE_PGXS
|
||||
PG_CONFIG = pg_config
|
||||
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ execute_process(
|
|||
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/access/rmgrdesc/uheapdesc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/uheapdesc.cpp
|
||||
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/access/rmgrdesc/undologdesc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/undologdesc.cpp
|
||||
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/access/rmgrdesc/replorigindesc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/replorigindesc.cpp
|
||||
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/smgr/cfs/cfs_mddesc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cfs_mddesc.cpp
|
||||
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/dss/dss_adaptor.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dss_adaptor.cpp
|
||||
)
|
||||
|
||||
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TGT_xlogdump_SRC)
|
||||
|
|
@ -41,8 +39,8 @@ SET(xlogdump_LINK_LIBS libpgcommon.a -lpgport -lcrypt -ldl -lm -ledit -lssl -lcr
|
|||
add_bintarget(pg_xlogdump TGT_xlogdump_SRC TGT_xlogdump_INC "${xlogdump_DEF_OPTIONS}" "${xlogdump_COMPILE_OPTIONS}" "${xlogdump_LINK_OPTIONS}" "${xlogdump_LINK_LIBS}")
|
||||
add_dependencies(pg_xlogdump pgport_static pgcommon_static)
|
||||
target_link_directories(pg_xlogdump PUBLIC
|
||||
${LIBOPENSSL_LIB_PATH} ${LIBCURL_LIB_PATH} ${SECURE_LIB_PATH}
|
||||
${LIBOPENSSL_LIB_PATH} ${PROTOBUF_LIB_PATH} ${LIBPARQUET_LIB_PATH} ${LIBCURL_LIB_PATH} ${SECURE_LIB_PATH}
|
||||
${ZLIB_LIB_PATH} ${LIBOBS_LIB_PATH} ${LIBEDIT_LIB_PATH} ${LIBCGROUP_LIB_PATH} ${CMAKE_BINARY_DIR}/lib
|
||||
)
|
||||
|
||||
install(TARGETS pg_xlogdump RUNTIME DESTINATION bin)
|
||||
install(TARGETS pg_xlogdump RUNTIME DESTINATION bin)
|
||||
|
|
@ -5,10 +5,8 @@ PGAPPICON=win32
|
|||
|
||||
PROGRAM = pg_xlogdump
|
||||
OBJS = pg_xlogdump.o compat.o xlogreader.o xlogreader_common.o rmgrdesc.o \
|
||||
$(top_builddir)/src/gausskernel/storage/smgr/cfs/cfs_mddesc.o \
|
||||
$(top_builddir)/src/lib/pgcommon/libpgcommon.a \
|
||||
$(RMGRDESCOBJS) $(WIN32RES) \
|
||||
$(top_builddir)/src/gausskernel/storage/dss/dss_adaptor.o
|
||||
$(RMGRDESCOBJS) $(WIN32RES)
|
||||
|
||||
RMGRDESCSOURCES = $(notdir $(wildcard $(top_srcdir)/src/gausskernel/storage/access/rmgrdesc/*desc.cpp))
|
||||
RMGRDESCOBJS = $(patsubst %.cpp,%.o,$(RMGRDESCSOURCES))
|
||||
|
|
|
|||
|
|
@ -78,17 +78,14 @@ const char* timestamptz_to_str(TimestampTz dt)
|
|||
char zone[MAXDATELEN + 1];
|
||||
time_t result = (time_t)timestamptz_to_time_t(dt);
|
||||
struct tm* ltime = localtime(&result);
|
||||
errno_t rc = EOK;
|
||||
|
||||
strftime(ts, sizeof(ts), "%Y-%m-%d %H:%M:%S", ltime);
|
||||
strftime(zone, sizeof(zone), "%Z", ltime);
|
||||
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
rc = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "%s.%06d %s", ts, (int)(dt % USECS_PER_SEC), zone);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
sprintf(buf, "%s.%06d %s", ts, (int)(dt % USECS_PER_SEC), zone);
|
||||
#else
|
||||
rc = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "%s.%.6f %s", ts, fabs(dt - floor(dt)), zone);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
sprintf(buf, "%s.%.6f %s", ts, fabs(dt - floor(dt)), zone);
|
||||
#endif
|
||||
|
||||
return buf;
|
||||
|
|
@ -145,36 +142,41 @@ ForkNumber forkname_to_number(const char* forkName)
|
|||
/*
|
||||
* relpathbackend - construct path to a relation's file
|
||||
*/
|
||||
char *relpathbackend(RelFileNode rnode, BackendId backend, ForkNumber forknum)
|
||||
char* relpathbackend(RelFileNode rnode, BackendId backend, ForkNumber forknum)
|
||||
{
|
||||
int pathlen;
|
||||
char *path = NULL;
|
||||
errno_t rc = EOK;
|
||||
char* path = NULL;
|
||||
|
||||
/* Column store file path, e.g: 16384_C1.0, 16384_C1_bcm */
|
||||
if (forknum > MAX_FORKNUM) {
|
||||
char attr_name[32];
|
||||
int attid = forknum - MAX_FORKNUM;
|
||||
|
||||
path = (char *)calloc(MAXPGPATH, sizeof(char));
|
||||
rc = snprintf_s(attr_name, sizeof(attr_name), sizeof(attr_name) - 1, "C%d", attid);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
path = (char*)calloc(MAXPGPATH, sizeof(char));
|
||||
(void)snprintf(attr_name, sizeof(attr_name), "C%d", attid);
|
||||
|
||||
if (rnode.spcNode == GLOBALTABLESPACE_OID) {
|
||||
/* Shared system relations live in {datadir}/global */
|
||||
Assert(rnode.dbNode == 0);
|
||||
pathlen = strlen("global") + 1 + OIDCHARS + 1 + strlen(attr_name) + 1;
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "global/%u_%s", rnode.relNode, attr_name);
|
||||
(void)snprintf(path, pathlen, "global/%u_%s", rnode.relNode, attr_name);
|
||||
} else if (rnode.spcNode == DEFAULTTABLESPACE_OID) {
|
||||
/* The default tablespace is {datadir}/base */
|
||||
pathlen = strlen("base") + 1 + OIDCHARS + 1 + OIDCHARS + 1 + strlen(attr_name) + 1;
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "base/%u/%u_%s", rnode.dbNode, rnode.relNode, attr_name);
|
||||
(void)snprintf(path, pathlen, "base/%u/%u_%s", rnode.dbNode, rnode.relNode, attr_name);
|
||||
} else {
|
||||
/* All other tablespaces are accessed via symlinks */
|
||||
pathlen = 9 + 1 + OIDCHARS + 1 + strlen(TABLESPACE_VERSION_DIRECTORY) + 1 + strlen(PGXCNodeName) + 1 +
|
||||
OIDCHARS + 1 + OIDCHARS + 1 + strlen(attr_name) + 1;
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s_%s/%u/%u_%s", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, PGXCNodeName, rnode.dbNode, rnode.relNode, attr_name);
|
||||
OIDCHARS + 1 + OIDCHARS + 1 + strlen(attr_name) + 1;
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s_%s/%u/%u_%s",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
PGXCNodeName,
|
||||
rnode.dbNode,
|
||||
rnode.relNode,
|
||||
attr_name);
|
||||
}
|
||||
} else {
|
||||
if (rnode.spcNode == GLOBALTABLESPACE_OID) {
|
||||
|
|
@ -182,85 +184,133 @@ char *relpathbackend(RelFileNode rnode, BackendId backend, ForkNumber forknum)
|
|||
Assert(rnode.dbNode == 0);
|
||||
Assert(backend == InvalidBackendId);
|
||||
pathlen = 7 + OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char *)malloc(pathlen);
|
||||
path = (char*)malloc(pathlen);
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "global/%u_%s", rnode.relNode, forkNames[forknum]);
|
||||
(void)snprintf(path, pathlen, "global/%u_%s", rnode.relNode, forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "global/%u", rnode.relNode);
|
||||
(void)snprintf(path, pathlen, "global/%u", rnode.relNode);
|
||||
} else if (rnode.spcNode == DEFAULTTABLESPACE_OID) {
|
||||
/* The default tablespace is {datadir}/base */
|
||||
if (backend == InvalidBackendId) {
|
||||
pathlen = 5 + OIDCHARS + 1 + OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char *)malloc(pathlen);
|
||||
path = (char*)malloc(pathlen);
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "base/%u/%u_%s", rnode.dbNode, rnode.relNode,
|
||||
forkNames[forknum]);
|
||||
(void)snprintf(path, pathlen, "base/%u/%u_%s", rnode.dbNode, rnode.relNode, forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "base/%u/%u", rnode.dbNode, rnode.relNode);
|
||||
(void)snprintf(path, pathlen, "base/%u/%u", rnode.dbNode, rnode.relNode);
|
||||
} else {
|
||||
/* OIDCHARS will suffice for an integer, too */
|
||||
pathlen = 5 + OIDCHARS + 2 + OIDCHARS + 1 + OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char *)malloc(pathlen);
|
||||
path = (char*)malloc(pathlen);
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "base/%u/t%d_%u_%s", rnode.dbNode, backend,
|
||||
rnode.relNode, forkNames[forknum]);
|
||||
(void)snprintf(
|
||||
path, pathlen, "base/%u/t%d_%u_%s", rnode.dbNode, backend, rnode.relNode, forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "base/%u/t%d_%u", rnode.dbNode, backend,
|
||||
rnode.relNode);
|
||||
(void)snprintf(path, pathlen, "base/%u/t%d_%u", rnode.dbNode, backend, rnode.relNode);
|
||||
}
|
||||
} else {
|
||||
/* All other tablespaces are accessed via symlinks */
|
||||
if (backend == InvalidBackendId) {
|
||||
pathlen = 9 + 1 + OIDCHARS + 1 + strlen(TABLESPACE_VERSION_DIRECTORY) + 1 + OIDCHARS +
|
||||
1
|
||||
1
|
||||
#ifdef PGXC
|
||||
/* Postgres-XC tablespaces include node name */
|
||||
+ strlen(PGXCNodeName) + 1
|
||||
/* Postgres-XC tablespaces include node name */
|
||||
+ strlen(PGXCNodeName) + 1
|
||||
#endif
|
||||
+ OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char *)malloc(pathlen);
|
||||
+ OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char*)malloc(pathlen);
|
||||
#ifdef PGXC
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s_%s/%u/%u_%s", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, PGXCNodeName, rnode.dbNode, rnode.relNode, forkNames[forknum]);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s_%s/%u/%u_%s",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
PGXCNodeName,
|
||||
rnode.dbNode,
|
||||
rnode.relNode,
|
||||
forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s_%s/%u/%u", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, PGXCNodeName, rnode.dbNode, rnode.relNode);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s_%s/%u/%u",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
PGXCNodeName,
|
||||
rnode.dbNode,
|
||||
rnode.relNode);
|
||||
#else
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s/%u/%u_%s", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, rnode.dbNode, rnode.relNode, forkNames[forknum]);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s/%u/%u_%s",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
rnode.dbNode,
|
||||
rnode.relNode,
|
||||
forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s/%u/%u", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, rnode.dbNode, rnode.relNode);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s/%u/%u",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
rnode.dbNode,
|
||||
rnode.relNode);
|
||||
#endif
|
||||
} else {
|
||||
/* OIDCHARS will suffice for an integer, too */
|
||||
pathlen = 9 + 1 + OIDCHARS + 1 + strlen(TABLESPACE_VERSION_DIRECTORY) + 1 + OIDCHARS + 2
|
||||
#ifdef PGXC
|
||||
+ strlen(PGXCNodeName) + 1
|
||||
+ strlen(PGXCNodeName) + 1
|
||||
#endif
|
||||
+ OIDCHARS + 1 + OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char *)malloc(pathlen);
|
||||
+ OIDCHARS + 1 + OIDCHARS + 1 + FORKNAMECHARS + 1;
|
||||
path = (char*)malloc(pathlen);
|
||||
#ifdef PGXC
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s_%s/%u/t%d_%u_%s", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, PGXCNodeName, rnode.dbNode, backend, rnode.relNode,
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s_%s/%u/t%d_%u_%s",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
PGXCNodeName,
|
||||
rnode.dbNode,
|
||||
backend,
|
||||
rnode.relNode,
|
||||
forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s_%s/%u/t%d_%u", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, PGXCNodeName, rnode.dbNode, backend, rnode.relNode);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s_%s/%u/t%d_%u",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
PGXCNodeName,
|
||||
rnode.dbNode,
|
||||
backend,
|
||||
rnode.relNode);
|
||||
#else
|
||||
if (forknum != MAIN_FORKNUM)
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s/%u/t%d_%u_%s", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, rnode.dbNode, backend, rnode.relNode, forkNames[forknum]);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s/%u/t%d_%u_%s",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
rnode.dbNode,
|
||||
backend,
|
||||
rnode.relNode,
|
||||
forkNames[forknum]);
|
||||
else
|
||||
rc = snprintf_s(path, pathlen, pathlen - 1, "pg_tblspc/%u/%s/%u/t%d_%u", rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY, rnode.dbNode, backend, rnode.relNode);
|
||||
(void)snprintf(path,
|
||||
pathlen,
|
||||
"pg_tblspc/%u/%s/%u/t%d_%u",
|
||||
rnode.spcNode,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
rnode.dbNode,
|
||||
backend,
|
||||
rnode.relNode);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
return path;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@
|
|||
#include "replication/replicainternal.h"
|
||||
#include "rmgrdesc.h"
|
||||
#include "storage/smgr/segment.h"
|
||||
#include "storage/page_compression.h"
|
||||
#include "storage/dss/dss_adaptor.h"
|
||||
#include "storage/file/fio_device.h"
|
||||
|
||||
static const char* progname;
|
||||
|
||||
|
|
@ -46,8 +43,6 @@ typedef struct XLogDumpPrivate {
|
|||
bool endptr_reached;
|
||||
char* shareStorageXlogFilePath;
|
||||
long shareStorageXlogSize;
|
||||
bool enable_dss;
|
||||
char* socketpath;
|
||||
} XLogDumpPrivate;
|
||||
|
||||
typedef struct XLogDumpConfig {
|
||||
|
|
@ -81,7 +76,7 @@ typedef struct XLogDumpStats {
|
|||
} XLogDumpStats;
|
||||
|
||||
static void XLogDumpTablePage(XLogReaderState* record, int block_id, RelFileNode rnode, BlockNumber blk);
|
||||
static void XLogDumpXLogRead(char* directory, TimeLineID timeline_id, XLogRecPtr startptr, char* buf, Size count);
|
||||
static void XLogDumpXLogRead(const char* directory, TimeLineID timeline_id, XLogRecPtr startptr, char* buf, Size count);
|
||||
static int XLogDumpReadPage(XLogReaderState* state, XLogRecPtr targetPagePtr, int reqLen, XLogRecPtr targetPtr,
|
||||
char* readBuff, TimeLineID* curFileTLI, char* xlog_path = NULL);
|
||||
static void XLogDumpCountRecord(XLogDumpConfig* config, XLogDumpStats* stats, XLogReaderState* record);
|
||||
|
|
@ -92,7 +87,6 @@ static void XLogDumpDisplayStats(XLogDumpConfig* config, XLogDumpStats* stats);
|
|||
static void usage(void);
|
||||
|
||||
static int fuzzy_open_file(const char* directory, const char* fname);
|
||||
static int open_dss_file(char* directory, const char* fname);
|
||||
static void split_path(char* path, char** dir, char** fname);
|
||||
static bool verify_directory(const char* directory);
|
||||
static void print_rmgr_list(void);
|
||||
|
|
@ -229,21 +223,6 @@ static int fuzzy_open_file(const char* directory, const char* fname)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// for dss storage
|
||||
static int open_dss_file(char* directory, const char* fname)
|
||||
{
|
||||
int fd = -1;
|
||||
char fpath[MAXPGPATH];
|
||||
|
||||
/* directory / fname */
|
||||
canonicalize_path(directory);
|
||||
snprintf(fpath, MAXPGPATH, "%s/%s", directory, fname);
|
||||
if (dss_open_file(fpath, O_RDONLY | PG_BINARY, 0, &fd) == GS_SUCCESS) {
|
||||
return fd;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* write the full page to disk.
|
||||
*/
|
||||
|
|
@ -347,7 +326,7 @@ static void XLogDumpReadSharedStorage(char* directory, XLogRecPtr startptr, long
|
|||
* given timeline, containing the specified record pointer; store the data in
|
||||
* the passed buffer.
|
||||
*/
|
||||
static void XLogDumpXLogRead(char* directory, TimeLineID timeline_id, XLogRecPtr startptr, char* buf, Size count)
|
||||
static void XLogDumpXLogRead(const char* directory, TimeLineID timeline_id, XLogRecPtr startptr, char* buf, Size count)
|
||||
{
|
||||
char* p = NULL;
|
||||
XLogRecPtr recptr;
|
||||
|
|
@ -379,11 +358,7 @@ static void XLogDumpXLogRead(char* directory, TimeLineID timeline_id, XLogRecPtr
|
|||
|
||||
XLogFileName(fname, MAXFNAMELEN, timeline_id, sendSegNo);
|
||||
|
||||
if (is_dss_file(directory)) {
|
||||
sendFile = open_dss_file(directory, fname);
|
||||
} else {
|
||||
sendFile = fuzzy_open_file(directory, fname);
|
||||
}
|
||||
sendFile = fuzzy_open_file(directory, fname);
|
||||
|
||||
if (sendFile < 0)
|
||||
fatal_error("could not find file \"%s\": %s", fname, strerror(errno));
|
||||
|
|
@ -543,7 +518,6 @@ static void XLogDumpDisplayRecord(XLogDumpConfig* config, XLogReaderState* recor
|
|||
int block_id;
|
||||
XLogRecPtr lsn;
|
||||
XLogRecPtr xl_prev = XLogRecGetPrev(record);
|
||||
RelFileCompressOption compOpt;
|
||||
|
||||
printf("REDO @ %X/%X; LSN %X/%X: prev %X/%X; xid " XID_FMT "; term %u; len %u; total %u; crc %u; "
|
||||
"desc: %s - ",
|
||||
|
|
@ -581,15 +555,6 @@ static void XLogDumpDisplayRecord(XLogDumpConfig* config, XLogReaderState* recor
|
|||
if (IsBucketFileNode(rnode)) {
|
||||
printf("/%d", rnode.bucketNode);
|
||||
}
|
||||
|
||||
if (rnode.opt != 0) {
|
||||
TransCompressOptions(rnode, &compOpt);
|
||||
printf(", compressed file: byteConvert: %u, diffConvert: %u, PreallocChunks: %u, compressLevel: %u"
|
||||
", compressAlgorithm: %u, compressChunkSize: %u.",
|
||||
compOpt.byteConvert, compOpt.diffConvert, compOpt.compressPreallocChunks,
|
||||
compOpt.compressLevelSymbol, compOpt.compressAlgorithm, CHUNK_SIZE_LIST[compOpt.compressChunkSize]);
|
||||
}
|
||||
|
||||
StorageType storage_type = HEAP_DISK;
|
||||
if (IsSegmentFileNode(rnode)) {
|
||||
storage_type = SEGMENT_PAGE;
|
||||
|
|
@ -831,8 +796,6 @@ static void usage(void)
|
|||
printf(" -z, --stats show statistics instead of records\n");
|
||||
printf(" -v, --verbose show detailed information\n");
|
||||
printf(" -?, --help show this help, then exit\n");
|
||||
printf(" --enable-dss enable shared storage mode\n");
|
||||
printf(" --socketpath=SOCKETPATH dss connect socket file path\n");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
@ -849,14 +812,12 @@ int main(int argc, char** argv)
|
|||
|
||||
static struct option long_options[] = {{"bkp-details", no_argument, NULL, 'b'},
|
||||
{"end", required_argument, NULL, 'e'},
|
||||
{"enable-dss", no_argument, NULL, 1},
|
||||
{"follow", no_argument, NULL, 'f'},
|
||||
{"help", no_argument, NULL, '?'},
|
||||
{"limit", required_argument, NULL, 'n'},
|
||||
{"path", required_argument, NULL, 'p'},
|
||||
{"rmgr", required_argument, NULL, 'r'},
|
||||
{"start", required_argument, NULL, 's'},
|
||||
{"socketpath", required_argument, NULL, 2},
|
||||
{"timeline", required_argument, NULL, 't'},
|
||||
{"write-fpw", no_argument, NULL, 'w'},
|
||||
{"xid", required_argument, NULL, 'x'},
|
||||
|
|
@ -880,8 +841,6 @@ int main(int argc, char** argv)
|
|||
dumpprivate.endptr = InvalidXLogRecPtr;
|
||||
dumpprivate.endptr_reached = false;
|
||||
dumpprivate.shareStorageXlogFilePath = NULL;
|
||||
dumpprivate.enable_dss = false;
|
||||
dumpprivate.socketpath = NULL;
|
||||
const long defaultShareStorageXlogSize = 512 * 1024 * 1024 * 1024L;
|
||||
dumpprivate.shareStorageXlogSize = defaultShareStorageXlogSize;
|
||||
|
||||
|
|
@ -989,13 +948,6 @@ int main(int argc, char** argv)
|
|||
case 'z':
|
||||
config.stats = true;
|
||||
break;
|
||||
case 1:
|
||||
dumpprivate.enable_dss = true;
|
||||
break;
|
||||
case 2:
|
||||
dumpprivate.enable_dss = true;
|
||||
dumpprivate.socketpath = strdup(optarg);
|
||||
break;
|
||||
default:
|
||||
goto bad_argument;
|
||||
}
|
||||
|
|
@ -1006,30 +958,6 @@ int main(int argc, char** argv)
|
|||
goto bad_argument;
|
||||
}
|
||||
|
||||
// dss device init
|
||||
if (dss_device_init(dumpprivate.socketpath, dumpprivate.enable_dss) != DSS_SUCCESS) {
|
||||
fatal_error("failed to init dss device");
|
||||
}
|
||||
|
||||
if (dumpprivate.enable_dss) {
|
||||
if (dumpprivate.socketpath == NULL) {
|
||||
fprintf(stderr, "%s: socketpath cannot be NULL when enable dss\n", progname);
|
||||
goto bad_argument;
|
||||
}
|
||||
|
||||
char* directory = dumpprivate.inpath == NULL ? argv[optind] : dumpprivate.inpath;
|
||||
if (directory != NULL) {
|
||||
if (directory[0] != '+' || strstr(directory, "/") == NULL) {
|
||||
fprintf(stderr, "%s: xlog file path should be absolutely when enable dss\n", progname);
|
||||
goto bad_argument;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "%s: xlog file path must be specified when enable dss\n", progname);
|
||||
goto bad_argument;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (dumpprivate.inpath != NULL) {
|
||||
/* validate path points to directory */
|
||||
if (!verify_directory(dumpprivate.inpath)) {
|
||||
|
|
@ -1038,9 +966,6 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
if (dumpprivate.enable_dss)
|
||||
XLogSegmentSize = DSS_XLOG_SEG_SIZE;
|
||||
|
||||
/* parse files as start/end boundaries, extract path if not specified */
|
||||
if (optind < argc) {
|
||||
char* directory = NULL;
|
||||
|
|
@ -1062,12 +987,7 @@ int main(int argc, char** argv)
|
|||
fatal_error("cannot open directory \"%s\": %s", dumpprivate.inpath, strerror(errno));
|
||||
}
|
||||
|
||||
if (is_dss_file(dumpprivate.inpath)) {
|
||||
fd = open_dss_file(dumpprivate.inpath, fname);
|
||||
} else {
|
||||
fd = fuzzy_open_file(dumpprivate.inpath, fname);
|
||||
}
|
||||
|
||||
fd = fuzzy_open_file(dumpprivate.inpath, fname);
|
||||
if (fd < 0)
|
||||
fatal_error("could not open file \"%s\"", fname);
|
||||
close(fd);
|
||||
|
|
@ -1099,12 +1019,7 @@ int main(int argc, char** argv)
|
|||
/* ignore directory, already have that */
|
||||
split_path(argv[optind + 1], &directory, &fname);
|
||||
|
||||
if (is_dss_file(dumpprivate.inpath)) {
|
||||
fd = open_dss_file(dumpprivate.inpath, fname);
|
||||
} else {
|
||||
fd = fuzzy_open_file(dumpprivate.inpath, fname);
|
||||
}
|
||||
|
||||
fd = fuzzy_open_file(dumpprivate.inpath, fname);
|
||||
if (fd < 0)
|
||||
fatal_error("could not open file \"%s\"", fname);
|
||||
close(fd);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include "storage/buf/bufmgr.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/snapmgr.h"
|
||||
|
||||
PG_MODULE_MAGIC;
|
||||
|
||||
|
|
@ -196,7 +195,7 @@ static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
|
|||
switch (rel->rd_rel->relkind) {
|
||||
case RELKIND_RELATION:
|
||||
case RELKIND_TOASTVALUE:
|
||||
//case RELKIND_UNCATALOGED:
|
||||
case RELKIND_UNCATALOGED:
|
||||
case RELKIND_SEQUENCE:
|
||||
case RELKIND_LARGE_SEQUENCE:
|
||||
return pgstat_heap(rel, fcinfo);
|
||||
|
|
@ -251,7 +250,7 @@ static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
|
|||
*/
|
||||
static Datum pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
|
||||
{
|
||||
TableScanDesc scan;
|
||||
HeapScanDesc scan;
|
||||
HeapTuple tuple;
|
||||
BlockNumber nblocks;
|
||||
BlockNumber block = 0; /* next block to count free space in */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# contrib/postgres_fdw/Makefile
|
||||
|
||||
MODULE_big = postgres_fdw
|
||||
OBJS = postgres_fdw.o option.o deparse.o connection.o internal_interface.o
|
||||
OBJS = postgres_fdw.o option.o deparse.o connection.o
|
||||
|
||||
PG_CPPFLAGS = -I$(libpq_srcdir)
|
||||
SHLIB_LINK_INTERNAL = $(libpq)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "utils/syscache.h"
|
||||
#include "utils/timestamp.h"
|
||||
#include "storage/ipc.h"
|
||||
#include "executor/executor.h"
|
||||
|
||||
|
||||
/*
|
||||
* Connection cache hash table entry
|
||||
|
|
@ -243,39 +243,6 @@ PGconn *GetConnection(ForeignServer *server, UserMapping *user, bool will_prep_s
|
|||
return entry->conn;
|
||||
}
|
||||
|
||||
PGconn* GetConnectionByFScanState(ForeignScanState* node, bool will_prep_stmt)
|
||||
{
|
||||
ForeignScan* fsplan = (ForeignScan *)node->ss.ps.plan;
|
||||
EState* estate = node->ss.ps.state;
|
||||
RangeTblEntry* rte = NULL;
|
||||
Oid userid;
|
||||
ForeignTable* table = NULL;
|
||||
ForeignServer* server = NULL;
|
||||
UserMapping* user = NULL;
|
||||
int rtindex;
|
||||
|
||||
/*
|
||||
* Identify which user to do the remote access as. This should match what
|
||||
* ExecCheckRTEPerms() does. In case of a join or aggregate, use the
|
||||
* lowest-numbered member RTE as a representative; we would get the same
|
||||
* result from any.
|
||||
*/
|
||||
if (fsplan->scan.scanrelid > 0) {
|
||||
rtindex = fsplan->scan.scanrelid;
|
||||
} else {
|
||||
rtindex = bms_next_member(fsplan->fs_relids, -1);
|
||||
}
|
||||
rte = exec_rt_fetch(rtindex, estate);
|
||||
userid = rte->checkAsUser ? rte->checkAsUser : GetUserId();
|
||||
|
||||
/* Get info about foreign table. */
|
||||
table = GetForeignTable(rte->relid);
|
||||
server = GetForeignServer(table->serverid);
|
||||
user = GetUserMapping(userid, table->serverid);
|
||||
|
||||
return GetConnection(server, user, will_prep_stmt);
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect to remote server using specified server and user mapping properties.
|
||||
*/
|
||||
|
|
@ -795,16 +762,6 @@ static void pgfdw_xact_callback(XactEvent event, void *arg)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MOT
|
||||
/*
|
||||
* These events are added only for MOT FDW. So, others can safely ignore these event.
|
||||
*/
|
||||
if (event == XACT_EVENT_START || event == XACT_EVENT_RECORD_COMMIT || event == XACT_EVENT_PREROLLBACK_CLEANUP ||
|
||||
event == XACT_EVENT_POST_COMMIT_CLEANUP || event == XACT_EVENT_STMT_FINISH) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Scan all connection cache entries to find open remote transactions, and
|
||||
* close them.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,665 +0,0 @@
|
|||
/* -------------------------------------------------------------------------
|
||||
*
|
||||
* postgres_fdw.c
|
||||
* Foreign-data wrapper for remote openGauss servers
|
||||
*
|
||||
* Portions Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
* Portions Copyright (c) 2012-2014, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* contrib/postgres_fdw/postgres_fdw.c
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef FRONTEND
|
||||
|
||||
#include "postgres.h"
|
||||
#include "utils/memutils.h"
|
||||
#else
|
||||
#include "postgres_fe.h"
|
||||
/* It's possible we could use a different value for this in frontend code */
|
||||
#define MaxAllocSize ((Size)0x3fffffff) /* 1 gigabyte - 1 */
|
||||
#endif
|
||||
|
||||
#include "internal_interface.h"
|
||||
#include "optimizer/pathnode.h"
|
||||
#include "optimizer/cost.h"
|
||||
#include "optimizer/planmain.h"
|
||||
|
||||
/*
|
||||
* Get a copy of an existing local path for a given join relation.
|
||||
*
|
||||
* This function is usually helpful to obtain an alternate local path for EPQ
|
||||
* checks.
|
||||
*
|
||||
* Right now, this function only supports unparameterized foreign joins, so we
|
||||
* only search for unparameterized path in the given list of paths. Since we
|
||||
* are searching for a path which can be used to construct an alternative local
|
||||
* plan for a foreign join, we look for only MergeJoin, HashJoin or NestLoop
|
||||
* paths.
|
||||
*
|
||||
* If the inner or outer subpath of the chosen path is a ForeignScan, we
|
||||
* replace it with its outer subpath. For this reason, and also because the
|
||||
* planner might free the original path later, the path returned by this
|
||||
* function is a shallow copy of the original. There's no need to copy
|
||||
* the substructure, so we don't.
|
||||
*
|
||||
* Since the plan created using this path will presumably only be used to
|
||||
* execute EPQ checks, efficiency of the path is not a concern. But since the
|
||||
* path list in RelOptInfo is anyway sorted by total cost we are likely to
|
||||
* choose the most efficient path, which is all for the best.
|
||||
*/
|
||||
Path *GetExistingLocalJoinPath(RelOptInfo *joinrel)
|
||||
{
|
||||
ListCell *lc = NULL;
|
||||
errno_t rc;
|
||||
|
||||
Assert(IS_JOIN_REL(joinrel));
|
||||
|
||||
foreach (lc, joinrel->pathlist) {
|
||||
Path *path = (Path *)lfirst(lc);
|
||||
JoinPath *joinpath = NULL;
|
||||
|
||||
/* Skip parameterized paths. */
|
||||
if (path->param_info != NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (path->pathtype) {
|
||||
case T_HashJoin: {
|
||||
HashPath *hash_path = makeNode(HashPath);
|
||||
rc = memcpy_s(hash_path, sizeof(HashPath), path, sizeof(HashPath));
|
||||
securec_check(rc, "\0", "\0");
|
||||
joinpath = (JoinPath *)hash_path;
|
||||
} break;
|
||||
|
||||
case T_NestLoop: {
|
||||
NestPath *nest_path = makeNode(NestPath);
|
||||
rc = memcpy_s(nest_path, sizeof(NestPath), path, sizeof(NestPath));
|
||||
securec_check(rc, "\0", "\0");
|
||||
joinpath = (JoinPath *)nest_path;
|
||||
} break;
|
||||
|
||||
case T_MergeJoin: {
|
||||
MergePath *merge_path = makeNode(MergePath);
|
||||
rc = memcpy_s(merge_path, sizeof(MergePath), path, sizeof(MergePath));
|
||||
securec_check(rc, "\0", "\0");
|
||||
joinpath = (JoinPath *)merge_path;
|
||||
} break;
|
||||
|
||||
default:
|
||||
|
||||
/*
|
||||
* Just skip anything else. We don't know if corresponding
|
||||
* plan would build the output row from whole-row references
|
||||
* of base relations and execute the EPQ checks.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
||||
/* This path isn't good for us, check next. */
|
||||
if (!joinpath) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* If either inner or outer path is a ForeignPath corresponding to a
|
||||
* pushed down join, replace it with the fdw_outerpath, so that we
|
||||
* maintain path for EPQ checks built entirely of local join
|
||||
* strategies.
|
||||
*/
|
||||
if (IsA(joinpath->outerjoinpath, ForeignPath)) {
|
||||
ForeignPath *foreign_path;
|
||||
|
||||
foreign_path = (ForeignPath *)joinpath->outerjoinpath;
|
||||
if (IS_JOIN_REL(foreign_path->path.parent)) {
|
||||
joinpath->outerjoinpath = foreign_path->fdw_outerpath;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsA(joinpath->innerjoinpath, ForeignPath)) {
|
||||
ForeignPath *foreign_path;
|
||||
|
||||
foreign_path = (ForeignPath *)joinpath->innerjoinpath;
|
||||
if (IS_JOIN_REL(foreign_path->path.parent)) {
|
||||
joinpath->innerjoinpath = foreign_path->fdw_outerpath;
|
||||
}
|
||||
}
|
||||
|
||||
return (Path *)joinpath;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* psprintf
|
||||
*
|
||||
* Format text data under the control of fmt (an sprintf-style format string)
|
||||
* and return it in an allocated-on-demand buffer. The buffer is allocated
|
||||
* with palloc in the backend, or malloc in frontend builds. Caller is
|
||||
* responsible to free the buffer when no longer needed, if appropriate.
|
||||
*
|
||||
* Errors are not returned to the caller, but are reported via elog(ERROR)
|
||||
* in the backend, or printf-to-stderr-and-exit() in frontend builds.
|
||||
* One should therefore think twice about using this in libpq.
|
||||
*/
|
||||
char *psprintf(const char *fmt, ...)
|
||||
{
|
||||
int save_errno = errno;
|
||||
size_t len = 128; /* initial assumption about buffer size */
|
||||
|
||||
for (;;) {
|
||||
char *result = NULL;
|
||||
va_list args;
|
||||
size_t newlen;
|
||||
|
||||
/*
|
||||
* Allocate result buffer. Note that in frontend this maps to malloc
|
||||
* with exit-on-error.
|
||||
*/
|
||||
result = (char *)palloc(len);
|
||||
|
||||
/* Try to format the data. */
|
||||
errno = save_errno;
|
||||
va_start(args, fmt);
|
||||
newlen = pvsnprintf(result, len, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
if (newlen < len) {
|
||||
return result; /* success */
|
||||
}
|
||||
|
||||
/* Release buffer and loop around to try again with larger len. */
|
||||
pfree(result);
|
||||
len = newlen;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* pvsnprintf
|
||||
*
|
||||
* Attempt to format text data under the control of fmt (an sprintf-style
|
||||
* format string) and insert it into buf (which has length len).
|
||||
*
|
||||
* If successful, return the number of bytes emitted, not counting the
|
||||
* trailing zero byte. This will always be strictly less than len.
|
||||
*
|
||||
* If there's not enough space in buf, return an estimate of the buffer size
|
||||
* needed to succeed (this *must* be more than the given len, else callers
|
||||
* might loop infinitely).
|
||||
*
|
||||
* Other error cases do not return, but exit via elog(ERROR) or exit().
|
||||
* Hence, this shouldn't be used inside libpq.
|
||||
*
|
||||
* Caution: callers must be sure to preserve their entry-time errno
|
||||
* when looping, in case the fmt contains "%m".
|
||||
*
|
||||
* Note that the semantics of the return value are not exactly C99's.
|
||||
* First, we don't promise that the estimated buffer size is exactly right;
|
||||
* callers must be prepared to loop multiple times to get the right size.
|
||||
* (Given a C99-compliant vsnprintf, that won't happen, but it is rumored
|
||||
* that some implementations don't always return the same value ...)
|
||||
* Second, we return the recommended buffer size, not one less than that;
|
||||
* this lets overflow concerns be handled here rather than in the callers.
|
||||
*/
|
||||
size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args)
|
||||
{
|
||||
int nprinted = 0;
|
||||
|
||||
nprinted = vsnprintf_s(buf, len, len, fmt, args);
|
||||
securec_check_ss(nprinted, "\0", "\0");
|
||||
|
||||
/* We assume failure means the fmt is bogus, hence hard failure is OK */
|
||||
if (unlikely(nprinted < 0)) {
|
||||
#ifndef FRONTEND
|
||||
elog(ERROR, "vsnprintf failed: %m with format string \"%s\"", fmt);
|
||||
#else
|
||||
fprintf(stderr, "vsnprintf failed: %s with format string \"%s\"\n", strerror(errno), fmt);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((size_t)nprinted < len) {
|
||||
/* Success. Note nprinted does not include trailing null. */
|
||||
return (size_t)nprinted;
|
||||
}
|
||||
|
||||
/*
|
||||
* We assume a C99-compliant vsnprintf, so believe its estimate of the
|
||||
* required space, and add one for the trailing null. (If it's wrong, the
|
||||
* logic will still work, but we may loop multiple times.)
|
||||
*
|
||||
* Choke if the required space would exceed MaxAllocSize. Note we use
|
||||
* this palloc-oriented overflow limit even when in frontend.
|
||||
*/
|
||||
if (unlikely((size_t)nprinted > MaxAllocSize - 1)) {
|
||||
#ifndef FRONTEND
|
||||
ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("out of memory")));
|
||||
#else
|
||||
fprintf(stderr, _("out of memory\n"));
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
return nprinted + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* create_foreign_join_path
|
||||
* Creates a path corresponding to a scan of a foreign join,
|
||||
* returning the pathnode.
|
||||
*
|
||||
* This function is never called from core Postgres; rather, it's expected
|
||||
* to be called by the GetForeignJoinPaths function of a foreign data wrapper.
|
||||
* We make the FDW supply all fields of the path, since we do not have any way
|
||||
* to calculate them in core. However, there is a usually-sane default for
|
||||
* the pathtarget (rel->reltarget), so we let a NULL for "target" select that.
|
||||
*/
|
||||
ForeignPath *create_foreign_join_path(PlannerInfo *root, RelOptInfo *rel, List *target, double rows,
|
||||
Cost startup_cost, Cost total_cost, List *pathkeys, Relids required_outer, Path *fdw_outerpath, List *fdw_private)
|
||||
{
|
||||
ForeignPath *pathnode = makeNode(ForeignPath);
|
||||
|
||||
/*
|
||||
* We should use get_joinrel_parampathinfo to handle parameterized paths,
|
||||
* but the API of this function doesn't support it, and existing
|
||||
* extensions aren't yet trying to build such paths anyway. For the
|
||||
* moment just throw an error if someone tries it; eventually we should
|
||||
* revisit this.
|
||||
*/
|
||||
if (!bms_is_empty(required_outer) || !bms_is_empty(rel->lateral_relids)) {
|
||||
elog(ERROR, "parameterized foreign joins are not supported yet");
|
||||
}
|
||||
|
||||
pathnode->path.pathtype = T_ForeignScan;
|
||||
pathnode->path.parent = rel;
|
||||
pathnode->path.pathtarget = rel->reltarget;
|
||||
pathnode->path.param_info = NULL; /* XXX see above */
|
||||
pathnode->path.rows = rows;
|
||||
pathnode->path.startup_cost = startup_cost;
|
||||
pathnode->path.total_cost = total_cost;
|
||||
pathnode->path.pathkeys = pathkeys;
|
||||
pathnode->path.dop = 1;
|
||||
|
||||
pathnode->fdw_outerpath = fdw_outerpath;
|
||||
pathnode->fdw_private = fdw_private;
|
||||
|
||||
return pathnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call ExecInitExpr() on a list of expressions, return a list of ExprStates.
|
||||
*/
|
||||
List *ExecInitExprList(List *nodes, PlanState *parent)
|
||||
{
|
||||
List *result = NIL;
|
||||
ListCell *lc = NULL;
|
||||
|
||||
foreach (lc, nodes) {
|
||||
Expr *e = (Expr *)lfirst(lc);
|
||||
result = lappend(result, ExecInitExpr(e, parent));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_namespace_name_or_temp
|
||||
* As above, but if it is this backend's temporary namespace, return
|
||||
* "pg_temp" instead.
|
||||
*/
|
||||
char *get_namespace_name_or_temp(Oid nspid)
|
||||
{
|
||||
if (isTempNamespace(nspid)) {
|
||||
return pstrdup("pg_temp");
|
||||
} else {
|
||||
return get_namespace_name(nspid);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* fetch_upper_rel
|
||||
* Build a RelOptInfo describing some post-scan/join query processing,
|
||||
* or return a pre-existing one if somebody already built it.
|
||||
*
|
||||
* An "upper" relation is identified by an UpperRelationKind and a Relids set.
|
||||
* The meaning of the Relids set is not specified here, and very likely will
|
||||
* vary for different relation kinds.
|
||||
*
|
||||
* Most of the fields in an upper-level RelOptInfo are not used and are not
|
||||
* set here (though makeNode should ensure they're zeroes). We basically only
|
||||
* care about fields that are of interest to add_path() and set_cheapest().
|
||||
*/
|
||||
RelOptInfo *fetch_upper_rel(FDWUpperRelCxt *ufdwCxt, UpperRelationKind kind)
|
||||
{
|
||||
/*
|
||||
* For the moment, our indexing data structure is just a List for each
|
||||
* relation kind. If we ever get so many of one kind that this stops
|
||||
* working well, we can improve it. No code outside this function should
|
||||
* assume anything about how to find a particular upperrel.
|
||||
*/
|
||||
if (ufdwCxt->upperRels[kind] != NULL) {
|
||||
return ufdwCxt->upperRels[kind];
|
||||
}
|
||||
|
||||
RelOptInfo *upperrel = makeNode(RelOptInfo);
|
||||
upperrel->reloptkind = RELOPT_UPPER_REL;
|
||||
upperrel->relids = NULL;
|
||||
|
||||
upperrel->reltarget = makeNode(PathTarget);
|
||||
upperrel->pathlist = NIL;
|
||||
upperrel->cheapest_startup_path = NULL;
|
||||
upperrel->cheapest_total_path = NULL;
|
||||
upperrel->cheapest_unique_path = NULL;
|
||||
upperrel->cheapest_parameterized_paths = NIL;
|
||||
|
||||
ufdwCxt->upperRels[kind] = upperrel;
|
||||
|
||||
return upperrel;
|
||||
}
|
||||
|
||||
List* extract_target_from_tel(FDWUpperRelCxt *ufdw_cxt, PgFdwRelationInfo *fpinfo)
|
||||
{
|
||||
List* tel = NIL;
|
||||
switch (fpinfo->stage) {
|
||||
case UPPERREL_INIT:
|
||||
tel = ufdw_cxt->spjExtra->targetList;
|
||||
break;
|
||||
case UPPERREL_GROUP_AGG:
|
||||
tel = ufdw_cxt->groupExtra->targetList;
|
||||
break;
|
||||
case UPPERREL_ORDERED:
|
||||
tel = ufdw_cxt->orderExtra->targetList;
|
||||
break;
|
||||
case UPPERREL_FINAL:
|
||||
tel = ufdw_cxt->finalExtra->targetList;
|
||||
break;
|
||||
default:
|
||||
Assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
fpinfo->complete_tlist = tel;
|
||||
|
||||
List* tl = NULL;
|
||||
ListCell* lc = NULL;
|
||||
foreach(lc, tel) {
|
||||
Assert(IsA(lfirst(lc), TargetEntry));
|
||||
TargetEntry* te = (TargetEntry*)lfirst(lc);
|
||||
|
||||
tl = lappend(tl, copyObject(te->expr));
|
||||
}
|
||||
|
||||
return tl;
|
||||
}
|
||||
|
||||
/*
|
||||
* make_upper_rel
|
||||
*
|
||||
* Create a new grouping rel and set basic properties.
|
||||
*
|
||||
* input_rel represents the underlying scan/join relation.
|
||||
* target is the output expected from the grouping relation.
|
||||
*/
|
||||
RelOptInfo *make_upper_rel(FDWUpperRelCxt *ufdwCxt, PgFdwRelationInfo *fpinfo)
|
||||
{
|
||||
RelOptInfo *upper_rel = fetch_upper_rel(ufdwCxt, fpinfo->stage);
|
||||
|
||||
/* Set target. */
|
||||
upper_rel->reltarget->exprs = extract_target_from_tel(ufdwCxt, fpinfo);
|
||||
|
||||
/*
|
||||
* If the input rel belongs to a single FDW, so does the grouped rel.
|
||||
*/
|
||||
upper_rel->serverid = ufdwCxt->currentRel->serverid;
|
||||
upper_rel->userid = ufdwCxt->currentRel->userid;
|
||||
upper_rel->useridiscurrent = ufdwCxt->currentRel->useridiscurrent;
|
||||
upper_rel->fdwroutine = ufdwCxt->currentRel->fdwroutine;
|
||||
upper_rel->fdw_private = fpinfo;
|
||||
|
||||
return upper_rel;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_sortgroupref_clause_noerr
|
||||
* As above, but return NULL rather than throwing an error if not found.
|
||||
*/
|
||||
SortGroupClause *get_sortgroupref_clause_noerr(Index sortref, List *clauses)
|
||||
{
|
||||
ListCell *l = NULL;
|
||||
|
||||
foreach (l, clauses) {
|
||||
SortGroupClause *cl = (SortGroupClause *)lfirst(l);
|
||||
|
||||
if (cl->tleSortGroupRef == sortref) {
|
||||
return cl;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* create_foreign_upper_path
|
||||
* Creates a path corresponding to an upper relation that's computed
|
||||
* directly by an FDW, returning the pathnode.
|
||||
*
|
||||
* This function is never called from core Postgres; rather, it's expected to
|
||||
* be called by the GetForeignUpperPaths function of a foreign data wrapper.
|
||||
* We make the FDW supply all fields of the path, since we do not have any way
|
||||
* to calculate them in core. However, there is a usually-sane default for
|
||||
* the pathtarget (rel->reltarget), so we let a NULL for "target" select that.
|
||||
*/
|
||||
ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel, List *target, double rows,
|
||||
Cost startup_cost, Cost total_cost, List *pathkeys, Path *fdw_outerpath, List *fdw_private)
|
||||
{
|
||||
ForeignPath *pathnode = makeNode(ForeignPath);
|
||||
|
||||
/*
|
||||
* Upper relations should never have any lateral references, since joining
|
||||
* is complete.
|
||||
*/
|
||||
Assert(bms_is_empty(rel->lateral_relids));
|
||||
|
||||
pathnode->path.pathtype = T_ForeignScan;
|
||||
pathnode->path.parent = rel;
|
||||
pathnode->path.pathtarget = rel->reltarget;
|
||||
pathnode->path.param_info = NULL;
|
||||
pathnode->path.rows = rows;
|
||||
pathnode->path.startup_cost = startup_cost;
|
||||
pathnode->path.total_cost = total_cost;
|
||||
pathnode->path.pathkeys = pathkeys;
|
||||
pathnode->path.dop = 1;
|
||||
|
||||
pathnode->fdw_outerpath = fdw_outerpath;
|
||||
pathnode->fdw_private = fdw_private;
|
||||
|
||||
return pathnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* adjust_limit_rows_costs
|
||||
* Adjust the size and cost estimates for a LimitPath node according to the
|
||||
* offset/limit.
|
||||
*
|
||||
* This is only a cosmetic issue if we are at top level, but if we are
|
||||
* building a subquery then it's important to report correct info to the outer
|
||||
* planner.
|
||||
*
|
||||
* When the offset or count couldn't be estimated, use 10% of the estimated
|
||||
* number of rows emitted from the subpath.
|
||||
*
|
||||
* XXX we don't bother to add eval costs of the offset/limit expressions
|
||||
* themselves to the path costs. In theory we should, but in most cases those
|
||||
* expressions are trivial and it's just not worth the trouble.
|
||||
*/
|
||||
void adjust_limit_rows_costs(double *rows, /* in/out parameter */
|
||||
Cost *startup_cost, /* in/out parameter */
|
||||
Cost *total_cost, /* in/out parameter */
|
||||
int64 offset_est, int64 count_est)
|
||||
{
|
||||
double input_rows = *rows;
|
||||
Cost input_startup_cost = *startup_cost;
|
||||
Cost input_total_cost = *total_cost;
|
||||
|
||||
if (offset_est != 0) {
|
||||
double offset_rows;
|
||||
|
||||
if (offset_est > 0) {
|
||||
offset_rows = (double)offset_est;
|
||||
} else {
|
||||
offset_rows = clamp_row_est(input_rows * 0.10);
|
||||
}
|
||||
if (offset_rows > *rows) {
|
||||
offset_rows = *rows;
|
||||
}
|
||||
if (input_rows > 0) {
|
||||
*startup_cost += (input_total_cost - input_startup_cost) * offset_rows / input_rows;
|
||||
}
|
||||
*rows -= offset_rows;
|
||||
if (*rows < 1) {
|
||||
*rows = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (count_est != 0) {
|
||||
double count_rows;
|
||||
|
||||
if (count_est > 0) {
|
||||
count_rows = (double)count_est;
|
||||
} else {
|
||||
count_rows = clamp_row_est(input_rows * 0.10);
|
||||
}
|
||||
if (count_rows > *rows) {
|
||||
count_rows = *rows;
|
||||
}
|
||||
if (input_rows > 0) {
|
||||
*total_cost = *startup_cost + (input_total_cost - input_startup_cost) * count_rows / input_rows;
|
||||
}
|
||||
*rows = count_rows;
|
||||
if (*rows < 1) {
|
||||
*rows = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* tlist_same_exprs
|
||||
* Check whether two target lists contain the same expressions
|
||||
*
|
||||
* Note: this function is used to decide whether it's safe to jam a new tlist
|
||||
* into a non-projection-capable plan node. Obviously we can't do that unless
|
||||
* the node's tlist shows it already returns the column values we want.
|
||||
* However, we can ignore the TargetEntry attributes resname, ressortgroupref,
|
||||
* resorigtbl, resorigcol, and resjunk, because those are only labelings that
|
||||
* don't affect the row values computed by the node. (Moreover, if we didn't
|
||||
* ignore them, we'd frequently fail to make the desired optimization, since
|
||||
* the planner tends to not bother to make resname etc. valid in intermediate
|
||||
* plan nodes.) Note that on success, the caller must still jam the desired
|
||||
* tlist into the plan node, else it won't have the desired labeling fields.
|
||||
*/
|
||||
static bool tlist_same_exprs(List *tlist1, List *tlist2)
|
||||
{
|
||||
ListCell *lc1 = NULL;
|
||||
ListCell *lc2 = NULL;
|
||||
|
||||
if (list_length(tlist1) != list_length(tlist2)) {
|
||||
return false; /* not same length, so can't match */
|
||||
}
|
||||
|
||||
forboth(lc1, tlist1, lc2, tlist2) {
|
||||
TargetEntry *tle1 = (TargetEntry *)lfirst(lc1);
|
||||
TargetEntry *tle2 = (TargetEntry *)lfirst(lc2);
|
||||
|
||||
if (!equal(tle1->expr, tle2->expr)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* inject_projection_plan
|
||||
* Insert a Result node to do a projection step.
|
||||
*
|
||||
* This is used in a few places where we decide on-the-fly that we need a
|
||||
* projection step as part of the tree generated for some Path node.
|
||||
* We should try to get rid of this in favor of doing it more honestly.
|
||||
*
|
||||
* One reason it's ugly is we have to be told the right parallel_safe marking
|
||||
* to apply (since the tlist might be unsafe even if the child plan is safe).
|
||||
*/
|
||||
static Plan *inject_projection_plan(PlannerInfo *root, Plan *subplan, List *tlist)
|
||||
{
|
||||
Plan *plan = NULL;
|
||||
|
||||
plan = (Plan *)make_result(root, tlist, NULL, subplan);
|
||||
|
||||
/*
|
||||
* In principle, we should charge tlist eval cost plus cpu_per_tuple per
|
||||
* row for the Result node. But the former has probably been factored in
|
||||
* already and the latter was not accounted for during Path construction,
|
||||
* so being formally correct might just make the EXPLAIN output look less
|
||||
* consistent not more so. Hence, just copy the subplan's cost.
|
||||
*/
|
||||
copy_plan_costsize(plan, subplan);
|
||||
|
||||
return plan;
|
||||
}
|
||||
|
||||
/*
|
||||
* change_plan_targetlist
|
||||
* Externally available wrapper for inject_projection_plan.
|
||||
*
|
||||
* This is meant for use by FDW plan-generation functions, which might
|
||||
* want to adjust the tlist computed by some subplan tree. In general,
|
||||
* a Result node is needed to compute the new tlist, but we can optimize
|
||||
* some cases.
|
||||
*
|
||||
* In most cases, tlist_parallel_safe can just be passed as the parallel_safe
|
||||
* flag of the FDW's own Path node.
|
||||
*/
|
||||
Plan *change_plan_targetlist(PlannerInfo *root, Plan *subplan, List *tlist)
|
||||
{
|
||||
/*
|
||||
* If the top plan node can't do projections and its existing target list
|
||||
* isn't already what we need, we need to add a Result node to help it
|
||||
* along.
|
||||
*/
|
||||
if (!is_projection_capable_plan(subplan) && !tlist_same_exprs(tlist, subplan->targetlist)) {
|
||||
subplan = inject_projection_plan(root, subplan, tlist);
|
||||
} else {
|
||||
/* Else we can just replace the plan node's tlist */
|
||||
subplan->targetlist = tlist;
|
||||
}
|
||||
return subplan;
|
||||
}
|
||||
|
||||
/*
|
||||
* apply_tlist_labeling
|
||||
* Apply the TargetEntry labeling attributes of src_tlist to dest_tlist
|
||||
*
|
||||
* This is useful for reattaching column names etc to a plan's final output
|
||||
* targetlist.
|
||||
*/
|
||||
void apply_tlist_labeling(List *dest_tlist, List *src_tlist)
|
||||
{
|
||||
ListCell *ld = NULL;
|
||||
ListCell *ls = NULL;
|
||||
|
||||
Assert(list_length(dest_tlist) == list_length(src_tlist));
|
||||
forboth(ld, dest_tlist, ls, src_tlist)
|
||||
{
|
||||
TargetEntry *dest_tle = (TargetEntry *)lfirst(ld);
|
||||
TargetEntry *src_tle = (TargetEntry *)lfirst(ls);
|
||||
|
||||
Assert(dest_tle->resno == src_tle->resno);
|
||||
dest_tle->resname = src_tle->resname;
|
||||
dest_tle->ressortgroupref = src_tle->ressortgroupref;
|
||||
dest_tle->resorigtbl = src_tle->resorigtbl;
|
||||
dest_tle->resorigcol = src_tle->resorigcol;
|
||||
dest_tle->resjunk = src_tle->resjunk;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/* -------------------------------------------------------------------------
|
||||
*
|
||||
* postgres_fdw.c
|
||||
* Foreign-data wrapper for remote openGauss servers
|
||||
*
|
||||
* Portions Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
* Portions Copyright (c) 2012-2014, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* contrib/postgres_fdw/postgres_fdw.c
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _PGFDW_INTERNAL_INTERFACE_H_
|
||||
#define _PGFDW_INTERNAL_INTERFACE_H_
|
||||
|
||||
#include "c.h"
|
||||
#include "datatypes.h"
|
||||
#include "nodes/bitmapset.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "nodes/nodes.h"
|
||||
#include "nodes/execnodes.h"
|
||||
#include "executor/executor.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "postgres_fdw.h"
|
||||
|
||||
/*
|
||||
* This macro embodies the correct way to test whether a RestrictInfo is
|
||||
* "pushed down" to a given outer join, that is, should be treated as a filter
|
||||
* clause rather than a join clause at that outer join. This is certainly so
|
||||
* if is_pushed_down is true; but examining that is not sufficient anymore,
|
||||
* because outer-join clauses will get pushed down to lower outer joins when
|
||||
* we generate a path for the lower outer join that is parameterized by the
|
||||
* LHS of the upper one. We can detect such a clause by noting that its
|
||||
* required_relids exceed the scope of the join.
|
||||
*/
|
||||
#define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids) \
|
||||
((rinfo)->is_pushed_down || !bms_is_subset((rinfo)->required_relids, joinrelids))
|
||||
|
||||
extern char *psprintf(const char *fmt, ...);
|
||||
extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args);
|
||||
|
||||
extern Path *GetExistingLocalJoinPath(RelOptInfo *joinrel);
|
||||
extern ForeignPath *create_foreign_join_path(PlannerInfo *root, RelOptInfo *rel, List *target, double rows,
|
||||
Cost startup_cost, Cost total_cost, List *pathkeys, Relids required_outer, Path *fdw_outerpath, List *fdw_private);
|
||||
ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel, List *target, double rows,
|
||||
Cost startup_cost, Cost total_cost, List *pathkeys, Path *fdw_outerpath, List *fdw_private);
|
||||
extern List *ExecInitExprList(List *nodes, PlanState *parent);
|
||||
extern char *get_namespace_name_or_temp(Oid nspid);
|
||||
extern RelOptInfo *fetch_upper_rel(FDWUpperRelCxt *ufdwCxt, UpperRelationKind kind);
|
||||
extern RelOptInfo *make_upper_rel(FDWUpperRelCxt *ufdwCxt, PgFdwRelationInfo *fpinfo);
|
||||
extern void adjust_limit_rows_costs(double *rows, Cost *startup_cost, Cost *total_cost, int64 offset_est, int64 count_est);
|
||||
extern Plan *change_plan_targetlist(PlannerInfo *root, Plan *subplan, List *tlist);
|
||||
extern void apply_tlist_labeling(List *dest_tlist, List *src_tlist);
|
||||
extern List* extract_target_from_tel(FDWUpperRelCxt *ufdw_cxt, PgFdwRelationInfo *fpinfo);
|
||||
|
||||
#define boolVal(v) ((bool)(((Value*)(v))->val.ival))
|
||||
|
||||
extern SortGroupClause *get_sortgroupref_clause_noerr(Index sortref, List *clauses);
|
||||
|
||||
/* Control flags for format_type_extended */
|
||||
#define FORMAT_TYPE_TYPEMOD_GIVEN 0x01 /* typemod defined by caller */
|
||||
#define FORMAT_TYPE_ALLOW_INVALID 0x02 /* allow invalid types */
|
||||
#define FORMAT_TYPE_FORCE_QUALIFY 0x04 /* force qualification of type */
|
||||
#define FORMAT_TYPE_INVALID_AS_NULL 0x08 /* NULL if undefined */
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -18,123 +18,15 @@
|
|||
#include "lib/stringinfo.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
#include "libpq/libpq-fe.h"
|
||||
|
||||
#include "nodes/execnodes.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
/*
|
||||
* FDW-specific planner information kept in RelOptInfo.fdw_private for a
|
||||
* postgres_fdw foreign table. For a baserel, this struct is created by
|
||||
* postgresGetForeignRelSize, although some fields are not filled till later.
|
||||
* postgresGetForeignJoinPaths creates it for a joinrel, and
|
||||
* postgresGetForeignUpperPaths creates it for an upperrel.
|
||||
*/
|
||||
typedef struct PgFdwRelationInfo {
|
||||
/*
|
||||
* True means that the relation can be pushed down. Always true for simple
|
||||
* foreign scan.
|
||||
*/
|
||||
bool pushdown_safe;
|
||||
|
||||
/*
|
||||
* Restriction clauses, divided into safe and unsafe to pushdown subsets.
|
||||
* All entries in these lists should have RestrictInfo wrappers; that
|
||||
* improves efficiency of selectivity and cost estimation.
|
||||
*/
|
||||
List *remote_conds;
|
||||
List *local_conds;
|
||||
|
||||
/* Actual remote restriction clauses for scan (sans RestrictInfos) */
|
||||
List *final_remote_exprs;
|
||||
|
||||
/* Bitmap of attr numbers we need to fetch from the remote server. */
|
||||
Bitmapset *attrs_used;
|
||||
|
||||
/* True means that the query_pathkeys is safe to push down */
|
||||
bool qp_is_pushdown_safe;
|
||||
|
||||
/* Cost and selectivity of local_conds. */
|
||||
QualCost local_conds_cost;
|
||||
Selectivity local_conds_sel;
|
||||
|
||||
/* Selectivity of join conditions */
|
||||
Selectivity joinclause_sel;
|
||||
|
||||
/* Estimated size and cost for a scan with baserestrictinfo quals. */
|
||||
double rows;
|
||||
int width;
|
||||
Cost startup_cost;
|
||||
Cost total_cost;
|
||||
|
||||
/*
|
||||
* Estimated number of rows fetched from the foreign server, and costs
|
||||
* excluding costs for transferring those rows from the foreign server.
|
||||
* These are only used by estimate_path_cost_size().
|
||||
*/
|
||||
double retrieved_rows;
|
||||
Cost rel_startup_cost;
|
||||
Cost rel_total_cost;
|
||||
|
||||
/* Options extracted from catalogs. */
|
||||
bool use_remote_estimate;
|
||||
Cost fdw_startup_cost;
|
||||
Cost fdw_tuple_cost;
|
||||
List *shippable_extensions; /* OIDs of shippable extensions */
|
||||
bool async_capable;
|
||||
|
||||
/* Cached catalog information. */
|
||||
ForeignTable *table;
|
||||
ForeignServer *server;
|
||||
UserMapping *user; /* only set in use_remote_estimate mode */
|
||||
|
||||
int fetch_size; /* fetch size for this remote table */
|
||||
|
||||
/*
|
||||
* Name of the relation, for use while EXPLAINing ForeignScan. It is used
|
||||
* for join and upper relations but is set for all relations. For a base
|
||||
* relation, this is really just the RT index as a string; we convert that
|
||||
* while producing EXPLAIN output. For join and upper relations, the name
|
||||
* indicates which base foreign tables are included and the join type or
|
||||
* aggregation type used.
|
||||
*/
|
||||
char *relation_name;
|
||||
|
||||
/* Join information */
|
||||
RelOptInfo *outerrel;
|
||||
RelOptInfo *innerrel;
|
||||
JoinType jointype;
|
||||
/* joinclauses contains only JOIN/ON conditions for an outer join */
|
||||
List *joinclauses; /* List of RestrictInfo */
|
||||
|
||||
/* Upper relation information */
|
||||
UpperRelationKind stage;
|
||||
|
||||
/* Grouping information */
|
||||
List *grouped_tlist;
|
||||
|
||||
/* Subquery information */
|
||||
bool make_outerrel_subquery; /* do we deparse outerrel as a subquery? */
|
||||
bool make_innerrel_subquery; /* do we deparse innerrel as a subquery? */
|
||||
Relids lower_subquery_rels; /* all relids appearing in lower subqueries */
|
||||
|
||||
/*
|
||||
* Index of the relation. It is used to create an alias to a subquery
|
||||
* representing the relation.
|
||||
*/
|
||||
int relation_index;
|
||||
|
||||
/* target entry list from */
|
||||
List* complete_tlist;
|
||||
} PgFdwRelationInfo;
|
||||
|
||||
/* in postgres_fdw.c */
|
||||
extern int set_transmission_modes(void);
|
||||
extern void reset_transmission_modes(int nestlevel);
|
||||
|
||||
/* in connection.c */
|
||||
extern PGconn *GetConnection(ForeignServer *server, UserMapping *user, bool will_prep_stmt);
|
||||
PGconn* GetConnectionByFScanState(ForeignScanState *node, bool will_prep_stmt);
|
||||
extern void ReleaseConnection(PGconn *conn);
|
||||
extern unsigned int GetCursorNumber(PGconn *conn);
|
||||
extern unsigned int GetPrepStmtNumber(PGconn *conn);
|
||||
|
|
@ -149,26 +41,18 @@ extern int ExtractConnectionOptions(List *defelems, const char **keywords, const
|
|||
extern void classifyConditions(PlannerInfo *root, RelOptInfo *baserel, List *input_conds, List **remote_conds,
|
||||
List **local_conds);
|
||||
extern bool is_foreign_expr(PlannerInfo *root, RelOptInfo *baserel, Expr *expr);
|
||||
extern bool is_foreign_pathkey(PlannerInfo *root, RelOptInfo *baserel, PathKey *pathkey);
|
||||
extern void deparseSelectSql(StringInfo buf, PlannerInfo *root, RelOptInfo *baserel, Bitmapset *attrs_used,
|
||||
List **retrieved_attrs);
|
||||
extern void appendWhereClause(StringInfo buf, PlannerInfo *root, RelOptInfo *baserel, List *exprs, bool is_first,
|
||||
List **params);
|
||||
extern void deparseInsertSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *targetAttrs,
|
||||
List *withCheckOptionList, List *returningList, List **retrieved_attrs);
|
||||
List *returningList, List **retrieved_attrs);
|
||||
extern void deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *targetAttrs,
|
||||
List *withCheckOptionList, List *returningList, List **retrieved_attrs);
|
||||
List *returningList, List **retrieved_attrs);
|
||||
extern void deparseDeleteSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *returningList,
|
||||
List **retrieved_attrs);
|
||||
extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel);
|
||||
extern void deparseAnalyzeSql(StringInfo buf, Relation rel, List **retrieved_attrs);
|
||||
extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, List *tlist,
|
||||
List *remote_conds, List *pathkeys, bool has_final_sort, bool has_limit, bool is_subquery, List **retrieved_attrs,
|
||||
List **params_list);
|
||||
|
||||
extern const char *get_jointype_name(JoinType jointype);
|
||||
extern List *build_tlist_to_deparse(RelOptInfo *foreignrel);
|
||||
extern bool is_foreign_param(PlannerInfo *root, RelOptInfo *baserel, Expr *expr);
|
||||
extern EquivalenceMember *find_em_for_rel(PlannerInfo *root, EquivalenceClass *ec, RelOptInfo *rel);
|
||||
extern EquivalenceMember *find_em_for_rel_target(PlannerInfo *root, EquivalenceClass *ec, RelOptInfo *rel);
|
||||
|
||||
extern bool is_builtin(Oid oid);
|
||||
|
||||
#endif /* POSTGRES_FDW_H */
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -179,8 +179,11 @@ static bool is_valid_for_masking(const char* func_name, Oid funcnsp, int& funcid
|
|||
{
|
||||
CatCList *catlist = NULL;
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
int cacheId = (t_thrd.proc->workingVersionNum < 92470) ? PROCNAMEARGSNSP : PROCALLARGS;
|
||||
catlist = SearchSysCacheList1(cacheId, CStringGetDatum(func_name));
|
||||
if (t_thrd.proc->workingVersionNum < 92470) {
|
||||
catlist = SearchSysCacheList1(PROCNAMEARGSNSP, CStringGetDatum(func_name));
|
||||
} else {
|
||||
catlist = SearchSysCacheList1(PROCALLARGS, CStringGetDatum(func_name));
|
||||
}
|
||||
#else
|
||||
catlist = SearchSysCacheList1(PROCNAMEARGSNSP, CStringGetDatum(func_name));
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -170,10 +170,9 @@ bool load_policy_labels(bool reload)
|
|||
}
|
||||
|
||||
/* scan to load all labels */
|
||||
if (all_labels != NULL) {
|
||||
delete all_labels;
|
||||
if (all_labels == NULL) {
|
||||
all_labels = new loaded_labels;
|
||||
}
|
||||
all_labels = new loaded_labels;
|
||||
scan_policy_labels(all_labels);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -855,7 +855,7 @@ void gen_policy_labelitem(PolicyLabelItem &item, const ListCell *rel, int objtyp
|
|||
switch (objtype) {
|
||||
case O_VIEW:
|
||||
case O_TABLE: {
|
||||
Oid relid = RangeVarGetRelid((const RangeVar *)rel, NoLock, true);
|
||||
Oid relid = RangeVarGetRelid((RangeVar *)rel, NoLock, false);
|
||||
if (!OidIsValid(relid)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -865,7 +865,7 @@ void gen_policy_labelitem(PolicyLabelItem &item, const ListCell *rel, int objtyp
|
|||
}
|
||||
case O_FUNCTION: {
|
||||
FuncWithArgs *func = (FuncWithArgs *)(rel);
|
||||
Oid funcid = LookupFuncNameTypeNames(func->funcname, func->funcargs, true);
|
||||
Oid funcid = LookupFuncNameTypeNames(func->funcname, func->funcargs, false);
|
||||
if (!OidIsValid(funcid)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -974,4 +974,4 @@ CmdType get_rte_commandtype(RangeTblEntry *rte)
|
|||
} else {
|
||||
return CMD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -97,6 +97,7 @@ PG_MODULE_MAGIC;
|
|||
|
||||
extern "C" void _PG_init(void);
|
||||
extern "C" void _PG_fini(void);
|
||||
extern "C" void set_gsaudit_prehook(ProcessUtility_hook_type func);
|
||||
|
||||
#define POLICY_STR_BUFF_LEN 512
|
||||
#define POLICY_TMP_BUFF_LEN 256
|
||||
|
|
@ -139,7 +140,6 @@ static THR_LOCAL MngEventsVector *mng_events = NULL;
|
|||
using StrMap = gs_stl::gs_map<gs_stl::gs_string, masking_result>;
|
||||
|
||||
static void gsaudit_next_PostParseAnalyze_hook(ParseState *pstate, Query *query);
|
||||
|
||||
static void destroy_local_parameter();
|
||||
static void destory_thread_variables()
|
||||
{
|
||||
|
|
@ -410,16 +410,18 @@ bool verify_copy_command_is_reparsed(List* parsetree_list, const char* query_str
|
|||
gs_stl::gs_string& replaced_query_string)
|
||||
{
|
||||
/* do nothing when enable_security_policy is off */
|
||||
bool is_exist = (!u_sess->attr.attr_security.Enable_Security_Policy ||
|
||||
!is_masking_policy_exist());
|
||||
if (is_exist) return false;
|
||||
if (!u_sess->attr.attr_security.Enable_Security_Policy || !is_masking_policy_exist()) {
|
||||
return false;
|
||||
}
|
||||
ListCell* item = NULL;
|
||||
foreach(item, parsetree_list) {
|
||||
Node* parsetree = (Node *) lfirst(item);
|
||||
if (nodeTag(parsetree) == T_CopyStmt) {
|
||||
CopyStmt* stmt = (CopyStmt*)parsetree;
|
||||
bool is_from_query = (stmt->is_from || stmt->query);
|
||||
if (is_from_query) return false;
|
||||
if (stmt->is_from || stmt->query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* verify policies */
|
||||
IPV6 ip;
|
||||
get_remote_addr(&ip);
|
||||
|
|
@ -431,8 +433,10 @@ bool verify_copy_command_is_reparsed(List* parsetree_list, const char* query_str
|
|||
checkSecurityPolicyFilter_hook(filter_item, &policy_ids);
|
||||
}
|
||||
}
|
||||
bool is_empty_filter = (policy_ids.empty() && !check_audit_policy_filter(&filter_item, &policy_ids));
|
||||
if (is_empty_filter) return false;
|
||||
if (policy_ids.empty() && !check_audit_policy_filter(&filter_item, &policy_ids)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gs_stl::gs_string replace_buffer("(select ");
|
||||
|
||||
char replace_name[POLICY_TMP_BUFF_LEN] = {0};
|
||||
|
|
@ -515,6 +519,30 @@ void set_result_set_function(const PolicyLabelItem &func)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* check exchange partition list contains masked table.
|
||||
* For given AlterTableCmd list, check whether ordinary
|
||||
* tables have bound masking policies.
|
||||
*/
|
||||
static bool exchange_partition_with_masked_table(List *cmds)
|
||||
{
|
||||
if (cmds == NIL) {
|
||||
return false;
|
||||
}
|
||||
ListCell *lc = NULL;
|
||||
foreach (lc, cmds) {
|
||||
AlterTableCmd *cmd = (AlterTableCmd*)lfirst(lc);
|
||||
if (cmd->subtype == AT_ExchangePartition && cmd->exchange_with_rel != NULL) {
|
||||
Oid relid = RangeVarGetRelid(cmd->exchange_with_rel, NoLock, true);
|
||||
if (is_masked_relation(relid)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gsaudit_next_PostParseAnalyze_hook(ParseState *pstate, Query *query)
|
||||
{
|
||||
/* do nothing when enable_security_policy is off */
|
||||
|
|
@ -531,7 +559,7 @@ static void gsaudit_next_PostParseAnalyze_hook(ParseState *pstate, Query *query)
|
|||
enable_dml_auditing = true;
|
||||
}
|
||||
|
||||
if (u_sess->proc_cxt.IsNoMaskingInnerTools || (t_thrd.role != WORKER && t_thrd.role != THREADPOOL_WORKER) ||
|
||||
if (u_sess->proc_cxt.IsInnerMaintenanceTools || (t_thrd.role != WORKER && t_thrd.role != THREADPOOL_WORKER) ||
|
||||
(!enable_dml_auditing && !is_masking_policy_exist())) {
|
||||
if (next_post_parse_analyze_hook) {
|
||||
next_post_parse_analyze_hook(pstate, query);
|
||||
|
|
@ -628,24 +656,9 @@ static void gsaudit_next_PostParseAnalyze_hook(ParseState *pstate, Query *query)
|
|||
/* For ALTER TABLE EXCHANGE, will not allowed if the ordinary table(it's columns) has masking policy.*/
|
||||
if (query->utilityStmt != NULL && nodeTag(query->utilityStmt) == T_AlterTableStmt) {
|
||||
AlterTableStmt *alter_table = (AlterTableStmt *)(query->utilityStmt);
|
||||
Oid relid = RangeVarGetRelid(alter_table->relation, NoLock, true);
|
||||
|
||||
ListCell *lc = NULL;
|
||||
foreach (lc, alter_table->cmds) {
|
||||
AlterTableCmd *cmd = (AlterTableCmd *)lfirst(lc);
|
||||
if (cmd->subtype == AT_ExchangePartition) {
|
||||
Assert(PointerIsValid(cmd->exchange_with_rel));
|
||||
if (is_masked_relation(relid)) {
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("ALTER TABLE EXCHANGE can not execute with masked partition table.")));
|
||||
}
|
||||
|
||||
Oid ordTableOid = RangeVarGetRelid(cmd->exchange_with_rel, NoLock, true);
|
||||
if (is_masked_relation(ordTableOid)) {
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("ALTER TABLE EXCHANGE can not execute with masked ordinary table.")));
|
||||
}
|
||||
}
|
||||
if (exchange_partition_with_masked_table(alter_table->cmds)) {
|
||||
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("ALTER TABLE EXCHANGE can not execute with masked ordinary table.")));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -699,14 +712,7 @@ static inline bool get_prepare_command_object_name(Node *parsetree, RangeVar *&r
|
|||
}
|
||||
case T_UpdateStmt: {
|
||||
UpdateStmt *_stmt = (UpdateStmt *)parsetree;
|
||||
ListCell *l = NULL;
|
||||
foreach (l, _stmt->relationClause) {
|
||||
Node *n = (Node *)lfirst(l);
|
||||
if (IsA(n, RangeVar)) {
|
||||
rel = (RangeVar *)n;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
rel = _stmt->relation;
|
||||
return true;
|
||||
}
|
||||
case T_SelectStmt: {
|
||||
|
|
@ -727,7 +733,7 @@ static inline bool get_prepare_command_object_name(Node *parsetree, RangeVar *&r
|
|||
}
|
||||
case T_DeleteStmt: {
|
||||
DeleteStmt *_stmt = (DeleteStmt *)parsetree;
|
||||
rel = (RangeVar*)linitial(_stmt->relations);
|
||||
rel = _stmt->relation;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
|
@ -805,19 +811,19 @@ static void light_unified_audit_executor(const Query *query)
|
|||
access_audit_policy_run(query->rtable, query->commandType);
|
||||
}
|
||||
|
||||
static void gsaudit_ProcessUtility_hook(processutility_context* processutility_cxt,
|
||||
DestReceiver *dest, bool sentToRemote, char *completionTag, ProcessUtilityContext context,bool isCTAS = false)
|
||||
static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString, bool readOnlyTree, ParamListInfoData *params,
|
||||
bool isTopLevel, DestReceiver *dest, bool sentToRemote, char *completionTag, bool isCTAS = false)
|
||||
{
|
||||
/* do nothing when enable_security_policy is off */
|
||||
if (!u_sess->attr.attr_security.Enable_Security_Policy || !IsConnFromApp() ||
|
||||
u_sess->proc_cxt.IsInnerMaintenanceTools || IsConnFromCoord() ||
|
||||
!is_audit_policy_exist_load_policy_info()) {
|
||||
if (next_ProcessUtility_hook) {
|
||||
next_ProcessUtility_hook(processutility_cxt, dest, sentToRemote, completionTag,
|
||||
context, false);
|
||||
next_ProcessUtility_hook(parsetree, queryString, readOnlyTree, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
} else {
|
||||
standard_ProcessUtility(processutility_cxt, dest, sentToRemote, completionTag,
|
||||
context, false);
|
||||
standard_ProcessUtility(parsetree, queryString, readOnlyTree, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -831,7 +837,6 @@ static void gsaudit_ProcessUtility_hook(processutility_context* processutility_c
|
|||
checkSecurityPolicyFilter_hook(filter_item, &security_policy_ids);
|
||||
}
|
||||
RenameMap renamed_objects;
|
||||
Node* parsetree = processutility_cxt->parse_tree;
|
||||
if (parsetree != NULL) {
|
||||
switch (nodeTag(parsetree)) {
|
||||
case T_PlannedStmt: {
|
||||
|
|
@ -1610,11 +1615,11 @@ static void gsaudit_ProcessUtility_hook(processutility_context* processutility_c
|
|||
PG_TRY();
|
||||
{
|
||||
if (next_ProcessUtility_hook) {
|
||||
next_ProcessUtility_hook(processutility_cxt, dest, sentToRemote, completionTag,
|
||||
context, false);
|
||||
next_ProcessUtility_hook(parsetree, queryString, readOnlyTree, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
} else {
|
||||
standard_ProcessUtility(processutility_cxt, dest, sentToRemote, completionTag,
|
||||
context, false);
|
||||
standard_ProcessUtility(parsetree, queryString, readOnlyTree, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
}
|
||||
flush_access_logs(AUDIT_OK);
|
||||
send_mng_events(AUDIT_OK);
|
||||
|
|
@ -1777,7 +1782,7 @@ void install_audit_hook()
|
|||
* preserve the chains.
|
||||
*/
|
||||
next_ExecutorStart_hook = ExecutorStart_hook;
|
||||
next_ProcessUtility_hook = ProcessUtility_hook;
|
||||
set_gsaudit_prehook(ProcessUtility_hook);
|
||||
|
||||
/*
|
||||
* Install audit hooks, the interface for GaussDB kernel user as below
|
||||
|
|
@ -1817,6 +1822,15 @@ void install_label_hook()
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is used for setting prev_ProcessUtility to rewrite
|
||||
* standard_ProcessUtility by other extension.
|
||||
*/
|
||||
void set_gsaudit_prehook(ProcessUtility_hook_type func)
|
||||
{
|
||||
next_ProcessUtility_hook = func;
|
||||
}
|
||||
|
||||
/*
|
||||
* Define GUC variables and install hooks upon module load.
|
||||
* NOTE: _PG_init will be invoked(installed) many times
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ declare
|
|||
rd INTEGER;
|
||||
size INTEGER := pg_catalog.length(col);
|
||||
tmp text := col;
|
||||
res text := '';
|
||||
res text;
|
||||
begin
|
||||
while size > 0 loop
|
||||
rd := pg_catalog.floor(pg_catalog.random() * pg_catalog.length(tmp) + 1);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# security_plugin extension
|
||||
comment = 'provides security functionality'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/security_plugin'
|
||||
relocatable = true
|
||||
# security_plugin extension
|
||||
comment = 'provides security functionality'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/security_plugin'
|
||||
relocatable = true
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ static void sepgsql_executor_start(QueryDesc* queryDesc, int eflags)
|
|||
* It tries to rough-grained control on utility commands; some of them can
|
||||
* break whole of the things if nefarious user would use.
|
||||
*/
|
||||
static void sepgsql_utility_command(processutility_context* processutility_cxt,
|
||||
static void sepgsql_utility_command(Node* parsetree, const char* queryString, bool readOnlyTree, ParamListInfo params, bool isTopLevel,
|
||||
DestReceiver* dest,
|
||||
#ifdef PGXC
|
||||
bool sentToRemote,
|
||||
|
|
@ -251,7 +251,6 @@ static void sepgsql_utility_command(processutility_context* processutility_cxt,
|
|||
{
|
||||
sepgsql_context_info_t saved_context_info = sepgsql_context_info;
|
||||
ListCell* cell = NULL;
|
||||
Node* parsetree = processutility_cxt->parse_tree;
|
||||
|
||||
PG_TRY();
|
||||
{
|
||||
|
|
@ -301,14 +300,22 @@ static void sepgsql_utility_command(processutility_context* processutility_cxt,
|
|||
}
|
||||
|
||||
if (next_ProcessUtility_hook)
|
||||
(*next_ProcessUtility_hook)(processutility_cxt,
|
||||
(*next_ProcessUtility_hook)(parsetree,
|
||||
queryString,
|
||||
readOnlyTree,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif
|
||||
completionTag);
|
||||
else
|
||||
standard_ProcessUtility(processutility_cxt,
|
||||
standard_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
readOnlyTree,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ static void print_literal(StringInfo s, Oid typid, char* outputstr)
|
|||
/*
|
||||
* Decode tuple into stringinfo.
|
||||
*/
|
||||
static void TupleToStringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple)
|
||||
static void TupleToStringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
|
||||
{
|
||||
Assert(tuple != NULL);
|
||||
if ((tuple->tupTableType == HEAP_TUPLE) && (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data) ||
|
||||
|
|
@ -315,6 +315,10 @@ static void TupleToStringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple)
|
|||
origval = uheap_getattr((UHeapTuple)tuple, natt + 1, tupdesc, &isnull);
|
||||
}
|
||||
|
||||
if (skip_nulls && isnull) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* query output function */
|
||||
Oid typid = attr->atttypid; /* type of current attribute */
|
||||
getTypeOutputInfo(typid, &typoutput, &typisvarlena);
|
||||
|
|
@ -339,7 +343,7 @@ static void TupleToStringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple)
|
|||
* Decode tuple into stringinfo.
|
||||
* This function is used for UPDATE or DELETE statements.
|
||||
*/
|
||||
static void TupleToStringinfoUpd(Relation relation, StringInfo s, TupleDesc tupdesc, HeapTuple tuple)
|
||||
static void TupleToStringinfoUpd(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
|
||||
{
|
||||
if ((tuple->tupTableType == HEAP_TUPLE) && (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data) ||
|
||||
(int)HeapTupleHeaderGetNatts(tuple->t_data, tupdesc) > tupdesc->natts)) {
|
||||
|
|
@ -356,7 +360,7 @@ static void TupleToStringinfoUpd(Relation relation, StringInfo s, TupleDesc tupd
|
|||
|
||||
Form_pg_attribute attr = &tupdesc->attrs[natt]; /* the attribute itself */
|
||||
|
||||
if (attr->attisdropped || attr->attnum < 0 || !IsRelationReplidentKey(relation, attr->attnum)) {
|
||||
if (attr->attisdropped || attr->attnum < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -367,6 +371,10 @@ static void TupleToStringinfoUpd(Relation relation, StringInfo s, TupleDesc tupd
|
|||
origval = uheap_getattr((UHeapTuple)tuple, natt + 1, tupdesc, &isnull);
|
||||
}
|
||||
|
||||
if (isnull && skip_nulls) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isFirstAtt) {
|
||||
appendStringInfoString(s, " and ");
|
||||
} else {
|
||||
|
|
@ -395,32 +403,31 @@ static void TupleToStringinfoUpd(Relation relation, StringInfo s, TupleDesc tupd
|
|||
* Callback for handle decoded tuple.
|
||||
* Additional info will be added if the tuple is found null.
|
||||
*/
|
||||
static void TupleHandler(Relation relation, StringInfo s, TupleDesc tupdesc, ReorderBufferChange* change,
|
||||
bool isHeap, bool isNewTuple)
|
||||
static void TupleHandler(StringInfo s, TupleDesc tupdesc, ReorderBufferChange* change, bool isHeap, bool isNewTuple)
|
||||
{
|
||||
if (isHeap && isNewTuple) {
|
||||
if (change->data.tp.newtuple == NULL) {
|
||||
appendStringInfoString(s, " (no-tuple-data)");
|
||||
} else {
|
||||
TupleToStringinfo(s, tupdesc, &change->data.tp.newtuple->tuple);
|
||||
TupleToStringinfo(s, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
}
|
||||
} else if (isHeap && !isNewTuple) {
|
||||
if (change->data.tp.oldtuple == NULL) {
|
||||
appendStringInfoString(s, " (no-tuple-data)");
|
||||
} else {
|
||||
TupleToStringinfoUpd(relation, s, tupdesc, &change->data.tp.oldtuple->tuple);
|
||||
TupleToStringinfoUpd(s, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
}
|
||||
} else if (!isHeap && isNewTuple) {
|
||||
if (change->data.utp.newtuple == NULL) {
|
||||
appendStringInfoString(s, " (no-tuple-data)");
|
||||
} else {
|
||||
TupleToStringinfo(s, tupdesc, (HeapTuple)(&change->data.utp.newtuple->tuple));
|
||||
TupleToStringinfo(s, tupdesc, (HeapTuple)(&change->data.utp.newtuple->tuple), false);
|
||||
}
|
||||
} else {
|
||||
if (change->data.utp.oldtuple == NULL) {
|
||||
appendStringInfoString(s, " (no-tuple-data)");
|
||||
} else {
|
||||
TupleToStringinfoUpd(relation, s, tupdesc, (HeapTuple)(&change->data.utp.oldtuple->tuple));
|
||||
TupleToStringinfoUpd(s, tupdesc, (HeapTuple)(&change->data.utp.oldtuple->tuple), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -465,7 +472,7 @@ static void pg_decode_change(
|
|||
isHeap = false;
|
||||
}
|
||||
appendStringInfoString(ctx->out, " values ");
|
||||
TupleHandler(relation, ctx->out, tupdesc, change, isHeap, true);
|
||||
TupleHandler(ctx->out, tupdesc, change, isHeap, true);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UPDATE:
|
||||
case REORDER_BUFFER_CHANGE_UUPDATE:
|
||||
|
|
@ -476,12 +483,12 @@ static void pg_decode_change(
|
|||
isHeap = false;
|
||||
}
|
||||
appendStringInfoString(ctx->out, " where ");
|
||||
TupleHandler(relation, ctx->out, tupdesc, change, isHeap, false);
|
||||
TupleHandler(ctx->out, tupdesc, change, isHeap, false);
|
||||
appendStringInfoChar(ctx->out, ';');
|
||||
appendStringInfoString(ctx->out, "insert into ");
|
||||
appendStringInfoString(ctx->out, quote_qualified_identifier(schema, table));
|
||||
appendStringInfoString(ctx->out, " values ");
|
||||
TupleHandler(relation, ctx->out, tupdesc, change, isHeap, true);
|
||||
TupleHandler(ctx->out, tupdesc, change, isHeap, true);
|
||||
|
||||
break;
|
||||
|
||||
|
|
@ -495,7 +502,7 @@ static void pg_decode_change(
|
|||
}
|
||||
appendStringInfoString(ctx->out, " where ");
|
||||
|
||||
TupleHandler(relation, ctx->out, tupdesc, change, isHeap, false);
|
||||
TupleHandler(ctx->out, tupdesc, change, isHeap, false);
|
||||
break;
|
||||
default:
|
||||
Assert(false);
|
||||
|
|
|
|||
|
|
@ -199,13 +199,15 @@ static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id)
|
|||
return true;
|
||||
return false;
|
||||
}
|
||||
static void tuple_to_stringinfo(Relation relation, StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool isOld)
|
||||
static void tuple_to_stringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
|
||||
{
|
||||
if ((tuple->tupTableType == HEAP_TUPLE) && (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data) ||
|
||||
(int)HeapTupleHeaderGetNatts(tuple->t_data, tupdesc) > tupdesc->natts)) {
|
||||
if (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data))
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int)HeapTupleHeaderGetNatts(tuple->t_data, tupdesc) != tupdesc->natts)
|
||||
return;
|
||||
|
||||
int natt;
|
||||
Oid oid;
|
||||
|
||||
/* print oid of tuple, it's not included in the TupleDesc */
|
||||
|
|
@ -214,8 +216,9 @@ static void tuple_to_stringinfo(Relation relation, StringInfo s, TupleDesc tupde
|
|||
}
|
||||
|
||||
/* print all columns individually */
|
||||
for (int natt = 0; natt < tupdesc->natts; natt++) {
|
||||
for (natt = 0; natt < tupdesc->natts; natt++) {
|
||||
Form_pg_attribute attr; /* the attribute itself */
|
||||
Oid typid; /* type of current attribute */
|
||||
Oid typoutput; /* output function */
|
||||
bool typisvarlena = false;
|
||||
Datum origval; /* possibly toasted Datum */
|
||||
|
|
@ -234,17 +237,16 @@ static void tuple_to_stringinfo(Relation relation, StringInfo s, TupleDesc tupde
|
|||
* Don't print system columns, oid will already have been printed if
|
||||
* present.
|
||||
*/
|
||||
if (attr->attnum < 0 || (isOld && !IsRelationReplidentKey(relation, attr->attnum)))
|
||||
if (attr->attnum < 0)
|
||||
continue;
|
||||
|
||||
Oid typid = attr->atttypid; /* type of current attribute */
|
||||
typid = attr->atttypid;
|
||||
|
||||
/* get Datum from tuple */
|
||||
if (tuple->tupTableType == HEAP_TUPLE) {
|
||||
origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull);
|
||||
} else {
|
||||
origval = uheap_getattr((UHeapTuple)tuple, natt + 1, tupdesc, &isnull);
|
||||
}
|
||||
origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull);
|
||||
|
||||
if (isnull && skip_nulls)
|
||||
continue;
|
||||
|
||||
/* print attribute name */
|
||||
appendStringInfoChar(s, ' ');
|
||||
|
|
@ -325,40 +327,20 @@ static void pg_decode_change(
|
|||
if (change->data.tp.newtuple == NULL)
|
||||
appendStringInfoString(ctx->out, " (no-tuple-data)");
|
||||
else
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UINSERT:
|
||||
appendStringInfoString(ctx->out, " INSERT:");
|
||||
if (change->data.utp.newtuple == NULL)
|
||||
appendStringInfoString(ctx->out, " (no-tuple-data)");
|
||||
else
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, (HeapTuple)(&change->data.utp.newtuple->tuple), false);
|
||||
tuple_to_stringinfo(ctx->out, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UPDATE:
|
||||
appendStringInfoString(ctx->out, " UPDATE:");
|
||||
if (change->data.tp.oldtuple != NULL) {
|
||||
appendStringInfoString(ctx->out, " old-key:");
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
tuple_to_stringinfo(ctx->out, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
appendStringInfoString(ctx->out, " new-tuple:");
|
||||
}
|
||||
|
||||
if (change->data.tp.newtuple == NULL)
|
||||
appendStringInfoString(ctx->out, " (no-tuple-data)");
|
||||
else
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UUPDATE:
|
||||
appendStringInfoString(ctx->out, " UPDATE:");
|
||||
if (change->data.utp.oldtuple != NULL) {
|
||||
appendStringInfoString(ctx->out, " old-key:");
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, (HeapTuple)(&change->data.utp.oldtuple->tuple), true);
|
||||
appendStringInfoString(ctx->out, " new-tuple:");
|
||||
}
|
||||
|
||||
if (change->data.utp.newtuple == NULL)
|
||||
appendStringInfoString(ctx->out, " (no-tuple-data)");
|
||||
else
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, (HeapTuple)(&change->data.utp.newtuple->tuple), false);
|
||||
tuple_to_stringinfo(ctx->out, tupdesc, &change->data.tp.newtuple->tuple, false);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_DELETE:
|
||||
appendStringInfoString(ctx->out, " DELETE:");
|
||||
|
|
@ -368,15 +350,7 @@ static void pg_decode_change(
|
|||
appendStringInfoString(ctx->out, " (no-tuple-data)");
|
||||
/* In DELETE, only the replica identity is present; display that */
|
||||
else
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UDELETE:
|
||||
appendStringInfoString(ctx->out, " DELETE:");
|
||||
|
||||
if (change->data.utp.oldtuple == NULL)
|
||||
appendStringInfoString(ctx->out, " (no-tuple-data)");
|
||||
else
|
||||
tuple_to_stringinfo(relation, ctx->out, tupdesc, (HeapTuple)(&change->data.utp.oldtuple->tuple), true);
|
||||
tuple_to_stringinfo(ctx->out, tupdesc, &change->data.tp.oldtuple->tuple, true);
|
||||
break;
|
||||
default:
|
||||
Assert(false);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<repoType>Generic</repoType>
|
||||
<id>
|
||||
<offering>DOPRA SSP</offering>
|
||||
<version>DOPRA SSP V300R021C10SPC120B500</version>
|
||||
<version>DOPRA SSP V300R021C10SPC010B100</version>
|
||||
</id>
|
||||
<copies>
|
||||
<copy>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
<repoType>Generic</repoType>
|
||||
<id>
|
||||
<offering>BiSheng JDK Enterprise</offering>
|
||||
<version>BiSheng JDK Enterprise 2.1.0.330.B003</version>
|
||||
<version>BiSheng JDK Enterprise 2.1.0.320.B001</version>
|
||||
</id>
|
||||
<copies>
|
||||
<copy>
|
||||
|
|
|
|||
|
|
@ -233,11 +233,6 @@
|
|||
<entry>security labels on database objects</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><link linkend="catalog-pg-set"><structname>pg_set</structname></link></entry>
|
||||
<entry>set label and value definitions</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link></entry>
|
||||
<entry>dependencies on shared objects</entry>
|
||||
|
|
@ -1387,16 +1382,6 @@
|
|||
<entry>Password expiry time (only used for password authentication);
|
||||
null if no expiration</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><structfield>rolpasswordext</structfield></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>
|
||||
Password for other database encrypt rule if exists.
|
||||
If we created a B compatibility database, sha1(sha1(password)) will
|
||||
be stored here according to mysql_native_password strategy.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue