forked from openGauss-Ecosystem/openGauss-server
Compare commits
259 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
5c97f84e91 | |
|
|
68447494a4 | |
|
|
2951c00316 | |
|
|
f2b1038e12 | |
|
|
e9310d2976 | |
|
|
7029e5f016 | |
|
|
88e9160ad0 | |
|
|
404009bab0 | |
|
|
46134f7305 | |
|
|
5f6c9616a6 | |
|
|
f5c8dfd75b | |
|
|
fd2d247b4c | |
|
|
38973b0519 | |
|
|
a393a0988a | |
|
|
eb6f124dee | |
|
|
1a512ca82d | |
|
|
8106e23629 | |
|
|
2142246c60 | |
|
|
f6cd6f650e | |
|
|
bd163157ad | |
|
|
6584b8ff9e | |
|
|
47d345bc83 | |
|
|
3791143129 | |
|
|
1eee74fc30 | |
|
|
4d1c7b1a82 | |
|
|
6ffadffa5c | |
|
|
eec3c1d634 | |
|
|
c7e3c702a2 | |
|
|
98fc84f790 | |
|
|
d1cb9a377f | |
|
|
a7daf5ac3e | |
|
|
bad6703ab1 | |
|
|
692cd93a19 | |
|
|
ccd3eceecc | |
|
|
e8a0efc9c0 | |
|
|
cccbdebfbf | |
|
|
54e8b987b2 | |
|
|
5e0f4cdc3b | |
|
|
9e884c1073 | |
|
|
3276228499 | |
|
|
a0c190f19b | |
|
|
f87c380fea | |
|
|
84801fc880 | |
|
|
f33c2bca58 | |
|
|
1d0cca0689 | |
|
|
cd329d4636 | |
|
|
feb32b6c04 | |
|
|
fb6329d9d6 | |
|
|
a0fae7338c | |
|
|
41125fd93d | |
|
|
d9c1282ff4 | |
|
|
044f55ab0b | |
|
|
3aa0d7736a | |
|
|
fecdeb4f99 | |
|
|
ff7124c0bd | |
|
|
76491de228 | |
|
|
f916fcd84e | |
|
|
38802d405a | |
|
|
1a6ee507cc | |
|
|
7552d5a3a7 | |
|
|
e52a1eb067 | |
|
|
ddd954bd3c | |
|
|
0413e7f1b0 | |
|
|
df6a619b4c | |
|
|
897ea8b9fb | |
|
|
e39c152f65 | |
|
|
62e42c25d3 | |
|
|
cd1b328e22 | |
|
|
8922430919 | |
|
|
b4c82fb41c | |
|
|
6346315bfe | |
|
|
baa1414993 | |
|
|
90c8169f18 | |
|
|
06d4c6ee4a | |
|
|
66244cdee0 | |
|
|
01bc7a3f5d | |
|
|
63080b2d37 | |
|
|
c5e88b3be7 | |
|
|
800396f61b | |
|
|
2e691bd9cd | |
|
|
4d633b8364 | |
|
|
cd9f6b490c | |
|
|
7c57e5975b | |
|
|
a976745182 | |
|
|
e0241f088b | |
|
|
3afb086f4d | |
|
|
a81495043c | |
|
|
2544f59021 | |
|
|
653b534bd2 | |
|
|
f042f6fe7c | |
|
|
288cd473c3 | |
|
|
a1559e3e8b | |
|
|
7335c381a7 | |
|
|
40e02971c2 | |
|
|
a53d22a0ad | |
|
|
dc21219e6d | |
|
|
c1e1948931 | |
|
|
6b32ac9484 | |
|
|
3f7bf26194 | |
|
|
1894187ba7 | |
|
|
2a078bf0b8 | |
|
|
a45bfae25a | |
|
|
39e0320615 | |
|
|
7d3b2c03c3 | |
|
|
0c469e5f2a | |
|
|
e7a99b76c1 | |
|
|
79de533005 | |
|
|
0039280728 | |
|
|
332fc7da41 | |
|
|
92dfe1863e | |
|
|
74914a8da7 | |
|
|
b53f15e104 | |
|
|
55cebcb77f | |
|
|
6095f81310 | |
|
|
bffa58e13e | |
|
|
2e621a804f | |
|
|
f53c24ea8b | |
|
|
3a9585c0b0 | |
|
|
c8f5943251 | |
|
|
3c344a205f | |
|
|
9b108988a6 | |
|
|
15060bf00f | |
|
|
4c8204e7f4 | |
|
|
3a848f7323 | |
|
|
7efcd00a66 | |
|
|
44a75e3e28 | |
|
|
6530335e38 | |
|
|
e621c4edd7 | |
|
|
227d200aba | |
|
|
9a805c2eef | |
|
|
0c77d0027e | |
|
|
12ba820996 | |
|
|
bf074c9975 | |
|
|
e883989fb2 | |
|
|
8437e63439 | |
|
|
ed8c0638ff | |
|
|
f2fa1e1ba1 | |
|
|
b992e1957e | |
|
|
2798e7d19e | |
|
|
88ed60395a | |
|
|
54d7584191 | |
|
|
be6071eebd | |
|
|
46b4dac18d | |
|
|
a0260b81fb | |
|
|
3be0488ab1 | |
|
|
9b7170c6c1 | |
|
|
28270e72ed | |
|
|
2f29eeae78 | |
|
|
20c4bf07fe | |
|
|
25cbdcf6ce | |
|
|
6f091037b2 | |
|
|
a8f77a4678 | |
|
|
552ee3298a | |
|
|
683d8be157 | |
|
|
430acfbd84 | |
|
|
e605dc5aba | |
|
|
04a116ea22 | |
|
|
ad7eb165cf | |
|
|
fbf4fc2861 | |
|
|
616cf713ff | |
|
|
12da7491f1 | |
|
|
f1d24398d4 | |
|
|
afdf9b9858 | |
|
|
d2bcd8ca96 | |
|
|
8179d400ae | |
|
|
0a568bd991 | |
|
|
aaac084d7f | |
|
|
1ead26832f | |
|
|
96c50c0a81 | |
|
|
3cfa51a9c1 | |
|
|
5d67447ae3 | |
|
|
654e407446 | |
|
|
4f106fe8a3 | |
|
|
28c087e456 | |
|
|
ee99e11525 | |
|
|
f3d1def27a | |
|
|
4ce17d47de | |
|
|
cbeba1779e | |
|
|
52d009c6ae | |
|
|
70838dbbab | |
|
|
714954a06f | |
|
|
50db19b62c | |
|
|
a7dae44b62 | |
|
|
6fc31000c6 | |
|
|
b11082c4af | |
|
|
7ab4eebf6a | |
|
|
e911707543 | |
|
|
89b6c03df0 | |
|
|
96a41cfdd8 | |
|
|
5df7418564 | |
|
|
4bfd4765e0 | |
|
|
f5b5da8c00 | |
|
|
6736b6e2bf | |
|
|
d895a5767c | |
|
|
4e60932817 | |
|
|
c63a880e8a | |
|
|
dc5fc6299d | |
|
|
e1c5cb8c73 | |
|
|
a1c81e7ce5 | |
|
|
301ac8502e | |
|
|
cdd0841585 | |
|
|
d69e333d76 | |
|
|
dee07756d5 | |
|
|
324994809b | |
|
|
a5554872c0 | |
|
|
6d9302928f | |
|
|
ae26a4b680 | |
|
|
f70512b3e1 | |
|
|
9fae85b375 | |
|
|
88a0533c0b | |
|
|
9dfce8735a | |
|
|
6939022cdf | |
|
|
6bc3fae656 | |
|
|
17049c589d | |
|
|
f28c85bb15 | |
|
|
e266ff1896 | |
|
|
9a1542b4ab | |
|
|
c62aa81f3e | |
|
|
998f4a0fa6 | |
|
|
8bca669066 | |
|
|
ee791bd720 | |
|
|
8a2b19a1cf | |
|
|
07d4a897dd | |
|
|
b1377ef6a4 | |
|
|
5d64306497 | |
|
|
90433cd603 | |
|
|
b95ba5bc17 | |
|
|
8b7319f2cf | |
|
|
30971ad56e | |
|
|
56d56689dc | |
|
|
1ce0d3bc9a | |
|
|
c86cd03855 | |
|
|
705a139012 | |
|
|
a6ff7b5fff | |
|
|
4b966bc1cb | |
|
|
40612feeac | |
|
|
fb013d16f6 | |
|
|
5ee0248876 | |
|
|
b3e4d5a60d | |
|
|
43a3b0b2db | |
|
|
a493c304c4 | |
|
|
127a821823 | |
|
|
1e8931d6e4 | |
|
|
6b5e8d599a | |
|
|
c17ac270e8 | |
|
|
1e46d1b4ca | |
|
|
c85eab2542 | |
|
|
8fc10a08b1 | |
|
|
87ff1d3c76 | |
|
|
6e6eb8708c | |
|
|
f8003325cb | |
|
|
707f627e9c | |
|
|
8793cac1c6 | |
|
|
f1ab25ed55 | |
|
|
c6cf59f29f | |
|
|
36e8a88c7a | |
|
|
a5410b7f86 | |
|
|
c711c7dc5f | |
|
|
3bea35e8c1 |
|
|
@ -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
|
||||
|
|
@ -66,9 +66,9 @@ if("${GCC_VERSION}" STREQUAL "7.3.0")
|
|||
set(GCC_VERSION_LIT 7.3)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND uname -p OUTPUT_VARIABLE CURRENT_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if("$ENV{BUILD_TUPLE}" STREQUAL "")
|
||||
execute_process(COMMAND uname -p OUTPUT_VARIABLE CURRENT_TUPLE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(BUILD_TUPLE ${CURRENT_TUPLE})
|
||||
set(BUILD_TUPLE ${CURRENT_ARCH})
|
||||
else()
|
||||
set(BUILD_TUPLE $ENV{BUILD_TUPLE})
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -93,8 +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
|
||||
endif
|
||||
|
|
|
|||
1
License
1
License
|
|
@ -1,3 +1,4 @@
|
|||
木兰宽松许可证, 第2版
|
||||
木兰宽松许可证, 第2版
|
||||
|
||||
2020年1月 http://license.coscl.org.cn/MulanPSL2
|
||||
|
|
|
|||
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
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@
|
|||
./share/postgresql/extension/hstore--1.0--1.1.sql
|
||||
./share/postgresql/extension/log_fdw--1.0.sql
|
||||
./share/postgresql/extension/log_fdw.control
|
||||
./share/postgresql/extension/packages--1.0.sql
|
||||
./share/postgresql/extension/packages--1.0--1.1.sql
|
||||
./share/postgresql/extension/packages.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -614,6 +617,23 @@
|
|||
./share/postgresql/timezone/Asia/Yakutsk
|
||||
./share/postgresql/timezone/Asia/Magadan
|
||||
./share/postgresql/timezone/Asia/Amman
|
||||
./share/postgresql/timezone/Asia/Barnaul
|
||||
./share/postgresql/timezone/Asia/Chita
|
||||
./share/postgresql/timezone/Asia/Tomsk
|
||||
./share/postgresql/timezone/Asia/Atyrau
|
||||
./share/postgresql/timezone/Asia/Famagusta
|
||||
./share/postgresql/timezone/Asia/Qostanay
|
||||
./share/postgresql/timezone/Asia/Srednekolymsk
|
||||
./share/postgresql/timezone/Asia/Yangon
|
||||
./share/postgresql/timezone/Pacific/Bougainville
|
||||
./share/postgresql/timezone/Antarctica/Troll
|
||||
./share/postgresql/timezone/Europe/Astrakhan
|
||||
./share/postgresql/timezone/Europe/Ulyanovsk
|
||||
./share/postgresql/timezone/Europe/Kirov
|
||||
./share/postgresql/timezone/Europe/Saratov
|
||||
./share/postgresql/timezone/America/Fort_Nelson
|
||||
./share/postgresql/timezone/America/Nuuk
|
||||
./share/postgresql/timezone/America/Punta_Arenas
|
||||
./share/postgresql/timezone/Asia/Kuching
|
||||
./share/postgresql/timezone/Asia/Novosibirsk
|
||||
./share/postgresql/timezone/Asia/Seoul
|
||||
|
|
@ -670,25 +690,43 @@
|
|||
./share/postgresql/timezonesets/Etc.txt
|
||||
./share/postgresql/postgres.bki
|
||||
./share/sslcert/gsql/openssl.cnf
|
||||
./lib/libnuma.so*
|
||||
./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/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/liblz4.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libcjson_utils.so*
|
||||
./lib/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.3
|
||||
./lib/libcjson.so
|
||||
./lib/libcjson.so.1
|
||||
./lib/libcjson.so.1.7.15
|
||||
./lib/libcjson_utils.so
|
||||
./lib/libcjson_utils.so.1
|
||||
./lib/libcjson_utils.so.1.7.15
|
||||
./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
|
||||
|
|
@ -727,7 +765,6 @@
|
|||
./lib/postgresql/pg_upgrade_support.so
|
||||
./lib/postgresql/latin2_and_win1250.so
|
||||
./lib/postgresql/euc2004_sjis2004.so
|
||||
./lib/postgresql/pgoutput.so
|
||||
./include/postgresql/server/postgres_ext.h
|
||||
./include/postgresql/server/pg_config_os.h
|
||||
./include/postgresql/server/pgtime.h
|
||||
|
|
@ -882,13 +919,14 @@
|
|||
./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
|
||||
|
|
@ -904,4 +942,4 @@
|
|||
./include/pqcomm.h
|
||||
./include/pqexpbuffer.h
|
||||
[version]
|
||||
5.0.0
|
||||
3.0.3
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -66,8 +60,6 @@
|
|||
./share/postgresql/extension/hstore.control
|
||||
./share/postgresql/extension/security_plugin.control
|
||||
./share/postgresql/extension/security_plugin--1.0.sql
|
||||
./share/postgresql/extension/dolphin.control
|
||||
./share/postgresql/extension/dolphin--1.0.sql
|
||||
./share/postgresql/extension/file_fdw--1.0.sql
|
||||
./share/postgresql/extension/plpgsql.control
|
||||
./share/postgresql/extension/dist_fdw.control
|
||||
|
|
@ -83,9 +75,6 @@
|
|||
./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
|
||||
|
|
@ -658,6 +647,23 @@
|
|||
./share/postgresql/timezone/Asia/Yakutsk
|
||||
./share/postgresql/timezone/Asia/Magadan
|
||||
./share/postgresql/timezone/Asia/Amman
|
||||
./share/postgresql/timezone/Asia/Barnaul
|
||||
./share/postgresql/timezone/Asia/Chita
|
||||
./share/postgresql/timezone/Asia/Tomsk
|
||||
./share/postgresql/timezone/Asia/Atyrau
|
||||
./share/postgresql/timezone/Asia/Famagusta
|
||||
./share/postgresql/timezone/Asia/Qostanay
|
||||
./share/postgresql/timezone/Asia/Srednekolymsk
|
||||
./share/postgresql/timezone/Asia/Yangon
|
||||
./share/postgresql/timezone/Pacific/Bougainville
|
||||
./share/postgresql/timezone/Antarctica/Troll
|
||||
./share/postgresql/timezone/Europe/Astrakhan
|
||||
./share/postgresql/timezone/Europe/Ulyanovsk
|
||||
./share/postgresql/timezone/Europe/Kirov
|
||||
./share/postgresql/timezone/Europe/Saratov
|
||||
./share/postgresql/timezone/America/Fort_Nelson
|
||||
./share/postgresql/timezone/America/Nuuk
|
||||
./share/postgresql/timezone/America/Punta_Arenas
|
||||
./share/postgresql/timezone/Asia/Kuching
|
||||
./share/postgresql/timezone/Asia/Novosibirsk
|
||||
./share/postgresql/timezone/Asia/Seoul
|
||||
|
|
@ -756,11 +762,9 @@
|
|||
./lib/postgresql/pg_plugin
|
||||
./lib/postgresql/proc_srclib
|
||||
./lib/postgresql/security_plugin.so
|
||||
./lib/postgresql/dolphin.so
|
||||
./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
|
||||
|
|
@ -774,11 +778,18 @@
|
|||
./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 +803,59 @@
|
|||
./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/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.3
|
||||
./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
|
||||
|
|
@ -830,12 +872,12 @@
|
|||
./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 +1061,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 +1170,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 +1189,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,41 +1374,57 @@
|
|||
./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
|
||||
./lib/libpq.so.5
|
||||
./lib/libpq.so.5.5
|
||||
./lib/libpq_ce.so
|
||||
./lib/libpq_ce.so.5
|
||||
./lib/libpq_ce.so.5.5
|
||||
./lib/libgauss_cl_jni.so
|
||||
./lib/libconfig.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libstdc++.so.6
|
||||
./lib/libssl.so*
|
||||
./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)
|
||||
|
|
@ -162,4 +169,4 @@ function main()
|
|||
}
|
||||
main
|
||||
echo "now, all build has finished!"
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
@ -442,7 +442,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 +454,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
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
PRODUCT=openGauss
|
||||
VERSION=5.0.0
|
||||
VERSION=3.0.3
|
||||
|
|
@ -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
|
||||
|
|
@ -60,8 +60,6 @@
|
|||
./share/postgresql/extension/hstore.control
|
||||
./share/postgresql/extension/security_plugin.control
|
||||
./share/postgresql/extension/security_plugin--1.0.sql
|
||||
./share/postgresql/extension/dolphin.control
|
||||
./share/postgresql/extension/dolphin--1.0.sql
|
||||
./share/postgresql/extension/file_fdw--1.0.sql
|
||||
./share/postgresql/extension/plpgsql.control
|
||||
./share/postgresql/extension/dist_fdw.control
|
||||
|
|
@ -82,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
|
||||
|
|
@ -754,11 +749,9 @@
|
|||
./lib/postgresql/pg_plugin
|
||||
./lib/postgresql/proc_srclib
|
||||
./lib/postgresql/security_plugin.so
|
||||
./lib/postgresql/dolphin.so
|
||||
./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 +880,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 +1045,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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,7 +27,7 @@ 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
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +64,7 @@ function get_kernel_commitid()
|
|||
{
|
||||
export PATH=${BUILD_DIR}:$PATH
|
||||
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
|
||||
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | awk '{print $5}' | cut -d ")" -f 1)
|
||||
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | awk '{print $5}' | cut -d ")" -f 1)
|
||||
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
|
||||
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,34 +65,54 @@ 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"
|
||||
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 [[ -f "/etc/euleros-release" ]]; then
|
||||
dist_version="EulerOS"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
elif [[ -f "/etc/centos-release" ]]; then
|
||||
os_name="CentOS"
|
||||
dist_version="CentOS"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
|
||||
fi
|
||||
elif [[ -f "/etc/openEuler-release" ]]; then
|
||||
os_name="openEuler"
|
||||
elif [[ -f "/etc/FusionOS-release" ]]; then
|
||||
os_name="FusionOS"
|
||||
dist_version="openEuler"
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
|
||||
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE"
|
||||
fi
|
||||
elif [[ -f "/etc/kylin-release" ]]; then
|
||||
os_name="Kylin"
|
||||
elif [[ -f "/etc/asianux-release" ]]; then
|
||||
os_name="Asianux"
|
||||
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
|
||||
|
|
@ -94,6 +123,16 @@ else
|
|||
die "${binarylib_dir} doesn't exist."
|
||||
fi
|
||||
|
||||
# 小型化
|
||||
declare lite_dist_version=${dist_version}
|
||||
if [ "${lite_dist_version}" == "openEuler" ]; then
|
||||
lite_dist_version="OPENEULER"
|
||||
elif [ "${lite_dist_version}" == "Kylin" ]; then
|
||||
lite_dist_version="LYLIN"
|
||||
elif [ "${lite_dist_version}" == "EulerOS" ]; then
|
||||
lite_dist_version="EULER"
|
||||
fi
|
||||
|
||||
declare INSTALL_TOOLS_DIR=${binarylib_dir}/install_tools
|
||||
declare UNIX_ODBC="${BINARYLIBS_PATH}/unixodbc"
|
||||
|
||||
|
|
@ -106,8 +145,9 @@ export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_
|
|||
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
|
||||
export JAVA_HOME=${PLATFORM_PATH}/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"
|
||||
|
|
@ -127,10 +167,16 @@ 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"
|
||||
declare sha256_name="${lite_package_pre_name}.sha256"
|
||||
declare lite_package_pre_name="GaussDB-Kernel-V500R002C10-${lite_dist_version}-${PLATFORM}bit"
|
||||
declare lite_kernel_package_name="${lite_package_pre_name}.bin"
|
||||
declare lite_libpq_package_name="${lite_package_pre_name}-Libpq.tar.gz"
|
||||
declare lite_symbol_package_name="${lite_package_pre_name}-symbol.tar.gz"
|
||||
declare lite_sha256_name="${lite_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,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: package opengauss lite
|
||||
# Return 0 means OK.
|
||||
# Return 1 means failed.
|
||||
# version: 1.0
|
||||
# date: 2022-04-10
|
||||
#######################################################################
|
||||
|
||||
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
|
||||
|
||||
|
|
@ -39,24 +45,24 @@ function target_file_copy()
|
|||
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
|
||||
echo "Begin generate ${lite_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
|
||||
${BUILD_TOOLS_PATH}/p7z/bin/7z a -t7z -sfx "${lite_kernel_package_name}" ./* >> "$LOG_FILE" 2>&1
|
||||
cd '-'
|
||||
mv $2/"${kernel_package_name}" ./
|
||||
mv $2/"${lite_kernel_package_name}" ./
|
||||
if [ $? -ne 0 ]; then
|
||||
die "generate ${kernel_package_name} failed."
|
||||
die "generate ${lite_kernel_package_name} failed."
|
||||
fi
|
||||
echo "End generate ${kernel_package_name} tar file" >> "$LOG_FILE" 2>&1
|
||||
echo "End generate ${lite_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}"
|
||||
sha256_name="${lite_sha256_name}"
|
||||
echo "Begin generate ${lite_sha256_name} sha256 file..." >> "$LOG_FILE" 2>&1
|
||||
sha256sum "${lite_kernel_package_name}" | awk -F" " '{print $1}' > "${lite_sha256_name}"
|
||||
if [ $? -ne 0 ]; then
|
||||
die "generate sha256 file failed."
|
||||
fi
|
||||
echo "End generate ${sha256_name} sha256 file" >> "$LOG_FILE" 2>&1
|
||||
echo "End generate ${lite_sha256_name} sha256 file" >> "$LOG_FILE" 2>&1
|
||||
if [ -d "${2}" ]; then
|
||||
rm -rf ${2}
|
||||
fi
|
||||
|
|
@ -101,8 +107,8 @@ function separate_symbol()
|
|||
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
|
||||
mv symbols.tar.gz $lite_symbol_package_name
|
||||
deploy_pkgs $lite_symbol_package_name
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -142,10 +148,10 @@ function make_package_srv()
|
|||
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"
|
||||
cp ${BUILD_DIR}/"${lite_kernel_package_name}" ./
|
||||
cp ${BUILD_DIR}/"${lite_sha256_name}" ./
|
||||
tar -czf "${lite_package_pre_name}.tar.gz" ./*
|
||||
deploy_pkgs "${lite_package_pre_name}.tar.gz"
|
||||
echo "make server(all) package success!"
|
||||
}
|
||||
|
||||
|
|
@ -197,13 +203,13 @@ function make_package_libpq()
|
|||
|
||||
cd ${BUILD_DIR}/temp
|
||||
echo "packaging libpq..."
|
||||
tar -zvcf "${libpq_package_name}" ./* >>"$LOG_FILE" 2>&1
|
||||
tar -zvcf "${lite_libpq_package_name}" ./* >>"$LOG_FILE" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
die "$package_command ${libpq_package_name} failed"
|
||||
die "$package_command ${lite_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
|
||||
deploy_pkgs ${lite_libpq_package_name}
|
||||
echo "install $pkgname tools is ${lite_libpq_package_name} of ${package_path} directory " >> "$LOG_FILE" 2>&1
|
||||
echo "success!"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
#######################################################################
|
||||
|
|
@ -264,6 +275,7 @@ function install_gaussdb()
|
|||
get_kernel_commitid
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
##install gaussdb database and others
|
||||
##select to install something according to variables package_type need
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@
|
|||
./share/postgresql/extension/hstore--1.0--1.1.sql
|
||||
./share/postgresql/extension/log_fdw--1.0.sql
|
||||
./share/postgresql/extension/log_fdw.control
|
||||
./share/postgresql/extension/packages--1.0.sql
|
||||
./share/postgresql/extension/packages--1.0--1.1.sql
|
||||
./share/postgresql/extension/packages.control
|
||||
./share/postgresql/timezone/GB-Eire
|
||||
./share/postgresql/timezone/Turkey
|
||||
./share/postgresql/timezone/Kwajalein
|
||||
|
|
@ -614,6 +617,23 @@
|
|||
./share/postgresql/timezone/Asia/Yakutsk
|
||||
./share/postgresql/timezone/Asia/Magadan
|
||||
./share/postgresql/timezone/Asia/Amman
|
||||
./share/postgresql/timezone/Asia/Barnaul
|
||||
./share/postgresql/timezone/Asia/Chita
|
||||
./share/postgresql/timezone/Asia/Tomsk
|
||||
./share/postgresql/timezone/Asia/Atyrau
|
||||
./share/postgresql/timezone/Asia/Famagusta
|
||||
./share/postgresql/timezone/Asia/Qostanay
|
||||
./share/postgresql/timezone/Asia/Srednekolymsk
|
||||
./share/postgresql/timezone/Asia/Yangon
|
||||
./share/postgresql/timezone/Pacific/Bougainville
|
||||
./share/postgresql/timezone/Antarctica/Troll
|
||||
./share/postgresql/timezone/Europe/Astrakhan
|
||||
./share/postgresql/timezone/Europe/Ulyanovsk
|
||||
./share/postgresql/timezone/Europe/Kirov
|
||||
./share/postgresql/timezone/Europe/Saratov
|
||||
./share/postgresql/timezone/America/Fort_Nelson
|
||||
./share/postgresql/timezone/America/Nuuk
|
||||
./share/postgresql/timezone/America/Punta_Arenas
|
||||
./share/postgresql/timezone/Asia/Kuching
|
||||
./share/postgresql/timezone/Asia/Novosibirsk
|
||||
./share/postgresql/timezone/Asia/Seoul
|
||||
|
|
@ -673,21 +693,37 @@
|
|||
./lib/libpq.so
|
||||
./lib/libpq.so.5
|
||||
./lib/libpq.so.5.5
|
||||
./lib/libssl.so*
|
||||
./lib/libcrypto.so*
|
||||
./lib/libcgroup.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/liblz4.so*
|
||||
./lib/libcjson.so*
|
||||
./lib/libcjson_utils.so*
|
||||
./lib/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.3
|
||||
./lib/libcjson.so
|
||||
./lib/libcjson.so.1
|
||||
./lib/libcjson.so.1.7.15
|
||||
./lib/libcjson_utils.so
|
||||
./lib/libcjson_utils.so.1
|
||||
./lib/libcjson_utils.so.1.7.15
|
||||
./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
|
||||
|
|
@ -726,7 +762,6 @@
|
|||
./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,13 +916,14 @@
|
|||
./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
|
||||
|
|
@ -903,4 +939,4 @@
|
|||
./include/pqcomm.h
|
||||
./include/pqexpbuffer.h
|
||||
[version]
|
||||
5.0.0
|
||||
3.0.3
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -66,8 +60,6 @@
|
|||
./share/postgresql/extension/hstore.control
|
||||
./share/postgresql/extension/security_plugin.control
|
||||
./share/postgresql/extension/security_plugin--1.0.sql
|
||||
./share/postgresql/extension/dolphin.control
|
||||
./share/postgresql/extension/dolphin--1.0.sql
|
||||
./share/postgresql/extension/file_fdw--1.0.sql
|
||||
./share/postgresql/extension/plpgsql.control
|
||||
./share/postgresql/extension/dist_fdw.control
|
||||
|
|
@ -83,9 +75,6 @@
|
|||
./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
|
||||
|
|
@ -658,6 +647,23 @@
|
|||
./share/postgresql/timezone/Asia/Yakutsk
|
||||
./share/postgresql/timezone/Asia/Magadan
|
||||
./share/postgresql/timezone/Asia/Amman
|
||||
./share/postgresql/timezone/Asia/Barnaul
|
||||
./share/postgresql/timezone/Asia/Chita
|
||||
./share/postgresql/timezone/Asia/Tomsk
|
||||
./share/postgresql/timezone/Asia/Atyrau
|
||||
./share/postgresql/timezone/Asia/Famagusta
|
||||
./share/postgresql/timezone/Asia/Qostanay
|
||||
./share/postgresql/timezone/Asia/Srednekolymsk
|
||||
./share/postgresql/timezone/Asia/Yangon
|
||||
./share/postgresql/timezone/Pacific/Bougainville
|
||||
./share/postgresql/timezone/Antarctica/Troll
|
||||
./share/postgresql/timezone/Europe/Astrakhan
|
||||
./share/postgresql/timezone/Europe/Ulyanovsk
|
||||
./share/postgresql/timezone/Europe/Kirov
|
||||
./share/postgresql/timezone/Europe/Saratov
|
||||
./share/postgresql/timezone/America/Fort_Nelson
|
||||
./share/postgresql/timezone/America/Nuuk
|
||||
./share/postgresql/timezone/America/Punta_Arenas
|
||||
./share/postgresql/timezone/Asia/Kuching
|
||||
./share/postgresql/timezone/Asia/Novosibirsk
|
||||
./share/postgresql/timezone/Asia/Seoul
|
||||
|
|
@ -756,11 +762,9 @@
|
|||
./lib/postgresql/pg_plugin
|
||||
./lib/postgresql/proc_srclib
|
||||
./lib/postgresql/security_plugin.so
|
||||
./lib/postgresql/dolphin.so
|
||||
./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 +775,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 +800,59 @@
|
|||
./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/liblz4.so
|
||||
./lib/liblz4.so.1
|
||||
./lib/liblz4.so.1.9.3
|
||||
./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
|
||||
|
|
@ -827,13 +869,12 @@
|
|||
./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 +1002,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 +1057,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 +1166,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 +1185,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 +1370,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 +1406,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.3")
|
||||
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.
|
||||
|
|
@ -64,7 +58,6 @@ option(ENABLE_MYSQL_FDW "enable export or import data with mysql,the old is --en
|
|||
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 +67,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 +87,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 "")
|
||||
|
|
@ -140,30 +132,14 @@ 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(WARNING_OPTIONS -Wall -Wendif-labels -Werror -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(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()
|
||||
|
||||
# libraries need secure options during compling
|
||||
set(LIB_SECURE_OPTIONS -fPIC -fno-common -fstack-protector)
|
||||
# libraries need link options during linking
|
||||
|
|
@ -231,7 +207,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,36 +246,35 @@ 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_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)
|
||||
if(NOT ${ENABLE_MULTIPLE_NODES}_${ENABLE_PRIVATEGAUSS} STREQUAL OFF_OFF)
|
||||
if(NOT "${RET_HOTPATCH}" STREQUAL "-1")
|
||||
if("${GCC_VERSION}" STREQUAL "7.3.0")
|
||||
set(RET_ARM_HOTPATCH "no")
|
||||
if("${CURRENT_ARCH}" STREQUAL "aarch64")
|
||||
set(RET_ARM_HOTPATCH "yes")
|
||||
endif()
|
||||
set(SUPPORT_HOTPATCH "no")
|
||||
if(EXISTS ${LIBHOTPATCH_LIB_PATH}/libdoprapatch.a)
|
||||
if(NOT ${ENABLE_MULTIPLE_NODES}_${ENABLE_PRIVATEGAUSS} STREQUAL OFF_OFF)
|
||||
if(NOT "${ENABLE_LITE_NODES}" STREQUAL "ON")
|
||||
set(SUPPORT_HOTPATCH "yes")
|
||||
if(NOT ${RET_ARM_HOTPATCH} EQUAL -1)
|
||||
set(HOTPATCH_ATOMIC_LDS -Wl,-T${LIBHOTPATCH_TOOL_PATH}/atomic.lds)
|
||||
endif()
|
||||
else()
|
||||
set(SUPPORT_HOTPATCH "no")
|
||||
endif()
|
||||
else()
|
||||
endif()
|
||||
endif()
|
||||
if("${SUPPORT_HOTPATCH}_${RET_ARM_HOTPATCH}" STREQUAL "yes_yes")
|
||||
set(HOTPATCH_ATOMIC_LDS -Wl,-T${LIBHOTPATCH_TOOL_PATH}/atomic.lds)
|
||||
endif()
|
||||
if(EXISTS ${LIBHOTPATCH_SPEC_PATH}/x86_nop.spec)
|
||||
if("${ENABLE_DEBUG}" STREQUAL "ON")
|
||||
set(SUPPORT_HOTPATCH "no")
|
||||
endif()
|
||||
else()
|
||||
set(SUPPORT_HOTPATCH "no")
|
||||
if("${SUPPORT_HOTPATCH}" STREQUAL "yes")
|
||||
list(REMOVE_ITEM OPTIMIZE_OPTIONS -pipe)
|
||||
list(APPEND OPTIMIZE_OPTIONS -specs=${LIBHOTPATCH_SPEC_PATH}/x86_nop.spec)
|
||||
set(HOTPATCH_ATOMIC_LDS -Wl,-T${LIBHOTPATCH_TOOL_PATH}/atomic.lds)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${ENABLE_LITE_MODE} STREQUAL "ON")
|
||||
set(SUPPORT_HOTPATCH "no")
|
||||
endif()
|
||||
|
||||
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.3"
|
||||
|
||||
/* 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
|
||||
|
|
|
|||
|
|
@ -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.3"
|
||||
|
||||
/* 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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ set(OBS_HOME ${DEPENDENCY_PATH}/libobs/${LIB_UNIFIED_SUPPORT})
|
|||
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})
|
||||
|
|
@ -68,16 +68,13 @@ if (EXISTS "${PLATFORM_PATH}/openjdk8/${BUILD_TUPLE}/jdk")
|
|||
else()
|
||||
set(JAVA_HOME ${PLATFORM_PATH}/huaweijdk8/${BUILD_TUPLE}/jdk)
|
||||
endif()
|
||||
set(ZLIB_HOME ${DEPENDENCY_PATH}/zlib1.2.11/${SUPPORT_LLT})
|
||||
set(ZLIB_HOME ${DEPENDENCY_PATH}/zlib1.2.12/${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})
|
||||
|
|
@ -265,17 +262,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
|
||||
#############################################################################
|
||||
|
|
@ -289,6 +275,7 @@ set(LIBHOTPATCH_INCLUDE_PATH ${HOTPATCH_HOME}/include)
|
|||
set(LIBHOTPATCH_LIB_PATH ${HOTPATCH_HOME}/lib)
|
||||
set(LIBHOTPATCH_TOOL_PATH ${HOTPATCH_HOME}/tool)
|
||||
set(LIBHOTPATCH_CONFIG_PATH ${HOTPATCH_HOME}/config)
|
||||
set(LIBHOTPATCH_SPEC_PATH ${HOTPATCH_HOME}/spec)
|
||||
|
||||
#############################################################################
|
||||
# secure component
|
||||
|
|
|
|||
|
|
@ -121,34 +121,6 @@ fi])# PGAC_C_FUNCNAME_SUPPORT
|
|||
|
||||
|
||||
|
||||
# PGAC_CHECK_BUILTIN_FUNC
|
||||
# -----------------------
|
||||
# This is similar to AC_CHECK_FUNCS(), except that it will work for compiler
|
||||
# builtin functions, as that usually fails to.
|
||||
# The first argument is the function name, eg [__builtin_clzl], and the
|
||||
# second is its argument list, eg [unsigned long x]. The current coding
|
||||
# works only for a single argument named x; we might generalize that later.
|
||||
# It's assumed that the function's result type is coercible to int.
|
||||
# On success, we define "HAVEfuncname" (there's usually more than enough
|
||||
# underscores already, so we don't add another one).
|
||||
AC_DEFUN([PGAC_CHECK_BUILTIN_FUNC],
|
||||
[AC_CACHE_CHECK(for $1, pgac_cv$1,
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
||||
int
|
||||
call$1($2)
|
||||
{
|
||||
return $1(x);
|
||||
}], [])],
|
||||
[pgac_cv$1=yes],
|
||||
[pgac_cv$1=no])])
|
||||
if test x"${pgac_cv$1}" = xyes ; then
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE$1]), 1,
|
||||
[Define to 1 if your compiler understands $1.])
|
||||
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.3'
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define PG_VERSION "$PACKAGE_VERSION"
|
||||
|
|
@ -3274,9 +3272,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 +3710,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 +3722,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
|
||||
|
|
@ -6481,11 +6461,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 +6489,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 +6521,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 +6537,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
|
||||
|
|
@ -9851,7 +9826,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 +13418,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; }
|
||||
|
|
@ -18226,47 +18200,9 @@ fi
|
|||
|
||||
# On PPC, check if assembler supports LWARX instruction's mutex hint bit
|
||||
case $host_cpu in
|
||||
x86_64)
|
||||
# On x86_64, check if we can compile a popcntq instruction
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports x86_64 popcntq" >&5
|
||||
$as_echo_n "checking whether assembler supports x86_64 popcntq... " >&6; }
|
||||
if ${pgac_cv_have_x86_64_popcntq+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long long x = 1; long long r;
|
||||
__asm__ __volatile__ (" popcntq %1,%0\n" : "=q"(r) : "rm"(x));
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
pgac_cv_have_x86_64_popcntq=yes
|
||||
else
|
||||
pgac_cv_have_x86_64_popcntq=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_x86_64_popcntq" >&5
|
||||
$as_echo "$pgac_cv_have_x86_64_popcntq" >&6; }
|
||||
if test x"$pgac_cv_have_x86_64_popcntq" = xyes ; then
|
||||
|
||||
$as_echo "#define HAVE_X86_64_POPCNTQ 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
;;
|
||||
|
||||
ppc*|powerpc*)
|
||||
{ $as_echo "$as_me:$LINENO: checking whether assembler supports lwarx hint bit" >&5
|
||||
$as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
|
||||
if ${pgac_cv_have_ppc_mutex_hint+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
|
|
@ -18310,7 +18246,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
|
|||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $pgac_cv_have_ppc_mutex_hint" >&5
|
||||
$as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
|
||||
if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
|
||||
|
|
@ -24890,237 +24825,6 @@ cat >>confdefs.h <<_ACEOF
|
|||
#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
|
||||
_ACEOF
|
||||
|
||||
# These typically are compiler builtins, for which AC_CHECK_FUNCS fails.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap16" >&5
|
||||
$as_echo_n "checking for __builtin_bswap16... " >&6; }
|
||||
if ${pgac_cv__builtin_bswap16+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
call__builtin_bswap16(int x)
|
||||
{
|
||||
return __builtin_bswap16(x);
|
||||
}
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
pgac_cv__builtin_bswap16=yes
|
||||
else
|
||||
pgac_cv__builtin_bswap16=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_bswap16" >&5
|
||||
$as_echo "$pgac_cv__builtin_bswap16" >&6; }
|
||||
if test x"${pgac_cv__builtin_bswap16}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE__BUILTIN_BSWAP16 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
|
||||
$as_echo_n "checking for __builtin_bswap32... " >&6; }
|
||||
if ${pgac_cv__builtin_bswap32+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
call__builtin_bswap32(int x)
|
||||
{
|
||||
return __builtin_bswap32(x);
|
||||
}
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
pgac_cv__builtin_bswap32=yes
|
||||
else
|
||||
pgac_cv__builtin_bswap32=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_bswap32" >&5
|
||||
$as_echo "$pgac_cv__builtin_bswap32" >&6; }
|
||||
if test x"${pgac_cv__builtin_bswap32}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE__BUILTIN_BSWAP32 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64" >&5
|
||||
$as_echo_n "checking for __builtin_bswap64... " >&6; }
|
||||
if ${pgac_cv__builtin_bswap64+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
call__builtin_bswap64(long int x)
|
||||
{
|
||||
return __builtin_bswap64(x);
|
||||
}
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
pgac_cv__builtin_bswap64=yes
|
||||
else
|
||||
pgac_cv__builtin_bswap64=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_bswap64" >&5
|
||||
$as_echo "$pgac_cv__builtin_bswap64" >&6; }
|
||||
if test x"${pgac_cv__builtin_bswap64}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE__BUILTIN_BSWAP64 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
# 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
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_ctz" >&5
|
||||
$as_echo_n "checking for __builtin_ctz... " >&6; }
|
||||
if ${pgac_cv__builtin_ctz+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
call__builtin_ctz(unsigned int x)
|
||||
{
|
||||
return __builtin_ctz(x);
|
||||
}
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
pgac_cv__builtin_ctz=yes
|
||||
else
|
||||
pgac_cv__builtin_ctz=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_ctz" >&5
|
||||
$as_echo "$pgac_cv__builtin_ctz" >&6; }
|
||||
if test x"${pgac_cv__builtin_ctz}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE__BUILTIN_CTZ 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5
|
||||
$as_echo_n "checking for __builtin_popcount... " >&6; }
|
||||
if ${pgac_cv__builtin_popcount+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
call__builtin_popcount(unsigned int x)
|
||||
{
|
||||
return __builtin_popcount(x);
|
||||
}
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
pgac_cv__builtin_popcount=yes
|
||||
else
|
||||
pgac_cv__builtin_popcount=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_popcount" >&5
|
||||
$as_echo "$pgac_cv__builtin_popcount" >&6; }
|
||||
if test x"${pgac_cv__builtin_popcount}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE__BUILTIN_POPCOUNT 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
|
|
|
|||
31
configure.in
31
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
|
||||
#
|
||||
|
|
@ -1186,19 +1173,6 @@ fi
|
|||
|
||||
# On PPC, check if assembler supports LWARX instruction's mutex hint bit
|
||||
case $host_cpu in
|
||||
x86_64)
|
||||
# On x86_64, check if we can compile a popcntq instruction
|
||||
AC_CACHE_CHECK([whether assembler supports x86_64 popcntq],
|
||||
[pgac_cv_have_x86_64_popcntq],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
|
||||
[long long x = 1; long long r;
|
||||
__asm__ __volatile__ (" popcntq %1,%0\n" : "=q"(r) : "rm"(x));])],
|
||||
[pgac_cv_have_x86_64_popcntq=yes],
|
||||
[pgac_cv_have_x86_64_popcntq=no])])
|
||||
if test x"$pgac_cv_have_x86_64_popcntq" = xyes ; then
|
||||
AC_DEFINE(HAVE_X86_64_POPCNTQ, 1, [Define to 1 if the assembler supports X86_64's POPCNTQ instruction.])
|
||||
fi
|
||||
;;
|
||||
ppc*|powerpc*)
|
||||
AC_MSG_CHECKING([whether assembler supports lwarx hint bit])
|
||||
AC_TRY_COMPILE([],
|
||||
|
|
@ -1247,9 +1221,6 @@ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
|
|||
|
||||
AC_CHECK_FUNCS([cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat readlink setproctitle setsid sigprocmask symlink sync_file_range towlower utime utimes waitpid wcstombs wcstombs_l])
|
||||
|
||||
# We assume that we needn't test all widths of these explicitly:
|
||||
PGAC_CHECK_BUILTIN_FUNC([__builtin_clz], [unsigned int x])
|
||||
|
||||
AC_REPLACE_FUNCS(fseeko)
|
||||
case $host_os in
|
||||
# NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,19 @@ static int32 gbt_textcmp(const void* a, const void* b, Oid collation)
|
|||
return DatumGetInt32(DirectFunctionCall2Coll(bttextcmp, collation, PointerGetDatum(a), PointerGetDatum(b)));
|
||||
}
|
||||
|
||||
static Datum gbt_rtrim1(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text* string = PG_GETARG_TEXT_PP(0);
|
||||
text* ret = NULL;
|
||||
|
||||
ret = dotrim(VARDATA_ANY(string), VARSIZE_ANY_EXHDR(string), " ", 1, false, true);
|
||||
|
||||
if ((ret == NULL || 0 == VARSIZE_ANY_EXHDR(ret)) && u_sess->attr.attr_sql.sql_compatibility == A_FORMAT)
|
||||
PG_RETURN_NULL();
|
||||
else
|
||||
PG_RETURN_TEXT_P(ret);
|
||||
}
|
||||
|
||||
static gbtree_vinfo tinfo = {
|
||||
gbt_t_text, 0, FALSE, gbt_textgt, gbt_textge, gbt_texteq, gbt_textle, gbt_textlt, gbt_textcmp, NULL};
|
||||
|
||||
|
|
@ -91,7 +104,7 @@ Datum gbt_bpchar_compress(PG_FUNCTION_ARGS)
|
|||
|
||||
if (entry->leafkey) {
|
||||
|
||||
Datum d = DirectFunctionCall1(rtrim1, entry->key);
|
||||
Datum d = DirectFunctionCall1(gbt_rtrim1, entry->key);
|
||||
GISTENTRY trim;
|
||||
|
||||
gistentryinit(trim, d, entry->rel, entry->page, entry->offset, TRUE);
|
||||
|
|
@ -135,7 +148,7 @@ Datum gbt_bpchar_consistent(PG_FUNCTION_ARGS)
|
|||
bool retval = false;
|
||||
GBT_VARKEY* key = (GBT_VARKEY*)DatumGetPointer(entry->key);
|
||||
GBT_VARKEY_R r = gbt_var_key_readable(key);
|
||||
void* trim = (void*)DatumGetPointer(DirectFunctionCall1(rtrim1, PointerGetDatum(query)));
|
||||
void* trim = (void*)DatumGetPointer(DirectFunctionCall1(gbt_rtrim1, PointerGetDatum(query)));
|
||||
|
||||
/* All cases served by this function are exact */
|
||||
*recheck = false;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -375,7 +375,7 @@ static List* get_file_fdw_attribute_options(Oid relid)
|
|||
|
||||
/* Retrieve FDW options for all user-defined attributes. */
|
||||
for (attnum = 1; attnum <= natts; attnum++) {
|
||||
Form_pg_attribute attr = &tupleDesc->attrs[attnum - 1];
|
||||
Form_pg_attribute attr = tupleDesc->attrs[attnum - 1];
|
||||
List* options = NIL;
|
||||
ListCell* lc = NULL;
|
||||
|
||||
|
|
@ -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 */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -712,7 +708,7 @@ static void estimate_size(PlannerInfo* root, RelOptInfo* baserel, FileFdwPlanSta
|
|||
*/
|
||||
int tuple_width;
|
||||
|
||||
tuple_width = MAXALIGN(baserel->reltarget->width) + MAXALIGN(sizeof(HeapTupleHeaderData));
|
||||
tuple_width = MAXALIGN(baserel->width) + MAXALIGN(sizeof(HeapTupleHeaderData));
|
||||
ntuples = clamp_row_est((double)stat_buf.st_size / (double)tuple_width);
|
||||
|
||||
baserel->tuples = ntuples;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -929,7 +929,7 @@ static void gcdeparseTargetList(StringInfo buf, PlannerInfo* root, Index rtindex
|
|||
have_wholerow = bms_is_member(0 - FirstLowInvalidHeapAttributeNumber, attrs_used);
|
||||
|
||||
for (i = 1; i <= tupdesc->natts; i++) {
|
||||
Form_pg_attribute attr = &tupdesc->attrs[i - 1];
|
||||
Form_pg_attribute attr = tupdesc->attrs[i - 1];
|
||||
|
||||
/* Ignore dropped attributes. */
|
||||
if (attr->attisdropped)
|
||||
|
|
@ -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");
|
||||
|
|
@ -1122,7 +1122,7 @@ static void gcDeparseSubqueryTargetList(deparse_expr_cxt* context)
|
|||
/* Should only be called in these cases. */
|
||||
Assert(IS_SIMPLE_REL(foreignrel) || IS_JOIN_REL(foreignrel));
|
||||
|
||||
foreach (lc, foreignrel->reltarget->exprs) {
|
||||
foreach (lc, foreignrel->reltargetlist) {
|
||||
Node* node = (Node*)lfirst(lc);
|
||||
|
||||
if (!first)
|
||||
|
|
@ -2213,7 +2213,7 @@ static void get_relation_column_alias_ids(Var* node, RelOptInfo* foreignrel, int
|
|||
|
||||
/* Get the column alias ID */
|
||||
i = 1;
|
||||
foreach (lc, foreignrel->reltarget->exprs) {
|
||||
foreach (lc, foreignrel->reltargetlist) {
|
||||
if (equal(lfirst(lc), (Node*)node)) {
|
||||
*colno = i;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -747,8 +745,8 @@ static void gcBeginForeignScan(ForeignScanState* node, int eflags)
|
|||
fsstate->resultSlot->tts_isnull[i] = true;
|
||||
}
|
||||
|
||||
fsstate->resultSlot->tts_flags &= ~TTS_FLAG_EMPTY;
|
||||
fsstate->scanSlot->tts_flags &= ~TTS_FLAG_EMPTY;
|
||||
fsstate->resultSlot->tts_isempty = false;
|
||||
fsstate->scanSlot->tts_isempty = false;
|
||||
|
||||
fsstate->attinmeta = TupleDescGetAttInMetadata(fsstate->tupdesc);
|
||||
|
||||
|
|
@ -864,7 +862,7 @@ static void postgresConstructResultSlotWithArray(ForeignScanState* node)
|
|||
for (scanAttr = 0, resultAttr = 0; resultAttr < resultDesc->natts; resultAttr++, scanAttr += map) {
|
||||
Assert(list_length(colmap) == resultDesc->natts);
|
||||
|
||||
Oid typoid = resultDesc->attrs[resultAttr].atttypid;
|
||||
Oid typoid = resultDesc->attrs[resultAttr]->atttypid;
|
||||
Value* val = (Value*)list_nth(colmap, resultAttr);
|
||||
map = val->val.ival;
|
||||
|
||||
|
|
@ -919,7 +917,7 @@ static void postgresConstructResultSlotWithArray(ForeignScanState* node)
|
|||
}
|
||||
|
||||
resultSlot->tts_nvalid = resultDesc->natts;
|
||||
resultSlot->tts_flags &= ~TTS_FLAG_EMPTY;
|
||||
resultSlot->tts_isempty = false;
|
||||
}
|
||||
|
||||
static void postgresMapResultFromScanSlot(ForeignScanState* node)
|
||||
|
|
@ -958,7 +956,7 @@ static TupleTableSlot* gcIterateNormalForeignScan(ForeignScanState* node)
|
|||
|
||||
/* reset tupleslot on the begin */
|
||||
(void)ExecClearTuple(fsstate->resultSlot);
|
||||
fsstate->resultSlot->tts_flags &= ~TTS_FLAG_EMPTY;
|
||||
fsstate->resultSlot->tts_isempty = false;
|
||||
|
||||
TupleTableSlot* slot = node->ss.ss_ScanTupleSlot;
|
||||
|
||||
|
|
@ -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);
|
||||
|
|
@ -1813,17 +1811,17 @@ static void gcfdw_fetch_remote_table_info(
|
|||
pq_sendint(&retbuf, tupdesc->natts, 4);
|
||||
|
||||
for (int i = 0; i < tupdesc->natts; i++) {
|
||||
att_name_len = strlen(tupdesc->attrs[i].attname.data);
|
||||
att_name_len = strlen(tupdesc->attrs[i]->attname.data);
|
||||
pq_sendint(&retbuf, att_name_len, 4);
|
||||
pq_sendbytes(&retbuf, tupdesc->attrs[i].attname.data, att_name_len);
|
||||
pq_sendbytes(&retbuf, tupdesc->attrs[i]->attname.data, att_name_len);
|
||||
|
||||
Assert(InvalidOid != tupdesc->attrs[i].atttypid);
|
||||
Assert(InvalidOid != tupdesc->attrs[i]->atttypid);
|
||||
|
||||
type_name = get_typename(tupdesc->attrs[i].atttypid);
|
||||
type_name = get_typename(tupdesc->attrs[i]->atttypid);
|
||||
type_name_len = strlen(type_name);
|
||||
pq_sendint(&retbuf, type_name_len, 4);
|
||||
pq_sendbytes(&retbuf, type_name, type_name_len);
|
||||
pq_sendint(&retbuf, tupdesc->attrs[i].atttypmod, 4);
|
||||
pq_sendint(&retbuf, tupdesc->attrs[i]->atttypmod, 4);
|
||||
pfree(type_name);
|
||||
}
|
||||
|
||||
|
|
@ -2368,7 +2366,7 @@ static void conversion_error_callback(void *arg)
|
|||
TupleDesc tupdesc = RelationGetDescr(errpos->rel);
|
||||
|
||||
if (errpos->cur_attno > 0 && errpos->cur_attno <= tupdesc->natts) {
|
||||
attname = NameStr(tupdesc->attrs[errpos->cur_attno - 1].attname);
|
||||
attname = NameStr(tupdesc->attrs[errpos->cur_attno - 1]->attname);
|
||||
} else if (errpos->cur_attno == SelfItemPointerAttributeNumber) {
|
||||
attname = "ctid";
|
||||
} else if (errpos->cur_attno == ObjectIdAttributeNumber) {
|
||||
|
|
@ -2588,7 +2586,7 @@ static void GcFdwCopyRemoteInfo(PgFdwRemoteInfo* new_remote_info, PgFdwRemoteInf
|
|||
bool hasSpecialArrayType(TupleDesc desc)
|
||||
{
|
||||
for (int i = 0; i < desc->natts; i++) {
|
||||
Oid typoid = desc->attrs[i].atttypid;
|
||||
Oid typoid = desc->attrs[i]->atttypid;
|
||||
|
||||
if (INT8ARRAYOID == typoid || FLOAT8ARRAYOID == typoid || FLOAT4ARRAYOID == typoid || NUMERICARRAY == typoid) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -702,15 +702,15 @@ Datum hstore_from_record(PG_FUNCTION_ARGS)
|
|||
|
||||
for (i = 0, j = 0; i < ncolumns; ++i) {
|
||||
ColumnIOData* column_info = &my_extra->columns[i];
|
||||
Oid column_type = tupdesc->attrs[i].atttypid;
|
||||
Oid column_type = tupdesc->attrs[i]->atttypid;
|
||||
char* value = NULL;
|
||||
|
||||
/* Ignore dropped columns in datatype */
|
||||
if (tupdesc->attrs[i].attisdropped)
|
||||
if (tupdesc->attrs[i]->attisdropped)
|
||||
continue;
|
||||
|
||||
pairs[j].key = NameStr(tupdesc->attrs[i].attname);
|
||||
pairs[j].keylen = hstoreCheckKeyLen(strlen(NameStr(tupdesc->attrs[i].attname)));
|
||||
pairs[j].key = NameStr(tupdesc->attrs[i]->attname);
|
||||
pairs[j].keylen = hstoreCheckKeyLen(strlen(NameStr(tupdesc->attrs[i]->attname)));
|
||||
|
||||
if (nulls == NULL || nulls[i]) {
|
||||
pairs[j].val = NULL;
|
||||
|
|
@ -864,18 +864,18 @@ Datum hstore_populate_record(PG_FUNCTION_ARGS)
|
|||
|
||||
for (i = 0; i < ncolumns; ++i) {
|
||||
ColumnIOData* column_info = &my_extra->columns[i];
|
||||
Oid column_type = tupdesc->attrs[i].atttypid;
|
||||
Oid column_type = tupdesc->attrs[i]->atttypid;
|
||||
char* value = NULL;
|
||||
int idx;
|
||||
int vallen;
|
||||
|
||||
/* Ignore dropped columns in datatype */
|
||||
if (tupdesc->attrs[i].attisdropped) {
|
||||
if (tupdesc->attrs[i]->attisdropped) {
|
||||
nulls[i] = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
idx = hstoreFindKey(hs, 0, NameStr(tupdesc->attrs[i].attname), strlen(NameStr(tupdesc->attrs[i].attname)));
|
||||
idx = hstoreFindKey(hs, 0, NameStr(tupdesc->attrs[i]->attname), strlen(NameStr(tupdesc->attrs[i]->attname)));
|
||||
|
||||
/*
|
||||
* we can't just skip here if the key wasn't found since we might have
|
||||
|
|
@ -903,7 +903,7 @@ Datum hstore_populate_record(PG_FUNCTION_ARGS)
|
|||
* checks are done
|
||||
*/
|
||||
values[i] =
|
||||
InputFunctionCall(&column_info->proc, NULL, column_info->typioparam, tupdesc->attrs[i].atttypmod);
|
||||
InputFunctionCall(&column_info->proc, NULL, column_info->typioparam, tupdesc->attrs[i]->atttypmod);
|
||||
nulls[i] = true;
|
||||
} else {
|
||||
vallen = HS_VALLEN(entries, idx);
|
||||
|
|
@ -913,7 +913,7 @@ Datum hstore_populate_record(PG_FUNCTION_ARGS)
|
|||
value[vallen] = 0;
|
||||
|
||||
values[i] =
|
||||
InputFunctionCall(&column_info->proc, value, column_info->typioparam, tupdesc->attrs[i].atttypmod);
|
||||
InputFunctionCall(&column_info->proc, value, column_info->typioparam, tupdesc->attrs[i]->atttypmod);
|
||||
nulls[i] = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "access/gist.h"
|
||||
#include "access/skey.h"
|
||||
#include "port/pg_bitutils.h"
|
||||
|
||||
#include "_int.h"
|
||||
|
||||
|
|
@ -30,6 +29,264 @@ extern "C" Datum g_intbig_picksplit(PG_FUNCTION_ARGS);
|
|||
extern "C" Datum g_intbig_union(PG_FUNCTION_ARGS);
|
||||
extern "C" Datum g_intbig_same(PG_FUNCTION_ARGS);
|
||||
|
||||
/* Number of one-bits in an unsigned byte */
|
||||
static const uint8 number_of_ones[256] = {0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
6,
|
||||
7,
|
||||
7,
|
||||
8};
|
||||
|
||||
PG_FUNCTION_INFO_V1(_intbig_in);
|
||||
extern "C" Datum _intbig_in(PG_FUNCTION_ARGS);
|
||||
|
||||
|
|
@ -171,7 +428,11 @@ Datum g_intbig_compress(PG_FUNCTION_ARGS)
|
|||
|
||||
static int4 sizebitvec(BITVECP sign)
|
||||
{
|
||||
return pg_popcount(sign, SIGLEN);
|
||||
int4 size = 0, i;
|
||||
|
||||
LOOPBYTE
|
||||
size += number_of_ones[(unsigned char)sign[i]];
|
||||
return size;
|
||||
}
|
||||
|
||||
static int hemdistsign(BITVECP a, BITVECP b)
|
||||
|
|
@ -181,8 +442,7 @@ static int hemdistsign(BITVECP a, BITVECP b)
|
|||
LOOPBYTE
|
||||
{
|
||||
diff = (unsigned char)(a[i] ^ b[i]);
|
||||
/* Using the popcount functions here isn't likely to win */
|
||||
dist += pg_number_of_ones[diff];
|
||||
dist += number_of_ones[diff];
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1530,7 +1530,7 @@ static void fill_pglog_planstate_from_logft_rel(pglogPlanState* pg_log, Relation
|
|||
|
||||
Assert(PGLOG_ATTR_MAX == tupdesc->natts);
|
||||
for (int i = 0; i < PGLOG_ATTR_MAX; ++i) {
|
||||
Form_pg_attribute att = &tupdesc->attrs[i];
|
||||
Form_pg_attribute att = tupdesc->attrs[i];
|
||||
pg_log->allattr_typmod[i] = att->atttypmod;
|
||||
getTypeInputInfo(att->atttypid, &in_func_oid, &pg_log->allattr_typioparam[i]);
|
||||
fmgr_info(in_func_oid, &pg_log->allattr_fmgrinfo[i]);
|
||||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "access/gist.h"
|
||||
#include "access/skey.h"
|
||||
#include "port/pg_bitutils.h"
|
||||
#include "crc32.h"
|
||||
#include "ltree.h"
|
||||
|
||||
|
|
@ -35,6 +34,264 @@ extern "C" Datum _ltree_consistent(PG_FUNCTION_ARGS);
|
|||
#define GETENTRY(vec, pos) ((ltree_gist*)DatumGetPointer((vec)->vector[(pos)].key))
|
||||
#define NEXTVAL(x) ((ltree*)((char*)(x) + INTALIGN(VARSIZE(x))))
|
||||
|
||||
/* Number of one-bits in an unsigned byte */
|
||||
static const uint8 number_of_ones[256] = {0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
6,
|
||||
7,
|
||||
7,
|
||||
8};
|
||||
|
||||
#define WISH_F(a, b, c) (double)(-(double)(((a) - (b)) * ((a) - (b)) * ((a) - (b))) * (c))
|
||||
|
||||
static void hashing(BITVECP sign, ltree* t)
|
||||
|
|
@ -174,7 +431,11 @@ Datum _ltree_union(PG_FUNCTION_ARGS)
|
|||
|
||||
static int4 sizebitvec(BITVECP sign)
|
||||
{
|
||||
return pg_popcount((const char *) sign, ASIGLEN);
|
||||
int4 size = 0, i;
|
||||
|
||||
ALOOPBYTE
|
||||
size += number_of_ones[(unsigned char)sign[i]];
|
||||
return size;
|
||||
}
|
||||
|
||||
static int hemdistsign(BITVECP a, BITVECP b)
|
||||
|
|
@ -184,8 +445,7 @@ static int hemdistsign(BITVECP a, BITVECP b)
|
|||
ALOOPBYTE
|
||||
{
|
||||
diff = (unsigned char)(a[i] ^ b[i]);
|
||||
/* Using the popcount functions here isn't likely to win */
|
||||
dist += pg_number_of_ones[diff];
|
||||
dist += number_of_ones[diff];
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ static void TupleToJsoninfo(Relation relation, cJSON* cols_name, cJSON* cols_typ
|
|||
Datum origval = 0; /* possibly toasted Datum */
|
||||
bool isnull = false; /* column is null? */
|
||||
|
||||
Form_pg_attribute attr = &tupdesc->attrs[natt]; /* the attribute itself */
|
||||
Form_pg_attribute attr = tupdesc->attrs[natt]; /* the attribute itself */
|
||||
|
||||
/*
|
||||
* don't print dropped columns, we can't be sure everything is
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
${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.
|
||||
"",
|
||||
|
|
@ -153,6 +148,7 @@ typedef enum SegmentType {
|
|||
SEG_UHEAP,
|
||||
SEG_INDEX_BTREE,
|
||||
SEG_UNDO,
|
||||
SEG_INDEX_URQ,
|
||||
SEG_UNKNOWN
|
||||
} SegmentType;
|
||||
|
||||
|
|
@ -196,7 +192,6 @@ static ParseHeapTupleData PgIndexRelTupleParser[] = {ParseToastIndexTupleData};
|
|||
static int PgHeapRelTupleParserCursor = -1;
|
||||
static int PgIndexRelTupleParserCursor = -1;
|
||||
|
||||
|
||||
/* For Assert(...) macros. */
|
||||
THR_LOCAL bool assert_enabled = true;
|
||||
|
||||
|
|
@ -205,7 +200,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;
|
||||
|
|
@ -826,6 +820,7 @@ typedef enum HackingType {
|
|||
HACKING_UNDO_RECORD,
|
||||
HACKING_UNDO_FIX,
|
||||
HACKING_SEGMENT,
|
||||
HACKING_INDEX_URQ,
|
||||
NUM_HACKINGTYPE
|
||||
} HackingType;
|
||||
|
||||
|
|
@ -852,7 +847,8 @@ static const char* HACKINGTYPE[] = {"heap",
|
|||
"undo_slot",
|
||||
"undo_record",
|
||||
"undo_fix",
|
||||
"segment"
|
||||
"segment",
|
||||
"btree_index_urq"
|
||||
};
|
||||
|
||||
const char* PageTypeNames[] = {"DATA", "FSM", "VM"};
|
||||
|
|
@ -1020,9 +1016,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");
|
||||
|
|
@ -2581,7 +2574,7 @@ static void parse_btree_index_item(const Item item, unsigned len, int blkno, int
|
|||
/* there are xmin/xmax */
|
||||
UstoreIndexXid uxid = (UstoreIndexXid)UstoreIndexTupleGetXid(itup);
|
||||
fprintf(stdout,
|
||||
"%s xmin:%d xmax:%d Heap Tid: block %u/%u, offset %u\n",
|
||||
"%s xmin:%u xmax:%u Heap Tid: block %u/%u, offset %u\n",
|
||||
indents[indentLevel],
|
||||
uxid->xmin,
|
||||
uxid->xmax,
|
||||
|
|
@ -2807,6 +2800,7 @@ static void parse_special_data(const char* buffer, SegmentType type)
|
|||
|
||||
fprintf(stdout, "\tbtree cycle ID: %u\n", opaque->btpo_cycleid);
|
||||
if (uopaque) {
|
||||
(void)fprintf(stdout, "\tubtree xidbase: %lu\n", uopaque->xid_base);
|
||||
fprintf(stdout, "\tubtree active tuples: %d\n", uopaque->activeTupleCount);
|
||||
}
|
||||
} else if (SEG_UHEAP == type) {
|
||||
|
|
@ -3059,6 +3053,67 @@ static void parse_fsm_page(const char *buffer, int blkno)
|
|||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
static bool UrqIsMetaPage(BlockNumber blkno)
|
||||
{
|
||||
const int FirstNormalBlockNumber = 2;
|
||||
return blkno < FirstNormalBlockNumber;
|
||||
}
|
||||
|
||||
static uint32 UrqGetBlockMaxItems(BlockNumber blkno)
|
||||
{
|
||||
uint32 freeSpace = BLCKSZ - sizeof(PageHeaderData) - offsetof(UBTRecycleQueueHeaderData, items);
|
||||
if (UrqIsMetaPage(blkno)) {
|
||||
freeSpace -= sizeof(UBTRecycleMetaData);
|
||||
}
|
||||
return freeSpace / sizeof(UBTRecycleQueueItemData);
|
||||
}
|
||||
|
||||
static UBTRecycleQueueHeader UrqGetRecycleQueueHeader(Page page, BlockNumber blkno)
|
||||
{
|
||||
if (!UrqIsMetaPage(blkno)) {
|
||||
return (UBTRecycleQueueHeader)PageGetContents(page);
|
||||
}
|
||||
return (UBTRecycleQueueHeader)(((char*)PageGetContents(page)) + sizeof(UBTRecycleMetaData));
|
||||
}
|
||||
|
||||
static void ParseBtreeIndexUrq(const char *buffer, int blkno)
|
||||
{
|
||||
const int baseIndent = 1;
|
||||
const int indent1 = baseIndent + 1;
|
||||
const int indent2 = indent1 + 1;
|
||||
(void)fprintf(stdout, "\n%sRecycle queue information on this page\n", indents[baseIndent]);
|
||||
|
||||
if (UrqIsMetaPage((BlockNumber)blkno)) {
|
||||
UBTRecycleMeta meta = (UBTRecycleMeta)(PageGetContents((Page)buffer));
|
||||
(void)fprintf(stdout, "%sMeta: #%u\n", indents[indent1], blkno);
|
||||
(void)fprintf(stdout, "%sflags: %u\n", indents[indent2], meta->flags);
|
||||
(void)fprintf(stdout, "%sheadBlkno: %u\n", indents[indent2], meta->headBlkno);
|
||||
(void)fprintf(stdout, "%stailBlkno: %u\n", indents[indent2], meta->tailBlkno);
|
||||
(void)fprintf(stdout, "%snblocksUpper: %u\n", indents[indent2], meta->nblocksUpper);
|
||||
(void)fprintf(stdout, "%snblocksLower: %u\n", indents[indent2], meta->nblocksLower);
|
||||
}
|
||||
|
||||
UBTRecycleQueueHeader header = UrqGetRecycleQueueHeader((Page)buffer, (BlockNumber)blkno);
|
||||
uint32 maxItem = UrqGetBlockMaxItems((BlockNumber)blkno);
|
||||
|
||||
(void)fprintf(stdout, "%sBlock: #%d, flags: %u, head:%d, tail:%d, ",
|
||||
indents[indent1], blkno, header->flags, header->head, header->tail);
|
||||
(void)fprintf(stdout, "freeItems:%d, freeListHead:%d, prevBlkno:%u, nextBlkno:%u\n",
|
||||
header->freeItems, header->freeListHead, header->prevBlkno, header->nextBlkno);
|
||||
|
||||
for (uint32 i = 0; i < maxItem; i++) {
|
||||
UBTRecycleQueueItem item = &(header->items[i]);
|
||||
if (item->xid == 0 && item->blkno == 0 && item->prev == 0 && item->next == 0) {
|
||||
continue;
|
||||
}
|
||||
(void)fprintf(stdout, "%s#%3d, xid: %lu, blkno: %3u, prev: %3d, next: %3d\n",
|
||||
indents[indent2], i, item->xid, item->blkno, item->prev, item->next);
|
||||
}
|
||||
|
||||
(void)fprintf(stdout, "%sSummary (%u total): %u used, %d free\n\n",
|
||||
indents[baseIndent], maxItem, maxItem - header->freeItems, header->freeItems);
|
||||
}
|
||||
|
||||
static bool parse_data_page(const char *buffer, int blkno, SegmentType type)
|
||||
{
|
||||
if (only_vm || only_bcm) {
|
||||
|
|
@ -3068,6 +3123,8 @@ static bool parse_data_page(const char *buffer, int blkno, SegmentType type)
|
|||
parse_heap_or_index_page(buffer, blkno, type);
|
||||
} else if (type == SEG_FSM) {
|
||||
parse_fsm_page(buffer, blkno);
|
||||
} else if (type == SEG_INDEX_URQ) {
|
||||
ParseBtreeIndexUrq(buffer, blkno);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3109,10 +3166,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 +3182,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 +3212,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 +3235,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 +3257,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;
|
||||
}
|
||||
|
|
@ -3433,8 +3484,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 +3715,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;
|
||||
}
|
||||
|
|
@ -3751,8 +3800,7 @@ static int parse_cu_file(char* filename, uint64 offset)
|
|||
errno_t rc = snprintf_s(fullpath, sizeof(fullpath), sizeof(fullpath) - 1, "%s.%d", filename, seg_num);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
|
||||
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 +3859,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 +3956,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 +4018,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;
|
||||
}
|
||||
|
|
@ -4108,8 +4153,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 +4208,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;
|
||||
}
|
||||
|
|
@ -4422,7 +4465,7 @@ static bool parse_dw_file(const char* file_name, uint32 start_page, uint32 page_
|
|||
(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(meta_name_tmp, PATH_MAX, DW_META_FILE);
|
||||
securec_check(rc, "", "");
|
||||
meta_name = basename(meta_name_tmp);
|
||||
|
||||
|
|
@ -4433,6 +4476,7 @@ static bool parse_dw_file(const char* file_name, uint32 start_page, uint32 page_
|
|||
securec_check(rc, "", "");
|
||||
|
||||
fd = fopen(meta_full_path, "rb+");
|
||||
|
||||
if (fd == NULL) {
|
||||
fprintf(stderr, "%s: %s\n", meta_full_path, strerror(errno));
|
||||
return false;
|
||||
|
|
@ -4598,7 +4642,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 +4714,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);
|
||||
|
|
@ -5384,7 +5428,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 +5479,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},
|
||||
|
|
@ -5588,7 +5630,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 +5654,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 +5760,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,19 +5782,10 @@ 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)) {
|
||||
(hackingtype > HACKING_UNDO && hackingtype != HACKING_DW && hackingtype != HACKING_SEGMENT &&
|
||||
hackingtype != HACKING_INDEX_URQ)) {
|
||||
fprintf(stderr, "Start point or block number only takes effect when hacking segment/heap/undo/index.\n");
|
||||
start_point = num_block = 0;
|
||||
}
|
||||
|
|
@ -5788,13 +5811,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;
|
||||
|
|
@ -5835,6 +5851,13 @@ int main(int argc, char** argv)
|
|||
}
|
||||
break;
|
||||
|
||||
case HACKING_INDEX_URQ:
|
||||
if (!parse_page_file(filename, SEG_INDEX_URQ, start_point, num_block)) {
|
||||
(void)fprintf(stderr, "Error during parsing index urq file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case HACKING_FILENODE:
|
||||
if (!parse_filenodemap_file(filename)) {
|
||||
fprintf(stderr, "Error during parsing filenode_map file %s\n", filename);
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ static void parse_compress_meta(StringInfo outputBuf, char* page_content, Relati
|
|||
int size = PageGetSpecialSize(page_header);
|
||||
|
||||
TupleDesc desc = RelationGetDescr(rel);
|
||||
FormData_pg_attribute* att = desc->attrs;
|
||||
Form_pg_attribute* att = desc->attrs;
|
||||
int attrno;
|
||||
int attrnum = desc->natts;
|
||||
|
||||
|
|
@ -444,7 +444,7 @@ static void parse_compress_meta(StringInfo outputBuf, char* page_content, Relati
|
|||
char mode = 0;
|
||||
|
||||
for (attrno = 0; attrno < attrnum && cmprsOff < size; ++attrno) {
|
||||
Form_pg_attribute thisatt = &att[attrno];
|
||||
Form_pg_attribute thisatt = att[attrno];
|
||||
int metaSize = 0;
|
||||
|
||||
metaInfo = PageCompress::FetchAttrCmprMeta(start + cmprsOff, thisatt->attlen, &metaSize, &mode);
|
||||
|
|
|
|||
|
|
@ -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, 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, 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,25 @@ static void pgss_ProcessUtility(processutility_context* processutility_cxt,
|
|||
PG_TRY();
|
||||
{
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(processutility_cxt,
|
||||
prev_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
else
|
||||
standard_ProcessUtility(processutility_cxt,
|
||||
standard_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
nested_level--;
|
||||
}
|
||||
PG_CATCH();
|
||||
|
|
@ -821,23 +817,25 @@ 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,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
else
|
||||
standard_ProcessUtility(processutility_cxt,
|
||||
standard_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif /* PGXC */
|
||||
completionTag,
|
||||
context,
|
||||
isCTAS);
|
||||
completionTag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1860,7 +1858,7 @@ static void fill_in_constant_lengths(pgssJumbleState* jstate, const char* query)
|
|||
locs = jstate->clocations;
|
||||
|
||||
/* initialize the flex scanner --- should match raw_parser() */
|
||||
yyscanner = scanner_init(query, &yyextra, &ScanKeywords, ScanKeywordTokens);
|
||||
yyscanner = scanner_init(query, &yyextra, ScanKeywords, NumScanKeywords);
|
||||
|
||||
/* Search for each constant, in sequence */
|
||||
for (i = 0; i < jstate->clocations_count; i++) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
*/
|
||||
#include "postgres.h"
|
||||
#include "knl/knl_variable.h"
|
||||
#include "port/pg_bitutils.h"
|
||||
|
||||
#include "trgm.h"
|
||||
|
||||
|
|
@ -41,6 +40,264 @@ extern "C" Datum gtrgm_picksplit(PG_FUNCTION_ARGS);
|
|||
|
||||
#define GETENTRY(vec, pos) ((TRGM*)DatumGetPointer((vec)->vector[(pos)].key))
|
||||
|
||||
/* Number of one-bits in an unsigned byte */
|
||||
static const uint8 number_of_ones[256] = {0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
6,
|
||||
7,
|
||||
7,
|
||||
8};
|
||||
|
||||
Datum gtrgm_in(PG_FUNCTION_ARGS)
|
||||
{
|
||||
elog(ERROR, "not implemented");
|
||||
|
|
@ -420,7 +677,11 @@ Datum gtrgm_same(PG_FUNCTION_ARGS)
|
|||
|
||||
static int4 sizebitvec(BITVECP sign)
|
||||
{
|
||||
return pg_popcount(sign, SIGLEN);
|
||||
int4 size = 0, i;
|
||||
|
||||
LOOPBYTE
|
||||
size += number_of_ones[(unsigned char)sign[i]];
|
||||
return size;
|
||||
}
|
||||
|
||||
static int hemdistsign(BITVECP a, BITVECP b)
|
||||
|
|
@ -430,8 +691,7 @@ static int hemdistsign(BITVECP a, BITVECP b)
|
|||
LOOPBYTE
|
||||
{
|
||||
diff = (unsigned char)(a[i] ^ b[i]);
|
||||
/* Using the popcount functions here isn't likely to win */
|
||||
dist += pg_number_of_ones[diff];
|
||||
dist += number_of_ones[diff];
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -45,4 +43,4 @@ target_link_directories(pg_xlogdump PUBLIC
|
|||
${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))
|
||||
|
|
|
|||
|
|
@ -145,36 +145,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 +187,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
|
|
@ -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
|
||||
|
|
@ -699,14 +700,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 +721,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 +799,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, 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, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
} else {
|
||||
standard_ProcessUtility(processutility_cxt, dest, sentToRemote, completionTag,
|
||||
context, false);
|
||||
standard_ProcessUtility(parsetree, queryString, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -831,7 +825,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 +1603,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, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
} else {
|
||||
standard_ProcessUtility(processutility_cxt, dest, sentToRemote, completionTag,
|
||||
context, false);
|
||||
standard_ProcessUtility(parsetree, queryString, params, isTopLevel, dest, sentToRemote, completionTag,
|
||||
false);
|
||||
}
|
||||
flush_access_logs(AUDIT_OK);
|
||||
send_mng_events(AUDIT_OK);
|
||||
|
|
@ -1777,7 +1770,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 +1810,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
|
||||
|
|
|
|||
|
|
@ -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, 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,20 @@ static void sepgsql_utility_command(processutility_context* processutility_cxt,
|
|||
}
|
||||
|
||||
if (next_ProcessUtility_hook)
|
||||
(*next_ProcessUtility_hook)(processutility_cxt,
|
||||
(*next_ProcessUtility_hook)(parsetree,
|
||||
queryString,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
#endif
|
||||
completionTag);
|
||||
else
|
||||
standard_ProcessUtility(processutility_cxt,
|
||||
standard_ProcessUtility(parsetree,
|
||||
queryString,
|
||||
params,
|
||||
isTopLevel,
|
||||
dest,
|
||||
#ifdef PGXC
|
||||
sentToRemote,
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ Datum /* have to return HeapTuple to Executor */
|
|||
snprintf(sql, sizeof(sql), "INSERT INTO %s VALUES (", relname);
|
||||
for (i = 1; i <= natts; i++) {
|
||||
ctypes[i - 1] = SPI_gettypeid(tupdesc, i);
|
||||
if (!(tupdesc->attrs[i - 1].attisdropped)) /* skip dropped columns */
|
||||
if (!(tupdesc->attrs[i - 1]->attisdropped)) /* skip dropped columns */
|
||||
{
|
||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%c$%d", separ, i);
|
||||
separ = ',';
|
||||
|
|
|
|||
|
|
@ -107,9 +107,9 @@ static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions*
|
|||
|
||||
foreach (option, ctx->output_plugin_options) {
|
||||
DefElem* elem = (DefElem*)lfirst(option);
|
||||
|
||||
|
||||
Assert(elem->arg == NULL || IsA(elem->arg, String));
|
||||
|
||||
|
||||
if (strcmp(elem->defname, "include-xids") == 0) {
|
||||
/* if option does not provide a value, it means its value is true */
|
||||
if (elem->arg == NULL) {
|
||||
|
|
@ -194,7 +194,7 @@ static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN*
|
|||
|
||||
OutputPluginPrepareWrite(ctx, true);
|
||||
appendStringInfoString(ctx->out, "COMMIT");
|
||||
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
|
||||
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
|
||||
appendStringInfo(ctx->out, " %lu", txn->csn);
|
||||
OutputPluginWrite(ctx, true);
|
||||
}
|
||||
|
|
@ -302,7 +302,7 @@ static void TupleToStringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple)
|
|||
Oid typoutput = 0; /* output function */
|
||||
Datum origval = 0; /* possibly toasted Datum */
|
||||
|
||||
Form_pg_attribute attr = &tupdesc->attrs[natt]; /* the attribute itself */
|
||||
Form_pg_attribute attr = tupdesc->attrs[natt]; /* the attribute itself */
|
||||
|
||||
if (attr->attisdropped || attr->attnum < 0) {
|
||||
continue;
|
||||
|
|
@ -354,7 +354,7 @@ static void TupleToStringinfoUpd(Relation relation, StringInfo s, TupleDesc tupd
|
|||
bool isnull = false; /* column is null? */
|
||||
bool typisvarlena = false;
|
||||
|
||||
Form_pg_attribute attr = &tupdesc->attrs[natt]; /* the attribute itself */
|
||||
Form_pg_attribute attr = tupdesc->attrs[natt]; /* the attribute itself */
|
||||
|
||||
if (attr->attisdropped || attr->attnum < 0 || !IsRelationReplidentKey(relation, attr->attnum)) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -1337,35 +1337,35 @@ static void validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool
|
|||
}
|
||||
|
||||
/* check that the types of the first two columns match */
|
||||
if (tupdesc->attrs[0].atttypid != tupdesc->attrs[1].atttypid)
|
||||
if (tupdesc->attrs[0]->atttypid != tupdesc->attrs[1]->atttypid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("invalid return type"),
|
||||
errdetail("First two columns must be the same type.")));
|
||||
|
||||
/* check that the type of the third column is INT4 */
|
||||
if (tupdesc->attrs[2].atttypid != INT4OID)
|
||||
if (tupdesc->attrs[2]->atttypid != INT4OID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("invalid return type"),
|
||||
errdetail("Third column must be type %s.", format_type_be(INT4OID))));
|
||||
|
||||
/* check that the type of the fourth column is TEXT if applicable */
|
||||
if (show_branch && tupdesc->attrs[3].atttypid != TEXTOID)
|
||||
if (show_branch && tupdesc->attrs[3]->atttypid != TEXTOID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("invalid return type"),
|
||||
errdetail("Fourth column must be type %s.", format_type_be(TEXTOID))));
|
||||
|
||||
/* check that the type of the fifth column is INT4 */
|
||||
if (show_branch && show_serial && tupdesc->attrs[4].atttypid != INT4OID)
|
||||
if (show_branch && show_serial && tupdesc->attrs[4]->atttypid != INT4OID)
|
||||
elog(ERROR,
|
||||
"query-specified return tuple not valid for Connectby: "
|
||||
"fifth column must be type %s",
|
||||
format_type_be(INT4OID));
|
||||
|
||||
/* check that the type of the fifth column is INT4 */
|
||||
if (!show_branch && show_serial && tupdesc->attrs[3].atttypid != INT4OID)
|
||||
if (!show_branch && show_serial && tupdesc->attrs[3]->atttypid != INT4OID)
|
||||
elog(ERROR,
|
||||
"query-specified return tuple not valid for Connectby: "
|
||||
"fourth column must be type %s",
|
||||
|
|
@ -1383,8 +1383,8 @@ static bool compatConnectbyTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupde
|
|||
Oid sql_atttypid;
|
||||
|
||||
/* check the key_fld types match */
|
||||
ret_atttypid = ret_tupdesc->attrs[0].atttypid;
|
||||
sql_atttypid = sql_tupdesc->attrs[0].atttypid;
|
||||
ret_atttypid = ret_tupdesc->attrs[0]->atttypid;
|
||||
sql_atttypid = sql_tupdesc->attrs[0]->atttypid;
|
||||
if (ret_atttypid != sql_atttypid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
|
|
@ -1393,8 +1393,8 @@ static bool compatConnectbyTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupde
|
|||
"not match return key field datatype.")));
|
||||
|
||||
/* check the parent_key_fld types match */
|
||||
ret_atttypid = ret_tupdesc->attrs[1].atttypid;
|
||||
sql_atttypid = sql_tupdesc->attrs[1].atttypid;
|
||||
ret_atttypid = ret_tupdesc->attrs[1]->atttypid;
|
||||
sql_atttypid = sql_tupdesc->attrs[1]->atttypid;
|
||||
if (ret_atttypid != sql_atttypid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
|
|
@ -1421,8 +1421,8 @@ static bool compatCrosstabTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdes
|
|||
return false;
|
||||
|
||||
/* check the rowid types match */
|
||||
ret_atttypid = ret_tupdesc->attrs[0].atttypid;
|
||||
sql_atttypid = sql_tupdesc->attrs[0].atttypid;
|
||||
ret_atttypid = ret_tupdesc->attrs[0]->atttypid;
|
||||
sql_atttypid = sql_tupdesc->attrs[0]->atttypid;
|
||||
if (ret_atttypid != sql_atttypid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
|
|
|
|||
|
|
@ -201,11 +201,13 @@ static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id)
|
|||
}
|
||||
static void tuple_to_stringinfo(Relation relation, StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool isOld)
|
||||
{
|
||||
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,14 +216,15 @@ 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 */
|
||||
bool isnull = true; /* column is null? */
|
||||
|
||||
attr = &tupdesc->attrs[natt];
|
||||
attr = tupdesc->attrs[natt];
|
||||
|
||||
/*
|
||||
* don't print dropped columns, we can't be sure everything is
|
||||
|
|
@ -237,14 +240,10 @@ static void tuple_to_stringinfo(Relation relation, StringInfo s, TupleDesc tupde
|
|||
if (attr->attnum < 0 || (isOld && !IsRelationReplidentKey(relation, attr->attnum)))
|
||||
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);
|
||||
|
||||
/* print attribute name */
|
||||
appendStringInfoChar(s, ' ');
|
||||
|
|
@ -327,13 +326,6 @@ static void pg_decode_change(
|
|||
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);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_UPDATE:
|
||||
appendStringInfoString(ctx->out, " UPDATE:");
|
||||
if (change->data.tp.oldtuple != NULL) {
|
||||
|
|
@ -347,19 +339,6 @@ static void pg_decode_change(
|
|||
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);
|
||||
break;
|
||||
case REORDER_BUFFER_CHANGE_DELETE:
|
||||
appendStringInfoString(ctx->out, " DELETE:");
|
||||
|
||||
|
|
@ -370,14 +349,6 @@ static void pg_decode_change(
|
|||
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);
|
||||
break;
|
||||
default:
|
||||
Assert(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<repoType>Generic</repoType>
|
||||
<id>
|
||||
<offering>Huawei Secure C</offering>
|
||||
<version>Huawei Secure C V100R001C01SPC010B002</version>
|
||||
<version>Huawei Secure C V100R001C01SPC012B002</version>
|
||||
</id>
|
||||
<copies>
|
||||
<copy>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<repoType>Generic</repoType>
|
||||
<id>
|
||||
<offering>DOPRA SSP</offering>
|
||||
<version>DOPRA SSP V300R021C10SPC120B500</version>
|
||||
<version>DOPRA SSP V300R022C00SPC050B200</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.3.0.340.B003</version>
|
||||
</id>
|
||||
<copies>
|
||||
<copy>
|
||||
|
|
@ -74,4 +74,4 @@
|
|||
</copies>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1186,7 +1186,7 @@ su - gaussdb
|
|||
the size of each individual file in the WAL log. It may be useful
|
||||
to adjust this size to control the granularity of WAL log shipping.
|
||||
The default size is 16 megabytes.
|
||||
The value must be a power of 2 between 1 and 512 (megabytes).
|
||||
The value must be a power of 2 between 1 and 64 (megabytes).
|
||||
Note that changing this value requires an gs_initdb.
|
||||
</para>
|
||||
</listitem>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ Complete list of usable sgml source files in this directory.
|
|||
<!ENTITY alterDatabase SYSTEM "alter_database.sgml">
|
||||
<!ENTITY alterDefaultPrivileges SYSTEM "alter_default_privileges.sgml">
|
||||
<!ENTITY alterDomain SYSTEM "alter_domain.sgml">
|
||||
<!ENTITY alterEventTrigger SYSTEM "alter_event_trigger.sgml">
|
||||
<!ENTITY alterExtension SYSTEM "alter_extension.sgml">
|
||||
<!ENTITY alterForeignDataWrapper SYSTEM "alter_foreign_data_wrapper.sgml">
|
||||
<!ENTITY alterForeignTable SYSTEM "alter_foreign_table.sgml">
|
||||
|
|
@ -27,7 +26,6 @@ Complete list of usable sgml source files in this directory.
|
|||
<!ENTITY alterOperator SYSTEM "alter_operator.sgml">
|
||||
<!ENTITY alterOperatorClass SYSTEM "alter_opclass.sgml">
|
||||
<!ENTITY alterOperatorFamily SYSTEM "alter_opfamily.sgml">
|
||||
<!ENTITY alterProcedure SYSTEM "alter_procedure.sgml">
|
||||
<!ENTITY alterRole SYSTEM "alter_role.sgml">
|
||||
<!ENTITY alterSchema SYSTEM "alter_schema.sgml">
|
||||
<!ENTITY alterServer SYSTEM "alter_server.sgml">
|
||||
|
|
@ -65,7 +63,6 @@ Complete list of usable sgml source files in this directory.
|
|||
<!ENTITY createConversion SYSTEM "create_conversion.sgml">
|
||||
<!ENTITY createDatabase SYSTEM "create_database.sgml">
|
||||
<!ENTITY createDomain SYSTEM "create_domain.sgml">
|
||||
<!ENTITY createEventTrigger SYSTEM "create_event_trigger.sgml">
|
||||
<!ENTITY createExtension SYSTEM "create_extension.sgml">
|
||||
<!ENTITY createForeignDataWrapper SYSTEM "create_foreign_data_wrapper.sgml">
|
||||
<!ENTITY createForeignTable SYSTEM "create_foreign_table.sgml">
|
||||
|
|
@ -110,7 +107,6 @@ Complete list of usable sgml source files in this directory.
|
|||
<!ENTITY dropConversion SYSTEM "drop_conversion.sgml">
|
||||
<!ENTITY dropDatabase SYSTEM "drop_database.sgml">
|
||||
<!ENTITY dropDomain SYSTEM "drop_domain.sgml">
|
||||
<!ENTITY dropEventTrigger SYSTEM "drop_event_trigger.sgml">
|
||||
<!ENTITY dropExtension SYSTEM "drop_extension.sgml">
|
||||
<!ENTITY dropForeignDataWrapper SYSTEM "drop_foreign_data_wrapper.sgml">
|
||||
<!ENTITY dropForeignTable SYSTEM "drop_foreign_table.sgml">
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<refentry id="SQL-ALTEREVENTTRIGGER">
|
||||
<refmeta>
|
||||
<refentrytitle>ALTER EVENT TRIGGER</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>ALTER EVENT TRIGGER</refname>
|
||||
<refpurpose>change the definition of an event trigger</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<indexterm zone="sql-altereventtrigger">
|
||||
<primary>ALTER EVENT TRIGGER</primary>
|
||||
</indexterm>
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER EVENT TRIGGER name DISABLE
|
||||
ALTER EVENT TRIGGER name ENABLE [ REPLICA | ALWAYS ]
|
||||
ALTER EVENT TRIGGER name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
|
||||
ALTER EVENT TRIGGER name RENAME TO new_name
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
@ -30,27 +30,13 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> DROP <replacea
|
|||
|
||||
<phrase>where <replaceable class="PARAMETER">member_object</replaceable> is:</phrase>
|
||||
|
||||
AGGREGATE <replaceable class="PARAMETER">agg_name</replaceable> (agg_type [, ...] ) |
|
||||
CAST (source_type AS target_type) |
|
||||
COLLATION <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
CONVERSION <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
DOMAIN <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
FOREIGN DATA WRAPPER <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
FOREIGN TABLE <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) |
|
||||
MATERIALIZED VIEW <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
OPERATOR <replaceable class="PARAMETER">operator_name</replaceable> (left_type, right_type) |
|
||||
OPERATOR CLASS <replaceable class="PARAMETER">object_name</replaceable> USING index_method |
|
||||
OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING index_method |
|
||||
[ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
SCHEMA <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
SERVER <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
TABLE <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
TEXT SEARCH CONFIGURATION <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
TEXT SEARCH DICTIONARY <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
TEXT SEARCH PARSER <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
TEXT SEARCH TEMPLATE <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
TYPE <replaceable class="PARAMETER">object_name</replaceable> |
|
||||
VIEW <replaceable class="PARAMETER">object_name</replaceable>
|
||||
</synopsis>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="para
|
|||
ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
|
||||
RENAME TO <replaceable>new_name</replaceable>
|
||||
ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
|
||||
OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
|
||||
OWNER TO <replaceable>new_owner</replaceable>
|
||||
ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
|
||||
SET SCHEMA <replaceable>new_schema</replaceable>
|
||||
|
||||
|
|
@ -41,7 +41,6 @@ ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="para
|
|||
SET <replaceable class="parameter">configuration_parameter</replaceable> FROM CURRENT
|
||||
RESET <replaceable class="parameter">configuration_parameter</replaceable>
|
||||
RESET ALL
|
||||
COMMENT <replaceable class="parameter">'text'</replaceable>
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ ALTER SCHEMA schema_name
|
|||
ALTER SCHEMA schema_name
|
||||
OWNER TO new_owner;
|
||||
ALTER SCHEMA schema_name {WITH | WITHOUT} BLOCKCHAIN;
|
||||
ALTER SCHEMA schema_name
|
||||
[ [ DEFAULT ] CHARACTER SET | CHARSET [ = ] charset ] [ [ DEFAULT ] COLLATE [ = ] collation ];
|
||||
NOTICE: '[ [ DEFAULT ] CHARACTER SET | CHARSET [ = ] charset ] [ [ DEFAULT ] COLLATE [ = ] collation ]' is only available in CENTRALIZED mode and B-format database!
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
@ -23,7 +23,6 @@ PostgreSQL documentation
|
|||
<synopsis>
|
||||
ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> CONNECTION '<replaceable>conninfo</replaceable>'
|
||||
ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> SET PUBLICATION <replaceable class="parameter">publication_name</replaceable> [, ...]
|
||||
ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> REFRESH PUBLICATION [ WITH ( <replaceable class="parameter">refresh_option</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] ) ]
|
||||
ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> ENABLE
|
||||
ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> SET ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )
|
||||
ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
|
||||
|
|
@ -47,23 +46,6 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
|
|||
(Currently, all subscription owners must be superusers, so the owner checks
|
||||
will be bypassed in practice. But this might change in the future.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When refreshing a publication we remove the relations that are no longer
|
||||
part of the publication and we also remove the table synchronization slots
|
||||
if there are any. It is necessary to remove these slots so that the resources
|
||||
allocated for the subscription on the remote host are released. If due to
|
||||
network breakdown or some other error, <productname>openGauss</productname>
|
||||
is unable to remove the slots, an ERROR will be reported. To proceed in this
|
||||
situation, the user either needs to retry the operation or disassociate the
|
||||
slot from the subscription and drop the subscription as explained in
|
||||
<xref linkend="sql-dropsubscription"/>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Commands <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command>
|
||||
cannot be executed inside a transaction block.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
|
|
@ -94,36 +76,6 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
|
|||
<term><literal>SET PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>REFRESH PUBLICATION</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Fetch missing table information from publisher. This will start
|
||||
replication of tables that were added to the subscribed-to publications
|
||||
since the last invocation of <command>REFRESH PUBLICATION</command> or
|
||||
since <command>CREATE SUBSCRIPTION</command>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<replaceable>refresh_option</replaceable> specifies additional options for the
|
||||
refresh operation. The supported options are:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>copy_data</literal> (<type>boolean</type>)</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies whether the existing data in the publications that are
|
||||
being subscribed to should be copied once the replication starts.
|
||||
The default is <literal>true</literal>. (Previously subscribed
|
||||
tables are not copied.)
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>ENABLE</literal></term>
|
||||
<listitem>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER SYSTEM SET { GUC_name } TO { GUC_value };
|
||||
|
||||
NOTICE: only supported in opengauss, not supported in distributeGauss or privateGauss.
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
|
|||
|
|
@ -51,19 +51,11 @@ column_clause
|
|||
| FORCE ROW LEVEL SECURITY
|
||||
| NO FORCE ROW LEVEL SECURITY
|
||||
| ENCRYPTION KEY ROTATION
|
||||
| AUTO_INCREMENT [ = ] value
|
||||
| ALTER INDEX index_name [ VISBLE | INVISIBLE ]
|
||||
| [ [ DEFAULT ] CHARACTER SET | CHARSET [ = ] charset ] [ [ DEFAULT ] COLLATE [ = ] collation ]
|
||||
| CONVERT TO CHARACTER SET | CHARSET charset [ COLLATE collation ]
|
||||
NOTICE: '[ CHARACTER SET | CHARSET ]' is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: '[ COLLATE ]' is only available in CENTRALIZED mode and B-format database!
|
||||
where column_clause can be:
|
||||
ADD [ COLUMN ] column_name data_type [ CHARACTER SET | CHARSET charset ] [ compress_mode ] [ COLLATE collation ] [ column_constraint [ ... ] ] [ FIRST | AFTER column_name ]
|
||||
ADD [ COLUMN ] column_name data_type [ compress_mode ] [ COLLATE collation ] [ column_constraint [ ... ] ]
|
||||
| MODIFY column_name data_type
|
||||
| MODIFY column_name [ CONSTRAINT constraint_name ] NOT NULL [ ENABLE ]
|
||||
| MODIFY column_name [ CONSTRAINT constraint_name ] NULL
|
||||
| MODIFY [ COLUMN ] column_name data_type [ CHARACTER SET | CHARSET charset ] [ COLLATE collation ] [ column_constraint [ ... ] ] [FIRST | AFTER column_name]
|
||||
| CHANGE [ COLUMN ] column_name new_column_name data_type [ CHARACTER SET | CHARSET charset ] [ COLLATE collation ] [ column_constraint [ ... ] ] [FIRST | AFTER column_name]
|
||||
| DROP [ COLUMN ] [ IF EXISTS ] column_name [ RESTRICT | CASCADE ]
|
||||
| ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ USING expression ]
|
||||
| ALTER [ COLUMN ] column_name { SET DEFAULT expression | DROP DEFAULT }
|
||||
|
|
@ -74,32 +66,28 @@ ADD [ COLUMN ] column_name data_type [ CHARACTER SET | CHARSET charset ] [ compr
|
|||
| ALTER [ COLUMN ] column_name SET ( {attribute_option = value} [, ... ] )
|
||||
| ALTER [ COLUMN ] column_name RESET ( attribute_option [, ... ] )
|
||||
| ALTER [ COLUMN ] column_name SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
|
||||
NOTICE: 'MODIFY [ COLUMN ] ...' action is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: 'CHANGE [ COLUMN ] ...' action is only available in CENTRALIZED mode and B-format database!
|
||||
where column_constraint can be:
|
||||
[ CONSTRAINT constraint_name ]
|
||||
{ NOT NULL |
|
||||
NULL |
|
||||
CHECK ( expression ) |
|
||||
DEFAULT default_expr |
|
||||
GENERATED ALWAYS AS ( generation_expr ) [STORED] |
|
||||
AUTO_INCREMENT |
|
||||
UNIQUE [KEY] index_parameters |
|
||||
GENERATED ALWAYS AS ( generation_expr ) STORED |
|
||||
UNIQUE index_parameters |
|
||||
PRIMARY KEY index_parameters |
|
||||
ENCRYPTED WITH ( COLUMN_ENCRYPTION_KEY = column_encryption_key, ENCRYPTION_TYPE = encryption_type_value ) |
|
||||
REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
|
||||
[ ON DELETE action ] [ ON UPDATE action ] }
|
||||
[ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
|
||||
NOTICE: 'UNIQUE KEY' in table_constraint is only available in CENTRALIZED mode and B-format database!
|
||||
where compress_mode can be:
|
||||
{ DELTA | PREFIX | DICTIONARY | NUMSTR | NOCOMPRESS }
|
||||
where table_constraint can be:
|
||||
[ CONSTRAINT [ constraint_name ] ]
|
||||
[ CONSTRAINT constraint_name ]
|
||||
{ CHECK ( expression ) |
|
||||
UNIQUE [ idx_name ] [ USING method ] ( { { column_name | ( expression ) } [ ASC | DESC ] } [, ... ] ) index_parameters [ VISIBLE | INVISIBLE ] |
|
||||
PRIMARY KEY [ USING method ] ( { column_name [ ASC | DESC ] }[, ... ] ) index_parameters [ VISIBLE | INVISIBLE ] |
|
||||
UNIQUE ( column_name [, ... ] ) index_parameters |
|
||||
PRIMARY KEY ( column_name [, ... ] ) index_parameters |
|
||||
PARTIAL CLUSTER KEY ( column_name [, ... ] ) |
|
||||
FOREIGN KEY [ idx_name ] ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
|
||||
FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
|
||||
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] }
|
||||
[ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
|
||||
where index_parameters can be:
|
||||
|
|
@ -109,17 +97,6 @@ where table_constraint_using_index can be:
|
|||
[ CONSTRAINT constraint_name ]
|
||||
{ UNIQUE | PRIMARY KEY } USING INDEX index_name
|
||||
[ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
|
||||
|
||||
NOTICE: '[ constraint_name ]' in table_constraint is optional in CENTRALIZED mode and B-format database, it is mandatory in other scenarios.
|
||||
NOTICE: '[ index_name ]' in table_constraint is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: '[ USING method ]' in table_constraint is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: '[ ASC | DESC ]' in table_constraint is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: '( expression )' in 'UNIQUE' clause of table_constraint is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: 'AUTO_INCREMENT' is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: '[ FIRST | AFTER column_name ]' clause is only available in CENTRALIZED mode!
|
||||
NOTICE: '[ FIRST | AFTER column_name ]' in 'MODIFY | CHANGE [ COLUMN ] ...' clause is only available in B-format database!
|
||||
NOTICE: '[ CHARACTER SET | CHARSET charset ]' is only available in CENTRALIZED mode and B-format database!
|
||||
NOTICE: '[ VISIBLE | INVISIBLE ]' is only avaliable in CENTRALIZED mode and B-format database!
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER TABLE [ IF EXISTS ] { table_name [*] | ONLY table_name | ONLY ( table_name )}
|
||||
{ action [, ... ] | rename_clause | reset_clause };
|
||||
action [, ... ];
|
||||
ALTER TABLE [ IF EXISTS ] { table_name [*] | ONLY table_name | ONLY ( table_name )}
|
||||
RENAME PARTITION { partion_name | FOR ( partition_value [, ...] ) } TO partition_new_name;
|
||||
|
||||
where action can be:
|
||||
move_clause |
|
||||
|
|
@ -28,16 +30,16 @@ MOVE PARTITION { partion_name | FOR ( partition_value [, ...] ) } TABLESPACE tab
|
|||
where exchange_clause can be:
|
||||
EXCHANGE PARTITION { ( partition_name ) | FOR ( partition_value [, ...] ) }
|
||||
WITH TABLE {[ ONLY ] ordinary_table_name | ordinary_table_name * | ONLY ( ordinary_table_name )}
|
||||
[ { WITH | WITHOUT } VALIDATION ] [ VERBOSE ] [ UPDATE GLOBAL INDEX ]
|
||||
[ { WITH | WITHOUT } VALIDATION ] [ VERBOSE ]
|
||||
where row_clause can be:
|
||||
{ ENABLE | DISABLE } ROW MOVEMENT
|
||||
where merge_clause can be:
|
||||
MERGE PARTITIONS { partition_name } [, ...] INTO PARTITION partition_name
|
||||
[ TABLESPACE tablespacename ] [ UPDATE GLOBAL INDEX ]
|
||||
[ TABLESPACE tablespacename ]
|
||||
where modify_clause can be:
|
||||
MODIFY PARTITION partition_name { UNUSABLE LOCAL INDEXES | REBUILD UNUSABLE LOCAL INDEXES }
|
||||
where split_clause can be:
|
||||
SPLIT PARTITION { partition_name | FOR ( partition_value [, ...] ) } { split_point_clause | no_split_point_clause } [ UPDATE GLOBAL INDEX ]
|
||||
SPLIT PARTITION { partition_name | FOR ( partition_value [, ...] ) } { split_point_clause | no_split_point_clause }
|
||||
where split_point_clause can be:
|
||||
AT ( partition_value ) INTO ( PARTITION partition_name [ TABLESPACE tablespacename ] , PARTITION partition_name [ TABLESPACE tablespacename ] )
|
||||
where no_split_point_clause can be:
|
||||
|
|
@ -58,13 +60,10 @@ PARTITION partition_name {
|
|||
{END({partition_value | MAXVALUE})}
|
||||
} [TABLESPACE tablespace_name]
|
||||
where drop_clause can be:
|
||||
DROP PARTITION { partition_name | FOR ( partition_value [, ...] ) } [ UPDATE GLOBAL INDEX ]
|
||||
DROP PARTITION { partition_name | FOR ( partition_value [, ...] ) }
|
||||
where truncate_clause can be:
|
||||
TRUNCATE PARTITION { partition_name | FOR ( partition_value [, ...] ) } [ UPDATE GLOBAL INDEX ]
|
||||
where rename_clause can be:
|
||||
RENAME PARTITION { partion_name | FOR ( partition_value [, ...] ) } TO partition_new_name;
|
||||
where reset_clause can be:
|
||||
RESET PARTITION;
|
||||
NOTICE: 'truncate_clause' is only avaliable in CENTRALIZED mode!
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
@ -11,16 +11,13 @@
|
|||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER TABLE [ IF EXISTS ] { table_name [*] | ONLY table_name | ONLY ( table_name )}
|
||||
{ action [, ... ] | reset_clause };
|
||||
action [, ... ];
|
||||
|
||||
where action can be:
|
||||
row_clause |
|
||||
add_clause |
|
||||
drop_clause |
|
||||
split_clause |
|
||||
truncate_clause
|
||||
where row_clause can be:
|
||||
{ ENABLE | DISABLE } ROW MOVEMENT
|
||||
where add_clause can be:
|
||||
ADD { partition_less_than_item | partition_list_item } [ ( subpartition_definition_list ) ]
|
||||
MODIFY PARTITION partition_name ADD subpartition_definition
|
||||
|
|
@ -29,7 +26,7 @@ PARTITION partition_name VALUES LESS THAN ( partition_value | MAXVALUE ) [ TABLE
|
|||
where partition_list_item can be:
|
||||
PARTITION partition_name VALUES ( partition_value [, ...] | DEFAULT ) [ TABLESPACE tablespacename ]
|
||||
where subpartition_definition_list can be:
|
||||
SUBPARTITION subpartition_name { VALUES LESS THAN ( partition_value | MAXVALUE ) | VALUES ( partition_value [, ...] | DEFAULT ) } [ TABLESPACE tablespace ]
|
||||
SUBPARTITION subpartition_name [ VALUES LESS THAN ( partition_value | MAXVALUE ) | VALUES ( partition_value [, ...] | DEFAULT )] [ TABLESPACE tablespace ]
|
||||
where drop_clause can be:
|
||||
DROP PARTITION { partition_name | FOR ( partition_value ) } [ UPDATE GLOBAL INDEX ]
|
||||
DROP SUBPARTITION { subpartition_name | FOR ( partition_value, subpartition_value ) } [ UPDATE GLOBAL INDEX ]
|
||||
|
|
@ -40,8 +37,7 @@ AT ( subpartition_value ) INTO ( SUBPARTITION subpartition_name [ TABLESPACE tab
|
|||
VALUES ( subpartition_value ) INTO ( SUBPARTITION subpartition_name [ TABLESPACE tablespacename ] , SUBPARTITION subpartition_name [ TABLESPACE tablespacename ] )
|
||||
where truncate_clause can be:
|
||||
TRUNCATE SUBPARTITION { subpartition_name } [ UPDATE GLOBAL INDEX ]
|
||||
where reset_clause can be:
|
||||
RESET PARTITION;
|
||||
NOTICE: 'ALTER TABLE SUBPARTITION' is only avaliable in CENTRALIZED mode!
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER USER [ IF EXISTS ] user_name [ [ WITH ] option [ ... ] ];
|
||||
ALTER USER user_name [ [ WITH ] option [ ... ] ];
|
||||
ALTER USER user_name
|
||||
RENAME TO new_name;
|
||||
ALTER USER user_name [ IN DATABASE database_name ]
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ ALTER VIEW [ IF EXISTS ] view_name
|
|||
SET ( {view_option_name [= view_option_value]} [, ... ] );
|
||||
ALTER VIEW [ IF EXISTS ] view_name
|
||||
RESET ( view_option_name [, ... ] );
|
||||
ALTER [DEFINER = user] VIEW view_name [ ( column_name [, ...] ) ]
|
||||
AS query;
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
[ table_name [ ( column_name [, ...] ) ] ];
|
||||
{ANALYZE | ANALYSE} [ VERBOSE ]
|
||||
[ table_name [ ( column_name [, ...] ) ] ]
|
||||
PARTITION (partition_name);
|
||||
PARTITION patrition_name;
|
||||
{ANALYZE | ANALYSE} [ VERBOSE ]
|
||||
{ foreign_table_name | FOREIGN TABLES };
|
||||
{ANALYZE | ANALYSE} [ VERBOSE ]
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
{ANALYZE | ANALYSE} VERIFY {FAST|COMPLETE}
|
||||
table_name|index_name [CASCADE];
|
||||
{ANALYZE | ANALYSE} VERIFY {FAST|COMPLETE}
|
||||
table_name PARTITION (partition_name) [CASCADE];
|
||||
table_name PARTITION (patrition_name) [CASCADE];
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
[ table_name [ ( column_name [, ...] ) ] ];
|
||||
{ ANALYZE | ANALYSE } [ VERBOSE ]
|
||||
[ table_name [ ( column_name [, ...] ) ] ]
|
||||
PARTITION (partition_name);
|
||||
PARTITION patrition_name;
|
||||
{ ANALYZE | ANALYSE } [ VERBOSE ]
|
||||
{ foreign_table_name | FOREIGN TABLES };
|
||||
{ ANALYZE | ANALYSE } [ VERBOSE ]
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
{ ANALYZE | ANALYSE } VERIFY { FAST | COMPLETE };
|
||||
{ ANALYZE | ANALYSE } VERIFY { FAST | COMPLETE } table_name | index_name [ CASCADE ];
|
||||
{ ANALYZE | ANALYSE } VERIFY { FAST | COMPLETE }
|
||||
table_name PARTITION (partition_name) [ CASCADE ];
|
||||
table_name PARTITION (patrition_name) [ CASCADE ];
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
</refentry>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue