Compare commits

..

444 Commits

Author SHA1 Message Date
opengauss-bot a548f5c3c6
!1675 修复发布订阅死锁问题
Merge pull request !1675 from 薛蒙恩/pubsub_deadlock
2022-04-24 01:53:42 +00:00
opengauss-bot eb4e54d4eb
!1678 openGauss 发布订阅支持gs_probackup备份恢复后连接不断开
Merge pull request !1678 from chenxiaobin/probackup
2022-04-22 02:42:08 +00:00
chenxiaobin19 3f7a909887 gs_probackup支持备份发布订阅的逻辑复制槽 2022-04-18 20:56:52 +08:00
xue_meng_en d8b89ceea5 修复发布订阅死锁问题 2022-04-16 19:34:20 +08:00
opengauss-bot 2250adfd4b
!1671 Implementing Monte Carlo Tree Search Algorithm
Merge pull request !1671 from liuly/master
2022-04-15 07:36:01 +00:00
flyly fd34b5da2a Implementing Monte Carlo Tree Search Algorithm 2022-04-14 17:11:09 +08:00
opengauss-bot 7f97d633f1
!1665 发布订阅支持以二进制格式发送数据和发布端主备切换不断开
Merge pull request !1665 from 薛蒙恩/pubsub330
2022-04-12 01:32:52 +00:00
opengauss-bot 6ba4c95f5f
!1666 修复enable_global_syscache关闭时连接B兼容性数据库的core问题
Merge pull request !1666 from chenxiaobin/fixbcore
2022-04-11 11:10:58 +00:00
xue_meng_en 5755feee5d 发布订阅支持主备切换不断开 2022-04-11 10:14:20 +08:00
opengauss-bot cd5d44d66c
!1668 gs_ctl添加-C参数适配流式容灾
Merge pull request !1668 from zhangxubo/master
2022-04-08 08:37:04 +00:00
zhang_xubo 2d657cddbe 添加参数适配流式容灾 2022-04-08 15:13:35 +08:00
chenxiaobin19 ccd674c159 修复enable_global_syscache关闭时连接B兼容性数据库的core问题 2022-04-08 11:11:07 +08:00
xue_meng_en 8292238381 发布订阅支持以二进制格式发送数据 2022-04-07 11:08:45 +08:00
opengauss-bot 5054ddd002
!1661 修复sql插件切换数据库插件依然存在
Merge pull request !1661 from 仲夏十三/bb0aa02e
2022-04-06 08:26:34 +00:00
ganyang 48a5033c18 fix space error 2022-04-06 10:32:10 +08:00
ganyang 811a9afcd9 optimize judgement 2022-04-02 16:44:36 +08:00
ganyang bb0aa02eb0 fix plugin hook issue 2022-04-02 15:01:58 +08:00
opengauss-bot 02c14696bf
!1657 【轻量级 PR】:修复mxid_to_string在TopMemoryContext分配内存的问题
Merge pull request !1657 from chenxiaobin/N/A
2022-04-01 07:59:00 +00:00
chenxiaobin 877f0b69e3
修复mxid_to_string在TopMemoryContext分配内存的问题 2022-04-01 06:53:42 +00:00
opengauss-bot 120ddcc6d8
!1654 【轻量级 PR】:修复CheckTimeout TimestampTz和float类型运算导致的精度丢失问题
Merge pull request !1654 from chenxiaobin/N/A
2022-04-01 06:17:39 +00:00
opengauss-bot 2cc80a5727
!1656 回滚pg_stat_get_wal_senders的升级
Merge pull request !1656 from 胡正超/master
2022-04-01 03:38:06 +00:00
gentle_hu 6d8bec171c revert upgrade of pg_stat_get_wal_senders() 2022-04-01 10:42:18 +08:00
chenxiaobin 9f7da01725
修复CheckTimeout TimestampTz和float类型运算导致的精度丢失问题 2022-04-01 02:17:51 +00:00
opengauss-bot ea938c947e
!1635 修复om安装时gs_guc设置 '' 给sync_standby_names解析错误的问题。
Merge pull request !1635 from 胡正超/anyxmaster
2022-03-31 14:53:24 +00:00
opengauss-bot 498d7ac08d
!1652 修复主备升级到3.0.0时失败的问题
Merge pull request !1652 from 胡正超/fixanyxupgrade
2022-03-31 14:33:55 +00:00
gentle_hu 40b717d9dd mv new column of pg_stat_get_wal_senders to tail 2022-03-31 21:29:49 +08:00
gentle_hu 94aeb766e5 fix issue of sync_standby_names='' 2022-03-31 20:08:33 +08:00
opengauss-bot 8577a61c7b
!1649 revert “发布订阅支持以二进制格式发送数据和主备切换不断开”
Merge pull request !1649 from 薛蒙恩/pubsub_revert
2022-03-31 11:33:59 +00:00
xue_meng_en 59db2a14cc Revert "发布订阅支持以二进制格式发送数据"
This reverts commit 71f53e575c.
2022-03-31 14:55:10 +08:00
xue_meng_en e7795cd01c Revert "发布订阅支持主备切换不断开"
This reverts commit aadf88ecc6.
2022-03-31 14:54:58 +08:00
opengauss-bot ee30df5221
!1633 小型化增加gs probackup
Merge pull request !1633 from 吴岳川/master
2022-03-30 03:41:23 +00:00
opengauss-bot 5a6e2f6152
!1644 【bugfix】修复高并发下不能创建新连接,数据库hang住问题,合入master。
Merge pull request !1644 from li_jianqiu/cherry-pick-1648555047
2022-03-30 01:57:00 +00:00
wuyuechuan b33b47a9bd 小型化增加gs probackup 2022-03-30 09:45:33 +08:00
li_jianqiu 9fe77cc9b6 fixed 56422b7 from https://gitee.com/li_jianqiu/openGauss-server/pulls/1634
【bugfix】从应用端看连接数并没有达到1W最大连接数,但是数据库堆栈中存在13800个线程,也不能创建新连接,数据库hang住。
2022-03-29 11:57:27 +00:00
opengauss-bot 7ddd053f55
!1630 【轻量级 PR】:修改replication origin lwlock名称
Merge pull request !1630 from pengjiong/N/A
2022-03-28 07:06:00 +00:00
opengauss-bot 557583acd0
!1511 发布订阅支持以二进制格式发送数据和发布端主备切换不断开
Merge pull request !1511 from 薛蒙恩/pubsub330
2022-03-28 06:59:50 +00:00
opengauss-bot 1b1642e3ca
!1632 gs_dbmind: enhance gs_dbmind and add README.md
Merge pull request !1632 from wangtq/master
2022-03-28 02:06:02 +00:00
w00464751 5fbf995e8f optimize gs_dbmind and add docs
Offering: GaussDB Kernel

More detail: opt
2022-03-26 17:57:20 +08:00
opengauss-bot 2d8130e1b5
!1621 gs_ctl启动gaussdb服务后分离postmaster进程
Merge pull request !1621 from fairyfar/master
2022-03-26 07:32:19 +00:00
opengauss-bot b710043d0c
!1625 修复postgis创建postgis_topology扩展不支持的问题
Merge pull request !1625 from zhangxubo/3.0.0_dev
2022-03-26 06:12:46 +00:00
opengauss-bot d36d8ebbff
!1583 【轻量级 PR】:修复scanEreport工具的内存泄露问题
Merge pull request !1583 from pengjiong/N/A
2022-03-26 03:07:18 +00:00
pengjiong 827bdfc040
修改lwlock名称 2022-03-26 02:58:11 +00:00
opengauss-bot 8c3c4ef12a
!1626 修复问题:truncate时错误将正确页面的nchunks置0
Merge pull request !1626 from 吴岳川/master
2022-03-26 01:40:37 +00:00
zhang_xubo f9a294bc2e support CreateDomainStmt for openGauss 2022-03-26 09:16:29 +08:00
wuyuechuan 71468cb8ad truncate时错误将正确页面的nchunks置0 2022-03-25 18:12:19 +08:00
opengauss-bot 39e2278922
!1624 SWCB: suspend warning if column can be found in upper query
Merge pull request !1624 from 吴岳川/master
2022-03-25 07:25:37 +00:00
wuyuechuan ccc875f391 suspend warning if column can be found in upper query 2022-03-25 10:38:27 +08:00
xue_meng_en aadf88ecc6 发布订阅支持主备切换不断开 2022-03-25 09:19:02 +08:00
xue_meng_en 71f53e575c 发布订阅支持以二进制格式发送数据 2022-03-25 09:18:43 +08:00
opengauss-bot 588299a50a
!1612 删除非必要的告警
Merge pull request !1612 from chenxiaobin/fixwarning
2022-03-24 13:26:18 +00:00
fairyfar 42cf785d37 gs_ctl启动gaussdb服务后分离postmaster进程 2022-03-24 20:48:25 +08:00
opengauss-bot 5f0e5f3bcd
!1616 修复gs_dump备份后序列值递增问题
Merge pull request !1616 from 薛蒙恩/gsdump_sequence
2022-03-24 12:48:12 +00:00
opengauss-bot 3ac101d466
!1607 2.0.0回合ANYX到master
Merge pull request !1607 from 胡正超/anyxmaster
2022-03-24 01:50:11 +00:00
xue_meng_en 366d81a8fd 修复gs_dump备份后序列值递增问题 2022-03-23 15:28:36 +08:00
opengauss-bot b593bfb7f9
!1617 两阶段建表回滚过程,chunk_size!=1/2 blcksz时数据库宕机
Merge pull request !1617 from 吴岳川/twophase
2022-03-23 06:39:22 +00:00
wuyuechuan cc1ad7194f bugfix: 2pc rollback core dump when compress_chunk_size != 1/2 BLCKSZ 2022-03-23 11:15:43 +08:00
opengauss-bot 8ba5e324f6
!1502 gs_probackup支持压缩文件备份
Merge pull request !1502 from 吴岳川/compress_newly
2022-03-22 12:25:55 +00:00
opengauss-bot d3ec5ceb06
!1566 bugfix: 事务、两阶段场景,建表回滚、删表提交无法正确删除压缩数据文件
Merge pull request !1566 from 吴岳川/twophase
2022-03-22 12:08:24 +00:00
wuyuechuan abdcea01c2 twophase bugfix 2022-03-22 10:29:25 +08:00
chenxiaobin19 3ea2ac37e9 fix unnecessage warning 2022-03-21 20:17:02 +08:00
opengauss-bot 87de255604
!1608 Fix handling of varchar constants in MOT JIT
Merge pull request !1608 from Vinoth Veeraraghavan/master
2022-03-21 04:06:37 +00:00
gentle_hu e930224d92 support any x group 2022-03-21 10:32:01 +08:00
Vinoth Veeraraghavan 79516bb52d Fix handling of varchar constants in MOT JIT 2022-03-21 10:12:22 +08:00
wuyuechuan 260d3f3ea0 优化gs ctl、basebackup过程完整校验性能 2022-03-19 15:44:08 +08:00
wuyuechuan 74c8611e4a probackup: support backup compress files 2022-03-19 15:44:06 +08:00
opengauss-bot 3a552c955d
!1602 修复postgis编译问题
Merge pull request !1602 from 仲夏十三/postgis
2022-03-19 06:52:23 +00:00
opengauss-bot 948d3acf65
!1603 bugfix: ustore tpcc数据库重启失败
Merge pull request !1603 from 吴岳川/ustore
2022-03-19 06:48:38 +00:00
opengauss-bot 0c8b345357
!1605 回滚误合代码
Merge pull request !1605 from 胡正超/revert
2022-03-18 13:09:20 +00:00
gentle_hu 332019a810 revert 14bf3a2139 2022-03-18 19:09:20 +08:00
opengauss-bot 3fd1d61d11
!1594 huawei.com字段替换为opengauss.org
Merge pull request !1594 from zhoutianlian/master
2022-03-18 09:36:00 +00:00
opengauss-bot bc5a489b4b
!1589 修复从1.1.0/2.0.0版本升级到2.1.0后,回滚失败的问题
Merge pull request !1589 from pengjiong/fix_rollback
2022-03-18 07:53:44 +00:00
opengauss-bot f58c305a9b
!1589 修复从1.1.0/2.0.0版本升级到2.1.0后,回滚失败的问题
Merge pull request !1589 from pengjiong/fix_rollback
2022-03-18 07:53:43 +00:00
wuyuechuan c66d37c274 1 ustore bugfix
2  禁用段页式、USTORE压缩表使用
3  禁用压缩表页面修复
4  修复remote read功能
2022-03-18 14:08:38 +08:00
kidhasdream bd7df4b1a9 add makefile 2022-03-18 11:13:36 +08:00
opengauss-bot c1399b1719
!1558 修复无法使用域名搭建主从bug
Merge pull request !1558 from sharpwei/master
2022-03-18 03:01:39 +00:00
TotaJ 2eb31af0ec Fix rollback. 2022-03-18 09:10:23 +08:00
kidhasdream 76ef342528 fix postgis compile error 2022-03-17 21:31:08 +08:00
opengauss-bot fb4209396d
!1598 修复int相除精度被舍弃导致计划代价不准确的问题
Merge pull request !1598 from 胡正超/4ppreform
2022-03-17 13:10:51 +00:00
opengauss-bot fa2c2899b1
!1598 修复int相除精度被舍弃导致计划代价不准确的问题
Merge pull request !1598 from 胡正超/4ppreform
2022-03-17 13:10:51 +00:00
opengauss-bot 43d8ca835e
!1599 同步lob相关问题修复
Merge pull request !1599 from 胡正超/lob
2022-03-17 08:44:47 +00:00
gentle_hu 97baa93140 fix issue of lob 2022-03-17 14:26:01 +08:00
gentle_hu f5d6b792b3 fix err pruningRatio expr and misstake code 2022-03-17 14:25:09 +08:00
opengauss-bot de5d95be1b
!1597 修复startwitch下cte和subquery嵌套的问题
Merge pull request !1597 from 杨皓/master
2022-03-17 03:58:55 +00:00
yanghao 53e0d681cf fix problem that startwith result not correct while cte and subquery nesting 2022-03-17 11:07:16 +08:00
opengauss-bot 9963364bfa
!1596 恢复代码
Merge pull request !1596 from 胡正超/misscode
2022-03-16 12:35:59 +00:00
gentle_hu 05a04c1d9b missing code of bd515dfada Fix rename schema bug. 2022-03-16 19:44:07 +08:00
gentle_hu f3c1d59045 missing code of 3f3b578e1074a00bfe3bcd51c34d45eae06a5f72: char/varchar length count. 2022-03-16 19:43:18 +08:00
zhoutianlian 30013666 d5afad0539 change huawei.com to opengauss.org 2022-03-16 13:37:56 +08:00
opengauss-bot f3e27c51bc
!1590 修复创建多个订阅端,后创建的订阅端生效耗时较长的问题
Merge pull request !1590 from pengjiong/fix_snap_too_long
2022-03-16 02:06:11 +00:00
opengauss-bot cba028b3c2
!1555 订阅端应该连接到发布端的HA端口
Merge pull request !1555 from pengjiong/sub_auth
2022-03-16 02:00:04 +00:00
opengauss-bot 7997a8cf86
!1556 优雅地判断LLVM_MAJOR_VERSION宏定义为空还是数值
Merge pull request !1556 from fairyfar/master
2022-03-16 01:58:32 +00:00
opengauss-bot 83fb394ac6
!1578 b_sql_plugin插件内核适配修改
Merge pull request !1578 from chenxiaobin/b_sql_plugin
2022-03-16 01:19:36 +00:00
chenxiaobin19 59ff629c95 b_sql_plugin插件内核适配修改 2022-03-15 21:19:06 +08:00
opengauss-bot 9e4aa05aa5
!1576 修复多事务并发对同一元组更新加锁的xlog回放导致的数据不一致问题
Merge pull request !1576 from chenxiaobin/fixRelay
2022-03-15 11:53:55 +00:00
opengauss-bot 4a38ade643
!1591 gs_dump补充测试用例
Merge pull request !1591 from 吴岳川/gs_dump
2022-03-15 09:59:58 +00:00
opengauss-bot 5ab9e44e4b
!1586 修复因为修改pagewriter_sleep参数导致无法重启数据库的bug
Merge pull request !1586 from Cross-罗/unstop
2022-03-15 09:47:33 +00:00
opengauss-bot 919cdc58b1
!1586 修复因为修改pagewriter_sleep参数导致无法重启数据库的bug
Merge pull request !1586 from Cross-罗/unstop
2022-03-15 09:47:33 +00:00
wuyuechuan 164223adae add gs_dump_encrypt testcase 2022-03-15 17:08:04 +08:00
opengauss-bot ba28d92b06
!1572 单机下取消在read\out funcs中通过name+namespace来重写typeoid
Merge pull request !1572 from 胡正超/typeoid
2022-03-15 08:48:04 +00:00
opengauss-bot fc2467bbd1
!1572 单机下取消在read\out funcs中通过name+namespace来重写typeoid
Merge pull request !1572 from 胡正超/typeoid
2022-03-15 08:48:03 +00:00
luozihao 238df3258d 修复无法重启数据库的bug 2022-03-15 16:47:15 +08:00
opengauss-bot 97bd39fcfa
!1584 同步主线若干问题修复
Merge pull request !1584 from 杨皓/master
2022-03-15 07:25:57 +00:00
TotaJ a4a0147952 Fix wait too long when create some subscription at one time. 2022-03-15 11:04:31 +08:00
yanghao b7b93008e4 fix problem in regression test 2022-03-14 21:22:05 +08:00
openGaussDev cb831efeb2 fix problem that int16 upgrade
Match-id-e1d589f34a5010fa5d06d285a9d81900e127d908
2022-03-14 21:22:05 +08:00
openGaussDev 8fa9add60b logical decoding fix oldestXmin bug
Offering: openGaussDev

More detail: logical decoding fix oldestXmin bug

Match-id-87cb95184273b561cc007bc585ff4e45fc03c45a
2022-03-14 21:22:05 +08:00
openGaussDev 734764285d Offering: openGaussDev
More detail: 

# Conflicts:
#	src/gausskernel/storage/tcap/tcap_drop.cpp

Match-id-fa7ce45964faefccb43c1539268d6621d9a8dafd
2022-03-14 19:34:46 +08:00
openGaussDev a004cc661a fix mock password
Offering: openGaussDev

More detail: fix mock password

Match-id-4ea8e26156c0027ad6be4a2626aa666e7afc01e3
2022-03-14 19:34:46 +08:00
openGaussDev de631b5047 fix pitr force advance archive slot failed
Offering: openGaussDev

More detail: Modify pgarch walsender and walreceiver

Match-id-99d82487ad3d4e927779aa40996fb062fc7ea357
2022-03-14 19:34:46 +08:00
openGaussDev ea0a5061e9 primary must update the targetBarrier incrementally.
Offering: openGaussDev

More detail: targetBarrier更新必须递增

Match-id-be34323f18803bbe8851773fc97170ec8b73be02
2022-03-14 19:34:45 +08:00
openGaussDev 87eeb92227 The codegen function of VecAgg adapts to unique_check.
Offering: openGaussDev

More detail: The codegen function of VecAgg adapts to unique_check.

Match-id-4314cb63a4c79ae386cfe88a1681216111c9e14f
2022-03-14 19:34:45 +08:00
openGaussDev 2483136618 当口令作为脚本或命令的参数时,禁止通过历史操作查询(如上下键、ctrl + r、历史记录命令)等方式显示口令等敏感信息。
Offering: openGaussDev

More detail: 当口令作为脚本或命令的参数时,禁止通过历史操作查询(如上下键、ctrl + r、历史记录命令)等方式显示口令等敏感信息。

Match-id-1d8922456b1511c4f818ceaa37bf0755a1023217
2022-03-14 19:34:45 +08:00
openGaussDev e9c1bafa4c 修复 truncatecsnlog cutoff_xid 过大的问题
Offering: openGaussDev

More detail: 修复 truncatecsnlog cutoff_xid 过大的问题

Match-id-70294496a4db845521a52ac94f0a2b6556401c2e
2022-03-14 19:34:45 +08:00
openGaussDev 94a6f12608 fix
Offering: openGaussDev

More detail: fixed the instantaneous inconsistency of data between index scan and table scan in interval partition table

Signed-off-by:  <jiang.yu@huawei.com>

Match-id-a83cf32c48755b34a0443892b4875cf99e80e00c
2022-03-14 19:34:45 +08:00
openGaussDev b2c77be2dd Fix IndexBuildUHeapScan release buffer too early
Offering: openGaussDev

More detail: Fix IndexBuildUHeapScan release buffer too early

Match-id-a1c03d8bfb863446b058ec2220eccd49887dc97e
2022-03-14 19:34:45 +08:00
openGaussDev 76d76c8b12 DBE SCHEDULER
Offering: openGaussDev

More detail:credential 密码mask支持多个单引号

Match-id-1d86f3a0a3a407d3569f9ba892c38538f89c7cf5
2022-03-14 19:34:45 +08:00
openGaussDev fb6fb990a1 fix the erreport bugs
Offering: openGaussDev

More detail: fix the erreport of all double write history files

# Conflicts:
#	src/gausskernel/storage/access/transam/single_double_write.cpp

Match-id-0f22771c3109347655ae2c0e4b1acb21c8c89f23
2022-03-14 19:34:45 +08:00
openGaussDev c3339b5ba1 fix invalid memory in undo
Offering: openGaussDev

More detail: fix invalid memory in undo

Match-id-496852205f7ba0be46bf71ec29580aeece9d50f5
2022-03-14 19:34:45 +08:00
openGaussDev 9014fc5261 fix mock password
Offering: openGaussDev

More detail: fix mock password

Match-id-55ca9762c2d8270a6b5458977f906b00f6b777f2
2022-03-14 19:34:45 +08:00
openGaussDev 1f0543f212 parallel decoding change toastMask to the highest bit
Offering: openGaussDev

More detail: parallel decoding fix initialization bug

Match-id-8e0cddece001059dedf185e00506ed2f72f370e8
2022-03-14 19:34:45 +08:00
openGaussDev 6e1770b403 just calculate RTO when apply lsn update
Offering: openGaussDev

More detail: 可选

Match-id-1a6bcef19603d8a1f43286bec3a350c2760f0a0f
2022-03-14 19:34:45 +08:00
openGaussDev 2c01f72e88 codecheck
Offering: openGaussDev

More detail: codecheck

Match-id-082dcecf96ae3d928c3d77899d47d3a236932dd4
2022-03-14 19:34:45 +08:00
openGaussDev 1c8b74121d decorate xgboost Error information
Offering: openGaussDev

More detail: decorate xgboost Error information:Delete Stack Print

Match-id-04f4a4620009e86d912ff90ffe0117c62dba8847
2022-03-14 19:34:45 +08:00
openGaussDev 513eabfde4 fix xgboost Error information
Offering: openGaussDev

More detail: fix xgboost Error information:Delete Stack Print

Match-id-80e36471ef2d99815d78f1b667b900bd016a43e0
2022-03-14 19:34:45 +08:00
openGaussDev 430ffd0582 show Un-support feature for obs
Offering: openGaussDev

More detail: show Un-support feature for obs

Match-id-522435bc1d43f361b9f5700de80584b3cc5637f5
2022-03-14 19:34:45 +08:00
openGaussDev 01d4a56856 perf optimization for audit process
Offering: openGaussDev

More detail: fix Audit cleanup process issue for audit_space_limit warning

Match-id-a8f0429fe3195d274ae428fab51da848d4a56656
2022-03-14 19:34:45 +08:00
openGaussDev 9924ecb026 add test case hw_audit_pg_query
Offering: openGaussDev

More detail:add test case hw_audit_pg_query

Match-id-08b44df1f068d35498a10f3748a471204a7f16d8
2022-03-14 19:34:45 +08:00
openGaussDev 930a83f2b5 perf optimization for audit process
Offering: openGaussDev

More detail: fix Audit coredump issue in audit_enabled=off scenario

Match-id-c68e0d0a0182ce08d873e7e289e4fc29e2f1ae40
2022-03-14 19:34:45 +08:00
openGaussDev c5cb95d2ec fix histort command
Offering: openGaussDev

More detail: fix history command

Match-id-47f0ca1ca39932e17bc82af8b09bed256c7a331c
2022-03-14 19:34:45 +08:00
openGaussDev 877fbfeb52 not support extreme rto for disaster read
Offering: openGaussDev

More detail:

Match-id-e2dab0fb2cfabc9fd08fd337af8d3b945e6b3d65
2022-03-14 19:34:45 +08:00
openGaussDev 14bcd13362 when pagewriter has the exception occurs, retry again.
Offering: openGaussDev

More detail:

Match-id-378bacef6fbbeca1f01de992dd6cb6e3f7fcee43
2022-03-14 19:34:44 +08:00
openGaussDev 2ea04d8152 dont't replace pghba when cross region build
Offering: openGaussDev

More detail:

Match-id-b36b3f7f882a819dab886714343a54188ca203ad
2022-03-14 19:34:44 +08:00
openGaussDev 5ee5433c5b fix bug for barrier preparse
Offering: openGaussDev

More detail:

Match-id-478a97c2593006ff511072ea037227fb26f9d5a4
2022-03-14 19:34:44 +08:00
openGaussDev 2b09dd1a67 : fix swcb qual push down issues
Offering: openGaussDev

More detail: push down only join quals and leave filter quals outside of the sw op

Match-id-85219d101564ac6e5b2a3b575e9738c3ba1ccdca
2022-03-14 19:34:44 +08:00
openGaussDev 8b5d92a0e2 try last block for insert only when nobody holds locks on it.
Offering: openGaussDev

More detail: try last block for insert only when nobody holds locks on it.

Signed-off-by: Liu Rong <liurong25@huawei.com>

Match-id-d4b2af2c21d441ce9d2dcd6205adf5c2f4aa0581
2022-03-14 19:34:44 +08:00
openGaussDev 794f5e1dde fix upgrade bug when set proc_implicit_for_loop_variable
Offering: openGaussDev

More detail: fix upgrade bug when set proc_implicit_for_loop_variable

Match-id-d2d20a967032236273a1c17e0b7c6e3c9e315b17
2022-03-14 19:34:44 +08:00
openGaussDev d885776b8f The resourceOwner of the SMP is optimized.
Offering: openGaussDev

More detail:
  1. If the SMP is not used, no memory is applied for the tempOwner.
  2. If SMP is used, after the plan is successful, 
     CurrentResourceOwner to reduce the memory usage.

Match-id-8d0c6a3065d99d76fe103c0f82dc97c93e14dfd2
2022-03-14 19:34:44 +08:00
openGaussDev ea8d14f7c4 fix CodeCheck
Offering: openGaussDev

More detail: fix CodeCheck

Match-id-9a6021ff7bac5219a9894bcef8582a05f9eeb4d4
2022-03-14 19:34:44 +08:00
openGaussDev 927c5e918f Modifying Hyperparameter Settings
Offering: openGaussDev

More detail: Modifying Hyperparameter Settings

Match-id-c7650485108bc6fe7b1f63cd7ff9bf23bbc3325f
2022-03-14 19:34:44 +08:00
openGaussDev 84e65fdf73 fix revert select into clob
Offering: openGaussDev

More detail: fix revert select into clob

Match-id-1493a65ab2a81b36455743e029e4a34d798c7e1e
2022-03-14 19:34:44 +08:00
openGaussDev e896716077 fix bug
Offering: openGaussDev

More detail: 修复分区表DDL回滚后使用全局分区索引扫描数据丢失的问题

Match-id-a93d94a074d384ac493a696380c7d848fdee36cd
2022-03-14 19:34:44 +08:00
openGaussDev 370ce09096 fix comment
Offering: openGaussDev

More detail: fix comment

Match-id-48e870ae97f5684563475aa1d8f425d943fedea1
2022-03-14 19:34:44 +08:00
openGaussDev 58ae150aac fix bugs
Offering: openGaussDev

More detail: fix bugs

Match-id-6ff3b41d5271e2175ad319889e5cddd1c89ab3e4
2022-03-14 19:34:44 +08:00
openGaussDev 6e76940206 submit code to openGauss-server
Offering: openGaussDev

More detail:fix并发index unusable和rebuild死锁

Signed-off-by:lihaixiao lihaixiao3@huawei.com

Match-id-2339b79686a9ccf5f7eff94b2678e0fb283659b6
2022-03-14 19:34:44 +08:00
openGaussDev 88e3ad9fb4 parallel decoding fix memory leakage bug
Offering: openGaussDev

More detail: parallel decoding fix initialization bug

Match-id-4b9ee91c71686dcaba8bbd3021d2363206294dba
2022-03-14 19:34:44 +08:00
openGaussDev 5547cd8c86 standby build按照min recovery 和read的位置中大的位置来获取日志
Offering: openGaussDev

More detail: standby build按照min recovery 和read的位置中大的位置来获取日志

Match-id-284d40865b0eceea3afa77e4ab177d70be60f2a8
2022-03-14 19:34:44 +08:00
openGaussDev 0c08e764e0 Global SysCache
Offering: openGaussDev

More detail:
修复闪回功能未适配GSC导致DDL数据无法丢弃问题

# Conflicts:
#	src/gausskernel/storage/tcap/tcap_truncate.cpp

Match-id-e09ce9c267ac9ae227186b0e7cbc9377b1cfb06a
2022-03-14 19:34:44 +08:00
openGaussDev 66b05d1215 Global SysCache
Offering: openGaussDev

More detail:
lsc内存控制

# Conflicts:
#	src/test/regress/expected/gsc_func.out

Match-id-675c5cad1d601f1e7ca9e318fe82367c9626f4e8
2022-03-14 19:34:43 +08:00
openGaussDev f45ec47b1b Narrowing the range of iteration times
Offering: openGaussDev

More detail: Narrowing the range of iteration times

Match-id-e8830353af1a99500aa8e97a0a0894b2872e4f24
2022-03-14 19:34:43 +08:00
openGaussDev 4cb0596eda Fixed gsql Memory Leakage
Offering: openGaussDev

More detail: Fixed gsql Memory Leakage

Match-id-7690c6e6d5a316182fbaa55f89e90e00762fa13d
2022-03-14 19:34:43 +08:00
openGaussDev a2e54efa3f fix pitr init lsn
Offering: openGaussDev

More detail: fix pitr init lsn

# Conflicts:
#	src/include/miscadmin.h

Match-id-c961b8f1667451e30db14fddaa047f646018f52f
2022-03-14 19:34:43 +08:00
openGaussDev e353bc4d55 修复问题
Offering: openGaussDev

More detail: 修复TRUNCATE二级分区同时更新全局分区索引后索引损坏的问题

# Conflicts:
#	src/gausskernel/optimizer/commands/tablecmds.cpp

Match-id-5cca3b98dbd06df99074a23359704a58db4d5fc2
2022-03-14 19:34:43 +08:00
openGaussDev 1246208782 fix memory leak
Offering: openGaussDev

More detail: OidRBTree functions should not switch context

Match-id-549a0404d2d65dff177f0a2d2d2391f1c158a4da
2022-03-14 19:34:43 +08:00
openGaussDev 1062a1c1f6 fix archive slot could not flush lsn
Offering: openGaussDev

More detail: Modify slot advance part

Match-id-3060b2f1218e72eb5ffc28d1742fbc15360ef534
2022-03-14 19:34:43 +08:00
openGaussDev 704eed3368 fix probackup core
Offering: openGaussDev

More detail: fix probackup core

Match-id-8791b0f194f0ddfef801aa77f9edabb0bc589d30
2022-03-14 19:34:43 +08:00
openGaussDev c0e4b1b7b8 修复单用户模式下,使用未初始化线程池控制变量问题
Offering: openGaussDev

More detail: 修复单用户模式下,使用未初始化线程池控制变量问题

Match-id-fd3c7865f75ad8a8a3ceef95feb1f721c50eca2e
2022-03-14 19:34:43 +08:00
openGaussDev 4f86334f04 fix
Offering: openGaussDev

More detail:可选

# Conflicts:
#	src/gausskernel/storage/access/transam/extreme_rto/page_redo.cpp

Match-id-053ac62bbf12d1f8ce6878055eee44eb635c98c1
2022-03-14 19:34:43 +08:00
openGaussDev e2d527347a [AI]
Offering: openGaussDev

More detail: 

Match-id-20039fa1ded1bc58ea219f89bb28ca4e31890c9b
2022-03-14 19:34:43 +08:00
openGaussDev efc4559509 [AI]
Offering: openGaussDev

More detail: 

Match-id-1aa4ebbfa370ed5029291d6443f619edd9c0d20f
2022-03-14 19:34:43 +08:00
openGaussDev 8b3522b5aa [] optimize DBMind framework
Offering: openGaussDev

More detail: opt

Match-id-b564581c0d5b19df33100ee1fa35188ac9212b9a
2022-03-14 19:34:43 +08:00
openGaussDev d288b1824e gs_guc encrypt decouple from GAUSSHOME env
Offering: openGaussDev

More detail: gs_guc encrpyt doesnot need GAUSSHOME env,but now rely on it,so do decoupling

Match-id-00c1d5eeb4633a7ab8692f5726d225cda326a3cb
2022-03-14 19:34:43 +08:00
openGaussDev eceb848411 parallel decoding fix initialization bug
Offering: openGaussDev

More detail: parallel decoding fix initialization bug

Match-id-b6cc77c9f7f21082986e421867874c055ffff70a
2022-03-14 19:34:43 +08:00
openGaussDev d45634be91 Fix oldest xmin in logical decoding.
Offering: openGaussDev

More detail: Fix oldest xmin in logical decoding.

Match-id-d652068e86f96a843c7212f959f72c855635a2ed
2022-03-14 19:34:43 +08:00
openGaussDev b3ba5e5db9 fix forbid execute function commit/rollback
Offering: openGaussDev

More detail:fix forbid execute function commit/rollback

Match-id-1d200d7662fb20f0df4063a2399d31fadc5548d8
2022-03-14 19:34:43 +08:00
openGaussDev dedd14af5e Do not allow creation of users with empty passwords
Offering: openGaussDev

More detail: Do not allow creation of users with empty passwords

Match-id-8cb0a708be3c4115ad5e7ac3584d3cdd83ec7b1e
2022-03-14 19:34:42 +08:00
openGaussDev 06e43a8f9b fix the bug that mask password fails when stmt is truncated
Offering: openGaussDev

More detail: fix the bug that mask password fails when stmt is truncated

Signed-off-by: HeRui <herui30@huawei.com>

Match-id-d32724bb606ac2ebae17c2900b160b35c4033a24
2022-03-14 19:34:42 +08:00
openGaussDev 5852d1949f Fix the bug sublink pullup in SWCB contains subquerys
Offering: openGaussDev

More detail:

Match-id-dac69c0ec0d9bb19b1464709d932ca87a889f67f
2022-03-14 19:34:42 +08:00
openGaussDev 6dc2d139d5 Global SysCache
Offering: openGaussDev

More detail:
	    修复线程池模式waitmission起事务后内存上下文不正确导致内存泄漏问题

Match-id-18f61b45531eaa886b7b7cf2bce9bf6c97a901fb
2022-03-14 19:34:42 +08:00
openGaussDev 38b7213f8e fix security issue
Offering: openGaussDev

More detail: fix try-catch of check_engine_status

Match-id-9560a5be8caa621a4d5bf1eb6e24403e5a2aacfa
2022-03-14 19:34:42 +08:00
openGaussDev 3900f93081 fixbug for pgarch thread restart too frequently
Offering: openGaussDev

More detail:

Match-id-02918e510f5ec5f6cf40951eba74dee706324deb
2022-03-14 19:34:42 +08:00
openGaussDev 884ea16aa3 fix get_tuple
Offering: openGaussDev

More detail: fix get_tuple

Match-id-aed00ca9fb0d67624e5de7d2448c57a3baf26eb0
2022-03-14 19:34:42 +08:00
openGaussDev 1d66aded47 Offering: openGaussDev
More detail: 

# Conflicts:
#	src/gausskernel/storage/tcap/tcap_manager.cpp

Match-id-c0b0a159ce50e302e53a882e1916b594b0f47286
2022-03-14 19:34:42 +08:00
openGaussDev e5970d87e0 [] optimize plugins of DBMind
Offering: openGaussDev

More detail: opt

Match-id-9495280ca4e6c28de3c1e6d0150cae65d5e8ead6
2022-03-14 19:34:42 +08:00
openGaussDev 893535a2b8 modify cmakelist
Offering: openGaussDev

More detail: opt

Match-id-211f56860c55277e240e52618c1fa7011237de5d
2022-03-14 19:34:42 +08:00
openGaussDev af8dd4ecb9 mask password before storing into hash
Offering: openGaussDev

More detail: mask password before storing into hash

Match-id-8eb6b3914e2a402344b1b1b8ac69c00adec93236
2022-03-14 19:34:42 +08:00
openGaussDev 3bb32d1d4a SQL optimization
Offering: openGaussDev

More detail: support null_test short circuit

# Conflicts:
#	src/test/regress/parallel_schedule0

Match-id-b136e3ec8a8b1f7983c92aa6c68b395a2ea6bbd7
2022-03-14 19:34:42 +08:00
openGaussDev ab3ee6a00a submit code to openGauss-server
Offering: openGaussDev

More detail: predpush hint warning

Signed-off-by:chenhaotian <chenhaotian3@huawei.com>

Match-id-d5062416ccb335e3e249bdab904fd99bf4765f3b
2022-03-14 19:34:42 +08:00
openGaussDev b6fb01e80e fix parallel decoding visibility bug
Offering: openGaussDev

More detail: parallel decoding fix physical addressing info bug.

Match-id-491e37c4587a09f855ba3022206f5aaae7a8831f
2022-03-14 19:34:42 +08:00
openGaussDev f602677e45 fix clob > 1G unspport error
Offering: openGaussDev

More detail:fix clob > 1G unspport error

Match-id-f3aa081fe8c987e3f540d857a091175c5d28c690
2022-03-14 19:34:42 +08:00
openGaussDev 6d95c39328 amend another port in hw_audit_multi_thread_rotation_interval.source
Offering: openGaussDev

More detail:amend output/hw_audit_multi_thread_rotation_interval.source

Match-id-caaf55d0bdc81b37724df69b616274af06f3340e
2022-03-14 19:34:42 +08:00
openGaussDev 92f0f1918b amend port in hw_audit_multi_thread_rotation_interval.source
Offering: openGaussDev

More detail:amend output/hw_audit_multi_thread_rotation_interval.source

Match-id-0e3532ea2db5174cef7b676a8a869cf63cb7c487
2022-03-14 19:34:42 +08:00
openGaussDev 75e1fdf696 amend relative path, config file, security_audit_schedule0
Offering: openGaussDev

More detail:amend relative path, config file, security_audit_schedule0

Match-id-6c3f38437cd2d0ceaff79335056071c6ce88b9c0
2022-03-14 19:34:42 +08:00
openGaussDev b72ca81c15 update and add test cases
Offering: openGaussDev

More detail:update and add test cases

Match-id-84e2ce2f9c02c5055474130ed5a93c75f5eee768
2022-03-14 19:34:42 +08:00
openGaussDev 35dfd94bc2 add mutex
Offering: openGaussDev

More detail: 可选

Match-id-7fbecffd865c0ed00fe0b6e8b74bf944e8ba6b01
2022-03-14 19:34:42 +08:00
openGaussDev 8f5757a3f1 修复分区表锁问题
Offering: openGaussDev

More detail: 修复分区表锁问题

Match-id-a622ce1c30dc32b725d624fabb46109c8add5942
2022-03-14 19:34:41 +08:00
openGaussDev 79662644d8 fixbug
Offering: openGaussDev

More detail: fixbug toast delete error

Match-id-7c3ae1b8af0a951caa93f58c00773f0fff3f40c9
2022-03-14 19:34:41 +08:00
openGaussDev 3affdfa80c check
Offering: openGaussDev

More detail:check valid

# Conflicts:
#	src/gausskernel/dbmind/tools/components/index_advisor/index_advisor_workload.py

Match-id-bad4401dafd921e40de698c90a59158f8d36ddbf
2022-03-14 19:34:41 +08:00
openGaussDev 45879b85fd make max_size_for_xlog_prune take effect under asynchronous commit mode
Offering: openGaussDev

More detail: make max_size_for_xlog_prune take effect under asynchronous commit mode

Match-id-17fbd5b477e7922c2d390fd6bd708ab68b629817
2022-03-14 19:34:41 +08:00
openGaussDev 2cda1074d3 fix barrier creator core bug
Offering: openGaussDev

More detail: Modify barrier creator part

Match-id-047fc5e5f919885ac3e03a4af18b63e1b3c2abd8
2022-03-14 19:34:41 +08:00
openGaussDev dc8a4f11e3 fix drop slot failed
Offering: openGaussDev

More detail: Modify drop replication slot part

Match-id-a167049aa605cf4fae4bfa8c05188a5e0ab23a78
2022-03-14 19:34:41 +08:00
openGaussDev 79e95ec77b fix barrier creator bug
Offering: openGaussDev

More detail: Modify barrier creator

Match-id-ed84ca49671f54cb50ae1eacd885d4742be970b3
2022-03-14 19:34:41 +08:00
openGaussDev f1241ddf15 Fix the bug of checkpoint problem
Offering: openGaussDev

More detail:

Match-id-c87ee9f3800a09975cfedd2199b1e698f3d149b2
2022-03-14 19:34:41 +08:00
openGaussDev 1ad8739cab fix text func
Offering: openGaussDev

More detail: fix bug

Match-id-3c8048507934c33af32c16ff16e139d2a330b3d2
2022-03-14 19:34:41 +08:00
openGaussDev acb17bd1ec fix pitr restore startup thread pause
Offering: openGaussDev

More detail: Modify startup thread

Match-id-84834a5b1b36b79ed1d39f14f921c4d6bc20129c
2022-03-14 19:34:41 +08:00
openGaussDev 91c2c64911 修复release版本 fuzz测试发现core问题
Offering: openGaussDev

More detail: 修复release版本 fuzz测试发现core问题

Match-id-e829d6e129ef91704509e304d32acb322ad9c69f
2022-03-14 19:34:41 +08:00
openGaussDev b43c4be304 check sql valid in for rec in query
Offering: openGaussDev

More detail: check sql valid in for rec in query

Match-id-ef6b3cb6dfe3e7c5f2abb1c0a04d603347d7da81
2022-03-14 19:34:41 +08:00
openGaussDev 84f7c879d7 use case
Offering: openGaussDev

More detail: use case

Match-id-fbe61ca0327bfa20855dacf6b6c9f91cc876f671
2022-03-14 19:34:41 +08:00
openGaussDev 039aff4f64 Global SysCache
Offering: openGaussDev

More detail:
修复initsession时缓存命中,但是u_sess->proc_cxt.MyDatabaseId为0导致cache无法刷新问题

Match-id-eba30ce5fb121c33b1dccbcd127624fafe5cb83f
2022-03-14 19:34:41 +08:00
openGaussDev 9e59584896 fix bugs
Offering: openGaussDev

More detail: fix bug

Match-id-0fb0e3fd71fd43bedfaef338789265f221e045f6
2022-03-14 19:34:41 +08:00
openGaussDev 621d5004a6 fix error
Offering: openGaussDev

More detail: fix error

Match-id-2ac331e2403136e00b782c83860331a198dbfcc1
2022-03-14 19:34:41 +08:00
openGaussDev 0f699af7b6 解决ustore模式下,备机上运行逻辑解码和备机读业务,备机上每秒打印约百条日志:WARNING: [CheckLastRecordSize:503]last record size 697 != xlog last record size 689
Offering: openGaussDev

More detail: 解决ustore模式下,备机上运行逻辑解码和备机读业务,备机上每秒打印约百条日志:WARNING: [CheckLastRecordSize:503]last record size 697 != xlog last record size 689

Match-id-bafd821a73fa2dba5919b38c1af024cc6761f938
2022-03-14 19:34:41 +08:00
openGaussDev 1b7cc1bc75 revert
Offering: openGaussDev

More detail: MR2097 results in a poor performance in TPCC

Signed-off-by: Liu Rong <liurong25@huawei.com>

Match-id-21d8c5f281d8fa0cee92cfc5eec28662b6e6e250
2022-03-14 19:34:41 +08:00
openGaussDev 5b7d38d879 perf optimization for audit process
Offering: openGaussDev

More detail: fix AuditIndexTable Name

Match-id-06433bab149ddc6cdf4e1a7457fe2a1cf978c81b
2022-03-14 19:34:40 +08:00
openGaussDev 5cfddc1b52 Fix bug
Offering: openGaussDev

More detail: 修复删除分区表报错

# Conflicts:
#	src/common/backend/utils/init/globals.cpp
#	src/include/access/xlogproc.h

Match-id-978d16029c7f5ac4681e6191b78392f89718edba
2022-03-14 19:34:40 +08:00
openGaussDev 5e577476a4 : Do not displaye the partition LOCAL index when \d+(\d+ \dS) a table.
Offering: openGaussDev

More detail: Do not displaye the partition LOCAL index when \d+(\d+ \dS) a table.

Match-id-c339646cb2c3610ae13ce1391c5e4ec9e997a929
2022-03-14 19:34:40 +08:00
openGaussDev 90e7a6b7f6 free stringinfo
Offering: openGaussDev

More detail: free stringinfo

Match-id-195105d1af600164d70fa568cb3890550bf70e9f
2022-03-14 19:34:40 +08:00
openGaussDev d28a571efd submit code to openGauss-server
Offering: openGaussDev

More detail: fix owner for fdw

Signed-off-by:chenbobo <chenbobo3@huawei.com>

Match-id-0cdd43e2bf4f91363b42dec95cd648e902b88bd5
2022-03-14 19:34:40 +08:00
openGaussDev a4da772704 : Fix that deleting view will core when explain_perf_mode is not EXPLAIN_NORMAL.
Offering: openGaussDev

More detail: Fix that deleting view will core when explain_perf_mode is not EXPLAIN_NORMAL.

Match-id-e8eddf898bbef7bec3e1d746a29aaa49ded93ef6
2022-03-14 19:34:40 +08:00
openGaussDev c426a575e3 submit code to openGauss-server
Offering: openGaussDev

More detail:range分区表PBE单分区剪枝

Signed-off-by:lihaixiao lihaixiao3@huawei.com

Match-id-a88ff128079ca680f33a7419eeab078bacf466d6
2022-03-14 19:34:40 +08:00
openGaussDev 75c95e8adf fix create function core when set try_vector_engine_strategy
Offering: openGaussDev

More detail: fix create function core when set try_vector_engine_strategy

Match-id-d86091d4336785aeb6490eed86457e01414595d8
2022-03-14 19:34:40 +08:00
openGaussDev 1763fab84f fix index bug
Offering: openGaussDev

More detail: fix index bug

Match-id-0f03a389aa14be42e77b3ae7dc9aa5b0d94cf863
2022-03-14 19:34:40 +08:00
openGaussDev 9dd8fb38e7 Fix vacuum GPI bug
Offering: openGaussDev

More detail: Fix vacuum GPI bug

Match-id-fc68e3d7470fee7a0f85cf146c49ac0922c6998e
2022-03-14 19:34:40 +08:00
openGaussDev 266cfad0fc add pg_catalog.
Offering: openGaussDev

More detail: add pg_catalog.

Match-id-b5efea09edc757fa778b76599c908ee973f71cb0
2022-03-14 19:34:40 +08:00
openGaussDev 791b04f19c perf
Offering: openGaussDev

More detail: perf

Match-id-3e2076ba3cde3a1687d61ed5f0632e289fe6c654
2022-03-14 19:34:40 +08:00
openGaussDev 8191e214c6 fixbug
Offering: openGaussDev

More detail: fixbug toast update

Match-id-e1c8f8cebd825f9509c89dc60e25d62af8a06474
2022-03-14 19:34:40 +08:00
openGaussDev 0319403518 autonomous package value support anonymous block
Offering: openGaussDev

More detail: autonomous package value support anonymous block

Match-id-f3ca9de6f1d4d47382dad1566a600a1aa0e8d0ba
2022-03-14 19:34:40 +08:00
openGaussDev 06c8f2afcf deep copy procedure arg value
Offering: openGaussDev

More detail: deep copy procedure arg value

Match-id-dda612d112a2a69b554912340314383a39e71a7c
2022-03-14 19:34:40 +08:00
openGaussDev b93d4de9ed Workaround for single connect-by cases
Offering: openGaussDev

More detail: If no rownum or level qual is present, do not create connect-by-level filter.

Signed-off-by:peijisheng peijisheng@huawei.com

Match-id-400310ecf9513b47303f71f69da642d4b44d762b
2022-03-14 19:34:39 +08:00
openGaussDev fd2bf6d4a6 [] decouple DBMind configurations
Offering: openGaussDev

More detail:fix the bug

Match-id-f11b3eeb02b57e799de38ccaee2d6bb6f256d5d5
2022-03-14 19:34:39 +08:00
openGaussDev f02c16a949 [] decouple DBMind configurations
Offering: openGaussDev

More detail:fix the bug

Match-id-f0436c0cf8c87c59b2597181cf413b71253cbfa5
2022-03-14 19:34:39 +08:00
openGaussDev e984d5525c shutdown wal rcv and writer before truncate xlog in pitr
Offering: openGaussDev

More detail: shutdown wal rcv and writer before truncate xlog in pitr

Match-id-2b7bfe694a9842674fa20f302ae6dfc040c313fd
2022-03-14 19:34:39 +08:00
openGaussDev c423cfdb1b adjust pitr barrier time
Offering: openGaussDev

More detail: adjust pitr barrier time

Match-id-4bd3feb79953fdfe59ac34788c57d59b5a3e356b
2022-03-14 19:34:39 +08:00
openGaussDev 8264115840 upgrade grand version
Offering: openGaussDev

More detail: 更新预留版本号92508为92602,预留版本号92512为92604
2022-03-14 19:34:39 +08:00
openGaussDev d17420c4f6 add interface
Offering: openGaussDev

More detail: add interface of get_client_info

Match-id-d860436ca1408ee2625b8a680a865a2f8f2784e0
2022-03-14 19:34:39 +08:00
openGaussDev 651da5cbe4 Ensure that the sync state of the pagewriter remains unchanged during thread recovery
Offering: openGaussDev

More detail:

Match-id-b22f78c1caadc9390b82ac62f29658f024a79e9e
2022-03-14 19:34:39 +08:00
opengauss-bot 3b88755913
!1588 change version to 3.0.0
Merge pull request !1588 from zhangxubo/lite
2022-03-14 07:36:50 +00:00
opengauss-bot 9c8611ff49
!1585 解决bucketMap数组与NULL判断永远为false的问题
Merge pull request !1585 from 陈栋/issue1
2022-03-14 06:15:05 +00:00
chendong76 7c2e8463ab 解决bucketMap数组与NULL判断永远为false的问题 2022-03-14 10:38:52 +08:00
zhang_xubo ab47f73fd2 change version to 3.0.0 2022-03-14 10:06:21 +08:00
opengauss-bot 674c48d084
!1580 添加简化安装打包脚本以及更新三方库二进制地址
Merge pull request !1580 from zhangxubo/lite
2022-03-14 01:52:49 +00:00
pengjiong 360111d858
修复scanEreport工具的内存泄露问题 2022-03-12 09:33:32 +00:00
zhang_xubo ff0b60e057 add simple install package script 2022-03-11 21:35:03 +08:00
chenxiaobin19 928da3d6d2 fix wal replay of locking an updated tuple 2022-03-11 15:43:01 +08:00
opengauss-bot 621bd93e25
!1579 小型化升级脚本适配文件名修改
Merge pull request !1579 from hangjin2020/master
2022-03-11 06:20:33 +00:00
hangjin2020 d0d639699b 适配小型化升级脚本 2022-03-11 10:58:26 +08:00
opengauss-bot 3871359928
!1577 修复bypass_pbe用例失败问题
Merge pull request !1577 from 杨皓/master
2022-03-11 01:50:30 +00:00
fairyfar 4dc0eb36e6 判断LLVM_MAJOR_VERSION宏定义为空还是数值 2022-03-10 21:42:20 +08:00
openGaussDev 5398ea0f67 fix problem in regression bypass_pbe test 2022-03-10 18:50:37 +08:00
opengauss-bot 8b30bd9ceb
!1575 修复hw_pbe等几个用例预期
Merge pull request !1575 from 胡正超/hwpbe
2022-03-10 07:41:26 +00:00
opengauss-bot 2a34de04b8
!1564 修复升级过程中_jsonb类型oid的问题
Merge pull request !1564 from 胡正超/_jsonboid
2022-03-10 06:48:06 +00:00
gentle_hu 78c7cf53dd fix hw_pbe and explain_pbe of fastcheck 2022-03-09 19:36:01 +08:00
gentle_hu 14bf3a2139 unusing typename+typenamespace to override typeoid in read\out funcs 2022-03-09 19:26:49 +08:00
opengauss-bot c10de5f198
!1569 小型化修改适配
Merge pull request !1569 from zhangxubo/lite
2022-03-08 09:12:59 +00:00
zhang_xubo b82e608e6c 适配小型化修改 2022-03-08 16:06:24 +08:00
opengauss-bot beb1f5838e
!1567 修复升级脚本重复的问题
Merge pull request !1567 from 胡正超/duupgrade
2022-03-08 02:21:26 +00:00
opengauss-bot b19a23dcd9
!1546 bugfix: gs_ctl build备份、basebackup备份时,当文件大小超过一个段文件时,会导致build结果异常
Merge pull request !1546 from 吴岳川/I4V678
2022-03-07 13:20:58 +00:00
gentle_hu f8a23647d7 fix issue of duplicated upgrade sql 2022-03-07 21:02:37 +08:00
wuyuechuan 751684b561 fixbug: when file segno >= 1, pcaFilePath will be 16384.1_pca. when transfer 16384_pca, without set '\0', pcapath open will be like '16384_pcaca', which will cause file missing. 2022-03-07 20:02:35 +08:00
opengauss-bot ec66903e3f
!1530 1. 禁止pglz与compresslevel参数同时使用;2. 页内词典压缩当且仅当compression为yes,而不是compression为空或者为no。3. pg_rewind修改部分日志打印等级
Merge pull request !1530 from 吴岳川/master
2022-03-07 11:01:55 +00:00
gentle_hu 9a0b705a03 fix oid of _jsonb in upgrade 2022-03-07 11:14:43 +08:00
wuyuechuan 45e0a6f0d7 1. forbid setting compresslevel with pglz algorithm 2. bugfix: do PageCompression only when compression is yes
3. change some log level in pg_rewind
2022-03-07 09:20:08 +08:00
opengauss-bot 25ecba5316
!1563 行表压缩、哈希索引代码合入
Merge pull request !1563 from 吴岳川/0306_merge
2022-03-06 15:24:49 +00:00
wuyuechuan 15e3a99805 row compression & hash index 2022-03-06 22:47:02 +08:00
opengauss-bot f9fc8c0d68
!1561 openGauss 3.0.0代码合入
Merge pull request !1561 from 杨皓/sync
2022-03-06 12:14:24 +00:00
zhang_xubo 40b128e5cd fix publication ci problem 2022-03-06 19:23:15 +08:00
zhang_xubo e0960a0dbd change env to GAUSSHOME 2022-03-06 16:41:00 +08:00
zhang_xubo 1d1f529c89 更改fastcheck中,out文件空格导致失败问题 2022-03-06 02:09:43 +08:00
yanghao 6a5266d02a remove test in regression 2022-03-06 01:43:25 +08:00
yanghao e9a98a5a27 use makefile to build package 2022-03-05 16:55:07 +08:00
LiHeng de223dd152 sync code 2022-03-04 23:22:16 +08:00
jiang wei cede8802dc bugfix 修复无法使用域名搭建主从bug,如果replconninfo中配置域名,则无法与 pg_getnameinfo_all获取的IP比较 ,只能和port->remote_host中的域名比较。 2022-03-03 10:32:19 +08:00
TotaJ c7d12e661d Force subscription use HA port. 2022-03-02 16:54:40 +08:00
opengauss-bot d26ec83e7b
!1549 【修复bug】WaitGraceThreadsExit函数固定睡15次
Merge pull request !1549 from stupidstan/master
2022-02-28 06:51:12 +00:00
opengauss-bot 954817a429
!1548 Fix issue: Fix a bug on the index advisor: Solve the problem that the index space size cannot be obtained
Merge pull request !1548 from liuly/master
2022-02-28 02:33:47 +00:00
stupidstan@163.com 19cc194672 fix sleep fixed 15 times 2022-02-27 20:15:27 +08:00
flyly 320a31aa85 fixed bug 2022-02-26 21:02:02 +08:00
opengauss-bot b58517ed45
!1529 修复log_destination某些设置下启动失败的问题
Merge pull request !1529 from 胡正超/pglog
2022-02-25 01:49:37 +00:00
opengauss-bot a8bf343bc6
!1526 回退捕获UCE信号需求, 回退sigbushandler的处理逻辑
Merge pull request !1526 from cchen676/master1
2022-02-24 13:21:36 +00:00
opengauss-bot 7eada11574
!1478 gstrace start时候,校验下数据库进程是否存在
Merge pull request !1478 from zhangxubo/bug3
2022-02-24 08:54:36 +00:00
opengauss-bot 88da95eb84
!1488 opengauss编译适配flex 2.6以上版本
Merge pull request !1488 from zhangxubo/flexversion
2022-02-24 08:32:10 +00:00
opengauss-bot e160a27a8e
!1477 gs_collector收集plan信息,缺少gs_plan_simulator.sh脚本
Merge pull request !1477 from zhangxubo/bug1
2022-02-24 08:17:42 +00:00
opengauss-bot eb6a95bc60
!1379 修复日志未记录SQL语句的持续时间的bug
Merge pull request !1379 from Hemny/bug-I4FISK
2022-02-23 12:55:34 +00:00
opengauss-bot f3c5aafca2
!1379 修复日志未记录SQL语句的持续时间的bug
Merge pull request !1379 from Hemny/bug-I4FISK
2022-02-23 12:55:34 +00:00
opengauss-bot a647cf9e5a
!1524 轻量级PR: 修复部分场景synchronous_commit参数修改不生效的问题
Merge pull request !1524 from cchen676/new_master
2022-02-23 12:02:15 +00:00
opengauss-bot da986e78d1
!1350 修复修改最大可用模式most_available_sync未能稳定生效的缺陷
Merge pull request !1350 from chenxiaobin/mvs_reload
2022-02-23 11:28:41 +00:00
opengauss-bot e83f1300c8
!1465 修复升级未提交时创建带update的多事务、列存表relminmxid不为0以及ustore表获取外键锁失败的问题
Merge pull request !1465 from chenxiaobin/fk_bugfix
2022-02-23 09:47:00 +00:00
opengauss-bot 7e709135a0
!1415 【轻量级 PR】:修复加行锁或更新元组时忽略多事务中只锁事务的问题
Merge pull request !1415 from chenxiaobin/N/A
2022-02-23 09:46:30 +00:00
chenxiaobin19 c851929ad5 fix most_available_sync reload not effective bug 2022-02-23 16:12:21 +08:00
opengauss-bot 5ec5ebca4d
!1523 修复pgoutput安全编译问题
Merge pull request !1523 from 习特铭/master
2022-02-23 06:35:33 +00:00
opengauss-bot e0460e081c
!1506 修复wlm user info哈希表顺序扫描泄漏的问题
Merge pull request !1506 from april01xxx/hash_seq_search_leak
2022-02-23 03:33:22 +00:00
opengauss-bot dea03d919b
!1528 Fixes wrong planning for MOT queries
Merge pull request !1528 from Vinoth Veeraraghavan/master
2022-02-23 03:27:32 +00:00
opengauss-bot 1dfecc7b35
!1528 Fixes wrong planning for MOT queries
Merge pull request !1528 from Vinoth Veeraraghavan/master
2022-02-23 03:27:31 +00:00
gentle_hu e7c129ce05 fix core about log_destination 2022-02-22 22:11:20 +08:00
Vinoth Veeraraghavan 311c8d1cbb Fixes wrong planning for MOT queries 2022-02-22 20:05:04 +08:00
arcoalien@qq.com 6ee1db2c10 回退捕获uce需求,sigbushandler代码 2022-02-22 16:14:34 +08:00
arcoalien@qq.com ac8363f2bc fix issue 通过SET命令动态修改synchronous_commit设置不生效 2022-02-22 15:08:41 +08:00
opengauss-bot 3fbed4ad61
!1510 更新索引的收益query列表
Merge pull request !1510 from guoguozhenhaowan/positive_pos
2022-02-22 06:43:53 +00:00
xiteming 6802c5b784 修复pgoutput安全编译选项 2022-02-22 09:29:11 +08:00
opengauss-bot 39ba99288f
!1498 InitSession时候,添加InitExtensionVariable,修复创建dblink扩展数据库core掉问题
Merge pull request !1498 from zhangxubo/dblink
2022-02-21 13:19:19 +00:00
opengauss-bot 49a52a001f
!1516 一个编译告警
Merge pull request !1516 from 胡正超/master
2022-02-21 13:17:52 +00:00
gentle_hu 4a8f8b2140 compile warning 2022-02-16 20:57:01 +08:00
opengauss-bot ab9db1b86b
!1513 mcts算法增加推荐索引个数约束
Merge pull request !1513 from liuly/master
2022-02-16 01:54:00 +00:00
opengauss-bot 11c3fcff4c
!1513 mcts算法增加推荐索引个数约束
Merge pull request !1513 from liuly/master
2022-02-16 01:54:00 +00:00
flyly c2947db200 Increase the limit on the number of indexes 2022-02-15 18:44:32 +08:00
guoguozhenhaowan db52992505 change the positive_pos of workload 2022-02-15 16:53:11 +08:00
opengauss-bot 4cee123bf9
!1302 【bugfix】解决ssl为on的情况下备机故障时主机对应WalSender无法超时退出的问题
Merge pull request !1302 from chenxiaobin/sslblock
2022-02-14 06:29:15 +00:00
opengauss-bot b23db8d5a9
!1509 Implementing Monte Carlo Tree Search Algorithm
Merge pull request !1509 from liuly/master
2022-02-11 07:44:40 +00:00
flyly a7b1911fe0 Implementing Monte Carlo Tree Search Algorithm 2022-02-11 11:50:12 +08:00
opengauss-bot c1529a5a32
!1308 修复pg_recvlogical工具校验逻辑复制槽名称长度时候,未考虑双引号,在边界条件校验失败
Merge pull request !1308 from zhangxubo/bugfix
2022-02-11 01:44:18 +00:00
opengauss-bot 643ad86cd8
!1497 pg_probackup数据页完整性校验
Merge pull request !1497 from 薛蒙恩/pg_probackup_checksum
2022-02-11 01:40:55 +00:00
opengauss-bot 1e157104c1
!1492 【轻量级 PR】:修复误删除的pg_dump选项
Merge pull request !1492 from pengjiong/N/A
2022-02-10 08:16:47 +00:00
opengauss-bot a939423194
!1503 压缩参数修改增加限制:compress_byte_convert需要与compress_diff_convert一起使用;compress_level需要使用zstd压缩算法时才能设置和修改
Merge pull request !1503 from 吴岳川/master
2022-02-10 07:39:04 +00:00
opengauss-bot 1494028b14
!1505 MOT JIT bug fixes
Merge pull request !1505 from Vinoth Veeraraghavan/master
2022-02-10 03:35:07 +00:00
April01xxx 872a3444a0 修复wlm user info哈希表顺序扫描泄漏的问题。 2022-02-09 19:01:43 +08:00
Vinoth Veeraraghavan 7a7360c4a5 Disqualify full scan as not jittable query in MOT JIT 2022-02-09 16:46:46 +08:00
wuyuechuan 230900e411 在某些场景,禁止修改压缩参数 2022-02-09 14:09:54 +08:00
opengauss-bot 613b553152
!1487 修复connect by 联合查询where条件报错的问题
Merge pull request !1487 from pengjiong/fix_sw
2022-02-09 03:58:35 +00:00
opengauss-bot 0c110837b3
!1462 修复发布订阅同步二级分区表delete失败的问题
Merge pull request !1462 from pengjiong/fix_sub_part
2022-02-09 03:21:08 +00:00
opengauss-bot 385f38dffb
!1490 为发布订阅间的HA连接进行初始化用户操作
Merge pull request !1490 from pengjiong/sub_auth
2022-02-08 09:17:01 +00:00
opengauss-bot 3836a3e9b5
!1490 为发布订阅间的HA连接进行初始化用户操作
Merge pull request !1490 from pengjiong/sub_auth
2022-02-08 09:17:01 +00:00
TotaJ 59b5b97b32 Fix start with connect by. 2022-02-08 17:00:31 +08:00
opengauss-bot 90927657fd
!1441 issue fix for detail
Merge pull request !1441 from 仲夏十三/detail
2022-01-29 03:00:48 +00:00
opengauss-bot 8b69e7b7a9
!1500 修复列存表explain场景下,sort信息被记录到了下一条sql的问题
Merge pull request !1500 from 仲夏十三/column
2022-01-29 03:00:33 +00:00
kidhasdream 2c93790db6 修复行存表 sort统计bug 2022-01-28 18:18:28 +08:00
opengauss-bot fac95fa751
!1422 oltp compression bug fix
Merge pull request !1422 from 吴岳川/compress_newly
2022-01-28 09:33:16 +00:00
zhang_xubo f39e638b28 Init extension variable to fix dblink core 2022-01-28 14:43:44 +08:00
xue_meng_en 1153832fd8 probackup checksum open, support data checksum check
Author: lwx843928 <liyifeng9@huawei.com>
Date:   Fri Jan 21 09:46:16 2022 +0800

    probackup checksum open

    Offering: GaussDB Kernel

    More detail: probackup checksum open, support data checksum check

    merged from liyifeng
2022-01-26 15:16:54 +08:00
kidhasdream 766bcf3d82 fix regress 2022-01-26 09:48:46 +08:00
opengauss-bot 3166a5054d
!1486 没有collectfn的聚集函数不走smp
Merge pull request !1486 from 胡正超/smpfix
2022-01-25 02:11:36 +00:00
opengauss-bot ff5a0678e8
!1493 修复explain performance prepare smp计划core掉的问题
Merge pull request !1493 from 胡正超/explaincore
2022-01-25 01:50:57 +00:00
gentle_hu e17f3be471 smp not support agg which without collectfn 2022-01-24 22:01:37 +08:00
kidhasdream f41342c57e add fastcheck 2022-01-24 10:26:36 +08:00
ganyang f6cd0050fa fix issue for detail 2022-01-24 10:21:30 +08:00
opengauss-bot e1258c4197
!1461 add nvarchar keyword to be compatible with databaseB
Merge pull request !1461 from 仲夏十三/nvarchar
2022-01-22 07:49:19 +00:00
wuyuechuan 2eb20665ee create index: compressOpts should be used with compresstype
compress_prealloc_chunks: must be less than BLCKSZ / chunksz
2022-01-22 09:55:04 +08:00
wuyuechuan c1c3973b02 bugfix: core when compressedtable large than 131072 * 8192 2022-01-22 09:55:04 +08:00
wuyuechuan 96590e8eb9 bugfix: pagehack compile error 2022-01-22 09:55:04 +08:00
wuyuechuan d4a2c0cfc5 1. bugfix: remote read failed when opt > 0xff
2. bugfix: byte_convert(diff_convert) can used independently
3. bugfix: checksum alway returns the same uint32
4. cleancode: remove dulicate check of mmap
5. bugfix: parallel repare pca when extreme rto
2022-01-22 09:55:04 +08:00
gentle_hu dea0c0daae fix explain performance core 2022-01-21 16:44:27 +08:00
pengjiong 934b53c678
test 2022-01-21 06:12:47 +00:00
chenxiaobin19 d183e96ae7 fix several bugs for enhance tuple lock 2022-01-21 11:58:06 +08:00
zhang_xubo 8771aef0d4 check db process before gstrace start 2022-01-21 09:32:00 +08:00
TotaJ 5e11ed9133 Add auth for subscription. 2022-01-20 17:57:37 +08:00
opengauss-bot 23ddd1ca38
!1484 修复twophasecleaner内存泄漏
Merge pull request !1484 from maxiang/master_twophase
2022-01-20 08:37:10 +00:00
zhang_xubo 26cf5e54b1 openGauss编译适配 flex2.6 以上版本 2022-01-19 17:58:03 +08:00
Xiao__Ma af801171ed 修复twophasecleaner内存泄漏 2022-01-19 14:49:30 +08:00
opengauss-bot c9108aecf6
!1474 修复unique sql在bypass下,部分统计数据一直为0的问题
Merge pull request !1474 from gentle_hu/unisql
2022-01-18 12:46:50 +00:00
opengauss-bot ad762fd052
!1475 修复日志量少的时候,极致RTO lsn推进慢的问题
Merge pull request !1475 from 陈栋/issue1
2022-01-18 11:08:45 +00:00
chendong76 52c4e269aa 修复日志量少的时候,极致RTO lsn推进慢的问题 2022-01-18 16:05:58 +08:00
kidhasdream 0bfb8e3ba7 fix fastcheck 2022-01-18 14:31:41 +08:00
opengauss-bot 3fe1bf4cb7
!1464 修复语法插件hook
Merge pull request !1464 from 仲夏十三/new-master
2022-01-18 06:24:48 +00:00
opengauss-bot 266517b751
!1451 【轻量级 PR】bugfix: 修复PITR测试发现的在不同的恢复终止条件下的2个问题
Merge pull request !1451 from cchen676/master1
2022-01-17 12:44:00 +00:00
gentle_hu 2794535ca3 fix sqlbypass fusionExecute 2022-01-17 17:21:34 +08:00
kidhasdream 77fbf44da8 增加enable_custom_parser和parser hook,支持自定义解析器 2022-01-14 11:21:31 +08:00
kidhasdream 7639f3f91e add nvarchar 2022-01-14 10:15:25 +08:00
opengauss-bot 90c8c63bdc
!1463 增加安全编译选项
Merge pull request !1463 from 陈栋/cve
2022-01-13 11:19:45 +00:00
opengauss-bot b3955adfcc
!1431 修改支持配置延迟进入最大可用模式需求的代码逻辑和相关问题
Merge pull request !1431 from cchen676/new_master
2022-01-11 09:20:28 +00:00
opengauss-bot dcad1d1985
!1459 fix upgrade of gs_encrypted_proc
Merge pull request !1459 from zhengxue/master
2022-01-11 07:44:23 +00:00
chendong76 b25c6eba44 增加安全编译选项 2022-01-11 09:44:46 +08:00
opengauss-bot 3751f522e1
!1460 删除无用的syscache
Merge pull request !1460 from pengjiong/remove_syscache
2022-01-10 07:31:13 +00:00
TotaJ 302bbb6280 Fix update sub partition failed. 2022-01-10 14:12:39 +08:00
TotaJ 85325497e2 Remove useless syscache. 2022-01-10 11:22:36 +08:00
shirley_zhengx 4d9af0d658 fix upgrade of gs_encrypted_proc 2022-01-08 18:12:18 +08:00
opengauss-bot 047c8ac79d
!1346 代码瑕疵存在隐患
Merge pull request !1346 from wangym11/I4GJWP
2022-01-07 07:59:51 +00:00
opengauss-bot e383f1b777
!1452 修复max min 函数误删除问题
Merge pull request !1452 from 习特铭/master
2022-01-07 02:16:08 +00:00
xiteming 657b6bd24e 修复社区max、min函数被误删除的的问题 2022-01-06 12:28:08 +08:00
arcoalien@qq.com e0f8f6a966 修改主线回合导致的差异 2022-01-05 16:01:35 +08:00
arcoalien@qq.com 004db02529 1.解决PITR按recovery_target_time条件测试时,Startup线程卡在RequestCheckpoint处无法继续运行,数据库状态始终处于恢复状态
2.解决PITR按recovery_target_lsn条件测试时,Startup线程没有在指定的lsn位置停止
3.解决主线回合的代码未添加对t_thrd.syncrep_cxt.SyncRepConfig的判空保护,导致自动化用例失败
2022-01-05 11:18:15 +08:00
opengauss-bot a7148f3714
!1421 修复unique sql统计少的问题
Merge pull request !1421 from gentle_hu/dfx
2022-01-05 01:53:41 +00:00
opengauss-bot abb5c8026c
!1419 【轻量级 PR】:update cluster_guc.conf add enable_custom_parser
Merge pull request !1419 from 仲夏十三/N/A
2022-01-05 01:53:04 +00:00
opengauss-bot 129b4593ad
!1414 修复复制源(replication origin)的redo代码没有适配极致rto和并行回放的问题
Merge pull request !1414 from pengjiong/pub_sub
2022-01-05 01:52:54 +00:00
opengauss-bot 60c51b371e
!1444 修复发布订阅功能的升级脚本问题
Merge pull request !1444 from pengjiong/pubsub_fix_upgrade
2022-01-05 01:51:04 +00:00
opengauss-bot edd216eee8
!1427 修复开启SSL情况下,订阅加解密password失败的问题
Merge pull request !1427 from pengjiong/pubsub_encrypt_bug
2022-01-05 01:49:49 +00:00
opengauss-bot 1e7740b754
!1428 发布订阅增强:解决一个异常的subscription会导致正常的subscription也无法启动worker的问题
Merge pull request !1428 from pengjiong/pubsub_enhance_launcher
2022-01-05 01:48:31 +00:00
opengauss-bot 345c633c0b
!1436 【轻量级 PR】:update src/include/knl/knl_variable.h.
Merge pull request !1436 from Lain/N/A
2022-01-05 01:43:37 +00:00
opengauss-bot 52b4fc8cc0
!1437 修复gs_dump不指定-t时无法导出发布与表映射的问题
Merge pull request !1437 from 薛蒙恩/pubsub_fixbug2
2022-01-05 01:43:04 +00:00
opengauss-bot a79e4c777a
!1445 修复逻辑解码段页式表xlog失败的问题
Merge pull request !1445 from pengjiong/pubsub_fix_xlog
2022-01-05 01:40:43 +00:00
opengauss-bot 9d91b8b748
!1445 修复逻辑解码段页式表xlog失败的问题
Merge pull request !1445 from pengjiong/pubsub_fix_xlog
2022-01-05 01:40:43 +00:00
opengauss-bot b51530f247
!1447 修复postgis编译失败的问题
Merge pull request !1447 from pengjiong/postgis
2022-01-05 01:39:33 +00:00
opengauss-bot 6057d21b37
!1448 修复upsert子查询、first last函数等特性功能不可用问题
Merge pull request !1448 from gentle_hu/guass
2022-01-05 01:36:31 +00:00
gentle_hu 18a38c2a29 recover missing code about upsert-subquery\first last agg\array func\cgroup 2022-01-04 19:14:55 +08:00
TotaJ 863e5c119c Fix build postgis failed. 2022-01-04 17:43:41 +08:00
opengauss-bot e7a5fbb9af
!1438 修复外键死锁代码没有适配逻辑解码的问题
Merge pull request !1438 from pengjiong/pubsub_fix1
2022-01-04 08:06:29 +00:00
opengauss-bot fc7f59f3da !1430 修改订阅端connection不做校验问题
Merge pull request !1430 from 薛蒙恩/pubsub_fixbug
2022-01-04 01:32:46 +00:00
opengauss-bot ab5354ef25 !1432 fix bug for local index with fastupdate for partition
Merge pull request !1432 from zhengxue/master_dev
2022-01-04 01:25:57 +00:00
TotaJ 3a80e845b9 Fix wrong xlog in segment table. 2021-12-31 20:54:17 +08:00
opengauss-bot 3805086f6c !1442 修复openeuler-x86上打包releaselist错误导致安装失败的问题
Merge pull request !1442 from zhangxubo/master
2021-12-31 09:24:12 +00:00
opengauss-bot e25d5dfcc3 !1443 修复fastcheck_single不稳定的问题
Merge pull request !1443 from pengjiong/fix_fastcheck
2021-12-31 09:19:24 +00:00
TotaJ a73f5fcf91 Fix upgrade script for publication 2021-12-31 16:51:35 +08:00
TotaJ c748415948 Fix fastcheck_single unstable. 2021-12-31 16:32:00 +08:00
cchen676 5f30a78647 Merge branch 'master' of gitee.com:opengauss/openGauss-server into new_master 2021-12-31 06:20:18 +00:00
zhang_xubo 772a082f44 修复openeuler-x86上打包releaselist错误导致安装失败的问题 2021-12-31 11:47:00 +08:00
TotaJ f2af76de00 Enhance apply launcher when there are some abnormal subscription. 2021-12-30 11:03:18 +08:00
TotaJ 67bd246cef Fix subscription decrypt password failed. 2021-12-30 10:26:36 +08:00
TotaJ 0f41674e9d Tuple lock fit logical deocde 2021-12-30 10:23:12 +08:00
opengauss-bot 9fc8923859 !1435 [opengauss功能包合入]功能列表见PR说明
Merge pull request !1435 from zzy/new_features
2021-12-30 01:49:54 +00:00
xue_meng_en 1aa1deb6a3 修复gs_dump不指定-t时无法导出发布与表映射的问题 2021-12-29 22:00:22 +08:00
dengxuyue c7b25efcff New features (and bug fixes)
1. alter large sequence
    2. subpartition
    2.1 split subpartition
    2.2 truncate subpartition
    3. 支持load
    4. 支持start-with/connect-by
    5. ...
2021-12-29 21:33:28 +08:00
林开钞 2670d0d8c4
update src/include/knl/knl_variable.h.
单词拼写错误
2021-12-29 10:15:23 +00:00
arcoalien@qq.com 40fb97943f 修改支持配置延迟进入最大可用模式需求的代码逻辑
修复社区该需求相关的问题
2021-12-27 21:41:57 +08:00
shirley_zhengx a5da5b5264 modify parameter 2021-12-27 19:06:46 +08:00
shirley_zhengx 2a46352f5f modify parameter 2021-12-27 19:03:44 +08:00
shirley_zhengx a3cf9e4b3c fix bug for local index with fastupdate for partition 2021-12-27 13:14:53 +08:00
xue_meng_en 4b26769c6c 修改订阅端connection不做校验问题 2021-12-24 16:42:11 +08:00
gentle_hu e7752a5030 fix issue where unique sql statistics are inaccurate 2021-12-21 20:14:19 +08:00
仲夏十三 9ee55aefc5
update cluster_guc.conf add enable_custom_parser 2021-12-21 02:36:51 +00:00
chenxiaobin 841be96b35
Consider other lockers of a xmax when it's a multi with an aborted update 2021-12-20 07:56:10 +00:00
TotaJ e40b7dc8cd Fit for exterm RTO and parallel redo for replicaiton origin. 2021-12-20 15:43:19 +08:00
opengauss-bot 27bdb0d62b !1413 修复外键死锁代码没有适配逻辑解码的问题
Merge pull request !1413 from pengjiong/pub_sub
2021-12-20 07:40:09 +00:00
TotaJ 3dfe9dee3f Tuple lock fit logical deocde 2021-12-20 11:30:50 +08:00
opengauss-bot ddf5632d90 !1409 解决core bug
Merge pull request !1409 from aaronwell/master1
2021-12-17 08:18:59 +00:00
opengauss-bot f5d2b43c97 !1408 修复删除逻辑复制槽时内存泄漏问题
Merge pull request !1408 from 王珍珍/master
2021-12-17 06:19:44 +00:00
opengauss-bot fdc66f641e !1407 支持同步模式转最大可用模式超时时间窗口参数设置
Merge pull request !1407 from 薛蒙恩/keep_sync_window
2021-12-17 03:53:16 +00:00
aaronwell 97c394acc4
update src/gausskernel/optimizer/plan/subselect.cpp.
查找node时,每次只处理一个
2021-12-17 02:56:51 +00:00
mry e40c175b52 commit for keep_sync_window 2021-12-17 09:56:19 +08:00
opengauss-bot a25b1e1b62 !1390 支持发布订阅
Merge pull request !1390 from pengjiong/pub_sub
2021-12-16 16:29:07 +00:00
TotaJ 974d7e8726 Fix acl error. 2021-12-16 23:20:22 +08:00
xue_meng_en eaaf873a9f openGauss支持发布订阅 2021-12-16 23:20:10 +08:00
TotaJ 4bf1feab89 Support subscription and publication. 2021-12-16 23:16:24 +08:00
opengauss-bot 1726faa49a !1403 支持OLTP场景数据压缩需求
Merge pull request !1403 from 吴岳川/compress_newly
2021-12-16 15:15:07 +00:00
wuyuechuan 4b35784ea0 table/index(btree) support compression 2021-12-16 22:24:44 +08:00
opengauss-bot 17a872b1fd !1387 Improve concurrency of foreign key locking
Merge pull request !1387 from chenxiaobin/enhancetuplelock
2021-12-16 14:17:30 +00:00
王珍珍 e2ee77537d
update src/gausskernel/storage/replication/slotfuncs.cpp.
实现内容:修复删除逻辑复制槽时内存泄漏问题

主要逻辑:在对复制槽名称进行memcpy_s时,复制长度设置为复制槽名称的长度
2021-12-16 14:02:56 +00:00
chenxiaobin19 899cd4a36c enhance tuple lock 2021-12-16 20:37:27 +08:00
zhang_xubo dea61e33d1 package gs_plan_simulator script 2021-12-15 15:10:46 +08:00
opengauss-bot f43410e164 !1386 修正了pg_buffercache_pages的返回字段isvalid值不正确的问题
Merge pull request !1386 from 彭煜玮/master
2021-12-06 07:22:17 +00:00
Yuwei Peng a3298d8fe8 修正了pg_buffercache_pages的返回字段isvalid值不正确的问题。 2021-12-03 21:37:17 +08:00
hemny 7a5dbf29c6 修复日志未记录SQL语句的持续时间的bug 2021-12-02 13:27:37 +08:00
opengauss-bot 2417964517 !1356 为pg_buffercache_pages()补充了fastcheck用例
Merge pull request !1356 from 彭煜玮/master
2021-11-16 08:06:19 +00:00
Yuwei Peng 6c555f5002 为pg_buffercache_pages增加fastcheck用例。 2021-11-14 14:56:59 +08:00
opengauss-bot afcd4f26e4 !1351 修复cstore unique index 一些问题
Merge pull request !1351 from 吴岳川/master
2021-11-10 03:50:00 +00:00
wuyuechuan f5fea59092 cstore: unique index bug fix 2021-11-09 10:12:25 +08:00
wangym11 a879c38b96 Merge branch 'master' of https://gitee.com/opengauss/openGauss-server into I4GJWP 2021-11-08 11:23:29 +08:00
opengauss-bot b2ff10be13 !1313 为函数pg_buffercache_pages增加了isvalid和pinning_backends两个输出参数
Merge pull request !1313 from 彭煜玮/master
2021-11-04 07:34:57 +00:00
Yuwei Peng cd3ccd0334 增加了针对pg_buffercache_pages函数的回滚脚本
增加了针对pg_buffercache_pages函数的回滚脚本,同时补充了otherdb中针对该函数的升级脚本,也将升级脚本中bucketid的类型更正为int4。
2021-11-02 20:16:02 +08:00
wangym 4bd6a7f045 代码瑕疵,存在隐患 2021-11-02 16:44:16 +08:00
opengauss-bot e12231a393 !1325 add nvarchar keyword to be compatible with databaseB
Merge pull request !1325 from 仲夏十三/master
2021-11-01 09:33:15 +00:00
ganyang df57653524 Add for nvarchar. 2021-10-30 17:49:58 +08:00
opengauss-bot ea541acd13 !1275 support row_num in Column-Oriented Table
Merge pull request !1275 from scarbor_fair/rownum
2021-10-28 02:35:13 +00:00
opengauss-bot 261d169ece !1322 解决bgwriter线程退出时,查询local_bgwriter_stat()导致数据库宕机的问题
Merge pull request !1322 from 陈栋/bugfix1
2021-10-27 02:51:06 +00:00
chendong76 6e1eac1c26 解决bgwriter线程退出时,查询local_bgwriter_stat()导致数据库宕机的问题 2021-10-26 16:40:31 +08:00
opengauss-bot f20a461caa !1299 【测试类型:性能】【测试版本:2.1.0】账本数据库删除全局区块表oid提升事务处理性能
Merge pull request !1299 from herui/remove_gchain_oid
2021-10-26 01:54:25 +00:00
opengauss-bot 890bcf8913 !1304 修复打包version.cfg中git number获取错误的问题
Merge pull request !1304 from zhangxubo/version
2021-10-25 11:04:04 +00:00
opengauss-bot 656d26c156 !1307 修复流复制synchronous_commit参数工作不正确的问题
Merge pull request !1307 from April01xxx/sync_rep_wait_mode
2021-10-22 09:19:38 +00:00
Yuwei Peng fc8fd72914 更正了升级脚本 2021-10-19 00:05:22 +08:00
Yuwei Peng 4702f7687a 将pg_buffercache_pages的参数bucketid的类型修正为int4 2021-10-18 00:15:10 +08:00
Yuwei Peng 6f253bd041 将pg_buffercache_pages的输出参数isdirty的类型修正为boolean 2021-10-17 23:45:13 +08:00
Yuwei Peng 83c8185721 为pg_buffercache_pages增加了2个输出参数isvalid和pinning_backends 2021-10-17 20:58:00 +08:00
zhang_xubo b36a716a69 pg_recvlogical工具校验逻辑复制槽名称长度添加对双引号考虑 2021-10-15 11:17:07 +08:00
April01xxx 66aea19936 修复流复制synchronous_commit参数工作不正确的问题。 2021-10-13 15:36:12 +08:00
zhang_xubo 76d923ba2b 修复打包后version.cfg错误的问题 2021-10-11 11:56:54 +08:00
chenxiaobin19 3ec2d32c69 stop retry when the send buffer is full for nonblocking SSL_write 2021-10-09 17:51:23 +08:00
he_ray 17b4cfb347 remove oid for gs_global_chain 2021-10-08 11:11:38 +08:00
yupeng 1eefafe1a0 fix bug for rownum when cstore 2021-09-18 17:28:46 +08:00
3265 changed files with 727323 additions and 225356 deletions

9
.gitignore vendored
View File

@ -1,7 +1,7 @@
/.gitee/
/.vscode/
/.idea/
/cmake-build-debug/
*.a
*.o
*.so
@ -10,12 +10,15 @@
*.sgml
*.log
*.inc
*.rej
objfiles.txt
/tmp_build/
/output/
/mppdb_temp_install/
/GNUmakefile
/config.status
/ereport.txt
/build/script/version.cfg
/src/Makefile.global
/build/script/version.cfg

View File

@ -58,7 +58,6 @@ install:
$(MAKE) -C contrib/hstore $@
$(MAKE) -C $(root_builddir)/distribute/kernel/extension/packages $@
$(MAKE) -C contrib/pagehack $@
$(MAKE) -C contrib/pg_stat_statements $@
$(MAKE) -C contrib/pg_xlogdump $@
$(MAKE) -C $(root_builddir)/contrib/gsredistribute $@
$(MAKE) -C $(root_builddir)/distribute/kernel/extension/dimsearch $@
@ -67,17 +66,27 @@ install:
+@echo "openGauss installation complete."
else
ifeq ($(enable_privategauss), yes)
ifneq ($(enable_lite_mode), yes)
install:
$(MAKE) install_mysql_fdw
$(MAKE) install_oracle_fdw
$(MAKE) install_pldebugger
$(MAKE) -C contrib/postgres_fdw $@
$(MAKE) -C contrib/pg_stat_statements $@
$(MAKE) -C contrib/hstore $@
$(MAKE) -C $(root_builddir)/distribute/kernel/extension/packages $@
$(MAKE) -C $(root_builddir)/privategauss/kernel/extension/packages $@
$(MAKE) -C $(root_builddir)/contrib/gsredistribute $@
+@echo "openGauss installation complete."
else
install:
$(MAKE) install_mysql_fdw
$(MAKE) install_oracle_fdw
$(MAKE) install_pldebugger
$(MAKE) -C contrib/postgres_fdw $@
$(MAKE) -C contrib/hstore $@
$(MAKE) -C $(root_builddir)/privategauss/kernel/extension/packages $@
+@echo "openGauss installation complete."
endif
else
install:
$(MAKE) install_mysql_fdw
$(MAKE) install_oracle_fdw
@ -133,6 +142,8 @@ qunitcheck: all
fastcheck_single: all
upgradecheck_single: all
fastcheck_single_comm_proxy: all
redocheck: all

1233
README.md

File diff suppressed because it is too large Load Diff

View File

@ -1,62 +0,0 @@
[overwrite]
CMakeLists.txt
License
GNUmakefile.in
Makefile
README.en.md
README.md
Third_Party_Open_Source_Software_Notice
aclocal.m4
build
build.sh
cmake
config
configure
contrib
doc
docker
escan.txt
package
simpleInstall
src/DEVELOPERS
src/Makefile
src/Makefile.global.in
src/Makefile.shlib
src/bcc32.mak
src/bin
src/common
src/gausskernel
src/get_PlatForm_str.sh
src/include
src/lib
src/makefiles
src/manager
src/mtlocal.pl
src/nls-global.mk
src/test
src/tools
src/win32.mak
Tools/memory_check
[delete]
third_party
contrib/secbox
contrib/carbondata
contrib/gtmtester
src/bin/gds
src/bin/pg_redis
src/include/ssl/openssl_etcd.cnf
src/test/regress/jar
src/test/regress/krbclient
src/test/regress/obstools
src/tools/casedb
build/script/mpp_release_list_centos
build/script/mpp_release_list_centos_aarch64
build/script/mpp_release_list_centos_single
build/script/mpp_release_list_euleros
build/script/mpp_release_list_euleros_aarch64
build/script/mpp_release_list_euleros_aarch64_single
build/script/mpp_release_list_euleros_single
build/script/mpp_release_list_linux_x86_64
build/script/mpp_release_list_openeuler_aarch64
build/script/mpp_release_list_openeuler_aarch64_single
build/script/mpp_release_list_kylin_aarch64

View File

@ -1,116 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
use File::Basename;
use File::Path qw(make_path remove_tree);
use Cwd;
my $gausskernel_dir = $ARGV[0];
my $opengauss_dir = $ARGV[1];
sub usage
{
print " usage:\n";
print " perl port_openGauss.pl GaussDBKernel-server-directory openGauss-server-directory\n";
print " \n";
}
sub valid_line
{
my ($l) = @_;
$l =~ s/^\s+//g;
$l =~ s/\s+$//g;
return 1 if $l;
return 0;
}
sub prepare_parentdir
{
my $dir = $_[0];
$dir =~ s/\/*$//g;
die "there is no such a directory $dir" unless $dir;
my $parentdir = dirname($dir);
make_path $parentdir unless -d $parentdir;
}
if ( !$opengauss_dir || !$gausskernel_dir || $gausskernel_dir eq "-h" || $gausskernel_dir eq "--help" ) {
usage();
exit(-1);
}
if (! -d $opengauss_dir || ! -d $gausskernel_dir ) {
print "ERROR: $opengauss_dir or $gausskernel_dir does not exist!";
}
$opengauss_dir =~ s{/+$}{}g;
$gausskernel_dir =~ s{/+$}{}g;
my $open_assist_dir = dirname(__FILE__);
if ($open_assist_dir !~ m/^\//) {
$open_assist_dir = cwd() . '/' . $open_assist_dir;
}
$open_assist_dir =~ s/\/\.$//;
my $opengauss_fileset = "$open_assist_dir/opengauss_fileset";
my @overwrite_fileset;
my @delete_fileset;
open my $fset, "<", $opengauss_fileset or die "cannot open $opengauss_fileset: $!\n";
my $file_type = "none";
while(my $line=<$fset>) {
chomp $line;
if ($line =~ /\[overwrite\]/) {
$file_type = "overwrite";
next;
}
elsif ($line =~ /\[delete\]/) {
$file_type = "delete";
next;
}
if ($file_type eq "overwrite") {
push @overwrite_fileset, $line;
}
elsif ($file_type eq "delete") {
push @delete_fileset, $line;
}
}
print "[" . localtime() . "] synchronizing directories and files.\n";
foreach my $d(qw/src contrib/) {
if ( -d "$opengauss_dir/$d" ) {
remove_tree("$opengauss_dir/$d");
print "removed $opengauss_dir/$d\n";
}
make_path("$opengauss_dir/$d");
print "created $opengauss_dir/$d\n";
}
foreach my $f(@overwrite_fileset) {
next unless valid_line($f);
if ( -d "$gausskernel_dir/$f") {
prepare_parentdir("$opengauss_dir/$f");
remove_tree("$opengauss_dir/$f") if -d "$opengauss_dir/$f";
system("cp -fr $gausskernel_dir/$f $opengauss_dir/$f") == 0 or print "ERROR: copy $gausskernel_dir/$f failed\n";
print "copied $opengauss_dir/$f\n";
}
elsif ( -f "$gausskernel_dir/$f") {
system("cp -f $gausskernel_dir/$f $opengauss_dir/$f") == 0 or print "ERROR: copy $gausskernel_dir/$f failed\n";
print "copied $opengauss_dir/$f\n";
}
}
foreach my $f(@delete_fileset) {
next unless valid_line($f);
if ( -d "$opengauss_dir/$f") {
remove_tree("$opengauss_dir/$f");
print "deleted $opengauss_dir/$f\n";
}
elsif ( -f "$opengauss_dir/$f") {
unlink "$opengauss_dir/$f";
print "deleted $opengauss_dir/$f\n";
}
}
print "[" . localtime() . "] synchronized directories and files.\n";

View File

@ -1,5 +1,12 @@
#!/bin/bash
#######################################################################
# 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 build_version_mode='release'
declare build_binarylib_dir='None'
declare wrap_binaries='NO'
@ -74,10 +81,15 @@ ROOT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
echo "ROOT_DIR : $ROOT_DIR"
cd build/script
chmod a+x build_opengauss.sh
sh build_opengauss.sh -m ${build_version_mode} -3rd ${build_binarylib_dir} ${not_optimized} -pkg server -mc off
./build_opengauss.sh -m ${build_version_mode} -3rd ${build_binarylib_dir} ${not_optimized} -pkg server
if [ "${wrap_binaries}"X = "YES"X ]
then
chmod a+x build_opengauss.sh
sh package_opengauss.sh -3rd ${build_binarylib_dir} -m ${build_version_mode} -f ${config_file}
chmod a+x package_opengauss.sh
if [ X$config_file = "X" ];then
./package_opengauss.sh -3rd ${build_binarylib_dir} -m ${build_version_mode}
else
./package_opengauss.sh -3rd ${build_binarylib_dir} -m ${build_version_mode} -f ${config_file}
fi
fi
exit 0

View File

@ -2,46 +2,21 @@
./bin/gsql
./bin/gaussdb
./bin/gstrace
./bin/gs_basebackup
./bin/gs_probackup
./bin/gs_tar
./bin/gs_encrypt
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_ctl
./bin/gs_initdb
./bin/gs_guc
./bin/encrypt
./bin/openssl
./bin/gs_restore
./bin/gs_cgroup
./bin/openssl
./bin/pg_config
./bin/pg_controldata
./bin/pg_format_cu
./bin/gs_probackup
./bin/pg_resetxlog
./bin/pg_recvlogical
./bin/alarmItem.conf
./bin/retry_errcodes.conf
./bin/cluster_guc.conf
./bin/bind_net_irq.sh
./bin/setArmOptimization.sh
./bin/krb5kdc
./bin/klist
./bin/kinit
./bin/kdestroy
./bin/kdb5_util
./bin/kadmin.local
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
./etc/kerberos/mppdb-site.xml
./share/postgresql/tmp/udstools.py
./bin/gs_plan_simulator.sh
./share/postgresql/db4ai
./share/postgresql/snowball_create.sql
./share/postgresql/pg_hba.conf.sample
@ -53,7 +28,6 @@
./share/postgresql/pg_ident.conf.sample
./share/postgresql/postgres.description
./share/postgresql/postgresql.conf.sample
./share/postgresql/mot.conf.sample
./share/postgresql/extension/plpgsql--1.0.sql
./share/postgresql/extension/hstore.control
./share/postgresql/extension/security_plugin.control
@ -71,8 +45,6 @@
./share/postgresql/extension/hdfs_fdw.control
./share/postgresql/extension/log_fdw--1.0.sql
./share/postgresql/extension/log_fdw.control
./share/postgresql/extension/mot_fdw--1.0.sql
./share/postgresql/extension/mot_fdw.control
./share/postgresql/extension/postgres_fdw--1.0.sql
./share/postgresql/extension/postgres_fdw.control
./share/postgresql/timezone/GB-Eire
@ -281,7 +253,6 @@
./share/postgresql/timezone/Canada/Newfoundland
./share/postgresql/timezone/Canada/Saskatchewan
./share/postgresql/timezone/Canada/Pacific
./share/postgresql/timezone/Canada/East-Saskatchewan
./share/postgresql/timezone/Canada/Mountain
./share/postgresql/timezone/Canada/Central
./share/postgresql/timezone/CST6CDT
@ -663,7 +634,6 @@
./share/postgresql/timezone/Navajo
./share/postgresql/timezone/GMT
./share/postgresql/system_views.sql
./share/postgresql/private_system_views.sql
./share/postgresql/performance_views.sql
./share/postgresql/sql_features.txt
./share/postgresql/pg_cast_oid.txt
@ -702,11 +672,47 @@
./share/postgresql/timezonesets/Default
./share/postgresql/timezonesets/Etc.txt
./share/postgresql/postgres.bki
./share/llvmir/GaussDB_expr.ir
./share/sslcert/gsql/openssl.cnf
./share/sslcert/grpc/openssl.cnf
./share/sslcert/om/openssl.cnf
./lib/libsimsearch/
./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/libssl.so.1.1
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libcgroup.so
./lib/libcgroup.so.1
./lib/libz.so
./lib/libz.so.1
./lib/libz.so.1.2.11
./lib/liblz4.so
./lib/liblz4.so.1
./lib/liblz4.so.1.9.2
./lib/libcjson.so
./lib/libcjson.so.1
./lib/libcjson.so.1.7.14
./lib/libcjson_utils.so
./lib/libcjson_utils.so.1
./lib/libcjson_utils.so.1.7.14
./lib/libstdc++.so.6
./lib/libgcc_s.so.1
./lib/libgomp.so
./lib/libgomp.so.1
./lib/libgomp.so.1.0.0
./lib/libdcf.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.1
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
@ -715,12 +721,6 @@
./lib/postgresql/cyrillic_and_mic.so
./lib/postgresql/utf8_and_johab.so
./lib/postgresql/utf8_and_gb18030.so
./lib/postgresql/pgxs/src/makefiles/pgxs.mk
./lib/postgresql/pgxs/src/Makefile.shlib
./lib/postgresql/pgxs/src/Makefile.port
./lib/postgresql/pgxs/src/nls-global.mk
./lib/postgresql/pgxs/src/Makefile.global
./lib/postgresql/pgxs/src/get_PlatForm_str.sh
./lib/postgresql/pgxs/config/install-sh
./lib/postgresql/euc_cn_and_mic.so
./lib/postgresql/latin_and_mic.so
@ -746,141 +746,9 @@
./lib/postgresql/pg_plugin
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so
./lib/libpljava.so
./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/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.9
./lib/libupb.so.9.0.0
./lib/libabsl_str_format_internal.so
./lib/libabsl_strings.so
./lib/libabsl_throw_delegate.so
./lib/libabsl_strings_internal.so
./lib/libabsl_base.so
./lib/libabsl_dynamic_annotations.so
./lib/libabsl_spinlock_wait.so
./lib/libabsl_int128.so
./lib/libabsl_bad_optional_access.so
./lib/libabsl_raw_logging_internal.so
./lib/libabsl_log_severity.so
./lib/libaddress_sorting.so
./lib/libaddress_sorting.so.9
./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.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/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.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./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/libz.so.1
./lib/libz.so.1.2.11
./lib/liblz4.so
./lib/liblz4.so.1
./lib/liblz4.so.1.9.2
./lib/libcjson.so
./lib/libcjson.so.1
./lib/libcjson.so.1.7.13
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./share/llvmir/GaussDB_expr.ir
./lib/libeSDKLogAPI.so
./lib/libeSDKOBS.so
./lib/liblog4cpp.so
./lib/liblog4cpp.so.5
./lib/liblog4cpp.so.5.0.6
./lib/libcharset.so
./lib/libcharset.so.1
./lib/libcharset.so.1.0.0
./lib/libiconv.so
./lib/libiconv.so.2
./lib/libiconv.so.2.6.1
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.20.0
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
./lib/libsecurec.so
./lib/libxml2.so
./lib/libxml2.so.2
./lib/libxml2.so.2.9.9
./lib/libparquet.so
./lib/libparquet.so.14
./lib/libparquet.so.14.1.0
./lib/libarrow.so
./lib/libarrow.so.14
./lib/libarrow.so.14.1.0
./lib/OBS.ini
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/libdcf.so
./lib/libzstd.so
./lib/libzstd.so.1
./lib/libzstd.so.1.4.4
./lib/libxgboost.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h
@ -974,6 +842,7 @@
./include/postgresql/server/utils/aset.h
./include/postgresql/server/utils/catcache.h
./include/postgresql/server/utils/atomic_arm.h
./include/postgresql/server/utils/oidrbtree.h
./include/postgresql/server/datatype/timestamp.h
./include/postgresql/server/access/rmgr.h
./include/postgresql/server/access/xlogreader.h
@ -985,6 +854,7 @@
./include/postgresql/server/access/attnum.h
./include/postgresql/server/access/tupmacs.h
./include/postgresql/server/access/xlogrecord.h
./include/postgresql/server/tde_key_management/data_common.h
./include/postgresql/server/tcop/dest.h
./include/postgresql/server/catalog/pg_type.h
./include/postgresql/server/catalog/pg_attribute.h
@ -1008,6 +878,7 @@
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/lwlocknames.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1031,400 +902,14 @@
./include/postgresql/server/lib/ilist.h
./include/postgresql/server/pgxc/locator.h
./include/postgresql/server/gstrace/gstrace_infra.h
./include/postgresql/server/extension_dependency.h
./include/postgresql/server/libpq/libpq-fe.h
./include/postgresql/server/access/clog.h
./include/postgresql/server/storage/proc.h
./include/postgresql/server/access/xlog.h
./include/postgresql/server/storage/lwlocknames.h
./include/postgresql/server/access/xloginsert.h
./include/postgresql/server/catalog/pg_control.h
./include/postgresql/server/access/parallel_recovery/redo_item.h
./include/postgresql/server/access/parallel_recovery/posix_semaphore.h
./include/postgresql/server/replication/replicainternal.h
./include/postgresql/server/knl/knl_instance.h
./include/postgresql/server/knl/knl_guc.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_sql.h
./include/postgresql/server/knl/knl_guc/knl_guc_common.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_sql.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_storage.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_storage.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_storage.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_security.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_security.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_network.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_network.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_memory.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_memory.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_resource.h
./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/lib/circularqueue.h
./include/postgresql/server/access/double_write_basic.h
./include/postgresql/server/knl/knl_thread.h
./include/postgresql/server/access/sdir.h
./include/postgresql/server/gssignal/gs_signal.h
./include/postgresql/server/knl/knl_session.h
./include/postgresql/server/libpq/pqcomm.h
./include/postgresql/server/cipher.h
./include/postgresql/server/portability/instr_time.h
./include/postgresql/server/utils/memgroup.h
./include/postgresql/server/storage/latch.h
./include/postgresql/server/workload/qnode.h
./include/postgresql/server/streaming/init.h
./include/postgresql/server/streaming/launcher.h
./include/postgresql/server/pgxc/barrier.h
./include/postgresql/server/libcomm/libcomm.h
./include/postgresql/server/hotpatch/hotpatch.h
./include/postgresql/server/hotpatch/hotpatch_backend.h
./include/postgresql/server/postmaster/bgwriter.h
./include/postgresql/server/postmaster/pagewriter.h
./include/postgresql/server/replication/heartbeat.h
./include/postgresql/server/access/multi_redo_settings.h
./include/postgresql/server/access/redo_statistic_msg.h
./include/postgresql/server/replication/rto_statistic.h
./include/postgresql/server/replication/walprotocol.h
./include/postgresql/server/storage/mot/jit_def.h
./include/postgresql/server/threadpool/threadpool.h
./include/postgresql/server/threadpool/threadpool_controler.h
./include/postgresql/server/threadpool/threadpool_group.h
./include/postgresql/server/knl/knl_variable.h
./include/postgresql/server/threadpool/threadpool_listener.h
./include/postgresql/server/threadpool/threadpool_sessctl.h
./include/postgresql/server/storage/procsignal.h
./include/postgresql/server/threadpool/threadpool_worker.h
./include/postgresql/server/threadpool/threadpool_scheduler.h
./include/postgresql/server/threadpool/threadpool_stream.h
./include/postgresql/server/replication/dataqueuedefs.h
./include/postgresql/server/gtm/gtm_c.h
./include/postgresql/server/cm/etcdapi.h
./include/postgresql/server/alarm/alarm.h
./include/postgresql/server/access/xact.h
./include/postgresql/server/access/cstore_am.h
./include/postgresql/server/access/cstore_roughcheck_func.h
./include/postgresql/server/access/cstoreskey.h
./include/postgresql/server/storage/cu.h
./include/postgresql/server/vecexecutor/vectorbatch.h
./include/postgresql/server/cstore.h
./include/postgresql/server/storage/cstore/cstore_mem_alloc.h
./include/postgresql/server/access/cstore_minmax_func.h
./include/postgresql/server/storage/custorage.h
./include/postgresql/server/storage/fd.h
./include/postgresql/server/postmaster/aiocompleter.h
./include/postgresql/server/storage/buf/bufmgr.h
./include/postgresql/server/storage/buf/buf_internals.h
./include/postgresql/server/storage/smgr.h
./include/postgresql/server/catalog/pg_am.h
./include/postgresql/server/catalog/pg_class.h
./include/postgresql/server/catalog/pg_index.h
./include/postgresql/server/rewrite/prs2lock.h
./include/postgresql/server/tcop/stmt_retry.h
./include/postgresql/server/catalog/pg_hashbucket_fn.h
./include/postgresql/server/utils/rel_gs.h
./include/postgresql/server/catalog/pg_partition.h
./include/postgresql/server/catalog/pg_hashbucket.h
./include/postgresql/server/catalog/catalog.h
./include/postgresql/server/catalog/catversion.h
./include/postgresql/server/catalog/pg_namespace.h
./include/postgresql/server/utils/partitionmap_gs.h
./include/postgresql/server/access/heapam.h
./include/postgresql/server/storage/pagecompress.h
./include/postgresql/server/replication/bcm.h
./include/postgresql/server/storage/cstore/cstorealloc.h
./include/postgresql/server/storage/cucache_mgr.h
./include/postgresql/server/storage/cache_mgr.h
./include/postgresql/server/nodes/plannodes.h
./include/postgresql/server/foreign/foreign.h
./include/postgresql/server/access/obs/obs_am.h
./include/postgresql/server/storage/buf/buffile.h
./include/postgresql/server/replication/slot.h
./include/postgresql/server/access/obs/eSDKOBS.h
./include/postgresql/server/commands/defrem.h
./include/postgresql/server/optimizer/pruning.h
./include/postgresql/server/nodes/relation.h
./include/postgresql/server/optimizer/bucketinfo.h
./include/postgresql/server/pgxc/nodemgr.h
./include/postgresql/server/bulkload/dist_fdw.h
./include/postgresql/server/bulkload/importerror.h
./include/postgresql/server/commands/gds_stream.h
./include/postgresql/server/bulkload/utils.h
./include/postgresql/server/cjson/cJSON.h
./include/postgresql/server/ssl/gs_openssl_client.h
./include/postgresql/server/funcapi.h
./include/postgresql/server/executor/executor.h
./include/postgresql/server/executor/execdesc.h
./include/postgresql/server/nodes/execnodes.h
./include/postgresql/server/access/genam.h
./include/postgresql/server/nodes/tidbitmap.h
./include/postgresql/server/access/relscan.h
./include/postgresql/server/access/itup.h
./include/postgresql/server/executor/instrument.h
./include/postgresql/server/miscadmin.h
./include/postgresql/server/libpq/libpq-be.h
./include/postgresql/server/libpq/hba.h
./include/postgresql/server/libpq/sha2.h
./include/postgresql/server/utils/anls_opt.h
./include/postgresql/server/pgxc/pgxc.h
./include/postgresql/server/catalog/namespace.h
./include/postgresql/server/commands/trigger.h
./include/postgresql/server/executor/spi.h
./jre/ASSEMBLY_EXCEPTION
./jre/bin/java
./jre/bin/jjs
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
./jre/bin/policytool
./jre/bin/rmid
./jre/bin/rmiregistry
./jre/bin/servertool
./jre/bin/tnameserv
./jre/bin/unpack200
./jre/lib/amd64/jli/libjli.so
./jre/lib/amd64/jvm.cfg
./jre/lib/amd64/libattach.so
./jre/lib/amd64/libavplugin-ffmpeg-58.so
./jre/lib/amd64/libawt_headless.so
./jre/lib/amd64/libawt.so
./jre/lib/amd64/libawt_xawt.so
./jre/lib/amd64/libdecora_sse.so
./jre/lib/amd64/libdt_socket.so
./jre/lib/amd64/libfontmanager.so
./jre/lib/amd64/libfxplugins.so
./jre/lib/amd64/libglassgtk2.so
./jre/lib/amd64/libglassgtk3.so
./jre/lib/amd64/libglass.so
./jre/lib/amd64/libgstreamer-lite.so
./jre/lib/amd64/libhprof.so
./jre/lib/amd64/libinstrument.so
./jre/lib/amd64/libj2gss.so
./jre/lib/amd64/libj2pcsc.so
./jre/lib/amd64/libj2pkcs11.so
./jre/lib/amd64/libjaas_unix.so
./jre/lib/amd64/libjava_crw_demo.so
./jre/lib/amd64/libjavafx_font_freetype.so
./jre/lib/amd64/libjavafx_font_pango.so
./jre/lib/amd64/libjavafx_font.so
./jre/lib/amd64/libjavafx_iio.so
./jre/lib/amd64/libjava.so
./jre/lib/amd64/libjawt.so
./jre/lib/amd64/libjdwp.so
./jre/lib/amd64/libjfxmedia.so
./jre/lib/amd64/libjfxwebkit.so
./jre/lib/amd64/libjpeg.so
./jre/lib/amd64/libjsdt.so
./jre/lib/amd64/libjsig.so
./jre/lib/amd64/libjsoundalsa.so
./jre/lib/amd64/libjsound.so
./jre/lib/amd64/liblcms.so
./jre/lib/amd64/libmanagement.so
./jre/lib/amd64/libmlib_image.so
./jre/lib/amd64/libnet.so
./jre/lib/amd64/libnio.so
./jre/lib/amd64/libnpt.so
./jre/lib/amd64/libprism_common.so
./jre/lib/amd64/libprism_es2.so
./jre/lib/amd64/libprism_sw.so
./jre/lib/amd64/libsaproc.so
./jre/lib/amd64/libsctp.so
./jre/lib/amd64/libsplashscreen.so
./jre/lib/amd64/libsunec.so
./jre/lib/amd64/libunpack.so
./jre/lib/amd64/libverify.so
./jre/lib/amd64/libzip.so
./jre/lib/amd64/server/libjvm.so
./jre/lib/amd64/server/Xusage.txt
./jre/lib/calendars.properties
./jre/lib/charsets.jar
./jre/lib/classlist
./jre/lib/cmm/CIEXYZ.pf
./jre/lib/cmm/GRAY.pf
./jre/lib/cmm/LINEAR_RGB.pf
./jre/lib/cmm/PYCC.pf
./jre/lib/cmm/sRGB.pf
./jre/lib/content-types.properties
./jre/lib/currency.data
./jre/lib/ext/cldrdata.jar
./jre/lib/ext/dnsns.jar
./jre/lib/ext/jaccess.jar
./jre/lib/ext/jfxrt.jar
./jre/lib/ext/localedata.jar
./jre/lib/ext/meta-index
./jre/lib/ext/nashorn.jar
./jre/lib/ext/sunec.jar
./jre/lib/ext/sunjce_provider.jar
./jre/lib/ext/sunpkcs11.jar
./jre/lib/ext/zipfs.jar
./jre/lib/flavormap.properties
./jre/lib/fontconfig.Euler.properties
./jre/lib/fontconfig.properties
./jre/lib/fontconfig.Ubuntu.properties
./jre/lib/fonts/Roboto-Regular.ttf
./jre/lib/hijrah-config-umalqura.properties
./jre/lib/images/cursors/cursors.properties
./jre/lib/images/cursors/invalid32x32.gif
./jre/lib/images/cursors/motif_CopyDrop32x32.gif
./jre/lib/images/cursors/motif_CopyNoDrop32x32.gif
./jre/lib/images/cursors/motif_LinkDrop32x32.gif
./jre/lib/images/cursors/motif_LinkNoDrop32x32.gif
./jre/lib/images/cursors/motif_MoveDrop32x32.gif
./jre/lib/images/cursors/motif_MoveNoDrop32x32.gif
./jre/lib/javafx-mx.jar
./jre/lib/javafx.properties
./jre/lib/jce.jar
./jre/lib/jexec
./jre/lib/jfr/default.jfc
./jre/lib/jfr.jar
./jre/lib/jfr/profile.jfc
./jre/lib/jfxswt.jar
./jre/lib/jsse.jar
./jre/lib/jvm.hprof.txt
./jre/lib/logging.properties
./jre/lib/management-agent.jar
./jre/lib/management/jmxremote.access
./jre/lib/management/jmxremote.password.template
./jre/lib/management/management.properties
./jre/lib/management/snmp.acl.template
./jre/lib/meta-index
./jre/lib/net.properties
./jre/lib/psfontj2d.properties
./jre/lib/psfont.properties.ja
./jre/lib/resources.jar
./jre/lib/rt.jar
./jre/lib/security/blacklisted.certs
./jre/lib/security/cacerts
./jre/lib/security/java.policy
./jre/lib/security/java.security
./jre/lib/security/policy/limited/local_policy.jar
./jre/lib/security/policy/limited/US_export_policy.jar
./jre/lib/security/policy/unlimited/local_policy.jar
./jre/lib/security/policy/unlimited/US_export_policy.jar
./jre/lib/sound.properties
./jre/lib/tzdb.dat
./jre/LICENSE
./jre/THIRD_PARTY_README
[client]
./bin/gsql
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./bin/gs_basebackup
./bin/gs_probackup
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
./lib/postgresql/utf8_and_uhc.so
./lib/postgresql/euc_tw_and_big5.so
./lib/postgresql/cyrillic_and_mic.so
./lib/postgresql/utf8_and_johab.so
./lib/postgresql/utf8_and_gb18030.so
./lib/postgresql/pgxs/src/makefiles/pgxs.mk
./lib/postgresql/pgxs/src/Makefile.shlib
./lib/postgresql/pgxs/src/Makefile.port
./lib/postgresql/pgxs/src/nls-global.mk
./lib/postgresql/pgxs/src/Makefile.global
./lib/postgresql/pgxs/config/install-sh
./lib/postgresql/euc_cn_and_mic.so
./lib/postgresql/latin_and_mic.so
./lib/postgresql/utf8_and_sjis2004.so
./lib/postgresql/utf8_and_euc_jp.so
./lib/postgresql/utf8_and_sjis.so
./lib/postgresql/utf8_and_cyrillic.so
./lib/postgresql/utf8_and_euc_kr.so
./lib/postgresql/ascii_and_mic.so
./lib/postgresql/utf8_and_iso8859_1.so
./lib/postgresql/euc_jp_and_sjis.so
./lib/postgresql/dict_snowball.so
./lib/postgresql/utf8_and_ascii.so
./lib/postgresql/utf8_and_euc_tw.so
./lib/postgresql/utf8_and_iso8859.so
./lib/postgresql/utf8_and_win.so
./lib/postgresql/utf8_and_euc_cn.so
./lib/postgresql/utf8_and_gbk.so
./lib/postgresql/utf8_and_euc2004.so
./lib/postgresql/utf8_and_big5.so
./lib/postgresql/java/pljava.jar
./lib/libpljava.so
./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/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./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/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./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
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R002C00
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1433,14 +918,10 @@ V500R002C00
./include/pg_config.h
./include/pg_config_manual.h
./include/pg_config_os.h
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h
./include/xlogdefs.h
./include/cm-libpq-fe.h
[version]
3.0.0

View File

@ -35,8 +35,10 @@
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/gs_dbmind
./bin/server.key.cipher
./bin/server.key.rand
./bin/gs_plan_simulator.sh
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
@ -749,6 +751,7 @@
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so
./lib/postgresql/pgoutput.so
./lib/libpljava.so
./lib/libpq.a
./lib/libpq.so
@ -822,9 +825,7 @@
./lib/libverto.so
./lib/libverto.so.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./lib/libcurl.so*
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
@ -837,9 +838,7 @@
./lib/liblz4.so
./lib/liblz4.so.1
./lib/liblz4.so.1.9.2
./lib/libcjson.so
./lib/libcjson.so.1
./lib/libcjson.so.1.7.13
./lib/libcjson.so*
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libpgport_tool.so
@ -847,25 +846,13 @@
./share/llvmir/GaussDB_expr.ir
./lib/libeSDKLogAPI.so
./lib/libeSDKOBS.so
./lib/liblog4cpp.so
./lib/liblog4cpp.so.5
./lib/liblog4cpp.so.5.0.6
./lib/libcharset.so
./lib/libcharset.so.1
./lib/libcharset.so.1.0.0
./lib/libiconv.so
./lib/libiconv.so.2
./lib/libiconv.so.2.6.1
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.20.0
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
./lib/liblog4cpp.so*
./lib/libcharset.so*
./lib/libiconv.so*
./lib/libnghttp2.so*
./lib/libpcre.so*
./lib/libsecurec.so
./lib/libxml2.so
./lib/libxml2.so.2
./lib/libxml2.so.2.9.9
./lib/libxml2.so*
./lib/libparquet.so
./lib/libparquet.so.14
./lib/libparquet.so.14.1.0
@ -878,7 +865,10 @@
./lib/libdcf.so
./lib/libzstd.so
./lib/libzstd.so.1
./lib/libzstd.so.1.4.4
./lib/libzstd.so.1.5.0
./lib/libxgboost.so
./lib/libpagecompression.so
./lib/libpagecompression.so.1
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
@ -973,6 +963,7 @@
./include/postgresql/server/utils/aset.h
./include/postgresql/server/utils/catcache.h
./include/postgresql/server/utils/atomic_arm.h
./include/postgresql/server/utils/oidrbtree.h
./include/postgresql/server/datatype/timestamp.h
./include/postgresql/server/access/rmgr.h
./include/postgresql/server/access/xlogreader.h
@ -984,6 +975,7 @@
./include/postgresql/server/access/attnum.h
./include/postgresql/server/access/tupmacs.h
./include/postgresql/server/access/xlogrecord.h
./include/postgresql/server/tde_key_management/data_common.h
./include/postgresql/server/tcop/dest.h
./include/postgresql/server/catalog/pg_type.h
./include/postgresql/server/catalog/pg_attribute.h
@ -1007,6 +999,7 @@
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/lwlocknames.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1168,6 +1161,25 @@
./include/postgresql/server/catalog/namespace.h
./include/postgresql/server/commands/trigger.h
./include/postgresql/server/executor/spi.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
./include/postgresql/server/access/ustore/knl_utuple.h
./include/postgresql/server/access/ustore/knl_utype.h
./include/postgresql/server/access/ustore/knl_upage.h
./include/postgresql/server/access/ustore/knl_uredo.h
./include/postgresql/server/access/ustore/knl_uundovec.h
./include/postgresql/server/access/ustore/knl_uundorecord.h
./include/postgresql/server/access/ustore/undo/knl_uundoxlog.h
./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/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
./jre/ASSEMBLY_EXCEPTION
./jre/bin/java
./jre/bin/jjs
@ -1422,8 +1434,6 @@
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R002C00
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1435,9 +1445,6 @@ V500R002C00
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h

View File

@ -12,33 +12,158 @@
# 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
CMAKE_PKG="N"
declare CMAKE_PKG="N"
declare SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)
declare ROOT_DIR=$(dirname "${SCRIPT_DIR}")
declare ROOT_DIR=$(dirname "${ROOT_DIR}")
declare package_type='server'
declare product_mode='opengauss'
declare version_mode='release'
declare binarylib_dir='None'
declare make_check='off'
declare separate_symbol='on'
#(0) pre-check
if [ ! -f opengauss.spec ] || [ ! -f package_internal.sh ]; then
echo "ERROR: there is no opengauss.spec/mpp_package.sh"
function print_help()
{
echo "Usage: $0 [OPTION]
-h|--help show help information.
-V|--version show version information.
-3rd|--binarylib_dir the directory of third party binarylibs.
-pkg|--package provode type of installation packages, values parameter is server.
-m|--version_mode this values of paramenter is debug, release, memcheck, the default value is release.
-pm product mode, values parameter is opengauss.
-mc|--make_check this values of paramenter is on or off, the default value is on.
-s|--symbol_mode whether separate symbol in debug mode, the default value is on.
-co|--cmake_opt more cmake options
"
}
function print_version()
{
echo $(cat ${SCRIPT_DIR}/gaussdb.ver | grep 'VERSION' | awk -F "=" '{print $2}')
}
if [ $# = 0 ] ; then
echo "missing option"
print_help
exit 1
fi
#(1) prepare
cp opengauss.spec gauss.spec
#########################################################################
##read command line paramenters
#######################################################################
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
print_help
exit 1
;;
-V|--version)
print_version
exit 1
;;
-3rd|--binarylib_dir)
if [ "$2"X = X ]; then
echo "no given binarylib directory values"
exit 1
fi
binarylib_dir=$2
shift 2
;;
-pkg)
if [ "$2"X = X ]; then
echo "no given package type name"
exit 1
fi
package_type=$2
shift 2
;;
-m|--version_mode)
if [ "$2"X = X ]; then
echo "no given version number values"
exit 1
fi
version_mode=$2
shift 2
;;
-pm)
if [ "$2"X = X ]; then
echo "no given product mode"
exit 1
fi
product_mode=$2
shift 2
;;
-mc|--make_check)
if [ "$2"X = X ]; then
echo "no given make check values"
exit 1
fi
make_check=$2
shift 2
;;
-s|--symbol_mode)
if [ "$2"X = X ]; then
echo "no given symbol parameter"
exit 1
fi
separate_symbol=$2
shift 2
;;
--cmake_opt)
if [ "$2"X = X ]; then
echo "no extra configure options provided"
exit 1
fi
extra_cmake_opt=$2
shift 2
;;
--config_opt)
if [ "$2"X = X ]; then
echo "no extra configure options provided"
exit 1
fi
extra_config_opt=$2
shift 2
;;
*)
echo "Internal Error: option processing error: $1" 1>&2
echo "please input right paramtenter, the following command may help you"
echo "${0} --help or ${0} -h"
exit 1
esac
done
#(2) invoke package_internal.sh
if [ "$CMAKE_PKG" == "N" ]; then
chmod a+x package_internal.sh
echo "package_internal.sh $@ -nopkg -pm opengauss"
./package_internal.sh $@ -nopkg -pm opengauss
if [ $? != "0" ]; then
echo "failed in build opengauss"
fi
if [ -e "$SCRIPT_DIR/utils/common.sh" ];then
source $SCRIPT_DIR/utils/common.sh
else
chmod a+x cmake_package_internal.sh
echo "cmake_package_internal.sh $@ -nopkg -pm opengauss"
./cmake_package_internal.sh $@ -nopkg -pm opengauss
if [ $? != "0" ]; then
echo "failed in build opengauss"
fi
exit 1
fi
#(3) remove files which are not necessary
BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
#(1) invoke package_internal.sh
if [ "$CMAKE_PKG" == "N" ]; then
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
source $SCRIPT_DIR/utils/make_compile.sh || exit 1
else
echo "begin config cmake options:" >> "$LOG_FILE" 2>&1
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
declare CMAKE_BUILD_DIR=${ROOT_DIR}/tmp_build
declare CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_MOT=ON ${extra_cmake_opt}"
echo "[cmake options] cmake options is:${CMAKE_OPT}" >> "$LOG_FILE" 2>&1
source $SCRIPT_DIR/utils/cmake_compile.sh || exit 1
fi
function main()
{
echo "[makegaussdb] $(date +%y-%m-%d' '%T): script dir : ${SCRIPT_DIR}"
echo "[makegaussdb] $(date +%y-%m-%d' '%T): Work root dir : ${ROOT_DIR}"
read_gaussdb_version
read_gaussdb_number
gaussdb_pkg_pre_clean
gaussdb_build
}
main
echo "now, all build has finished!"
exit 0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,814 @@
#!/bin/bash
#######################################################################
# Copyright (c): 2020-2021, Huawei Tech. Co., Ltd.
# descript: Compile and pack MPPDB
# Return 0 means OK.
# Return 1 means failed.
# version: 2.0
# date: 2021-12-12
#######################################################################
##default package type is server
declare package_type='server'
declare install_package_format='tar'
##default version mode is relase
declare version_mode='release'
declare binarylib_dir='None'
declare separate_symbol='on'
#detect platform information.
PLATFORM=32
bit=$(getconf LONG_BIT)
if [ "$bit" -eq 64 ]; then
PLATFORM=64
fi
#get OS distributed version.
kernel=""
version=""
ext_version=""
if [ -f "/etc/euleros-release" ]; then
kernel=$(cat /etc/euleros-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/euleros-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
ext_version=$version
elif [ -f "/etc/openEuler-release" ]; then
kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/openEuler-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
elif [ -f "/etc/centos-release" ]; then
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
else
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
version=$(lsb_release -r | awk -F ' ' '{print $2}')
fi
if [ X"$kernel" == X"euleros" ]; then
dist_version="EULER"
elif [ X"$kernel" == X"centos" ]; then
dist_version="CentOS"
elif [ X"$kernel" == X"openeuler" ]; then
dist_version="openEuler"
else
echo "Only support EulerOS|Centos|openEuler platform."
echo "Kernel is $kernel"
exit 1
fi
show_package=false
gcc_version="7.3.0"
##add platform architecture information
cpus_num=$(grep -w processor /proc/cpuinfo|wc -l)
PLATFORM_ARCH=$(uname -p)
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
ARCHITECTURE_EXTRA_FLAG=_euleros2.0_${ext_version}_$PLATFORM_ARCH
release_file_list="aarch64_lite_list"
else
ARCHITECTURE_EXTRA_FLAG=_euleros2.0_sp5_${PLATFORM_ARCH}
release_file_list="x86_64_lite_list"
fi
##default install version storage path
declare mppdb_version='openGauss Lite'
declare mppdb_name_for_package="$(echo ${mppdb_version} | sed 's/ /-/g')"
declare package_path='./'
declare version_number=''
declare make_check='off'
declare zip_package='on'
declare extra_config_opt=''
#######################################################################
##putout the version of mppdb
#######################################################################
function print_version()
{
echo "$version_number"
}
#######################################################################
## print help information
#######################################################################
function print_help()
{
echo "Usage: $0 [OPTION]
-h|--help show help information.
-V|--version show version information.
-f|--file provide the file list released.
-3rd|--binarylib_dir the directory of third party binarylibs.
-pkg|--package provode type of installation packages, values parameter is all, server, jdbc, odbc, agent.
-pm product mode, values parameter is single, multiple or opengauss, default value is multiple.
-p|--path generation package storage path.
-t packaging format, values parameter is tar or rpm, the default value is tar.
-m|--version_mode this values of paramenter is debug, release, memcheck, the default value is release.
-mc|--make_check this values of paramenter is on or off, the default value is on.
-s|--symbol_mode whether separate symbol in debug mode, the default value is on.
-cv|--gcc_version gcc-version option: 7.3.0.
-nopkg|--no_package don't zip binaries into packages
-co|--config_opt more config options
-S|--show_pkg show server package name and Bin name base on current configuration.
"
}
if [ $# = 0 ] ; then
echo "missing option"
print_help
exit 1
fi
SCRIPT_PATH=${0}
FIRST_CHAR=$(expr substr "$SCRIPT_PATH" 1 1)
if [ "$FIRST_CHAR" = "/" ]; then
SCRIPT_PATH=${0}
else
SCRIPT_PATH="$(pwd)/${SCRIPT_PATH}"
fi
SCRIPT_NAME=$(basename $SCRIPT_PATH)
SCRIPT_DIR=$(dirname "${SCRIPT_PATH}")
SCRIPT_DIR=$(dirname "$SCRIPT_DIR")
if [ ! -f "$SCRIPT_DIR/$SCRIPT_NAME" ] ; then
SCRIPT_DIR=$SCRIPT_DIR/script
fi
package_path=$SCRIPT_DIR
#######################################################################
##read version from $release_file_list
#######################################################################
function read_mpp_version()
{
cd $SCRIPT_DIR
local head=$(cat $release_file_list | grep "\[version\]" -n | awk -F: '{print $1}')
if [ ! -n "$head" ]; then
echo "error: no find version in the $release_file_list file "
exit 1
fi
local tail=$(cat $release_file_list | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
if [ ! -n "$tail" ]; then
local all=$(cat $release_file_list | wc -l)
let tail=$all+1-$head
fi
version_number=$(cat $release_file_list | awk "NR==$head+1,NR==$tail+$head-1")
echo "${mppdb_name_for_package}-${version_number}">version.cfg
#auto read the number from kernal globals.cpp, no need to change it here
}
#########################################################################
##read command line paramenters
#######################################################################
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
print_help
exit 1
;;
-V|--version)
print_version
exit 1
;;
-f|--file)
if [ "$2"X = X ]; then
echo "no given file name"
exit 1
fi
release_file_list=$2
shift 2
;;
-3rd|--binarylib_dir)
if [ "$2"X = X ]; then
echo "no given binarylib directory values"
exit 1
fi
binarylib_dir=$2
shift 2
;;
-p|--path)
if [ "$2"X = X ]; then
echo "no given generration package path"
exit 1
fi
package_path=$2
if [ ! -d "$package_path" ]; then
mkdir -p $package_path
fi
shift 2
;;
-pkg)
if [ "$2"X = X ]; then
echo "no given package type name"
exit 1
fi
package_type=$2
shift 2
;;
-s|--symbol_mode)
if [ "$2"X = X ]; then
echo "no given symbol parameter"
exit 1
fi
separate_symbol=$2
shift 2
;;
-t)
if [ "$2"X = X ]; then
echo "no given installation package format values"
exit 1
fi
if [ "$2" = rpm ]; then
echo "error: do not suport rpm package now!"
exit 1
fi
install_package_format=$2
shift 1
;;
-m|--version_mode)
if [ "$2"X = X ]; then
echo "no given version number values"
exit 1
fi
version_mode=$2
shift 2
;;
-mc|--make_check)
if [ "$2"X = X ]; then
echo "no given make check values"
exit 1
fi
make_check=$2
shift 2
;;
-cv|--gcc_version)
if [ "$2"X = X ]; then
echo "no given gcc version"
exit 1
fi
gcc_version=$2
shift 2
;;
-nopkg|--no_package)
zip_package='off'
shift 1
;;
-co|--config_opt)
if [ "$2"X = X ]; then
echo "no extra configure options provided"
exit 1
fi
extra_config_opt=$2
shift 2
;;
-S|--show_pkg)
show_package=true
shift
;;
*)
echo "Internal Error: option processing error: $1" 1>&2
echo "please input right paramtenter, the following command may help you"
echo "./cmake_package_internal.sh --help or ./cmake_package_internal.sh -h"
exit 1
esac
done
read_mpp_version
if [ "$gcc_version" = "7.3.0" ]; then
gcc_version=${gcc_version:0:3}
else
echo "Unknown gcc version $gcc_version"
exit 1
fi
#######################################################################
## declare all package name
#######################################################################
declare version_string="${mppdb_name_for_package}-${version_number}"
declare package_pre_name="${version_string}-${dist_version}-${PLATFORM_ARCH}"
declare server_package_name="${package_pre_name}.${install_package_format}.gz"
declare libpq_package_name="${package_pre_name}-Libpq.${install_package_format}.gz"
declare symbol_package_name="${package_pre_name}-symbol.${install_package_format}.gz"
echo "[makemppdb] $(date +%y-%m-%d' '%T): script dir : ${SCRIPT_DIR}"
ROOT_DIR=$(dirname "$SCRIPT_DIR")
ROOT_DIR=$(dirname "$ROOT_DIR")
PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh")
if [ "${PLAT_FORM_STR}"x == "Failed"x ]
then
echo "Only support EulerOS openEuler platform."
exit 1
fi
CMAKE_BUILD_DIR=${ROOT_DIR}/tmp_build
declare LOG_FILE="${ROOT_DIR}/build/script/makemppdb_pkg.log"
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
declare ERR_MKGS_FAILED=1
declare MKGS_OK=0
if [ "${binarylib_dir}" != 'None' ] && [ -d "${binarylib_dir}" ]; then
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/${PLAT_FORM_STR}"
PLATFORM_PATH="${binarylib_dir}/platform/${PLAT_FORM_STR}"
BINARYLIBS_PATH="${binarylib_dir}/dependency"
else
BUILD_TOOLS_PATH="${ROOT_DIR}/buildtools/${PLAT_FORM_STR}"
PLATFORM_PATH="${ROOT_DIR}/platform/${PLAT_FORM_STR}"
BINARYLIBS_PATH="${ROOT_DIR}/binarylibs"
fi
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
export CC="$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/gcc"
export CXX="$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/g++"
export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_PATH/gcc$gcc_version/isl/lib:$BUILD_TOOLS_PATH/gcc$gcc_version/mpc/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/mpfr/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/gmp/lib/:$LD_LIBRARY_PATH
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
jdkpath=${binarylib_dir}/platform/huaweijdk8/${PLATFORM_ARCH}/jdk
if [ ! -d "${jdkpath}" ]; then
jdkpath=${binarylib_dir}/platform/openjdk8/${PLATFORM_ARCH}/jdk
fi
export JAVA_HOME=${jdkpath}
declare p7zpath="${BUILD_TOOLS_PATH}/p7z/bin"
###################################
# build parameter about enable-llt
##################################
echo "[makemppdb] $(date +%y-%m-%d' '%T): Work root dir : ${ROOT_DIR}"
###################################
# get version number from globals.cpp
##################################
function read_mpp_number()
{
global_kernal="${ROOT_DIR}/src/common/backend/utils/init/globals.cpp"
version_name="GRAND_VERSION_NUM"
version_num=""
line=$(cat $global_kernal | grep ^const* | grep $version_name)
version_num1=${line#*=}
#remove the symbol;
version_num=$(echo $version_num1 | tr -d ";")
#remove the blank
version_num=$(echo $version_num)
if echo $version_num | grep -qE '^92[0-9]+$'
then
# get the last three number
latter=${version_num:2}
echo "92.${latter}" >>${SCRIPT_DIR}/version.cfg
else
echo "Cannot get the version number from globals.cpp."
exit 1
fi
}
read_mpp_number
#######################################################################
# Print log.
#######################################################################
log()
{
echo "[makegaussdb] $(date +%y-%m-%d' '%T): $@"
echo "[makegaussdb] $(date +%y-%m-%d' '%T): $@" >> "$LOG_FILE" 2>&1
}
#######################################################################
# print log and exit.
#######################################################################
die()
{
log "$@"
echo "$@"
exit $ERR_MKGS_FAILED
}
#######################################################################
## Check the installation package production environment
#######################################################################
function mpp_pkg_pre_check()
{
if [ -d "$BUILD_DIR" ]; then
rm -rf $BUILD_DIR
fi
if [ -d "$LOG_FILE" ]; then
rm -rf $LOG_FILE
fi
}
#######################################################################
# Install all SQL files from distribute/include/catalog/upgrade_sql
# to INSTALL_DIR/bin/script/upgrade_sql.
# Package all SQL files and then verify them with SHA256.
#######################################################################
function package_upgrade_sql()
{
echo "Begin to install upgrade_sql files..."
UPGRADE_SQL_TAR="upgrade_sql.tar.gz"
UPGRADE_SQL_SHA256="upgrade_sql.sha256"
MULTIP_IGNORE_VERSION=(289 294 296)
cp -r "${UPGRADE_SQL_DIR}" .
[ $? -ne 0 ] && die "Failed to cp upgrade_sql files"
tar -czf ${UPGRADE_SQL_TAR} upgrade_sql
[ $? -ne 0 ] && die "Failed to package ${UPGRADE_SQL_TAR}"
rm -rf ./upgrade_sql > /dev/null 2>&1
sha256sum ${UPGRADE_SQL_TAR} | awk -F" " '{print $1}' > "${UPGRADE_SQL_SHA256}"
[ $? -ne 0 ] && die "Failed to generate sha256 sum file for ${UPGRADE_SQL_TAR}"
chmod 600 ${UPGRADE_SQL_TAR}
chmod 600 ${UPGRADE_SQL_SHA256}
echo "Successfully packaged upgrade_sql files."
}
#######################################################################
##install gaussdb database and others
##select to install something according to variables package_type need
#######################################################################
function mpp_pkg_bld()
{
install_gaussdb
}
#######################################################################
##install gaussdb database contained server,client and libpq
#######################################################################
function install_gaussdb()
{
# Generate the license control file, and set md5sum string to the code.
echo "Modify gaussdb_version.cpp file." >> "$LOG_FILE" 2>&1
echo "Modify gaussdb_version.cpp file success." >> "$LOG_FILE" 2>&1
cd "$ROOT_DIR/"
if [ $? -ne 0 ]; then
die "change dir to $SRC_DIR failed."
fi
if [ "$version_mode" = "debug" -a "$separate_symbol" = "on" ]; then
echo "WARNING: do not separate symbol in debug mode!"
fi
binarylibs_path=${ROOT_DIR}/binarylibs
if [ "${binarylib_dir}"x != "None"x ]; then
binarylibs_path=${binarylib_dir}
fi
export BUILD_TUPLE=${PLATFORM_ARCH}
export THIRD_BIN_PATH="${binarylibs_path}"
export PREFIX_HOME="${BUILD_DIR}"
if [ "$version_mode"x == "release"x ]; then
CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_PRIVATEGAUSS=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_LITE_MODE=ON"
export DEBUG_TYPE=release
elif [ "$version_mode"x == "memcheck"x ]; then
CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_PRIVATEGAUSS=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_LITE_MODE=ON"
export DEBUG_TYPE=memcheck
else
CMAKE_OPT="-DENABLE_MULTIPLE_NODES=OFF -DENABLE_PRIVATEGAUSS=OFF -DENABLE_THREAD_SAFETY=ON -DENABLE_LITE_MODE=ON"
export DEBUG_TYPE=debug
fi
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
export GAUSSHOME=${BUILD_DIR}
export LD_LIBRARY_PATH=${BUILD_DIR}/lib:${BUILD_DIR}/lib/postgresql:${LD_LIBRARY_PATH}
cd ${ROOT_DIR}
[ -d "${CMAKE_BUILD_DIR}" ] && rm -rf ${CMAKE_BUILD_DIR}
[ -d "${BUILD_DIR}" ] && rm -rf ${BUILD_DIR}
mkdir -p ${CMAKE_BUILD_DIR}
cd ${CMAKE_BUILD_DIR}
cmake .. ${CMAKE_OPT}
echo "Begin make and install gaussdb server" >> "$LOG_FILE" 2>&1
make VERBOSE=1 -sj ${cpus_num}
if [ $? -ne 0 ]; then
die "make failed."
fi
make install -sj ${cpus_num}
if [ $? -ne 0 ]; then
die "make install failed."
fi
## check build specification
spec="gaussdbkernel"
if ( cat $SCRIPT_DIR/gauss.spec | grep 'PRODUCT' | grep 'GaussDB Kernel' >/dev/null 2>&1 ); then
spec="gaussdbkernel"
elif ( cat $SCRIPT_DIR/gauss.spec | grep 'PRODUCT' | grep 'openGauss' >/dev/null 2>&1 ); then
spec="opengauss"
fi
chmod 444 ${BUILD_DIR}/bin/cluster_guc.conf
dos2unix ${BUILD_DIR}/bin/cluster_guc.conf > /dev/null 2>&1
#back to separate_debug_symbol.sh dir
cd $SCRIPT_DIR
if [ "$version_mode" = "release" -a "$separate_symbol" = "on" -a "$zip_package" = "on" ]; then
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
mv symbols.tar.gz $symbol_package_name
fi
#back to root dir
cd $ROOT_DIR
#insert the commitid to version.cfg as the upgrade app path specification
export PATH=${BUILD_DIR}:$PATH
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | cut -d ")" -f 1 | awk '{print $NF}')
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/bin/iperf3 ${BUILD_DIR}/bin
if [ $? -ne 0 ]; then
die "cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/bin/iperf3 ${BUILD_DIR}/bin failed"
fi
cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/lib/libiperf.so.0 ${BUILD_DIR}/lib
if [ $? -ne 0 ]; then
die "cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/iperf/comm/lib/libiperf.so.0 ${BUILD_DIR}/lib failed"
fi
cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/fio/comm/bin/fio ${BUILD_DIR}/bin
if [ $? -ne 0 ]; then
die "cp ${BINARYLIBS_PATH}/${PLAT_FORM_STR}/fio/comm/bin/fio ${BUILD_DIR}/bin failed"
fi
}
#######################################################################
##select package type according to variable package_type
#######################################################################
function mpp_pkg_make()
{
case "$package_type" in
server)
echo "file list: $release_file_list"
make_package $release_file_list 'server'
make_package $release_file_list 'libpq'
;;
libpq)
make_package $release_file_list 'libpq'
;;
esac
}
declare package_command
#######################################################################
##select package command accroding to install_package_format
#######################################################################
function select_package_command()
{
case "$install_package_format" in
tar)
tar='tar'
option=' -zcvf'
package_command="$tar$option"
;;
rpm)
rpm='rpm'
option=' -i'
package_command="$rpm$option"
;;
esac
}
###############################################################
## client tools package
## Roach no
## sslcert no
## Data Studio no
## Database Manager no
## Migration Toolkit no
## Cluster Configuration Assistant (CCA) no
## CAT no
###############################################################
function target_file_copy_for_non_server()
{
for file in $(echo $1)
do
tar -cpf - $file | ( cd $2; tar -xpf - )
done
}
declare bin_name="${package_pre_name}.bin"
declare sha256_name=''
declare script_dir="${ROOT_DIR}/script"
#######################################################################
##copy target file into temporary directory temp
#######################################################################
function target_file_copy()
{
###################################################
# make bin package
###################################################
for file in $(echo $1)
do
tar -cpf - $file | ( cd $2; tar -xpf - )
done
cd $BUILD_DIR
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
# do nothing in current version
echo ""
else
sed -i '/^process_cpu_affinity|/d' $2/bin/cluster_guc.conf
fi
if [ "$(ls -A /lib64/libaio.so*)" != "" ]
then
cp /lib64/libaio.so* $2/lib/
elif [ "$(ls -A /lib/libaio.so*)" != "" ]
then
cp /lib/libaio.so* $2/lib/
fi
if [ "$(ls -A /lib64/libnuma.so*)" != "" ]
then
cp /lib64/libnuma.so* $2/lib/
elif [ "$(ls -A /lib/libnuma.so*)" != "" ]
then
cp /lib/libnuma.so* $2/lib/
fi
#generate bin file
echo "Begin generate ${bin_name} bin file..." >> "$LOG_FILE" 2>&1
curpath=$(pwd)
cd $2
tar -zcf ${curpath}/${bin_name} . >> "$LOG_FILE" 2>&1
cd ${curpath}
if [ $? -ne 0 ]; then
echo "Please check and makesure '7z' exist. "
die "generate ${bin_name} failed."
fi
echo "End generate ${bin_name} bin file" >> "$LOG_FILE" 2>&1
#generate sha256 file
sha256_name="${package_pre_name}.sha256"
echo "Begin generate ${sha256_name} sha256 file..." >> "$LOG_FILE" 2>&1
sha256sum "${bin_name}" | awk -F" " '{print $1}' > "$sha256_name"
if [ $? -ne 0 ]; then
die "generate sha256 file failed."
fi
echo "End generate ${sha256_name} sha256 file" >> "$LOG_FILE" 2>&1
cp $2/lib/libstdc++.so.6 ./
###################################################
# make server package
###################################################
if [ -d "${2}" ]; then
rm -rf ${2}
fi
mkdir -p ${2}
mkdir -p $2/dependency
cp libstdc++.so.6 $2/dependency
mv ${bin_name} ${sha256_name} $2
}
#######################################################################
##function make_package have three actions
##1.parse release_file_list variable represent file
##2.copy target file into a newly created temporary directory temp
##3.package all file in the temp directory and renome to destination package_path
#######################################################################
function make_package()
{
cd $SCRIPT_DIR
releasefile=$1
pkgname=$2
local head=$(cat $releasefile | grep "\[$pkgname\]" -n | awk -F: '{print $1}')
if [ ! -n "$head" ]; then
die "error: ono find $pkgname in the $releasefile file "
fi
local tail=$(cat $releasefile | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
if [ ! -n "$tail" ]; then
local all=$(cat $releasefile | wc -l)
let tail=$all+1-$head
fi
dest=$(cat $releasefile | awk "NR==$head+1,NR==$tail+$head-1")
if [ "$pkgname"x = "libpq"x -a \( "$version_mode" = "debug" -o "$version_mode" = "release" \) ]; then
# copy include file
head=$(cat $releasefile | grep "\[header\]" -n | awk -F: '{print $1}')
if [ ! -n "$head" ]; then
die "error: ono find header in the $releasefile file "
fi
tail=$(cat $releasefile | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
if [ ! -n "$tail" ]; then
all=$(cat $releasefile | wc -l)
let tail=$all+1-$head
fi
dest1=$(cat $releasefile | awk "NR==$head+1,NR==$tail+$head-1")
dest=$(echo "$dest";echo "$dest1")
fi
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
rm -rf temp
mkdir temp
case "$pkgname" in
server)
mkdir -p ${BUILD_DIR}/temp/etc
target_file_copy "$dest" ${BUILD_DIR}/temp
;;
*)
target_file_copy_for_non_server "$dest" ${BUILD_DIR}/temp $pkgname
;;
esac
cd ${BUILD_DIR}/temp
select_package_command
case "$pkgname" in
server)
echo "packaging server..."
cp ${SCRIPT_DIR}/version.cfg ${BUILD_DIR}/temp
if [ $? -ne 0 ]; then
die "copy ${SCRIPT_DIR}/version.cfg to ${BUILD_DIR}/temp failed"
fi
cp ${ROOT_DIR}/${open_gauss}/liteom/install.sh ./
if [ $? -ne 0 ]
then
die "copy ${ROOT_DIR}/${open_gauss}/liteom/install.sh to ${BUILD_DIR}/temp failed"
fi
cp ${ROOT_DIR}/${open_gauss}/liteom/uninstall.sh ./
if [ $? -ne 0 ]
then
die "copy ${ROOT_DIR}/${open_gauss}/liteom/uninstall.sh to ${BUILD_DIR}/temp failed"
fi
cp ${ROOT_DIR}/${open_gauss}/liteom/opengauss_lite.conf ./
if [ $? -ne 0 ]
then
die "copy ${ROOT_DIR}/${open_gauss}/liteom/opengauss_lite.conf to ${BUILD_DIR}/temp failed"
fi
# pkg upgrade scripts:upgrade_GAUSSV5.sh, upgrade_common.sh, upgrade_config.sh, upgrade_errorcode.sh
for filename in upgrade_GAUSSV5.sh upgrade_common.sh upgrade_config.sh upgrade_errorcode.sh
do
if ! cp ${ROOT_DIR}/${open_gauss}/liteom/${filename} ./ ; then
die "copy ${ROOT_DIR}/${open_gauss}/liteom/${filename} to ${BUILD_DIR}/temp failed"
fi
done
# install upgrade_sql.* files.
package_upgrade_sql
$package_command "${server_package_name}" ./* >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${server_package_name} failed"
fi
mv ${server_package_name} ${package_path}
echo "install $pkgname tools is ${server_package_name} of ${package_path} directory " >> "$LOG_FILE" 2>&1
echo "success!"
;;
libpq)
echo "packaging libpq..."
$package_command "${libpq_package_name}" ./* >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${libpq_package_name} failed"
fi
mv ${libpq_package_name} ${package_path}
echo "install $pkgname tools is ${libpq_package_name} of ${package_path} directory " >> "$LOG_FILE" 2>&1
echo "success!"
;;
esac
}
#############################################################
# show package for hotpatch sdv.
#############################################################
if [ "$show_package" = true ]; then
echo "package: "$server_package_name
echo "bin: "$bin_name
exit 0
fi
#############################################################
# main function
#############################################################
# 1. clean install path and log file
mpp_pkg_pre_check
# 2. chose action
mpp_pkg_bld
if [ "$zip_package" = "off" ]; then
echo "The option 'nopkg' is on, no package will be zipped."
exit 0
fi
# 3. make package
mpp_pkg_make
#clean mpp_install directory
echo "clean enviroment"
echo "[makemppdb] $(date +%y-%m-%d' '%T): remove ${BUILD_DIR}" >>"$LOG_FILE" 2>&1
mkdir ${ROOT_DIR}/output
mv ${ROOT_DIR}/build/script/*.tar.gz ${ROOT_DIR}/output/
echo "now, all packages has finished!"
exit 0

View File

@ -1,2 +0,0 @@
PRODUCT=GaussDB Kernel
VERSION=V500R002C00

View File

@ -1,2 +1,2 @@
PRODUCT=openGauss
VERSION=2.1.0
VERSION=3.0.0

View File

@ -1,80 +0,0 @@
#!/bin/bash
#-----------------------------------------------------
#Copyright (c): 2020, Huawei Tech. Co., Ltd.
#FileName : gsql_env.sh
#Version : V500R001C10
#Date : 2020-08-06
#Description : This file is to configure environment variables of gsql
#-----------------------------------------------------
#find the absolute path of this script
LOCAL_PATH=${0}
if [ x${LOCAL_PATH:0:1} = "x-" ] || [ "x${LOCAL_PATH}" = "x/bin/bash" ] || [ "x${LOCAL_PATH}" = "x/bin/sh" ]; then
LOCAL_PATH="$(pwd)"
elif [ x${LOCAL_PATH:0:1} != "x/" ]; then
LOCAL_PATH="$(pwd)/$(dirname ${LOCAL_PATH})";
fi
function logerr()
{
printf "ERROR: $* \n" >&2
}
function loghint()
{
printf "HINT: $* \n" >&2
}
function logwarning()
{
printf "WARNING: $* \n" >&2
}
function doing()
{
length_of_line=60
printf "$1 ";
for ((i=${#1};i<$length_of_line;i++)); do
printf '.';
done;
printf " "
}
#------------------------------
# gsql things
#------------------------------
function cofig_gsql_and_gs_ktool()
{
doing 'Configuring LD_LIBRARY_PATH, PATH and GS_KTOOL_FILE_PATH for gsql and gs_ktool...'
LIB_PATH="${LOCAL_PATH}/lib"
BIN_PATH="${LOCAL_PATH}/bin"
GS_KT_FILE_PATH="${LOCAL_PATH}/gs_ktool_file"
if [ ! -f "${LOCAL_PATH}/bin/gsql" ]; then
logerr "failed to locate ./bin/gsql, please source this file at the path where it is. "
return 1;
fi;
if [ ! -f "${LOCAL_PATH}/bin/gs_ktool" ]; then
logerr "failed to locate ./bin/gs_ktool, please source this file at the path where it is. "
return 1;
fi;
if [ ! -f "${LOCAL_PATH}/gs_ktool_file/gs_ktool_conf.ini" ]; then
logerr "failed to locate ./gs_ktool_file/gs_ktool_con.ini, please source this file at the path where it is. "
return 1;
fi;
export LD_LIBRARY_PATH=${LIB_PATH}:${LD_LIBRARY_PATH}
export PATH=${BIN_PATH}:${PATH}
export GS_KTOOL_FILE_PATH=${GS_KT_FILE_PATH}
echo 'done'
return 0
}
if [ ! -z "$1" ]; then
echo "Usage:"
echo " source $0"
else
cofig_gsql_and_gs_ktool
if [ 0 -eq $? ]; then
echo 'All things done.'
fi
fi

View File

@ -1,5 +0,0 @@
V=100
R=003
C=00
OfficialVersion=
InternalVersion=B100

File diff suppressed because it is too large Load Diff

View File

@ -865,6 +865,8 @@
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.20.0
./lib/libpagecompression.so
./lib/libpagecompression.so.1
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,7 @@
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./bin/gs_plan_simulator.sh
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
@ -863,6 +864,8 @@
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.20.0
./lib/libpagecompression.so
./lib/libpagecompression.so.1
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
@ -1029,6 +1032,25 @@
./include/postgresql/server/pgxc/locator.h
./include/postgresql/server/gstrace/gstrace_infra.h
./include/postgresql/server/extension_dependency.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
./include/postgresql/server/access/ustore/knl_utuple.h
./include/postgresql/server/access/ustore/knl_utype.h
./include/postgresql/server/access/ustore/knl_upage.h
./include/postgresql/server/access/ustore/knl_uredo.h
./include/postgresql/server/access/ustore/knl_uundovec.h
./include/postgresql/server/access/ustore/knl_uundorecord.h
./include/postgresql/server/access/ustore/undo/knl_uundoxlog.h
./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/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
./jre/ASSEMBLY_EXCEPTION
./jre/bin/java
./jre/bin/jjs

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#!/bin/bash
#############################################################################
#######################################################################
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
@ -14,65 +14,47 @@
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# ----------------------------------------------------------------------------
# Description : gs_backup is a utility to back up or restore binary files and parameter files.
#############################################################################
# descript: Compile and pack GaussDB
# Return 0 means OK.
# Return 1 means failed.
# version: 2.0
# date: 2021-02-28
#######################################################################
declare SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)
declare ROOT_DIR=$(dirname "${SCRIPT_DIR}")
declare ROOT_DIR=$(dirname "${ROOT_DIR}")
declare package_type='server'
declare product_mode='opengauss'
declare version_mode='release'
declare binarylib_dir='None'
declare config_file=''
declare om_dir='None'
declare cm_dir='None'
declare show_package='false'
declare install_package_format='tar'
#detect platform information.
PLATFORM=32
bit=$(getconf LONG_BIT)
if [ "$bit" -eq 64 ]; then
PLATFORM=64
fi
#get OS distributed version.
kernel=""
version=""
if [ -f "/etc/openEuler-release" ]
then
kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/openEuler-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
elif [ -f "/etc/centos-release" ]
then
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
elif [ -f "/etc/euleros-release" ]
then
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
else
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
version=$(lsb_release -r | awk -F ' ' '{print $2}')
fi
## to solve kernel="name=openeuler"
if echo $kernel | grep -q 'openeuler'
then
kernel="openeuler"
fi
function print_help()
{
echo "Usage: $0 [OPTION]
-h|--help show help information.
-3rd|--binarylib_dir the directory of third party binarylibs.
-pkg|--package provode type of installation packages, values parameter is server.
-m|--version_mode this values of paramenter is debug, release, memcheck, the default value is release.
-pm|--product_mode this values of paramenter is opengauss or lite, the default value is opengauss.
"
}
if [ X"$kernel" == X"centos" ]; then
dist_version="CentOS"
elif [ X"$kernel" == X"openeuler" ]; then
dist_version="openEuler"
elif [ X"$kernel" == X"euleros" ]; then
dist_version="EulerOS"
elif [ X"$kernel" == X"kylin" ]; then
dist_version="Kylin"
elif [ X"$kernel" = X"ubuntu" ]; then
dist_version="Ubuntu"
else
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) and Ubuntu(x86) platform."
echo "Kernel is $kernel"
if [ $# = 0 ] ; then
echo "missing option"
print_help
exit 1
fi
declare release_file_list="opengauss_release_list_${kernel}_single"
declare dest_list=""
#########################################################################
##read command line paramenters
#######################################################################
@ -82,9 +64,29 @@ while [ $# -gt 0 ]; do
print_help
exit 1
;;
-v|--version)
print_version
exit 1
-3rd|--binarylib_dir)
if [ "$2"X = X ]; then
echo "no given binarylib directory values"
exit 1
fi
binarylib_dir=$2
shift 2
;;
-pkg)
if [ "$2"X = X ]; then
echo "no given package type name"
exit 1
fi
package_type=$2
shift 2
;;
-pm)
if [ "$2"X = X ]; then
echo "no given product mode"
exit 1
fi
product_mode=$2
shift 2
;;
-m|--version_mode)
if [ "$2"X = X ]; then
@ -94,22 +96,9 @@ while [ $# -gt 0 ]; do
version_mode=$2
shift 2
;;
-3rd|--binarylibs_dir)
if [ "$2"X = X ]; then
echo "no given binarylib directory values"
exit 1
fi
binarylib_dir=$2
shift 2
;;
-f|--config_file)
if [ "$2"X = X ]; then
echo "no given config file"
shift 1
else
config_file=$2
shift 2
fi
-S|--show_pkg)
show_package=true
shift
;;
*)
echo "Internal Error: option processing error: $1" 1>&2
@ -119,436 +108,37 @@ while [ $# -gt 0 ]; do
esac
done
##add platform architecture information
PLATFORM_ARCH=$(uname -p)
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] ; then
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64) platform."
exit 1
fi
release_file_list="opengauss_release_list_${kernel}_aarch64_single"
fi
if [ "$version_mode" = "mini" ]; then
release_file_list="opengauss_release_list_mini"
fi
##default install version storage path
declare server_version='openGauss'
declare server_name_for_package="$(echo ${server_version} | sed 's/ /-/g')" # replace blank with '-' for package name.
declare version_number=''
#######################################################################
##putout the version of server
#######################################################################
function print_version()
{
echo "$version_number"
}
#######################################################################
## print help information
#######################################################################
function print_help()
{
echo "Usage: $0 [OPTION]
-h|--help show help information
-V|--version show version information
-m|--version_mode this values of paramenter is debug, release or memcheck, the default value is release
-3rd|--binarylibs_dir the parent directory of binarylibs
"
}
#######################################################################
##version 2.0.0
#######################################################################
function read_srv_version()
{
cd $SCRIPT_DIR
version_number=$(grep 'VERSION' opengauss.spec | awk -F "=" '{print $2}')
echo "${server_name_for_package}-${version_number}">version.cfg
}
###################################
# get version number from globals.cpp
##################################
function read_srv_number()
{
global_kernal="${ROOT_DIR}/src/common/backend/utils/init/globals.cpp"
version_name="GRAND_VERSION_NUM"
version_num=""
line=$(cat $global_kernal | grep ^const* | grep $version_name)
version_num1=${line#*=}
#remove the symbol;
version_num=$(echo $version_num1 | tr -d ";")
#remove the blank
version_num=$(echo $version_num)
if echo $version_num | grep -qE '^92[0-9]+$'
then
# get the last three number
latter=${version_num:2}
echo "92.${latter}" >>${SCRIPT_DIR}/version.cfg
else
echo "Cannot get the version number from globals.cpp."
exit 1
fi
}
SCRIPT_DIR=$(cd $(dirname $0) && pwd)
test -d ${SCRIPT_DIR}/../../output || mkdir -p ${SCRIPT_DIR}/../../output && rm -fr ${SCRIPT_DIR}/../../output/*
output_path=$(cd ${SCRIPT_DIR}/../../output && pwd)
read_srv_version
#######################################################################
## declare all package name
#######################################################################
declare version_string="${server_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 kernel_symbol_package_name="${package_pre_name}-symbol.tar.gz"
declare sha256_name="${package_pre_name}.sha256"
echo "[make single db] $(date +%y-%m-%d' '%T): script dir : ${SCRIPT_DIR}"
ROOT_DIR=$(dirname "$SCRIPT_DIR")
ROOT_DIR=$(dirname "$ROOT_DIR")
PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh")
if [ "${PLAT_FORM_STR}"x == "Failed"x ]
then
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) platform."
exit 1;
fi
PG_REG_TEST_ROOT="${ROOT_DIR}/"
PMK_SCHEMA="${ROOT_DIR}/script/pmk_schema.sql"
declare LOG_FILE="${SCRIPT_DIR}/make_package.log"
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
BUILD_TOOLS_PATH="${ROOT_DIR}/binarylibs/buildtools/${PLAT_FORM_STR}"
BINARYLIBS_PATH="${ROOT_DIR}/binarylibs/dependency/${PLAT_FORM_STR}"
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
if [ "${binarylib_dir}"x != "None"x ]
then
echo "binarylib dir : ${binarylib_dir}"
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/${PLAT_FORM_STR}"
BINARYLIBS_PATH="${binarylib_dir}/dependency/${PLAT_FORM_STR}"
fi
gcc_version="7.3"
export CC=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/gcc
export CXX=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/g++
export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_PATH/gcc$gcc_version/isl/lib:$BUILD_TOOLS_PATH/gcc$gcc_version/mpc/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/mpfr/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/gmp/lib/:$LD_LIBRARY_PATH
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
read_srv_number
#######################################################################
# move pkgs to output directory
#######################################################################
function deploy_pkgs()
{
for pkg in $@; do
if [ -f $pkg ]; then
mv $pkg $output_path/
fi
done
}
#######################################################################
# Print log.
#######################################################################
log()
{
echo "[make single db] $(date +%y-%m-%d' '%T): $@"
echo "[make single db] $(date +%y-%m-%d' '%T): $@" >> "$LOG_FILE" 2>&1
}
#######################################################################
# print log and exit.
#######################################################################
die()
{
log "$@"
echo "$@"
if [ -e "$SCRIPT_DIR/utils/common.sh" ];then
source $SCRIPT_DIR/utils/common.sh
else
exit 1
}
#######################################################################
##install gaussdb database contained server
#######################################################################
function install_gaussdb()
{
cd $SCRIPT_DIR
if [ "$version_mode" = "release" ] || [ "$version_mode" = "mini" ]; then
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
mv symbols.tar.gz $kernel_symbol_package_name
deploy_pkgs $kernel_symbol_package_name
fi
#insert the commitid to version.cfg as the upgrade app path specification
export PATH=${BUILD_DIR}:$PATH
export LD_LIBRARY_PATH=${BUILD_DIR}/lib:$LD_LIBRARY_PATH
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | awk '{print $6}' | cut -d ")" -f 1)
if [ -z "$commitid" ]
then
commitid=$(date "+%Y%m%d%H%M%S")
commitid=${commitid:4:8}
fi
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
# copy directory's files list to $2
#######################################################################
function copy_files_list()
{
for file in $(echo $1)
do
test -e $file && tar -cpf - $file | ( cd $2; tar -xpf - )
done
}
#######################################################################
# set postgresql.conf.sample from config_file when packing
#######################################################################
function set_config_sample()
{
if [[ -f $config_file ]]
then
config_sample_file=${BUILD_DIR}/share/postgresql/postgresql.conf.sample
if [[ ! -f "$config_sample_file" ]]
then
echo "postgresql.conf.sample does not exist"
exit 1
else
echo "#------------------------------------------------------------------------------" >> $config_sample_file
echo "# USER SET CONFIG ON COMPILING TIME" >> $config_sample_file
echo "#------------------------------------------------------------------------------" >> $config_sample_file
while IFS= read -r line; do
SUBSTRING=$(echo $line | cut -d'=' -f 1)"= "
if grep -q "$SUBSTRING" $config_sample_file ; then
sed -i "/$SUBSTRING/c$line" $config_sample_file
else
echo $line >> $config_sample_file
fi
done < $config_file
fi
fi
}
#######################################################################
##copy target file into temporary directory temp
#######################################################################
function target_file_copy()
{
cd ${BUILD_DIR}
set_config_sample
copy_files_list "$1" $2
cp ${SCRIPT_DIR}/version.cfg ${BUILD_DIR}/temp
cp -rf ${SCRIPT_DIR}/../../simpleInstall ${BUILD_DIR}/temp
if [ $? -ne 0 ]; then
die "copy ${SCRIPT_DIR}/version.cfg to ${BUILD_DIR}/temp failed"
fi
sed -i '/^process_cpu_affinity|/d' $2/bin/cluster_guc.conf
#generate tar file
echo "Begin generate ${kernel_package_name} tar file..." >> "$LOG_FILE" 2>&1
cd $2
tar -jcvpf "${kernel_package_name}" ./* >> "$LOG_FILE" 2>&1
cd '-'
mv $2/"${kernel_package_name}" ./
if [ $? -ne 0 ]; then
die "generate ${kernel_package_name} failed."
fi
echo "End generate ${kernel_package_name} tar file" >> "$LOG_FILE" 2>&1
#generate sha256 file
sha256_name="${package_pre_name}.sha256"
echo "Begin generate ${sha256_name} sha256 file..." >> "$LOG_FILE" 2>&1
sha256sum "${kernel_package_name}" | awk -F" " '{print $1}' > "$sha256_name"
if [ $? -ne 0 ]; then
die "generate sha256 file failed."
fi
echo "End generate ${sha256_name} sha256 file" >> "$LOG_FILE" 2>&1
###################################################
# make server package
###################################################
if [ -d "${2}" ]; then
rm -rf ${2}
fi
}
function target_file_copy_for_non_server()
{
cd ${BUILD_DIR}
copy_files_list "$1" $2
}
#######################################################################
##function make_package_prep have two actions
##1.parse release_file_list variable represent file
##2.copy target file into a newly created temporary directory temp
#######################################################################
function prep_dest_list()
{
cd $SCRIPT_DIR
releasefile=$1
pkgname=$2
local head=$(cat $releasefile | grep "\[$pkgname\]" -n | awk -F: '{print $1}')
if [ ! -n "$head" ]; then
die "error: ono find $pkgname in the $releasefile file "
fi
local tail=$(cat $releasefile | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
if [ ! -n "$tail" ]; then
local all=$(cat $releasefile | wc -l)
let tail=$all+1-$head
fi
dest_list=$(cat $releasefile | awk "NR==$head+1,NR==$tail+$head-1")
}
function make_package_srv()
{
echo "Begin package server"
cd $SCRIPT_DIR
prep_dest_list $release_file_list 'server'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp/etc
target_file_copy "$dest_list" ${BUILD_DIR}/temp
deploy_pkgs ${sha256_name} ${kernel_package_name}
echo "make server(all) package success!"
}
#######################################################################
# Install all SQL files from src/distribute/include/catalog/upgrade_sql
# to INSTALL_DIR/bin/script/upgrade_sql.
# Package all SQL files and then verify them with SHA256.
#######################################################################
function make_package_upgrade_sql()
{
echo "Begin to install upgrade_sql files..."
UPGRADE_SQL_TAR="upgrade_sql.tar.gz"
UPGRADE_SQL_SHA256="upgrade_sql.sha256"
cd $SCRIPT_DIR
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
rm -rf temp
mkdir temp
cd ${BUILD_DIR}/temp
cp -r "${UPGRADE_SQL_DIR}" ./upgrade_sql
[ $? -ne 0 ] && die "Failed to cp upgrade_sql files"
tar -czf ${UPGRADE_SQL_TAR} upgrade_sql
[ $? -ne 0 ] && die "Failed to package ${UPGRADE_SQL_TAR}"
rm -rf ./upgrade_sql > /dev/null 2>&1
sha256sum ${UPGRADE_SQL_TAR} | awk -F" " '{print $1}' > "${UPGRADE_SQL_SHA256}"
[ $? -ne 0 ] && die "Failed to generate sha256 sum file for ${UPGRADE_SQL_TAR}"
chmod 600 ${UPGRADE_SQL_TAR}
chmod 600 ${UPGRADE_SQL_SHA256}
deploy_pkgs ${UPGRADE_SQL_TAR} ${UPGRADE_SQL_SHA256}
echo "Successfully packaged upgrade_sql files."
}
function make_package_libpq()
{
cd $SCRIPT_DIR
prep_dest_list $release_file_list 'libpq'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
cd ${BUILD_DIR}/temp
echo "packaging libpq..."
tar -zvcf "${libpq_package_name}" ./* >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${libpq_package_name} failed"
fi
deploy_pkgs ${libpq_package_name}
echo "install $pkgname tools is ${libpq_package_name} of ${output_path} directory " >> "$LOG_FILE" 2>&1
echo "success!"
}
function make_package_tools()
{
cd $SCRIPT_DIR
prep_dest_list $release_file_list 'client'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp
cd ${BUILD_DIR}/
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
cd ${BUILD_DIR}/temp
echo "packaging tools..."
tar -zvcf "${tools_package_name}" ./* >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${tools_package_name} failed"
fi
deploy_pkgs ${tools_package_name}
echo "install $pkgname tools is ${tools_package_name} of ${output_path} directory " >> "$LOG_FILE" 2>&1
echo "success!"
}
function spec_prep()
{
cp opengauss.spec gauss.spec
}
#######################################################################
## Check the installation package production environment
#######################################################################
function srv_pkg_bld()
{
install_gaussdb
}
function srv_pkg_make()
{
echo "Start package opengauss."
make_package_srv
make_package_libpq
make_package_tools
make_package_upgrade_sql
echo "End package opengauss."
}
fi
#############################################################
# main function
# show package for hotpatch sdv.
#############################################################
# 0. prepare spec file
spec_prep
if [ "$show_package" = true ]; then
echo "package: "$server_package_name
echo "bin: "$bin_name
exit 0
fi
# 1. build server
srv_pkg_bld
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
declare PKG_TMP_DIR="${BUILD_DIR}/temp"
# 2. make package
srv_pkg_make
if [ -e "$SCRIPT_DIR/utils/internal_packages.sh" ];then
source $SCRIPT_DIR/utils/internal_packages.sh
else
exit 1
fi
function main()
{
echo "[makegaussdb] $(date +%y-%m-%d' '%T): script dir : ${SCRIPT_DIR}"
echo "[makegaussdb] $(date +%y-%m-%d' '%T): Work root dir : ${ROOT_DIR}"
gaussdb_pkg
}
main
echo "now, all packages has finished!"
exit 0

View File

@ -1,265 +0,0 @@
#!/bin/bash
#######################################################################
# Copyright (c): 2020-2025, Huawei Tech. Co., Ltd.
# descript: recompress package
# version: 2.0
# date: 2021-05-19
#######################################################################
declare server_package_path=""
declare agent_package_path=""
declare product_mode="multiple"
declare unpack_server="unpack_server"
declare unpack_agent="unpack_agent"
declare unpack_psycopg2="unpack_psycopg2"
declare compress_command="tar -zcf"
declare decompress_command="tar -zxf"
function print_help()
{
echo "Usage: $0 [OPTION]
-h|--help show help information.
-pm product mode, values parameter is single, multiple or opengauss, default value is multiple.
--server-pacakge the server pacakge path.
--agent-package the agent package path, only -pm is single or multiple need.
"
}
function log() {
echo "[makegaussdb] $(date +%y-%m-%d' '%T): $@"
}
function error() {
echo -e "\033[31m[makegaussdb] $(date +%y-%m-%d' '%T) Error: $@\033[0m"
}
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
print_help
exit 1
;;
-pm)
if [ X$2 == X"" ]; then
error "no given pm product mode."
exit 1
fi
product_mode=$2
shift 2
;;
--server-package)
if [ X$2 == X"" ]; then
error "no given server compress path"
exit 1
fi
server_package_path=$2
shift 2
;;
--agent-package)
if [ X$2 == X"" ]; then
error "no given agent compress path"
exit 1
fi
agent_package_path=$2
shift 2
;;
*)
echo "Internal Error: option processing error: $1" 1>&2
echo "please input right paramtenter, the following command may help you"
echo "sh reconstruct.sh --help or sh reconstruct.sh -h"
exit 1
esac
done
function standard_path() {
local package_path=$1
local first_char=$(expr substr "${package_path}" 1 1)
if [ "${first_char}" != "/" ]; then
package_path="$(pwd)/${package_path}"
fi
echo "${package_path}"
}
function check_path() {
local package_type=$1
local package_path=$2
if [ X${package_path} = X ]; then
error "the paramtenter --${package_type} can not be empty."
exit 1
fi
if [ ! -f "${package_path}" ]; then
error "the file ${package_path} not exist, please check."
exit 1
fi
}
function check_parameter() {
check_path "server-package" ${server_package_path}
server_package_path=$(standard_path ${server_package_path})
if [ X${product_mode} != X"opengauss" ]; then
check_path "agent-pacakge" ${agent_package_path}
agent_package_path=$(standard_path ${agent_package_path})
fi
}
function backup_compress() {
local compress_name=$1
local bak_package_name="${compress_name%%.*}_old.${compress_name#*.}"
if [ -d "${bak_package_name}" ]; then
rm -rf ${bak_package_name}
fi
cp ${compress_name} ${bak_package_name}
}
function delete_backup_package() {
local compress_name=$1
local bak_package_name="${compress_name%%.*}_old.${compress_name#*.}"
if [ -d "${bak_package_name}" ]; then
rm -rf ${bak_package_name}
fi
}
function final_compress() {
local compress_file=$1
if [ X"${compress_file##*.}" == X"zip" ]; then
zip -q -r ${compress_file} ./*
else
${compress_command} ${compress_file} ./*
fi
}
function begin_decompress() {
local decompress_file=$1
local decompress_dir=$2
if [ X"${decompress_file##*.}" == X"zip" ]; then
unzip -q ${decompress_file} -d ${decompress_dir}
else
${decompress_command} ${decompress_file} -C ${decompress_dir}
fi
}
function distribute_compress() {
server_dir=$(dirname "${server_package_path}")
server_name=$(basename "${server_package_path}")
agent_dir=$(dirname "${agent_package_path}")
agent_name=$(basename "${agent_package_path}")
log "server_name: ${server_name}, agent_name: ${agent_name}"
# decompress server package and copy psycopg2 to lib
cd ${server_dir}
backup_compress ${server_name}
if [ -e "${unpack_server}" ]; then
rm -rf ${unpack_server}
fi
mkdir ${unpack_server}
begin_decompress ${server_name} ${unpack_server}
cd ${unpack_server} && mkdir ${unpack_server} ${unpack_psycopg2}
euler_name=$(basename "$(find . -name "GaussDB-Kernel-V500R00*-64bit.tar.gz")")
psycopg2_name=$(basename "$(find . -name "GaussDB-Kernel-V500R00*-64bit-Python.tar.gz")")
log "euler_name: ${euler_name}, psycopg2_name: ${psycopg2_name}"
${decompress_command} ${euler_name} -C ${unpack_server}
${decompress_command} ${psycopg2_name} -C ${unpack_psycopg2}
chmod -R 700 ${unpack_psycopg2}/psycopg2
cp -r ${unpack_psycopg2}/psycopg2 ${unpack_server}/lib
cp -r ${unpack_psycopg2}/psycopg2 ${unpack_server}/script/gspylib/inspection/lib
log "complete copy psycopg2 to server package."
# decompress agent package and copy psycopg2 to lib, then compress
cd ${agent_dir}
backup_compress ${agent_name}
if [ -e "${unpack_agent}" ]; then
rm -rf ${unpack_agent}
fi
mkdir ${unpack_agent}
begin_decompress ${agent_name} ${unpack_agent}
cd ${unpack_agent} && mkdir ${unpack_agent}
agent_tar_name=$(basename "$(find . -name "GaussDB-Kernel-V500R00*-64bit-AGENT.tar.gz")")
${decompress_command} ${agent_tar_name} -C ${unpack_agent}
cd ${unpack_agent}
cp -r ${server_dir}/${unpack_server}/${unpack_psycopg2}/psycopg2 lib/
${compress_command} ${agent_tar_name} ./*
rm -rf ../${agent_tar_name} && mv ${agent_tar_name} ../ && cd ../ && rm -rf ${unpack_agent}
final_compress ${agent_name}
rm -rf ../${agent_name} && mv ${agent_name} ../ && cd ../ && rm -rf ${unpack_agent}
cd ${agent_dir}
delete_backup_package ${agent_name}
log "complete copy psycopg2 to agent package and compress agent package."
# compress server package
log "begin to compress server package ......"
cd ${server_dir}/${unpack_server}/${unpack_server}
${compress_command} ${euler_name} ./*
rm -rf ../${euler_name} && mv ${euler_name} ../ && cd ../ && rm -rf ${unpack_server}
if [ -d "${unpack_psycopg2}" ]; then
rm -rf ${unpack_psycopg2}
fi
final_compress ${server_name}
rm -rf ../${server_name} && mv ${server_name} ../ && cd ../ && rm -rf ${unpack_server}
cd ${server_dir}
delete_backup_package ${server_name}
log "complete compress server package."
}
function opengauss_compress() {
server_dir=$(dirname "${server_package_path}")
server_name=$(basename "${server_package_path}")
cd ${server_dir}
backup_compress ${server_name}
if [ -e "${unpack_server}" ]; then
rm -rf ${unpack_server}
fi
mkdir ${unpack_server}
${decompress_command} ${server_name} -C ${unpack_server}
cd ${unpack_server} && mkdir ${unpack_agent} ${unpack_psycopg2}
psycopg2_name=$(basename "$(find . -name "openGauss-*-Python.tar.gz")")
agent_name=$(basename "$(find . -name "openGauss-*-om.tar.gz")")
log "agent_name: ${agent_name}, psycopg2_name: ${psycopg2_name}"
${decompress_command} ${agent_name} -C ${unpack_agent}
${decompress_command} ${psycopg2_name} -C ${unpack_psycopg2}
chmod -R 700 ${unpack_psycopg2}/psycopg2
cp -r ${unpack_psycopg2}/psycopg2 ${unpack_agent}/lib
cp -r ${unpack_psycopg2}/psycopg2 ${unpack_agent}/script/gspylib/inspection/lib
log "complete copy psycopg2 to agent package."
# compress agent package
cd ${unpack_agent}
${compress_command} ${agent_name} ./*
rm -rf ../${agent_name} && mv ${agent_name} ../ && cd ../ && rm -rf ${unpack_agent}
log "complete compress agent package."
# recover om sha256
sha256_name="$(echo ${agent_name} | sed 's/\.tar\.gz//').sha256"
if [ -d "${sha256_name}" ]; then
rm -rf ${sha256_name}
fi
sha256sum "${agent_name}" | awk -F" " '{print $1}' > "${sha256_name}"
if [ $? -ne 0 ]; then
die "generate sha256 file failed."
fi
if [ -d "${unpack_psycopg2}" ]; then
rm -rf ${unpack_psycopg2}
fi
${compress_command} ${server_name} ./*
rm -rf ../${server_name} && mv ${server_name} ../ && cd ../ && rm -rf ${unpack_server}
delete_backup_package ${server_name}
log "complete compress server package."
}
check_parameter
if [ X${product_mode} == X"opengauss" ]; then
opengauss_compress
else
distribute_compress
fi

View File

@ -76,11 +76,14 @@ separate_symbol()
echo "$x is a script, do not separate symbol"
elif [[ "$x" = *".dat" ]];then
echo "$x is a license file, do not separate symbol"
elif [[ "$x" = *".sh" ]];then
# The following second condition judges whether the file is a shell script without a suffix name.
# Usually, executable shell script has a header comment that indicates which interpreter to use,
# e.g., "#!/usr/bin/env bash".
elif [[ "$x" = *".sh" ]] || [[ -f "$x" && -x "$x" && "$(head -c2 $x)" == '#!' ]]; then
echo "$x is a shell file, do not separate symbol"
elif [[ "$x" = *".la" ]];then
echo "$x is a la file, do not separate symbol"
elif [[ "$x" = *".crt" ]];then
elif [[ "$x" = *".crt" ]];then
echo "$x is a crt file, do not separate symbol"
elif [[ "$x" = *".ini" ]];then
echo "$x is a ini file, do not separate symbol"

View File

@ -0,0 +1,187 @@
#!/bin/bash
#######################################################################
# 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
#######################################################################
function gaussdb_pkg_pre_clean()
{
if [ -d "$BUILD_DIR" ]; then
rm -rf $BUILD_DIR
fi
if [ -d "$LOG_FILE" ]; then
rm -rf $LOG_FILE
fi
}
###################################
#######################################################################
##read version from gaussdb.ver
#######################################################################
function read_gaussdb_version()
{
cd ${SCRIPT_DIR}
echo "${gaussdb_name_for_package}-${version_number}" > version.cfg
#auto read the number from kernal globals.cpp, no need to change it here
}
###################################
# get version number from globals.cpp
##################################
function read_gaussdb_number()
{
global_kernal="${ROOT_DIR}/src/common/backend/utils/init/globals.cpp"
version_name="GRAND_VERSION_NUM"
version_num=""
line=$(cat $global_kernal | grep ^const* | grep $version_name)
version_num1=${line#*=}
#remove the symbol;
version_num=$(echo $version_num1 | tr -d ";")
#remove the blank
version_num=$(echo $version_num)
if echo $version_num | grep -qE '^92[0-9]+$'
then
# get the last three number
latter=${version_num:2}
echo "92.${latter}" >>${SCRIPT_DIR}/version.cfg
else
echo "Cannot get the version number from globals.cpp."
exit 1
fi
}
#######################################################################
##insert the commitid to version.cfg as the upgrade app path specification
#######################################################################
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)
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
## generate the version file.
#######################################################################
function make_license_control()
{
python_exec=$(which python 2>/dev/null)
if [ -x "$python_exec" ]; then
$python_exec ${binarylib_dir}/buildtools/license_control/encrypted_version_file.py >> "$LOG_FILE" 2>&1
fi
if [ $? -ne 0 ]; then
die "create ${binarylib_dir}/buildtools/license_control license file failed."
fi
if [ -f "$gaussdb_200_file" ] && [ -f "$gaussdb_300_file" ]; then
# Get the md5sum.
gaussdb_200_sha256sum=$(sha256sum $gaussdb_200_file | awk '{print $1}')
gaussdb_300_sha256sum=$(sha256sum $gaussdb_300_file | awk '{print $1}')
# Modify the source code.
sed -i "s/^[ \t]*const[ \t]\+char[ \t]*\*[ \t]*sha256_digests[ \t]*\[[ \t]*SHA256_DIGESTS_COUNT[ \t]*\][ \t]*=[ \t]*{[ \t]*NULL[ \t]*,[ \t]*NULL[ \t]*}[ \t]*;[ \t]*$/const char \*sha256_digests\[SHA256_DIGESTS_COUNT\] = {\"$gaussdb_200_sha256sum\", \"$gaussdb_300_sha256sum\"};/g" $gaussdb_version_file
fi
if [ $? -ne 0 ]; then
die "modify '$gaussdb_version_file' failed."
fi
}
function make_gaussdb_kernel()
{
export BUILD_TUPLE=${PLATFORM_ARCH}
export THIRD_BIN_PATH="${binarylib_dir}"
export PREFIX_HOME="${BUILD_DIR}"
export DEBUG_TYPE=${version_mode}
echo "Begin make install gaussdb server" >> "$LOG_FILE" 2>&1
export GAUSSHOME=${BUILD_DIR}
export LD_LIBRARY_PATH=${BUILD_DIR}/lib:${BUILD_DIR}/lib/postgresql:${LD_LIBRARY_PATH}
[ -d "${CMAKE_BUILD_DIR}" ] && rm -rf ${CMAKE_BUILD_DIR}
[ -d "${BUILD_DIR}" ] && rm -rf ${BUILD_DIR}
mkdir -p ${CMAKE_BUILD_DIR}
cd ${CMAKE_BUILD_DIR}
cmake .. ${CMAKE_OPT}
if [ $? -ne 0 ]; then
die "cmake failed."
fi
cpus_num=$(grep -w processor /proc/cpuinfo|wc -l)
make -sj ${cpus_num}
if [ $? -ne 0 ]; then
die "make failed."
fi
make install -sj ${cpus_num}
if [ $? -ne 0 ]; then
die "make install failed."
fi
echo "End make install gaussdb server" >> "$LOG_FILE" 2>&1
}
#######################################################################
##install gaussdb database contained server,client and libpq
#######################################################################
function install_gaussdb()
{
# Generate the license control file, and set md5sum string to the code.
echo "Modify gaussdb_version.cpp file." >> "$LOG_FILE" 2>&1
make_license_control
echo "Modify gaussdb_version.cpp file success." >> "$LOG_FILE" 2>&1
cd "$ROOT_DIR/"
if [ $? -ne 0 ]; then
die "change dir to $ROOT_DIR failed."
fi
if [ "$version_mode" = "debug" -a "$separate_symbol" = "on" ]; then
echo "WARNING: do not separate symbol in debug mode!"
fi
if [ "$product_mode" != "opengauss" ]; then
die "the product mode can only be opengauss!"
fi
echo "build gaussdb kernel." >> "$LOG_FILE" 2>&1
make_gaussdb_kernel
echo "build gaussdb kernel success." >> "$LOG_FILE" 2>&1
chmod 444 ${BUILD_DIR}/bin/cluster_guc.conf
dos2unix ${BUILD_DIR}/bin/cluster_guc.conf > /dev/null 2>&1
#insert the commitid to version.cfg as the upgrade app path specification
get_kernel_commitid
}
#######################################################################
##install gaussdb database and others
##select to install something according to variables package_type need
#######################################################################
function gaussdb_build()
{
case "$package_type" in
server)
install_gaussdb
;;
libpq)
install_gaussdb
;;
*)
echo "Internal Error: option processing error: $package_type"
echo "please input right paramenter values server or libpq "
exit 1
esac
}

View File

@ -0,0 +1,164 @@
#!/bin/bash
#######################################################################
# 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 gaussdb_version='openGauss'
declare PLATFORM_ARCH=$(uname -p)
declare package_path=${ROOT_DIR}/output
declare install_package_format="tar"
declare PLATFORM=32
bit=$(getconf LONG_BIT)
if [ "$bit" -eq 64 ]; then
declare PLATFORM=64
fi
# 公共方法
#######################################################################
##putout the version of gaussdb
#######################################################################
function print_version()
{
echo "$version_number"
}
#######################################################################
# Print log.
#######################################################################
function log()
{
echo "[makegaussdb] $(date +%y-%m-%d' '%T): $@"
echo "[makegaussdb] $(date +%y-%m-%d' '%T): $@" >> "$LOG_FILE" 2>&1
}
#######################################################################
# print log and exit.
#######################################################################
function die()
{
log "$@"
echo "$@"
exit $ERR_MKGS_FAILED
}
#######################################################################
##select package command accroding to install_package_format
#######################################################################
function select_package_command()
{
case "$install_package_format" in
tar)
tar='tar'
option=' -zcvf'
package_command="$tar$option"
;;
esac
}
select_package_command
#######################################################################
##get os dist version
#######################################################################
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) platform."
exit 1;
fi
if [[ "$PLAT_FORM_STR" =~ "euleros" ]]; then
dist_version="EulerOS"
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
fi
elif [[ "$PLAT_FORM_STR" =~ "centos" ]]; then
dist_version="CentOS"
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
fi
elif [[ "$PLAT_FORM_STR" =~ "openeuler" ]]; then
dist_version="openEuler"
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE"
fi
elif [[ "$PLAT_FORM_STR" =~ "kylin" ]]; then
dist_version="Kylin"
if [ "$PLATFORM_ARCH"X == "aarch64"X ];then
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA"
fi
else
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) platform."
echo "Kernel is $kernel"
exit 1
fi
##add platform architecture information
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] ; then
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64) platform."
exit 1
fi
fi
if [ "${binarylib_dir}" != 'None' ] && [ -d "${binarylib_dir}" ]; then
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/${PLAT_FORM_STR}"
PLATFORM_PATH="${binarylib_dir}/platform/${PLAT_FORM_STR}"
BINARYLIBS_PATH="${binarylib_dir}/dependency"
else
die "${binarylib_dir} not exist"
fi
declare INSTALL_TOOLS_DIR=${BINARYLIBS_PATH}/install_tools_${PLAT_FORM_STR}
declare UNIX_ODBC="${BINARYLIBS_PATH}/${PLAT_FORM_STR}/unixodbc"
# Comment 编译相关
gcc_version="7.3"
ccache -V >/dev/null 2>&1 && USE_CCACHE="ccache " ENABLE_CCACHE="--enable-ccache"
export CC="${USE_CCACHE}$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/gcc"
export CXX="${USE_CCACHE}$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/g++"
export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_PATH/gcc$gcc_version/isl/lib:$BUILD_TOOLS_PATH/gcc$gcc_version/mpc/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/mpfr/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/gmp/lib/:$LD_LIBRARY_PATH
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
export JAVA_HOME=${binarylib_dir}/platform/huaweijdk8/${PLATFORM_ARCH}/jdk
declare ERR_MKGS_FAILED=1
declare MKGS_OK=0
gaussdb_200_file="${binarylib_dir}/buildtools/license_control/gaussdb.version.GaussDB200"
gaussdb_300_file="${binarylib_dir}/buildtools/license_control/gaussdb.version.GaussDB300"
gaussdb_200_standard_file="${binarylib_dir}/buildtools/license_control/gaussdb.license.GaussDB200_Standard"
gaussdb_version_file="${ROOT_DIR}/src/gausskernel/process/postmaster/gaussdb_version.cpp"
if [ -f "$SCRIPT_DIR/gaussdb.ver" ];then
declare version_number=$(cat ${SCRIPT_DIR}/gaussdb.ver | grep 'VERSION' | awk -F "=" '{print $2}')
else
echo "gaussdb.ver not found!"
exit 1
fi
declare release_file_list="${PLATFORM_ARCH}_${product_mode}_list"
#######################################################################
## declare all package name
#######################################################################
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"

View File

@ -0,0 +1,242 @@
#!/bin/bash
#############################################################################
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# ----------------------------------------------------------------------------
# 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"
#######################################################################
# move pkgs to output directory
#######################################################################
function deploy_pkgs()
{
mkdir -p $package_path
for pkg in $@; do
if [ -f "$pkg" ]; then
mv $pkg $package_path/
fi
done
}
#######################################################################
# copy directory's files list to $2
#######################################################################
function copy_files_list()
{
for file in $(echo $1)
do
test -e $file && tar -cpf - $file | ( cd $2; tar -xpf - )
done
}
#######################################################################
##copy target file into temporary directory temp
#######################################################################
function target_file_copy()
{
cd ${BUILD_DIR}
copy_files_list "$1" $2
cp ${SCRIPT_DIR}/version.cfg ${BUILD_DIR}/temp
# package simpleInstall dir
cp -rf ${SCRIPT_DIR}/../../simpleInstall ${BUILD_DIR}/temp
if [ $? -ne 0 ]; then
die "copy ${SCRIPT_DIR}/version.cfg to ${BUILD_DIR}/temp failed"
fi
sed -i '/^process_cpu_affinity|/d' $2/bin/cluster_guc.conf
#generate tar file
echo "Begin generate ${kernel_package_name} tar file..." >> "$LOG_FILE" 2>&1
cd $2
tar -jcvpf "${kernel_package_name}" ./* >> "$LOG_FILE" 2>&1
cd '-'
mv $2/"${kernel_package_name}" ./
if [ $? -ne 0 ]; then
die "generate ${kernel_package_name} failed."
fi
echo "End generate ${kernel_package_name} tar file" >> "$LOG_FILE" 2>&1
#generate sha256 file
sha256_name="${package_pre_name}.sha256"
echo "Begin generate ${sha256_name} sha256 file..." >> "$LOG_FILE" 2>&1
sha256sum "${kernel_package_name}" | awk -F" " '{print $1}' > "$sha256_name"
if [ $? -ne 0 ]; then
die "generate sha256 file failed."
fi
echo "End generate ${sha256_name} sha256 file" >> "$LOG_FILE" 2>&1
###################################################
# make server package
###################################################
if [ -d "${2}" ]; then
rm -rf ${2}
fi
}
function target_file_copy_for_non_server()
{
cd ${BUILD_DIR}
copy_files_list "$1" $2
}
#######################################################################
##function make_package_prep have two actions
##1.parse release_file_list variable represent file
##2.copy target file into a newly created temporary directory temp
#######################################################################
function prep_dest_list()
{
cd $SCRIPT_DIR
releasefile=$1
pkgname=$2
local head=$(cat $releasefile | grep "\[$pkgname\]" -n | awk -F: '{print $1}')
if [ ! -n "$head" ]; then
die "error: ono find $pkgname in the $releasefile file "
fi
local tail=$(cat $releasefile | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
if [ ! -n "$tail" ]; then
local all=$(cat $releasefile | wc -l)
let tail=$all+1-$head
fi
dest_list=$(cat $releasefile | awk "NR==$head+1,NR==$tail+$head-1")
}
#######################################################################
##back to separate_debug_symbol.sh dir
#######################################################################
function separate_symbol()
{
cd $SCRIPT_DIR
if [ "$version_mode" = "release" ]; then
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
mv symbols.tar.gz $symbol_package_name
deploy_pkgs $symbol_package_name
fi
}
function make_package_srv()
{
echo "Begin package server"
cd $SCRIPT_DIR
prep_dest_list $release_file_list 'server'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp/etc
target_file_copy "$dest_list" ${BUILD_DIR}/temp
deploy_pkgs ${sha256_name} ${kernel_package_name}
echo "make server(all) package success!"
}
#######################################################################
# Install all SQL files from src/distribute/include/catalog/upgrade_sql
# to INSTALL_DIR/bin/script/upgrade_sql.
# Package all SQL files and then verify them with SHA256.
#######################################################################
function make_package_upgrade_sql()
{
echo "Begin to install upgrade_sql files..."
UPGRADE_SQL_TAR="upgrade_sql.tar.gz"
UPGRADE_SQL_SHA256="upgrade_sql.sha256"
cd $SCRIPT_DIR
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
rm -rf temp
mkdir temp
cd ${BUILD_DIR}/temp
cp -r "${UPGRADE_SQL_DIR}" ./upgrade_sql
[ $? -ne 0 ] && die "Failed to cp upgrade_sql files"
tar -czf ${UPGRADE_SQL_TAR} upgrade_sql
[ $? -ne 0 ] && die "Failed to package ${UPGRADE_SQL_TAR}"
rm -rf ./upgrade_sql > /dev/null 2>&1
sha256sum ${UPGRADE_SQL_TAR} | awk -F" " '{print $1}' > "${UPGRADE_SQL_SHA256}"
[ $? -ne 0 ] && die "Failed to generate sha256 sum file for ${UPGRADE_SQL_TAR}"
chmod 600 ${UPGRADE_SQL_TAR}
chmod 600 ${UPGRADE_SQL_SHA256}
deploy_pkgs ${UPGRADE_SQL_TAR} ${UPGRADE_SQL_SHA256}
echo "Successfully packaged upgrade_sql files."
}
function make_package_libpq()
{
cd $SCRIPT_DIR
prep_dest_list $release_file_list 'libpq'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
cd ${BUILD_DIR}/temp
echo "packaging libpq..."
tar -zvcf "${libpq_package_name}" ./* >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${libpq_package_name} failed"
fi
deploy_pkgs ${libpq_package_name}
echo "install $pkgname tools is ${libpq_package_name} of ${package_path} directory " >> "$LOG_FILE" 2>&1
echo "success!"
}
function make_package_tools()
{
cd $SCRIPT_DIR
prep_dest_list $release_file_list 'client'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp
cd ${BUILD_DIR}/
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
cd ${BUILD_DIR}/temp
echo "packaging tools..."
tar -zvcf "${tools_package_name}" ./* >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${tools_package_name} failed"
fi
deploy_pkgs ${tools_package_name}
echo "install $pkgname tools is ${tools_package_name} of ${package_path} directory " >> "$LOG_FILE" 2>&1
echo "success!"
}
function gaussdb_pkg()
{
echo "Start package opengauss."
separate_symbol
make_package_srv
make_package_libpq
make_package_tools
make_package_upgrade_sql
echo "End package opengauss."
}

View File

@ -0,0 +1,286 @@
#!/bin/bash
#######################################################################
# 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
#######################################################################
function gaussdb_pkg_pre_clean()
{
if [ -d "$BUILD_DIR" ]; then
rm -rf $BUILD_DIR
fi
if [ -d "$LOG_FILE" ]; then
rm -rf $LOG_FILE
fi
}
###################################
#######################################################################
##read version from gaussdb.ver
#######################################################################
function read_gaussdb_version()
{
cd ${SCRIPT_DIR}
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
##################################
function read_gaussdb_number()
{
global_kernal="${ROOT_DIR}/src/common/backend/utils/init/globals.cpp"
version_name="GRAND_VERSION_NUM"
version_num=""
line=$(cat $global_kernal | grep ^const* | grep $version_name)
version_num1=${line#*=}
#remove the symbol;
version_num=$(echo $version_num1 | tr -d ";")
#remove the blank
version_num=$(echo $version_num)
if echo $version_num | grep -qE '^92[0-9]+$'
then
# get the last three number
latter=${version_num:2}
echo "92.${latter}" >>${SCRIPT_DIR}/version.cfg
else
echo "Cannot get the version number from globals.cpp."
exit 1
fi
}
#######################################################################
##insert the commitid to version.cfg as the upgrade app path specification
#######################################################################
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)
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
## generate the version file.
#######################################################################
function make_license_control()
{
python_exec=$(which python 2>/dev/null)
if [ -x "$python_exec" ]; then
$python_exec ${binarylib_dir}/buildtools/license_control/encrypted_version_file.py >> "$LOG_FILE" 2>&1
fi
if [ $? -ne 0 ]; then
die "create ${binarylib_dir}/buildtools/license_control license file failed."
fi
if [ -f "$gaussdb_200_file" ] && [ -f "$gaussdb_300_file" ]; then
# Get the md5sum.
gaussdb_200_sha256sum=$(sha256sum $gaussdb_200_file | awk '{print $1}')
gaussdb_300_sha256sum=$(sha256sum $gaussdb_300_file | awk '{print $1}')
# Modify the source code.
sed -i "s/^[ \t]*const[ \t]\+char[ \t]*\*[ \t]*sha256_digests[ \t]*\[[ \t]*SHA256_DIGESTS_COUNT[ \t]*\][ \t]*=[ \t]*{[ \t]*NULL[ \t]*,[ \t]*NULL[ \t]*}[ \t]*;[ \t]*$/const char \*sha256_digests\[SHA256_DIGESTS_COUNT\] = {\"$gaussdb_200_sha256sum\", \"$gaussdb_300_sha256sum\"};/g" $gaussdb_version_file
fi
if [ $? -ne 0 ]; then
die "modify '$gaussdb_version_file' failed."
fi
}
#######################################################################
##back to separate_debug_symbol.sh dir
#######################################################################
function separate_symbol()
{
cd $SCRIPT_DIR
if [ "$version_mode" = "release" -a "$separate_symbol" = "on" ]; then
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
mkdir -p $package_path
mv symbols.tar.gz $package_path/$symbol_package_name
fi
}
#######################################################################
##install gaussdb database contained server,client and libpq
#######################################################################
function install_gaussdb()
{
# Generate the license control file, and set md5sum string to the code.
echo "Modify gaussdb_version.cpp file." >> "$LOG_FILE" 2>&1
make_license_control
echo "Modify gaussdb_version.cpp file success." >> "$LOG_FILE" 2>&1
#putinto to Code dir
cd "$ROOT_DIR"
#echo "$ROOT_DIR/Code"
if [ $? -ne 0 ]; then
die "change dir to $ROOT_DIR failed."
fi
if [ "$version_mode" = "debug" -a "$separate_symbol" = "on" ]; then
echo "WARNING: do not separate symbol in debug mode!"
fi
if [ "$product_mode" != "opengauss" ]; then
die "the product mode can only be opengauss!"
fi
#configure
make distclean -sj >> "$LOG_FILE" 2>&1
echo "Begin configure." >> "$LOG_FILE" 2>&1
chmod 755 configure
if [ "$product_mode"x == "opengauss"x ]; then
enable_readline="--with-readline"
else
enable_readline="--without-readline"
fi
shared_opt="--gcc-version=${gcc_version}.0 --prefix="${BUILD_DIR}" --3rd=${binarylib_dir} --enable-thread-safety ${enable_readline} --without-zlib"
if [ "$product_mode"x == "opengauss"x ]; then
if [ "$version_mode"x == "release"x ]; then
# configure -D__USE_NUMA -D__ARM_LSE with arm opengauss mode
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
echo "configure -D__USE_NUMA -D__ARM_LSE with arm opengauss mode"
GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE"
fi
./configure $shared_opt CFLAGS="-O2 -g3 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
elif [ "$version_mode"x == "memcheck"x ]; then
./configure $shared_opt CFLAGS="-O0" --enable-mot --enable-debug --enable-cassert --enable-memory-check CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
elif [ "$version_mode"x == "fiurelease"x ]; then
./configure $shared_opt CFLAGS="-O2 -g3 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --disable-jemalloc CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
elif [ "$version_mode"x == "fiudebug"x ]; then
./configure $shared_opt CFLAGS="-O0 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --enable-debug --enable-cassert --disable-jemalloc CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
else
./configure $shared_opt CFLAGS="-O0 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --enable-debug --enable-cassert CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
fi
fi
if [ $? -ne 0 ]; then
die "configure failed."
fi
echo "End configure" >> "$LOG_FILE" 2>&1
echo "Begin make install MPPDB server" >> "$LOG_FILE" 2>&1
make clean >> "$LOG_FILE" 2>&1
export GAUSSHOME=${BUILD_DIR}
export LD_LIBRARY_PATH=${BUILD_DIR}/lib:${BUILD_DIR}/lib/postgresql:${LD_LIBRARY_PATH}
make -sj 20 >> "$LOG_FILE" 2>&1
make install -sj 8>> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
make install -sj 8>> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
make install -sj 8>> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "make install failed."
fi
fi
fi
cd "$ROOT_DIR/contrib/pg_upgrade_support"
make clean >> "$LOG_FILE" 2>&1
make -sj >> "$LOG_FILE" 2>&1
make install -sj >> "$LOG_FILE" 2>&1
echo "End make install MPPDB" >> "$LOG_FILE" 2>&1
cd "$ROOT_DIR"
if [ "${make_check}" = 'on' ]; then
echo "Begin make check MPPDB..." >> "$LOG_FILE" 2>&1
cd ${PG_REG_TEST_ROOT}
make check -sj >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "make check MPPDB failed."
fi
echo "End make check MPPDB success." >> "$LOG_FILE" 2>&1
fi
echo "Begin make install mpp_decoding..." >> "$LOG_FILE" 2>&1
#copy mppdb_decoding form clienttools to bin
if [ "$version_mode"x == "release"x ]; then
cd "$MPPDB_DECODING_DIR"
make >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "make install mppdb_decoding failed."
fi
echo "End make install mppdb_decoding success." >> "$LOG_FILE" 2>&1
echo "Begin pack mppdb_decoding..." >> "$LOG_FILE" 2>&1
cp ${MPPDB_DECODING_DIR}/mppdb_decoding.so ${BUILD_DIR}/lib/postgresql/mppdb_decoding.so
elif [ "$version_mode"x == "memcheck"x ]; then
cd "$MPPDB_DECODING_DIR"
make >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "make install mppdb_decoding failed."
fi
echo "End make install mppdb_decoding success." >> "$LOG_FILE" 2>&1
echo "Begin pack mppdb_decoding..." >> "$LOG_FILE" 2>&1
cp ${MPPDB_DECODING_DIR}/mppdb_decoding.so ${BUILD_DIR}/lib/postgresql/mppdb_decoding.so
else
cd "$MPPDB_DECODING_DIR"
make >> "$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "make install mppdb_decoding failed."
fi
echo "End make install mppdb_decoding success." >> "$LOG_FILE" 2>&1
echo "Begin pack mppdb_decoding..." >> "$LOG_FILE" 2>&1
cp ${MPPDB_DECODING_DIR}/mppdb_decoding.so ${BUILD_DIR}/lib/postgresql/mppdb_decoding.so
fi
if [ $? -ne 0 ]; then
if [ "$version_mode"x == "release"x ]; then
die "cp ${MPPDB_DECODING_DIR}/mppdb_decoding ${MPPDB_DECODING_DIR}/bin/mppdb_decoding failed"
else
die "cp ${MPPDB_DECODING_DIR}/mppdb_decoding ${MPPDB_DECODING_DIR}/bin/mppdb_decoding failed"
fi
fi
chmod 444 ${BUILD_DIR}/bin/cluster_guc.conf
dos2unix ${BUILD_DIR}/bin/cluster_guc.conf > /dev/null 2>&1
separate_symbol
get_kernel_commitid
}
#######################################################################
##install gaussdb database and others
##select to install something according to variables package_type need
#######################################################################
function gaussdb_build()
{
case "$package_type" in
server)
install_gaussdb
;;
libpq)
install_gaussdb
;;
*)
echo "Internal Error: option processing error: $package_type"
echo "please input right paramenter values server or libpq "
exit 1
esac
}

View File

@ -2,46 +2,21 @@
./bin/gsql
./bin/gaussdb
./bin/gstrace
./bin/gs_basebackup
./bin/gs_probackup
./bin/gs_tar
./bin/gs_encrypt
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_ctl
./bin/gs_initdb
./bin/gs_ctl
./bin/gs_guc
./bin/encrypt
./bin/openssl
./bin/gs_restore
./bin/gs_cgroup
./bin/openssl
./bin/pg_config
./bin/pg_controldata
./bin/pg_format_cu
./bin/pg_resetxlog
./bin/pg_recvlogical
./bin/gs_probackup
./bin/alarmItem.conf
./bin/retry_errcodes.conf
./bin/cluster_guc.conf
./bin/bind_net_irq.sh
./bin/setArmOptimization.sh
./bin/krb5kdc
./bin/klist
./bin/kinit
./bin/kdestroy
./bin/kdb5_util
./bin/kadmin.local
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
./etc/kerberos/mppdb-site.xml
./share/postgresql/tmp/udstools.py
./bin/gs_plan_simulator.sh
./share/postgresql/db4ai
./share/postgresql/snowball_create.sql
./share/postgresql/pg_hba.conf.sample
@ -53,7 +28,6 @@
./share/postgresql/pg_ident.conf.sample
./share/postgresql/postgres.description
./share/postgresql/postgresql.conf.sample
./share/postgresql/mot.conf.sample
./share/postgresql/extension/plpgsql--1.0.sql
./share/postgresql/extension/hstore.control
./share/postgresql/extension/security_plugin.control
@ -71,8 +45,6 @@
./share/postgresql/extension/hdfs_fdw.control
./share/postgresql/extension/log_fdw--1.0.sql
./share/postgresql/extension/log_fdw.control
./share/postgresql/extension/mot_fdw--1.0.sql
./share/postgresql/extension/mot_fdw.control
./share/postgresql/extension/postgres_fdw--1.0.sql
./share/postgresql/extension/postgres_fdw.control
./share/postgresql/timezone/GB-Eire
@ -281,7 +253,6 @@
./share/postgresql/timezone/Canada/Newfoundland
./share/postgresql/timezone/Canada/Saskatchewan
./share/postgresql/timezone/Canada/Pacific
./share/postgresql/timezone/Canada/East-Saskatchewan
./share/postgresql/timezone/Canada/Mountain
./share/postgresql/timezone/Canada/Central
./share/postgresql/timezone/CST6CDT
@ -663,7 +634,6 @@
./share/postgresql/timezone/Navajo
./share/postgresql/timezone/GMT
./share/postgresql/system_views.sql
./share/postgresql/private_system_views.sql
./share/postgresql/performance_views.sql
./share/postgresql/sql_features.txt
./share/postgresql/pg_cast_oid.txt
@ -702,11 +672,43 @@
./share/postgresql/timezonesets/Default
./share/postgresql/timezonesets/Etc.txt
./share/postgresql/postgres.bki
./share/llvmir/GaussDB_expr.ir
./share/sslcert/gsql/openssl.cnf
./share/sslcert/grpc/openssl.cnf
./share/sslcert/om/openssl.cnf
./lib/libsimsearch/
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libcgroup.so
./lib/libcgroup.so.1
./lib/libz.so
./lib/libz.so.1
./lib/libz.so.1.2.11
./lib/liblz4.so
./lib/liblz4.so.1
./lib/liblz4.so.1.9.2
./lib/libcjson.so
./lib/libcjson.so.1
./lib/libcjson.so.1.7.14
./lib/libcjson_utils.so
./lib/libcjson_utils.so.1
./lib/libcjson_utils.so.1.7.14
./lib/libstdc++.so.6
./lib/libgcc_s.so.1
./lib/libgomp.so
./lib/libgomp.so.1
./lib/libgomp.so.1.0.0
./lib/libdcf.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.1
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
@ -715,12 +717,6 @@
./lib/postgresql/cyrillic_and_mic.so
./lib/postgresql/utf8_and_johab.so
./lib/postgresql/utf8_and_gb18030.so
./lib/postgresql/pgxs/src/makefiles/pgxs.mk
./lib/postgresql/pgxs/src/Makefile.shlib
./lib/postgresql/pgxs/src/Makefile.port
./lib/postgresql/pgxs/src/nls-global.mk
./lib/postgresql/pgxs/src/Makefile.global
./lib/postgresql/pgxs/src/get_PlatForm_str.sh
./lib/postgresql/pgxs/config/install-sh
./lib/postgresql/euc_cn_and_mic.so
./lib/postgresql/latin_and_mic.so
@ -746,140 +742,9 @@
./lib/postgresql/pg_plugin
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so
./lib/libpljava.so
./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/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.9
./lib/libupb.so.9.0.0
./lib/libabsl_str_format_internal.so
./lib/libabsl_strings.so
./lib/libabsl_throw_delegate.so
./lib/libabsl_strings_internal.so
./lib/libabsl_base.so
./lib/libabsl_dynamic_annotations.so
./lib/libabsl_spinlock_wait.so
./lib/libabsl_int128.so
./lib/libabsl_bad_optional_access.so
./lib/libabsl_raw_logging_internal.so
./lib/libabsl_log_severity.so
./lib/libaddress_sorting.so
./lib/libaddress_sorting.so.9
./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.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/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.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./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/libz.so.1
./lib/libz.so.1.2.11
./lib/liblz4.so
./lib/liblz4.so.1
./lib/liblz4.so.1.9.2
./lib/libcjson.so
./lib/libcjson.so.1
./lib/libcjson.so.1.7.13
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./share/llvmir/GaussDB_expr.ir
./lib/libeSDKLogAPI.so
./lib/libeSDKOBS.so
./lib/liblog4cpp.so
./lib/liblog4cpp.so.5
./lib/liblog4cpp.so.5.0.6
./lib/libcharset.so
./lib/libcharset.so.1
./lib/libcharset.so.1.0.0
./lib/libiconv.so
./lib/libiconv.so.2
./lib/libiconv.so.2.6.1
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.20.0
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
./lib/libsecurec.so
./lib/libxml2.so
./lib/libxml2.so.2
./lib/libxml2.so.2.9.9
./lib/libparquet.so
./lib/libparquet.so.14
./lib/libparquet.so.14.1.0
./lib/libarrow.so
./lib/libarrow.so.14
./lib/libarrow.so.14.1.0
./lib/OBS.ini
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/libdcf.so
./lib/libzstd.so
./lib/libzstd.so.1
./lib/libzstd.so.1.4.4
./lib/libxgboost.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h
@ -973,6 +838,7 @@
./include/postgresql/server/utils/aset.h
./include/postgresql/server/utils/catcache.h
./include/postgresql/server/utils/atomic_arm.h
./include/postgresql/server/utils/oidrbtree.h
./include/postgresql/server/datatype/timestamp.h
./include/postgresql/server/access/rmgr.h
./include/postgresql/server/access/xlogreader.h
@ -984,6 +850,7 @@
./include/postgresql/server/access/attnum.h
./include/postgresql/server/access/tupmacs.h
./include/postgresql/server/access/xlogrecord.h
./include/postgresql/server/tde_key_management/data_common.h
./include/postgresql/server/tcop/dest.h
./include/postgresql/server/catalog/pg_type.h
./include/postgresql/server/catalog/pg_attribute.h
@ -1007,6 +874,7 @@
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/lwlocknames.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1030,400 +898,14 @@
./include/postgresql/server/lib/ilist.h
./include/postgresql/server/pgxc/locator.h
./include/postgresql/server/gstrace/gstrace_infra.h
./include/postgresql/server/extension_dependency.h
./include/postgresql/server/libpq/libpq-fe.h
./include/postgresql/server/access/clog.h
./include/postgresql/server/storage/proc.h
./include/postgresql/server/access/xlog.h
./include/postgresql/server/storage/lwlocknames.h
./include/postgresql/server/access/xloginsert.h
./include/postgresql/server/catalog/pg_control.h
./include/postgresql/server/access/parallel_recovery/redo_item.h
./include/postgresql/server/access/parallel_recovery/posix_semaphore.h
./include/postgresql/server/replication/replicainternal.h
./include/postgresql/server/knl/knl_instance.h
./include/postgresql/server/knl/knl_guc.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_sql.h
./include/postgresql/server/knl/knl_guc/knl_guc_common.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_sql.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_storage.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_storage.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_storage.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_security.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_security.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_network.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_network.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_memory.h
./include/postgresql/server/knl/knl_guc/knl_instance_attr_memory.h
./include/postgresql/server/knl/knl_guc/knl_session_attr_resource.h
./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/lib/circularqueue.h
./include/postgresql/server/access/double_write_basic.h
./include/postgresql/server/knl/knl_thread.h
./include/postgresql/server/access/sdir.h
./include/postgresql/server/gssignal/gs_signal.h
./include/postgresql/server/knl/knl_session.h
./include/postgresql/server/libpq/pqcomm.h
./include/postgresql/server/cipher.h
./include/postgresql/server/portability/instr_time.h
./include/postgresql/server/utils/memgroup.h
./include/postgresql/server/storage/latch.h
./include/postgresql/server/workload/qnode.h
./include/postgresql/server/streaming/init.h
./include/postgresql/server/streaming/launcher.h
./include/postgresql/server/pgxc/barrier.h
./include/postgresql/server/libcomm/libcomm.h
./include/postgresql/server/hotpatch/hotpatch.h
./include/postgresql/server/hotpatch/hotpatch_backend.h
./include/postgresql/server/postmaster/bgwriter.h
./include/postgresql/server/postmaster/pagewriter.h
./include/postgresql/server/replication/heartbeat.h
./include/postgresql/server/access/multi_redo_settings.h
./include/postgresql/server/access/redo_statistic_msg.h
./include/postgresql/server/replication/rto_statistic.h
./include/postgresql/server/replication/walprotocol.h
./include/postgresql/server/storage/mot/jit_def.h
./include/postgresql/server/threadpool/threadpool.h
./include/postgresql/server/threadpool/threadpool_controler.h
./include/postgresql/server/threadpool/threadpool_group.h
./include/postgresql/server/knl/knl_variable.h
./include/postgresql/server/threadpool/threadpool_listener.h
./include/postgresql/server/threadpool/threadpool_sessctl.h
./include/postgresql/server/storage/procsignal.h
./include/postgresql/server/threadpool/threadpool_worker.h
./include/postgresql/server/threadpool/threadpool_scheduler.h
./include/postgresql/server/threadpool/threadpool_stream.h
./include/postgresql/server/replication/dataqueuedefs.h
./include/postgresql/server/gtm/gtm_c.h
./include/postgresql/server/cm/etcdapi.h
./include/postgresql/server/alarm/alarm.h
./include/postgresql/server/access/xact.h
./include/postgresql/server/access/cstore_am.h
./include/postgresql/server/access/cstore_roughcheck_func.h
./include/postgresql/server/access/cstoreskey.h
./include/postgresql/server/storage/cu.h
./include/postgresql/server/vecexecutor/vectorbatch.h
./include/postgresql/server/cstore.h
./include/postgresql/server/storage/cstore/cstore_mem_alloc.h
./include/postgresql/server/access/cstore_minmax_func.h
./include/postgresql/server/storage/custorage.h
./include/postgresql/server/storage/fd.h
./include/postgresql/server/postmaster/aiocompleter.h
./include/postgresql/server/storage/buf/bufmgr.h
./include/postgresql/server/storage/buf/buf_internals.h
./include/postgresql/server/storage/smgr.h
./include/postgresql/server/catalog/pg_am.h
./include/postgresql/server/catalog/pg_class.h
./include/postgresql/server/catalog/pg_index.h
./include/postgresql/server/rewrite/prs2lock.h
./include/postgresql/server/tcop/stmt_retry.h
./include/postgresql/server/catalog/pg_hashbucket_fn.h
./include/postgresql/server/utils/rel_gs.h
./include/postgresql/server/catalog/pg_partition.h
./include/postgresql/server/catalog/pg_hashbucket.h
./include/postgresql/server/catalog/catalog.h
./include/postgresql/server/catalog/catversion.h
./include/postgresql/server/catalog/pg_namespace.h
./include/postgresql/server/utils/partitionmap_gs.h
./include/postgresql/server/access/heapam.h
./include/postgresql/server/storage/pagecompress.h
./include/postgresql/server/replication/bcm.h
./include/postgresql/server/storage/cstore/cstorealloc.h
./include/postgresql/server/storage/cucache_mgr.h
./include/postgresql/server/storage/cache_mgr.h
./include/postgresql/server/nodes/plannodes.h
./include/postgresql/server/foreign/foreign.h
./include/postgresql/server/access/obs/obs_am.h
./include/postgresql/server/storage/buf/buffile.h
./include/postgresql/server/replication/slot.h
./include/postgresql/server/access/obs/eSDKOBS.h
./include/postgresql/server/commands/defrem.h
./include/postgresql/server/optimizer/pruning.h
./include/postgresql/server/nodes/relation.h
./include/postgresql/server/optimizer/bucketinfo.h
./include/postgresql/server/pgxc/nodemgr.h
./include/postgresql/server/bulkload/dist_fdw.h
./include/postgresql/server/bulkload/importerror.h
./include/postgresql/server/commands/gds_stream.h
./include/postgresql/server/bulkload/utils.h
./include/postgresql/server/cjson/cJSON.h
./include/postgresql/server/ssl/gs_openssl_client.h
./include/postgresql/server/funcapi.h
./include/postgresql/server/executor/executor.h
./include/postgresql/server/executor/execdesc.h
./include/postgresql/server/nodes/execnodes.h
./include/postgresql/server/access/genam.h
./include/postgresql/server/nodes/tidbitmap.h
./include/postgresql/server/access/relscan.h
./include/postgresql/server/access/itup.h
./include/postgresql/server/executor/instrument.h
./include/postgresql/server/miscadmin.h
./include/postgresql/server/libpq/libpq-be.h
./include/postgresql/server/libpq/hba.h
./include/postgresql/server/libpq/sha2.h
./include/postgresql/server/utils/anls_opt.h
./include/postgresql/server/pgxc/pgxc.h
./include/postgresql/server/catalog/namespace.h
./include/postgresql/server/commands/trigger.h
./include/postgresql/server/executor/spi.h
./jre/ASSEMBLY_EXCEPTION
./jre/bin/java
./jre/bin/jjs
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
./jre/bin/policytool
./jre/bin/rmid
./jre/bin/rmiregistry
./jre/bin/servertool
./jre/bin/tnameserv
./jre/bin/unpack200
./jre/lib/amd64/jli/libjli.so
./jre/lib/amd64/jvm.cfg
./jre/lib/amd64/libattach.so
./jre/lib/amd64/libavplugin-ffmpeg-58.so
./jre/lib/amd64/libawt_headless.so
./jre/lib/amd64/libawt.so
./jre/lib/amd64/libawt_xawt.so
./jre/lib/amd64/libdecora_sse.so
./jre/lib/amd64/libdt_socket.so
./jre/lib/amd64/libfontmanager.so
./jre/lib/amd64/libfxplugins.so
./jre/lib/amd64/libglassgtk2.so
./jre/lib/amd64/libglassgtk3.so
./jre/lib/amd64/libglass.so
./jre/lib/amd64/libgstreamer-lite.so
./jre/lib/amd64/libhprof.so
./jre/lib/amd64/libinstrument.so
./jre/lib/amd64/libj2gss.so
./jre/lib/amd64/libj2pcsc.so
./jre/lib/amd64/libj2pkcs11.so
./jre/lib/amd64/libjaas_unix.so
./jre/lib/amd64/libjava_crw_demo.so
./jre/lib/amd64/libjavafx_font_freetype.so
./jre/lib/amd64/libjavafx_font_pango.so
./jre/lib/amd64/libjavafx_font.so
./jre/lib/amd64/libjavafx_iio.so
./jre/lib/amd64/libjava.so
./jre/lib/amd64/libjawt.so
./jre/lib/amd64/libjdwp.so
./jre/lib/amd64/libjfxmedia.so
./jre/lib/amd64/libjfxwebkit.so
./jre/lib/amd64/libjpeg.so
./jre/lib/amd64/libjsdt.so
./jre/lib/amd64/libjsig.so
./jre/lib/amd64/libjsoundalsa.so
./jre/lib/amd64/libjsound.so
./jre/lib/amd64/liblcms.so
./jre/lib/amd64/libmanagement.so
./jre/lib/amd64/libmlib_image.so
./jre/lib/amd64/libnet.so
./jre/lib/amd64/libnio.so
./jre/lib/amd64/libnpt.so
./jre/lib/amd64/libprism_common.so
./jre/lib/amd64/libprism_es2.so
./jre/lib/amd64/libprism_sw.so
./jre/lib/amd64/libsaproc.so
./jre/lib/amd64/libsctp.so
./jre/lib/amd64/libsplashscreen.so
./jre/lib/amd64/libsunec.so
./jre/lib/amd64/libunpack.so
./jre/lib/amd64/libverify.so
./jre/lib/amd64/libzip.so
./jre/lib/amd64/server/libjvm.so
./jre/lib/amd64/server/Xusage.txt
./jre/lib/calendars.properties
./jre/lib/charsets.jar
./jre/lib/classlist
./jre/lib/cmm/CIEXYZ.pf
./jre/lib/cmm/GRAY.pf
./jre/lib/cmm/LINEAR_RGB.pf
./jre/lib/cmm/PYCC.pf
./jre/lib/cmm/sRGB.pf
./jre/lib/content-types.properties
./jre/lib/currency.data
./jre/lib/ext/cldrdata.jar
./jre/lib/ext/dnsns.jar
./jre/lib/ext/jaccess.jar
./jre/lib/ext/jfxrt.jar
./jre/lib/ext/localedata.jar
./jre/lib/ext/meta-index
./jre/lib/ext/nashorn.jar
./jre/lib/ext/sunec.jar
./jre/lib/ext/sunjce_provider.jar
./jre/lib/ext/sunpkcs11.jar
./jre/lib/ext/zipfs.jar
./jre/lib/flavormap.properties
./jre/lib/fontconfig.Euler.properties
./jre/lib/fontconfig.properties
./jre/lib/fontconfig.Ubuntu.properties
./jre/lib/fonts/Roboto-Regular.ttf
./jre/lib/hijrah-config-umalqura.properties
./jre/lib/images/cursors/cursors.properties
./jre/lib/images/cursors/invalid32x32.gif
./jre/lib/images/cursors/motif_CopyDrop32x32.gif
./jre/lib/images/cursors/motif_CopyNoDrop32x32.gif
./jre/lib/images/cursors/motif_LinkDrop32x32.gif
./jre/lib/images/cursors/motif_LinkNoDrop32x32.gif
./jre/lib/images/cursors/motif_MoveDrop32x32.gif
./jre/lib/images/cursors/motif_MoveNoDrop32x32.gif
./jre/lib/javafx-mx.jar
./jre/lib/javafx.properties
./jre/lib/jce.jar
./jre/lib/jexec
./jre/lib/jfr/default.jfc
./jre/lib/jfr.jar
./jre/lib/jfr/profile.jfc
./jre/lib/jfxswt.jar
./jre/lib/jsse.jar
./jre/lib/jvm.hprof.txt
./jre/lib/logging.properties
./jre/lib/management-agent.jar
./jre/lib/management/jmxremote.access
./jre/lib/management/jmxremote.password.template
./jre/lib/management/management.properties
./jre/lib/management/snmp.acl.template
./jre/lib/meta-index
./jre/lib/net.properties
./jre/lib/psfontj2d.properties
./jre/lib/psfont.properties.ja
./jre/lib/resources.jar
./jre/lib/rt.jar
./jre/lib/security/blacklisted.certs
./jre/lib/security/cacerts
./jre/lib/security/java.policy
./jre/lib/security/java.security
./jre/lib/security/policy/limited/local_policy.jar
./jre/lib/security/policy/limited/US_export_policy.jar
./jre/lib/security/policy/unlimited/local_policy.jar
./jre/lib/security/policy/unlimited/US_export_policy.jar
./jre/lib/sound.properties
./jre/lib/tzdb.dat
./jre/LICENSE
./jre/THIRD_PARTY_README
[client]
./bin/gsql
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./bin/gs_basebackup
./bin/gs_probackup
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
./lib/postgresql/utf8_and_uhc.so
./lib/postgresql/euc_tw_and_big5.so
./lib/postgresql/cyrillic_and_mic.so
./lib/postgresql/utf8_and_johab.so
./lib/postgresql/utf8_and_gb18030.so
./lib/postgresql/pgxs/src/makefiles/pgxs.mk
./lib/postgresql/pgxs/src/Makefile.shlib
./lib/postgresql/pgxs/src/Makefile.port
./lib/postgresql/pgxs/src/nls-global.mk
./lib/postgresql/pgxs/src/Makefile.global
./lib/postgresql/pgxs/config/install-sh
./lib/postgresql/euc_cn_and_mic.so
./lib/postgresql/latin_and_mic.so
./lib/postgresql/utf8_and_sjis2004.so
./lib/postgresql/utf8_and_euc_jp.so
./lib/postgresql/utf8_and_sjis.so
./lib/postgresql/utf8_and_cyrillic.so
./lib/postgresql/utf8_and_euc_kr.so
./lib/postgresql/ascii_and_mic.so
./lib/postgresql/utf8_and_iso8859_1.so
./lib/postgresql/euc_jp_and_sjis.so
./lib/postgresql/dict_snowball.so
./lib/postgresql/utf8_and_ascii.so
./lib/postgresql/utf8_and_euc_tw.so
./lib/postgresql/utf8_and_iso8859.so
./lib/postgresql/utf8_and_win.so
./lib/postgresql/utf8_and_euc_cn.so
./lib/postgresql/utf8_and_gbk.so
./lib/postgresql/utf8_and_euc2004.so
./lib/postgresql/utf8_and_big5.so
./lib/postgresql/java/pljava.jar
./lib/libpljava.so
./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/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./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/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libgauss_cl_jni.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.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./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
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R002C00
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1432,14 +914,10 @@ V500R002C00
./include/pg_config.h
./include/pg_config_manual.h
./include/pg_config_os.h
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h
./include/xlogdefs.h
./include/cm-libpq-fe.h
[version]
3.0.0

View File

@ -35,8 +35,10 @@
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/gs_dbmind
./bin/server.key.cipher
./bin/server.key.rand
./bin/gs_plan_simulator.sh
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
@ -749,6 +751,7 @@
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so
./lib/postgresql/pgoutput.so
./lib/libpljava.so
./lib/libpq.a
./lib/libpq.so
@ -822,9 +825,7 @@
./lib/libverto.so
./lib/libverto.so.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./lib/libcurl.so*
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
@ -837,9 +838,7 @@
./lib/liblz4.so
./lib/liblz4.so.1
./lib/liblz4.so.1.9.2
./lib/libcjson.so
./lib/libcjson.so.1
./lib/libcjson.so.1.7.13
./lib/libcjson.so*
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libpgport_tool.so
@ -847,25 +846,13 @@
./share/llvmir/GaussDB_expr.ir
./lib/libeSDKLogAPI.so
./lib/libeSDKOBS.so
./lib/liblog4cpp.so
./lib/liblog4cpp.so.5
./lib/liblog4cpp.so.5.0.6
./lib/libcharset.so
./lib/libcharset.so.1
./lib/libcharset.so.1.0.0
./lib/libiconv.so
./lib/libiconv.so.2
./lib/libiconv.so.2.6.1
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.20.0
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
./lib/liblog4cpp.so*
./lib/libcharset.so*
./lib/libiconv.so*
./lib/libnghttp2.so*
./lib/libpcre.so*
./lib/libsecurec.so
./lib/libxml2.so
./lib/libxml2.so.2
./lib/libxml2.so.2.9.9
./lib/libxml2.so*
./lib/libparquet.so
./lib/libparquet.so.14
./lib/libparquet.so.14.1.0
@ -878,9 +865,10 @@
./lib/libdcf.so
./lib/libzstd.so
./lib/libzstd.so.1
./lib/libzstd.so.1.4.4
./lib/libzstd.so.1.5.0
./lib/libxgboost.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
@ -974,6 +962,7 @@
./include/postgresql/server/utils/aset.h
./include/postgresql/server/utils/catcache.h
./include/postgresql/server/utils/atomic_arm.h
./include/postgresql/server/utils/oidrbtree.h
./include/postgresql/server/datatype/timestamp.h
./include/postgresql/server/access/rmgr.h
./include/postgresql/server/access/xlogreader.h
@ -985,6 +974,7 @@
./include/postgresql/server/access/attnum.h
./include/postgresql/server/access/tupmacs.h
./include/postgresql/server/access/xlogrecord.h
./include/postgresql/server/tde_key_management/data_common.h
./include/postgresql/server/tcop/dest.h
./include/postgresql/server/catalog/pg_type.h
./include/postgresql/server/catalog/pg_attribute.h
@ -1006,8 +996,9 @@
./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
./include/postgresql/server/pg_config.h
@ -1169,6 +1160,25 @@
./include/postgresql/server/catalog/namespace.h
./include/postgresql/server/commands/trigger.h
./include/postgresql/server/executor/spi.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
./include/postgresql/server/access/ustore/knl_utuple.h
./include/postgresql/server/access/ustore/knl_utype.h
./include/postgresql/server/access/ustore/knl_upage.h
./include/postgresql/server/access/ustore/knl_uredo.h
./include/postgresql/server/access/ustore/knl_uundovec.h
./include/postgresql/server/access/ustore/knl_uundorecord.h
./include/postgresql/server/access/ustore/undo/knl_uundoxlog.h
./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/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
./jre/ASSEMBLY_EXCEPTION
./jre/bin/java
./jre/bin/jjs
@ -1423,8 +1433,6 @@
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R002C00
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1436,9 +1444,6 @@ V500R002C00
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h

View File

@ -198,18 +198,15 @@ ENDMACRO(CHECK_CC_ENABLE)
function(GET_VERSIONSTR_FROMGIT ret)
set(PG_VERSION "9.2.4")
set(OPENGAUSS_VERSION "2.1.0")
execute_process(
COMMAND ${CMAKE_SOURCE_DIR}/${openGauss}/cmake/src/buildfunction.sh --d ${PROJECT_TRUNK_DIR} OUTPUT_VARIABLE KERNEL_VERSION_STR)
set(OPENGAUSS_VERSION "3.0.0")
execute_process(
COMMAND ${CMAKE_SOURCE_DIR}/${openGauss}/cmake/src/buildfunction.sh --s ${PROJECT_TRUNK_DIR} OUTPUT_VARIABLE GS_VERSION_STR)
set(PG_VERSION "${PG_VERSION}" PARENT_SCOPE)
set(${ret} "${GS_VERSION_STR}" PARENT_SCOPE)
set(OPENGAUSS_VERSION_NUM_STR, "${OPENGAUSS_VERSION}" PARENT_SCOPE)
if(NOT ${ENABLE_MULTIPLE_NODES}_${ENABLE_PRIVATEGAUSS} STREQUAL OFF_OFF)
set(${ret} "${KERNEL_VERSION_STR}" PARENT_SCOPE)
set(PG_VERSION_STR "openGauss ${OPENGAUSS_VERSION} ${KERNEL_VERSION_STR}")
set(PG_VERSION_STR "openGauss ${OPENGAUSS_VERSION} ${GS_VERSION_STR}")
else()
set(${ret} "${GS_VERSION_STR}" PARENT_SCOPE)
set(PG_VERSION_STR "${GS_VERSION_STR}")
endif()
set(PG_VERSION_STR "${PG_VERSION_STR}" PARENT_SCOPE)

View File

@ -49,6 +49,7 @@ option(ENABLE_LCOV "enable lcov, the old is --enable-lcov" OFF)
# new add
option(ENABLE_MULTIPLE_NODES "enable distribute,the old is --enable-multiple-nodes" OFF)
option(ENABLE_PRIVATEGAUSS "enable privategauss,the old is --enable-pribategauss" OFF)
option(ENABLE_LITE_MODE "enable lite in single_node mode,the old is --enable-lite-mode" OFF)
option(ENABLE_DEBUG "enable privategauss,the old is --enable-pribategauss" OFF)
option(ENABLE_MOT "enable mot in single_node mode,the old is --enable-mot" OFF)
option(ENABLE_MYSQL_FDW "enable export or import data with mysql,the old is --enable-mysql-fdw" OFF)
@ -125,6 +126,12 @@ if(${BUILD_TUPLE} STREQUAL "aarch64")
endif()
endif()
if(${ENABLE_LITE_MODE} STREQUAL "ON")
set(ENABLE_LLVM_COMPILE OFF)
set(ENABLE_GSS OFF)
set(KRB5 OFF)
endif()
set(PROTECT_OPTIONS -fwrapv -std=c++14 -fnon-call-exceptions ${OPTIMIZE_LEVEL})
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)
@ -237,8 +244,8 @@ add_definitions(-Wno-builtin-macro-redefined)
SET_GCC_FLAGS(DB_COMMON_FLAGS "")
#hotpatch
set(HOTPATCH_PLATFORM_LIST suse11_sp1_x86_64 euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 euleros2.0_sp2_x86_64 euleros2.0_sp5_x86_64 kylinv10_sp1_aarch64 kylinv10_sp1_x86_64_intel)
set(HOTPATCH_ARM_LIST euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 kylinv10_sp1_aarch64)
set(HOTPATCH_PLATFORM_LIST suse11_sp1_x86_64 suse12_sp5_x86_64 euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 euleros2.0_sp10_aarch64 euleros2.0_sp2_x86_64 euleros2.0_sp5_x86_64 euleros2.0_sp10_x86_64 kylinv10_sp1_aarch64 kylinv10_sp1_x86_64_intel)
set(HOTPATCH_ARM_LIST euleros2.0_sp8_aarch64 euleros2.0_sp9_aarch64 euleros2.0_sp10_aarch64 kylinv10_sp1_aarch64)
list(FIND HOTPATCH_PLATFORM_LIST "${PLAT_FORM_NAME}" RET_HOTPATCH)
list(FIND HOTPATCH_ARM_LIST "${PLAT_FORM_NAME}" RET_ARM_HOTPATCH)
if(NOT ${ENABLE_MULTIPLE_NODES}_${ENABLE_PRIVATEGAUSS} STREQUAL OFF_OFF)
@ -246,11 +253,7 @@ if(NOT ${ENABLE_MULTIPLE_NODES}_${ENABLE_PRIVATEGAUSS} STREQUAL OFF_OFF)
if("${GCC_VERSION}" STREQUAL "7.3.0")
set(SUPPORT_HOTPATCH "yes")
if(NOT ${RET_ARM_HOTPATCH} EQUAL -1)
if("$ENV{DEBUG_TYPE}" STREQUAL "debug")
set(HOTPATCH_ATOMIC_LDS -Wl,-T${LIBHOTPATCH_TOOL_PATH}/atomic_debug.lds)
else()
set(HOTPATCH_ATOMIC_LDS -Wl,-T${LIBHOTPATCH_TOOL_PATH}/atomic.lds)
endif()
set(HOTPATCH_ATOMIC_LDS -Wl,-T${LIBHOTPATCH_TOOL_PATH}/atomic.lds)
endif()
else()
set(SUPPORT_HOTPATCH "no")
@ -262,11 +265,17 @@ else()
set(SUPPORT_HOTPATCH "no")
endif()
# 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})
list(GET LLVM_VERSION_LIST 0 LLVM_MAJOR_VERSION)
list(GET LLVM_VERSION_LIST 1 LLVM_MINOR_VERSION)
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})
list(GET LLVM_VERSION_LIST 0 LLVM_MAJOR_VERSION)
list(GET LLVM_VERSION_LIST 1 LLVM_MINOR_VERSION)
endif()
if(${NO_CHECK_CONFIG})
string(SUBSTRING "${BUILD_TUPLE}" 0 6 BUILD_HOST_PLATFORM)
@ -305,6 +314,9 @@ SET(EC_CONFIG_IN_FILE ecpg_config.h.in)
build_mppdb_config_paths_h(PG_CONFIG_PATH_H)
configure_file(${openGauss}/cmake/src/config-in/${CONFIG_IN_FILE} ${CMAKE_BINARY_DIR}/pg_config.h @ONLY)
configure_file(${openGauss}/cmake/src/config-in/${EC_CONFIG_IN_FILE} ${CMAKE_BINARY_DIR}/ecpg_config.h @ONLY)
#set host_cpu for pgxs.mk
set(HOST_CPU ${BUILD_TUPLE})
configure_file(${openGauss}/src/makefiles/pgxs.mk ${CMAKE_BINARY_DIR}/${openGauss}/src/makefiles/pgxs.mk @ONLY)
SET(PROJECT_INCLUDE_DIR ${PROJECT_INCLUDE_DIR} ${CMAKE_BINARY_DIR})
#
@ -312,3 +324,6 @@ if("${ENABLE_MULTIPLE_NODES}" STREQUAL "ON" AND "${ENABLE_MOT}" STREQUAL "ON")
message(FATAL_ERROR "error: --enable-mot option is not supported with --enable-multiple-nodes option")
endif()
if("${ENABLE_MULTIPLE_NODES}" STREQUAL "ON" AND "${ENABLE_LITE_MODE}" STREQUAL "ON")
message(FATAL_ERROR "error: --enable-lite-mode option is not supported with --enable-multiple-nodes option")
endif()

View File

@ -114,34 +114,17 @@ function get_gs_version()
commits=$(git log | grep "See merge request" | wc -l)
mrid=$(git log | grep "See merge request" | head -1 | awk -F! '{print $2}' | grep -o '[0-9]\+')
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 test "$enable_ccache" = yes; then
default_gs_version="(openGauss 2.0.0 build 1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
default_gs_version="(${product} ${version} build 1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
else
date_time=$(date -d today +"%Y-%m-%d %H:%M:%S")
default_gs_version="(openGauss 2.1.0 build $csv_version) compiled at $date_time commit $commits last mr $mrid $debug_str"
default_gs_version="(${product} ${version} build ${csv_version}) compiled at $date_time commit $commits last mr $mrid $debug_str"
fi
printf "${default_gs_version}"
}
function get_kernel_version()
{
cd $1
csv_version=$(git log | grep commit | head -1 | awk '{print $2}' | cut -b 1-8)
commits=$(git log | grep "See merge request" | wc -l)
mrid=$(git log | grep "See merge request" | head -1 | awk -F! '{print $2}' | grep -o '[0-9]\+')
debug_str="$DEBUG_TYPE"
product=$(cat build/script/gauss.spec | grep 'PRODUCT' | awk -F "=" '{print $2}')
version=$(cat build/script/gauss.spec | grep 'VERSION' | awk -F "=" '{print $2}')
if test "$enable_ccache" = yes; then
default_kernel_version="(GaussDB Kernel V500R002C00 build 1f1f1f1f1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
else
date_time=$(date -d today +"%Y-%m-%d %H:%M:%S")
default_kernel_version="($product $version build $csv_version) compiled at $date_time commit $commits last mr $mrid $debug_str"
fi
printf "${default_kernel_version}"
}
function get_time_for_roach()
{
tmp=$(date +'%d %b %Y %H:%M:%S')
@ -166,8 +149,6 @@ case "${DO_CMD}" in
create_conversionfile ;;
--create_snowballfile|snowball)
create_snowballfile ;;
--get_kernel_versionstr|--d)
get_kernel_version "$2";;
--get_gs_versionstr|--s)
get_gs_version "$2";;
--get_time_for_roach)

View File

@ -714,7 +714,7 @@
#define PGXC_VERSION_NUM
/* openGauss version as a number string */
#define OPENGAUSS_VERSION_NUM_STR "2.1.0"
#define OPENGAUSS_VERSION_NUM_STR "3.0.0"
/* A string containing the version number, platform, and C compiler */
#define PG_VERSION_STR "@PG_VERSION_STR@"
@ -913,6 +913,10 @@
* * (--enable-privategauss) */
#cmakedefine ENABLE_PRIVATEGAUSS
/* Define to 1 if you want to generate gauss product as lite mode.
* * (--enable-lite-mode) */
#cmakedefine ENABLE_LITE_MODE
/* Define to 1 if you want to use mot
* --enable-mot */
#cmakedefine ENABLE_MOT
@ -931,3 +935,7 @@
/* Define to on if you want to collect USTORE statistics */
#cmakedefine DEBUG_UHEAP
/* Define to 1 if you want to build opengauss rpm package on openeuler os.
* (--with-openeuler-os) */
#cmakedefine WITH_OPENEULER_OS

View File

@ -695,7 +695,7 @@
#define PG_VERSION "9.2.4"
/* openGauss version as a string */
#define OPENGAUSS_VERSION "2.1.0"
#define OPENGAUSS_VERSION "3.0.0"
/* Gaussdb version as a string*/
#define DEF_GS_VERSION "(GaussDB A 8.0.0 build 21f07aff) compiled at 2020-03-17 10:59:07 commit 7431 last mr 12039 debug"
@ -903,5 +903,4 @@
* code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */
#define ENABLE_LLVM_COMPILE 1

View File

@ -3,6 +3,7 @@ set(3RD_PATH $ENV{THIRD_BIN_PATH})
set(VERSION_TYPE $ENV{DEBUG_TYPE})
option(ENABLE_LLT "enable llt, current value is --enable-llt" OFF)
option(ENABLE_UT "enable ut, current value is --enable-ut" OFF)
option(WITH_OPENEULER_OS "Build openGauss rpm package on openEuler os" OFF)
execute_process(COMMAND sh ${PROJECT_SRC_DIR}/get_PlatForm_str.sh OUTPUT_VARIABLE PLAT_FORM_STR OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -13,7 +14,7 @@ execute_process(COMMAND sh ${PROJECT_SRC_DIR}/get_PlatForm_str.sh OUTPUT_VARIABL
# $(LIB_SUPPORT_LLT)
# 2. Huawei_Secure_C, gtest, mockcpp, unixodbc, libstd
# and openssl not support parameter --enable-llt and --enable-ut;
# $(LIB_NOT_SUPPORT_LLT)
# $(LIB_UNIFIED_SUPPORT)
#############################################################################
set(SUPPORT_LLT "")
set(JEMALLOC_SUPPORT_LLT "")
@ -34,7 +35,7 @@ else()
set(HOST_TUPLE aarch64-unknown-linux-gnu)
endif()
set(LIB_NOT_SUPPORT_LLT comm)
set(LIB_UNIFIED_SUPPORT comm)
set(MEMCHECK_BUILD_TYPE debug)
set(DEPENDENCY_PATH ${3RD_PATH}/dependency/${PLAT_FORM_STR})
set(PLATFORM_PATH ${3RD_PATH}/platform/${PLAT_FORM_STR})
@ -43,50 +44,55 @@ set(COMPONENT_PATH ${3RD_PATH}/component/${PLAT_FORM_STR})
set(MEMCHECK_HOME ${DEPENDENCY_PATH}/memcheck/${MEMCHECK_BUILD_TYPE})
set(CJSON_HOME ${DEPENDENCY_PATH}/cjson/${SUPPORT_LLT})
set(ETCD_HOME ${DEPENDENCY_PATH}/etcd/${LIB_NOT_SUPPORT_LLT})
set(EVENT_HOME ${DEPENDENCY_PATH}/event/${LIB_NOT_SUPPORT_LLT})
set(ETCD_HOME ${DEPENDENCY_PATH}/etcd/${LIB_UNIFIED_SUPPORT})
set(EVENT_HOME ${DEPENDENCY_PATH}/event/${LIB_UNIFIED_SUPPORT})
set(FIO_HOME ${DEPENDENCY_PATH}/fio/${SUPPORT_LLT})
set(IPERF_HOME ${DEPENDENCY_PATH}/iperf/${LIB_NOT_SUPPORT_LLT})
set(IPERF_HOME ${DEPENDENCY_PATH}/iperf/${LIB_UNIFIED_SUPPORT})
if("${VERSION_TYPE}" STREQUAL "debug" OR "${VERSION_TYPE}" STREQUAL "memcheck")
set(JEMALLOC_HOME ${DEPENDENCY_PATH}/jemalloc/debug${JEMALLOC_SUPPORT_LLT})
else()
set(JEMALLOC_HOME ${DEPENDENCY_PATH}/jemalloc/${VERSION_TYPE}${JEMALLOC_SUPPORT_LLT})
endif()
set(KERBEROS_HOME ${DEPENDENCY_PATH}/kerberos/${SUPPORT_LLT})
set(KMC_HOME ${PLATFORM_PATH}/kmc/${LIB_NOT_SUPPORT_LLT})
set(KMC_HOME ${PLATFORM_PATH}/kmc/${LIB_UNIFIED_SUPPORT})
set(CGROUP_HOME ${DEPENDENCY_PATH}/libcgroup/${SUPPORT_LLT})
set(CURL_HOME ${DEPENDENCY_PATH}/libcurl/${SUPPORT_LLT})
set(EDIT_HOME ${DEPENDENCY_PATH}/libedit/${SUPPORT_LLT})
set(OBS_HOME ${DEPENDENCY_PATH}/libobs/${LIB_NOT_SUPPORT_LLT})
set(OBS_HOME ${DEPENDENCY_PATH}/libobs/${LIB_UNIFIED_SUPPORT})
set(ORC_HOME ${DEPENDENCY_PATH}/liborc/${SUPPORT_LLT})
set(PARQUET_HOME ${DEPENDENCY_PATH}/libparquet/${SUPPORT_LLT})
set(XML2_HOME ${DEPENDENCY_PATH}/libxml2/${SUPPORT_LLT})
set(LLVM_HOME ${DEPENDENCY_PATH}/llvm/${LIB_NOT_SUPPORT_LLT})
set(LLVM_HOME ${DEPENDENCY_PATH}/llvm/${LIB_UNIFIED_SUPPORT})
set(LZ4_HOME ${DEPENDENCY_PATH}/lz4/${SUPPORT_LLT})
set(NANOMSG_HOME ${DEPENDENCY_PATH}/nanomsg/${LIB_NOT_SUPPORT_LLT})
set(NANOMSG_HOME ${DEPENDENCY_PATH}/nanomsg/${LIB_UNIFIED_SUPPORT})
set(NCURSES_HOME ${DEPENDENCY_PATH}/ncurses/${SUPPORT_LLT})
set(OPENSSL_HOME ${DEPENDENCY_PATH}/openssl/${LIB_NOT_SUPPORT_LLT})
set(PLJAVA_HOME ${DEPENDENCY_PATH}/pljava/${LIB_NOT_SUPPORT_LLT})
set(JAVA_HOME ${3RD_PATH}/platform/openjdk8/${BUILD_TUPLE}/jdk)
set(OPENSSL_HOME ${DEPENDENCY_PATH}/openssl/${LIB_UNIFIED_SUPPORT})
set(PLJAVA_HOME ${DEPENDENCY_PATH}/pljava/${LIB_UNIFIED_SUPPORT})
if (EXISTS "${3RD_PATH}/platform/openjdk8/${BUILD_TUPLE}/jdk")
set(JAVA_HOME ${3RD_PATH}/platform/openjdk8/${BUILD_TUPLE}/jdk)
else()
set(JAVA_HOME ${3RD_PATH}/platform/huaweijdk8/${BUILD_TUPLE}/jdk)
endif()
set(PROTOBUF_HOME ${DEPENDENCY_PATH}/protobuf/${SUPPORT_LLT})
set(THRIFT_HOME ${DEPENDENCY_PATH}/thrift)
set(SNAPPY_HOME ${DEPENDENCY_PATH}/snappy/${SUPPORT_LLT})
set(SNAPPY_HOME ${DEPENDENCY_PATH}/snappy/${LIB_UNIFIED_SUPPORT})
set(ZLIB_HOME ${DEPENDENCY_PATH}/zlib1.2.11/${SUPPORT_LLT})
set(XGBOOST_HOME ${DEPENDENCY_PATH}/xgboost/${SUPPORT_LLT})
set(ZSTD_HOME ${DEPENDENCY_PATH}/zstd)
set(LICENSE_HOME ${PLATFORM_PATH}/AdaptiveLM_C_V100R005C01SPC002/${SUPPORT_LLT})
set(HOTPATCH_HOME ${PLATFORM_PATH}/hotpatch)
set(SECURE_HOME ${PLATFORM_PATH}/Huawei_Secure_C/${LIB_NOT_SUPPORT_LLT})
set(SECURE_HOME ${PLATFORM_PATH}/Huawei_Secure_C/${LIB_UNIFIED_SUPPORT})
set(DCF_HOME ${COMPONENT_PATH}/dcf)
set(MOCKCPP_HOME ${BUILDTOOLS_PATH}/mockcpp/${LIB_NOT_SUPPORT_LLT})
set(GTEST_HOME ${BUILDTOOLS_PATH}/gtest/${LIB_NOT_SUPPORT_LLT})
set(LIBSTD_HOME ${BUILDTOOLS_PATH}/gcc${GCC_VERSION_LIT}/${LIB_NOT_SUPPORT_LLT})
set(MASSTREE_HOME ${BUILDTOOLS_PATH}/masstree/${LIB_NOT_SUPPORT_LLT})
set(MOCKCPP_HOME ${BUILDTOOLS_PATH}/mockcpp/${LIB_UNIFIED_SUPPORT})
set(GTEST_HOME ${BUILDTOOLS_PATH}/gtest/${LIB_UNIFIED_SUPPORT})
set(LIBSTD_HOME ${BUILDTOOLS_PATH}/gcc${GCC_VERSION_LIT}/${LIB_UNIFIED_SUPPORT})
set(MASSTREE_HOME ${BUILDTOOLS_PATH}/masstree/${LIB_UNIFIED_SUPPORT})
set(NUMA_HOME ${DEPENDENCY_PATH}/numactl/${SUPPORT_LLT})
set(ARROW_HOME ${DEPENDENCY_PATH}/libparquet/${SUPPORT_LLT})
set(BOOST_HOME ${DEPENDENCY_PATH}/boost/${SUPPORT_LLT})
set(ODBC_HOME ${3RD_PATH}/dependency/${PLAT_FORM_STR}/unixodbc)
set(MASSTREE_HOME ${DEPENDENCY_PATH}/masstree/${LIB_NOT_SUPPORT_LLT})
set(MASSTREE_HOME ${DEPENDENCY_PATH}/masstree/${LIB_UNIFIED_SUPPORT})
set(LCOV_HOME ${BUILDTOOLS_PATH}/gcc${GCC_VERSION_LIT}/gcc/lib/gcc/${HOST_TUPLE})
#############################################################################
@ -155,6 +161,12 @@ else()
endif()
endif()
if(${WITH_OPENEULER_OS} STREQUAL "ON")
set(SECURE_C_CHECK boundscheck)
else()
set(SECURE_C_CHECK securec)
endif()
#############################################################################
# kerberos component
#############################################################################
@ -251,15 +263,6 @@ set(LIBOPENSSL_INCLUDE_PATH ${OPENSSL_HOME}/include)
#############################################################################
set(PROTOBUF_INCLUDE_PATH ${PROTOBUF_HOME}/include)
set(PROTOBUF_LIB_PATH ${PROTOBUF_HOME}/lib)
if(${ENABLE_LLT} STREQUAL "ON")
set(PROTOBUF_LIB_NAME protobuf_pic)
else()
if("${ENABLE_UT}" STREQUAL "ON")
set(PROTOBUF_LIB_NAME protobuf_pic)
else()
set(PROTOBUF_LIB_NAME protobuf)
endif()
endif()
#############################################################################
# thrift component
@ -273,15 +276,6 @@ set(LIBTHRIFT_BIN_PATH ${THRIFT_HOME}/bin)
#############################################################################
set(SNAPPY_INCLUDE_PATH ${SNAPPY_HOME}/include)
set(SNAPPY_LIB_PATH ${SNAPPY_HOME}/lib)
if(${ENABLE_LLT} STREQUAL "ON")
set(SNAPPY_LIB_NAME snappy_pic)
else()
if("${ENABLE_UT}" STREQUAL "ON")
set(SNAPPY_LIB_NAME snappy_pic)
else()
set(SNAPPY_LIB_NAME snappy)
endif()
endif()
#############################################################################
# zlib component
@ -289,6 +283,12 @@ endif()
set(ZLIB_INCLUDE_PATH ${ZLIB_HOME}/include)
set(ZLIB_LIB_PATH ${ZLIB_HOME}/lib)
#############################################################################
# xgboost component
#############################################################################
set(XGBOOST_INCLUDE_PATH ${XGBOOST_HOME}/include)
set(XGBOOST_LIB_PATH ${XGBOOST_HOME}/lib64)
#############################################################################
# zstd component
#############################################################################
@ -360,3 +360,15 @@ set(MOCKCPP_3RDPARTY_PATH ${MOCKCPP_HOME}/3rdparty)
set(MASSTREE_INCLUDE_PATH ${MASSTREE_HOME}/include)
set(MASSTREE_LIB_PATH ${MASSTREE_HOME}/lib)
############################################################################
# gtest component
############################################################################
set(GTEST_INCLUDE_PATH ${GTEST_HOME}/include)
set(GTEST_LIB_PATH ${GTEST_HOME}/lib)
############################################################################
# mockcpp component
############################################################################
set(MOCKCPP_INCLUDE_PATH ${MOCKCPP_HOME}/include)
set(MOCKCPP_LIB_PATH ${MOCKCPP_HOME}/lib)
set(MOCKCPP_3RDPARTY_PATH ${MOCKCPP_HOME}/3rdparty)

177
configure vendored
View File

@ -708,6 +708,7 @@ with_ossp_uuid
with_selinux
krb_srvtab
with_python
with_openeuler_os
enable_thread_safety
INCLUDES
TAS
@ -741,12 +742,15 @@ enable_llt
enable_llvm
llvm_major_version
llvm_minor_version
flex_major_version
flex_minor_version
enable_ut
enable_qunit
enable_jemalloc
enable_jemalloc_debug
enable_privategauss
enable_multiple_nodes
enable_lite_mode
enable_mot
enable_memory_check
enable_mysql_fdw
@ -754,7 +758,6 @@ enable_oracle_fdw
enable_thread_check
enable_shared
default_gs_version
default_kernel_version
default_port
WANTED_LANGUAGES
enable_nls
@ -824,12 +827,14 @@ enable_integer_datetimes
enable_nls
with_pgport
with_gs_version
with_openeuler_os
enable_shared
enable_rpath
enable_jemalloc
enable_jemalloc_debug
enable_privategauss
enable_multiple_nodes
enable_lite_mode
enable_mot
enable_memory_check
enable_mysql_fdw
@ -1311,6 +1316,11 @@ Try \`$0 --help' for more information." >&2
esac
done
# if compile with_openeuler_os. it should use gcc on os.
if test "${with_openeuler_os+set}" = set; then
gcc_version=$(gcc --version | sed q | awk -F')' '{print $2}' | awk '{print $1}')
fi
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
{ $as_echo "$as_me: error: missing argument to $ac_option" >&2
@ -1549,6 +1559,7 @@ Optional Features:
--disable-float4-byval disable float4 passed by value
--disable-float8-byval disable float8 passed by value
--enable-ccache build with ccache reducing compile time
--enable-lite-mode generate the gauss product as lite mode
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -2184,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='2.1.0'
OPENGAUSS_VERSION='3.0.0'
cat >>confdefs.h <<_ACEOF
#define PG_VERSION "$PACKAGE_VERSION"
@ -2655,8 +2666,8 @@ $as_echo "$as_me: error: argument required for --with-gs-version option" >&2;}
esac
else
product=$(cat build/script/gauss.spec | grep 'PRODUCT' | awk -F "=" '{print $2}')
version=$(cat build/script/gauss.spec | grep 'VERSION' | awk -F "=" '{print $2}')
product=$(cat build/script/gaussdb.ver | grep 'PRODUCT' | awk -F "=" '{print $2}')
version=$(cat build/script/gaussdb.ver | grep 'VERSION' | awk -F "=" '{print $2}')
gitversion=$(git log 2>/dev/null | grep commit | head -1 | awk '{print $2}' | cut -b 1-8)
commits=$(git log 2>/dev/null | grep "See in merge request" | wc -l)
debug_str=""
@ -2666,11 +2677,9 @@ else
fi
if test "$enable_ccache" = yes; then
default_gs_version="(openGauss 2.1.0 build 1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
default_kernel_version="(GaussDB Kernel V500R002C00 build 1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
default_gs_version="($product $version build 1f1f1f1f) compiled at 2100-00-00 00:00:00 commit 9999 last mr 9999 debug"
else
default_gs_version="($product $version build $gitversion) compiled at `date -d today +\"%Y-%m-%d %H:%M:%S\"` commit $commits last mr $mrid $debug_str"
default_kernel_version="($product $version build $gitversion) compiled at `date -d today +\"%Y-%m-%d %H:%M:%S\"` commit $commits last mr $mrid $debug_str"
fi
fi
@ -2679,7 +2688,7 @@ fi
$as_echo "$default_gs_version" >&6; }
cat >>confdefs.h <<_ACEOF
#define DEF_GS_VERSION "${default_kernel_version}"
#define DEF_GS_VERSION "${default_gs_version}"
_ACEOF
@ -2876,14 +2885,6 @@ if test "${enable_mot+set}" = set; then
$as_echo "$as_me: error: --enable-mot option is not supported with --enable-multiple-nodes option" >&2;}
{ (exit 1); exit 1; }; }
fi
if test "$enable_llvm" = no; then
{ { $as_echo "$as_me:$LINENO: error: --enable-mot option is not supported with --disable-llvm option" >&5
$as_echo "$as_me: error: --enable-mot option is not supported with --disable-llvm option" >&2;}
{ (exit 1); exit 1; }; }
fi
;;
no)
@ -3185,6 +3186,91 @@ else
fi
#
# --enable-lite-mode enables
#
# Check whether --enable-lite-mode was given.
if test "${enable_lite_mode+set}" = set; then
enableval=$enable_lite_mode;
case $enableval in
yes)
if test "$enable_multiple_nodes" = yes; then
{ { $as_echo "$as_me:$LINENO: error: --enable-lite-mode option is not supported with --enable-multiple-nodes option" >&5
$as_echo "$as_me: error: --enable-lite-mode option is not supported with --enable-multiple-nodes option" >&2;}
{ (exit 1); exit 1; }; }
fi
;;
no)
:
;;
*)
{ { $as_echo "$as_me:$LINENO: error: no argument expected for --enable-lite-mode option" >&5
$as_echo "$as_me: error: no argument expected for --enable-lite-mode option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
enable_lite_mode=no
fi
if test "$enable_multiple_nodes" = yes; then
enable_lite_mode=no
fi
if test "$enable_lite_mode" = yes; then
cat >>confdefs.h <<\_ACEOF
#define ENABLE_LITE_MODE 1
_ACEOF
fi
#
# --with-openeuler-os enable
#
# Check whether --with-openeuler-os was given.
if test "${with_openeuler_os+set}" = set; then
enableval=$with_openeuler_os;
case $enableval in
yes)
if test "$enable_multiple_nodes" = yes; then
{ { $as_echo "$as_me:$LINENO: error: --with-openeuler-os option is not supported with --enable-multiple-nodes option" >&5
$as_echo "$as_me: error: --with-openeuler-os option is not supported with --enable-multiple-nodes option" >&2;}
{ (exit 1); exit 1; }; }
fi
;;
no)
:
;;
*)
{ { $as_echo "$as_me:$LINENO: error: no argument expected for --with-openeuler-os option" >&5
$as_echo "$as_me: error: no argument expected for --with-openeuler-os option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
with_openeuler_os=no
fi
if test "$enable_multiple_nodes" = yes; then
with_openeuler_os=no
fi
if test "$with_openeuler_os" = yes; then
cat >>confdefs.h <<\_ACEOF
#define WITH_OPENEULER_OS 1
_ACEOF
fi
#
@ -5771,10 +5857,14 @@ if test "${enable_llvm+set}" = set; then
case $enableval in
yes)
if test "$enable_lite_mode" = yes; then
{ $as_echo "$as_me:$LINENO: enable_lite_mode is open, llvm will close" >&5
$as_echo "$as_me: enable_lite_mode is open, llvm will close" >&2;}
else
cat >>confdefs.h <<\_ACEOF
#define ENABLE_LLVM_COMPILE 1
_ACEOF
fi
;;
no)
:
@ -5786,16 +5876,20 @@ $as_echo "$as_me: error: no argument expected for --enable-llvm option" >&2;}
;;
esac
else
if test "$enable_lite_mode" = yes; then
{ $as_echo "$as_me:$LINENO: enable_lite_mode is open, llvm will close" >&5
$as_echo "$as_me: enable_lite_mode is open, llvm will close" >&2;}
else
cat >>confdefs.h <<\_ACEOF
#define ENABLE_LLVM_COMPILE 1
_ACEOF
enable_llvm=yes
fi
fi
llvm_version_str='10.0.0'
if [ ! -z "${with_3rdpartydir}" ]; then
if [[ ! -z "${with_3rdpartydir}" ]] && [[ "$enable_lite_mode" != yes ]]; then
platstr=$(sh src/get_PlatForm_str.sh)
llvm_version_str=`${with_3rdpartydir}/dependency/${platstr}/llvm/comm/bin/llvm-config --version`
fi
@ -6527,9 +6621,28 @@ fi
# JDK
#
with_jdk=''
if [ ! -z "${with_3rdpartydir}" ]; then
if [[ ! -z "${with_3rdpartydir}" ]] && [[ "$with_openeuler_os" != yes ]]; then
platstr=$(sh src/get_PlatForm_str.sh)
cpuarch=$(uname -m)
for d in "openjdk8" "huaweijdk8"; do
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/platform/${d}/${cpuarch}" >&5
if [ ! -d "${with_3rdpartydir}/platform/${d}/${cpuarch}" ]; then
$as_echo "$as_me:$LINENO: result: no" >&5
continue
fi
for d2 in $(ls "${with_3rdpartydir}/platform/${d}/${cpuarch}" | sort -r 2>/dev/null); do
if [ -f "${with_3rdpartydir}/platform/${d}/${cpuarch}/${d2}/jre/bin/java" ]; then
with_jdk="${with_3rdpartydir}/platform/${d}/${cpuarch}/${d2}"
break;
fi
done
if [ ! -z "$with_jdk" ]; then
$as_echo "$as_me:$LINENO: result: yes" >&5
break;
fi
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/platform/${platstr}/${d}" >&5
if [ ! -d "${with_3rdpartydir}/platform/${platstr}/${d}" ]; then
$as_echo "$as_me:$LINENO: result: no" >&5
@ -7803,6 +7916,14 @@ else
pgac_flex_version=`$FLEX --version 2>/dev/null`
{ $as_echo "$as_me:$LINENO: using $pgac_flex_version" >&5
$as_echo "$as_me: using $pgac_flex_version" >&6;}
flex_major_version=$(echo $pgac_flex_version | awk '{print $2}' | awk -F "." '{print $1}')
flex_minor_version=$(echo $pgac_flex_version | awk '{print $2}' | awk -F "." '{print $2}')
cat >>confdefs.h <<_ACEOF
#define FLEX_MAJOR_VERSION $flex_major_version
#define FLEX_MINOR_VERSION $flex_minor_version
_ACEOF
fi
@ -9239,7 +9360,7 @@ $as_echo "$as_me: WARNING:
*** Not using spinlocks will cause poor performance." >&2;}
fi
if test "$with_gssapi" = no ; then
if test "$with_gssapi_" = no ; then
if test "$PORTNAME" != "win32"; then
{ $as_echo "$as_me:$LINENO: checking for library containing gss_init_sec_context" >&5
$as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
@ -12533,7 +12654,7 @@ fi
fi
if test "$with_gssapi" = no ; then
if test "$with_gssapi_" = no ; then
for ac_header in gssapi/gssapi.h
do
@ -29668,7 +29789,7 @@ fi
if test "$enable_multiple_nodes" = yes; then
cat >>confdefs.h <<_ACEOF
#define PG_VERSION_STR "openGauss $OPENGAUSS_VERSION ${default_kernel_version} on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
#define PG_VERSION_STR "openGauss $OPENGAUSS_VERSION ${default_gs_version} on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
_ACEOF
else
cat >>confdefs.h <<_ACEOF
@ -31137,8 +31258,10 @@ find src/gausskernel/ -name "*.y" | sort >> ./ereport.txt
find src/common/backend -name "*.cpp" | sort >> ./ereport.txt
find src/gausskernel/ -name "*.cpp" | sort >> ./ereport.txt
if [[ "$enable_multiple_nodes" != no ]] || [[ "$enable_privategauss" != no ]]; then
find ../distribute/cm -name "*.l" | sort > ./cm_ereport.txt
find ../distribute/cm -name "*.y" | sort >> ./cm_ereport.txt
find ../distribute/cm -name "*.cpp" | sort >> ./cm_ereport.txt
if [[ "$enable_lite_mode" != yes ]]; then
if [[ "$enable_multiple_nodes" != no ]] || [[ "$enable_privategauss" != no ]]; then
find ../distribute/cm -name "*.l" | sort > ./cm_ereport.txt
find ../distribute/cm -name "*.y" | sort >> ./cm_ereport.txt
find ../distribute/cm -name "*.cpp" | sort >> ./cm_ereport.txt
fi
fi

3
contrib/.gitignore vendored
View File

@ -21,3 +21,6 @@
/pg_xlogdump/xlogdesc.cpp
/pg_xlogdump/xlogreader.cpp
/pg_xlogdump/xlogreader_common.cpp
/pg_xlogdump/segpagedesc.cpp
/pg_xlogdump/uheapdesc.cpp
/pg_xlogdump/undologdesc.cpp

View File

@ -12,6 +12,7 @@ set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/hstore
${CMAKE_CURRENT_SOURCE_DIR}/test_decoding
${CMAKE_CURRENT_SOURCE_DIR}/mppdb_decoding
${CMAKE_CURRENT_SOURCE_DIR}/sql_decoding
${CMAKE_CURRENT_SOURCE_DIR}/spi
${CMAKE_CURRENT_SOURCE_DIR}/pg_upgrade_support
${CMAKE_CURRENT_SOURCE_DIR}/postgres_fdw
@ -28,6 +29,7 @@ set(CMAKE_MODULE_PATH
add_subdirectory(hstore)
add_subdirectory(test_decoding)
add_subdirectory(mppdb_decoding)
add_subdirectory(sql_decoding)
add_subdirectory(spi)
if("${ENABLE_MULTIPLE_NODES}" STREQUAL "ON" OR "${ENABLE_PRIVATEGAUSS}" STREQUAL "ON")
add_subdirectory(pg_upgrade_support)

View File

@ -3,7 +3,7 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION file_fdw" to load this file. \quit
CREATE FUNCTION file_fdw_handler()
CREATE FUNCTION pg_catalog.file_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;

View File

@ -158,6 +158,14 @@ Datum file_fdw_handler(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(fdwroutine);
}
void check_file_fdw_permission()
{
if ((!initialuser()) && !(isOperatoradmin(GetUserId()) && u_sess->attr.attr_security.operation_mode)) {
ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("Dist fdw are only available for the supper user and Operatoradmin")));
}
}
/*
* Validate the generic options given to a FOREIGN DATA WRAPPER, SERVER,
* USER MAPPING or FOREIGN TABLE that uses file_fdw.
@ -173,6 +181,7 @@ Datum file_fdw_validator(PG_FUNCTION_ARGS)
List* other_options = NIL;
ListCell* cell = NULL;
check_file_fdw_permission();
if (catalog == UserMappingRelationId) {
ereport(
ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("file_fdw doesn't support in USER MAPPING.")));
@ -192,9 +201,8 @@ Datum file_fdw_validator(PG_FUNCTION_ARGS)
* security hole.
*/
if (catalog == ForeignTableRelationId && !superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("only superuser can change options of a file_fdw foreign table")));
ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("only superuser can change options of a file_fdw foreign table")));
/*
* Check that only options supported by file_fdw, and allowed for the
@ -242,7 +250,8 @@ Datum file_fdw_validator(PG_FUNCTION_ARGS)
} else if (strcmp(def->defname, "format") == 0) {
char* fmt = defGetString(def);
if (strcasecmp(fmt, "fixed") == 0) {
ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("file_fdw doesn't support fixed option in format")));
ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("file_fdw doesn't support fixed option in format")));
}
other_options = lappend(other_options, def);
} else {

View File

@ -57,7 +57,18 @@ CREATE FOREIGN TABLE tbl (a int) SERVER file_server OPTIONS (format 'csv', delim
CREATE FOREIGN TABLE tbl (a int) SERVER file_server OPTIONS (format 'csv', null '
'); -- ERROR
CREATE FOREIGN TABLE tbl (a int) SERVER file_server; -- ERROR
CREATE FOREIGN TABLE tbl (a int2,b float4) SERVER file_server OPTIONS (format 'text', filename '', delimiter ' ', null '\n'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '', format 'text'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '', format 'binary'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '', format 'csv'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '',format 'text', header 'false'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '',format 'binary', header 'off'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE agg_text (
a int2,
b float4

View File

@ -75,6 +75,18 @@ CREATE FOREIGN TABLE tbl (a int) SERVER file_server OPTIONS (format 'csv', null
ERROR: COPY null representation cannot use newline or carriage return
CREATE FOREIGN TABLE tbl (a int) SERVER file_server; -- ERROR
ERROR: filename is required for file_fdw foreign tables
CREATE FOREIGN TABLE tbl (a int2,b float4) SERVER file_server OPTIONS (format 'text', filename '', delimiter ' ', null '\n'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '', format 'text'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '', format 'binary'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '', format 'csv'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '',format 'text', header 'false'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE tbl (id int) SERVER file_server OPTIONS (filename '',format 'binary', header 'off'); -- SUCCESS
DROP FOREIGN TABLE tbl;
CREATE FOREIGN TABLE agg_text (
a int2,
b float4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,12 +3,12 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION gc_fdw" to load this file. \quit
CREATE FUNCTION gc_fdw_handler()
CREATE FUNCTION pg_catalog.gc_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;
CREATE FUNCTION gc_fdw_validator(text[], oid)
CREATE FUNCTION pg_catalog.gc_fdw_validator(text[], oid)
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;

View File

@ -3,12 +3,12 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION hdfs_fdw" to load this file. \quit
CREATE FUNCTION hdfs_fdw_handler()
CREATE FUNCTION pg_catalog.hdfs_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;
CREATE FUNCTION hdfs_fdw_validator(text[], oid)
CREATE FUNCTION pg_catalog.hdfs_fdw_validator(text[], oid)
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;

View File

@ -363,8 +363,12 @@ void serverOptionValidator(List* ServerOptionList)
*/
switch (serverType) {
case T_OBS_SERVER: {
#ifndef ENABLE_LITE_MODE
checkOptionNameValidity(ServerOptionList, OBS_SERVER_OPTION);
break;
#else
FEATURE_ON_LITE_MODE_NOT_SUPPORTED();
#endif
}
case T_HDFS_SERVER: {
FEATURE_NOT_PUBLIC_ERROR("HDFS is not yet supported.");
@ -405,6 +409,7 @@ void serverOptionValidator(List* ServerOptionList)
ServerOptionCheckSet(ServerOptionList, serverType, addressFound, cfgPathFound, akFound, sakFound,
encrypt, userNameFound, passWordFound, regionFound, hostName, ak, sk, regionStr);
#ifndef ENABLE_LITE_MODE
if (T_OBS_SERVER == serverType) {
if (addressFound && regionFound) {
ereport(ERROR,
@ -442,6 +447,8 @@ void serverOptionValidator(List* ServerOptionList)
checkOBSServerValidity(URL, ak, sk, encrypt);
}
}
#endif
if (T_HDFS_SERVER == serverType && !cfgPathFound) {
ereport(ERROR,
(errcode(ERRCODE_FDW_DYNAMIC_PARAMETER_VALUE_NEEDED),
@ -1434,6 +1441,7 @@ static void HdfsEndForeignScan(ForeignScanState* scanState)
}
}
#ifdef ENABLE_LLVM_COMPILE
/*
* LLVM optimization information should be shown. We check the query
* uses LLVM optimization or not.
@ -1502,6 +1510,7 @@ static void HdfsEndForeignScan(ForeignScanState* scanState)
}
}
}
#endif
/* clears all file related memory */
if (NULL != executionState->fileReader) {

View File

@ -716,7 +716,11 @@ List* CNSchedulingForAnalyze(unsigned int* totalFilesNum, unsigned int* numOfDns
if (isglbstats) {
if (IS_OBS_CSV_TXT_FOREIGN_TABLE(foreignTableId)) {
/* for dist obs foreign table.*/
#ifndef ENABLE_LITE_MODE
allTask = CNSchedulingForDistOBSFt(foreignTableId);
#else
FEATURE_ON_LITE_MODE_NOT_SUPPORTED();
#endif
} else {
if (rel_loc_info == NULL) {
ereport(ERROR,
@ -1676,7 +1680,7 @@ static List* GetAllFiles(
delete (conn);
conn = NULL;
ereport(ERROR,
(errcode(ERRCODE_FDW_INVALID_OPTOIN_DATA),
(errcode(ERRCODE_FDW_INVALID_OPTION_DATA),
errmodule(MOD_HDFS),
errmsg("The foldername option cannot be a file path.")));
}
@ -1691,7 +1695,7 @@ static List* GetAllFiles(
delete (conn);
conn = NULL;
ereport(ERROR,
(errcode(ERRCODE_FDW_INVALID_OPTOIN_DATA),
(errcode(ERRCODE_FDW_INVALID_OPTION_DATA),
errmodule(MOD_HDFS),
errmsg("The entries in the options fileNames must be file!")));
}
@ -1770,7 +1774,7 @@ static List* GetHdfsAllFiles(dfs::DFSConnector* conn, Oid foreignTableId, List*
delete (conn);
conn = NULL;
ereport(ERROR,
(errcode(ERRCODE_FDW_INVALID_OPTOIN_DATA),
(errcode(ERRCODE_FDW_INVALID_OPTION_DATA),
errmodule(MOD_HDFS),
errmsg("The foldername option cannot be a file path.")));
}
@ -1785,7 +1789,7 @@ static List* GetHdfsAllFiles(dfs::DFSConnector* conn, Oid foreignTableId, List*
delete (conn);
conn = NULL;
ereport(ERROR,
(errcode(ERRCODE_FDW_INVALID_OPTOIN_DATA),
(errcode(ERRCODE_FDW_INVALID_OPTION_DATA),
errmodule(MOD_HDFS),
errmsg("The entries in the options fileNames must be file!")));
}
@ -2203,7 +2207,7 @@ static bool PartitionFilterClause(SplitInfo* split, List* scanClauses, Var* valu
partValue = strchr(fileName, '=');
if (NULL == partValue) {
ereport(ERROR,
(errcode(ERRCODE_FDW_INVALID_OPTOIN_DATA),
(errcode(ERRCODE_FDW_INVALID_OPTION_DATA),
errmodule(MOD_HDFS),
errmsg("Something wrong with the partition directory name of file %s.", split->filePath)));
}

View File

@ -5,22 +5,22 @@
CREATE TYPE hstore;
CREATE FUNCTION hstore_in(cstring)
CREATE FUNCTION pg_catalog.hstore_in(cstring)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION hstore_out(hstore)
CREATE FUNCTION pg_catalog.hstore_out(hstore)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION hstore_recv(internal)
CREATE FUNCTION pg_catalog.hstore_recv(internal)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION hstore_send(hstore)
CREATE FUNCTION pg_catalog.hstore_send(hstore)
RETURNS bytea
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -34,12 +34,12 @@ CREATE TYPE hstore (
STORAGE = extended
);
CREATE FUNCTION hstore_version_diag(hstore)
CREATE FUNCTION pg_catalog.hstore_version_diag(hstore)
RETURNS integer
AS 'MODULE_PATHNAME','hstore_version_diag'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION fetchval(hstore,text)
CREATE FUNCTION pg_catalog.fetchval(hstore,text)
RETURNS text
AS 'MODULE_PATHNAME','hstore_fetchval'
LANGUAGE C STRICT IMMUTABLE;
@ -50,7 +50,7 @@ CREATE OPERATOR -> (
PROCEDURE = fetchval
);
CREATE FUNCTION slice_array(hstore,text[])
CREATE FUNCTION pg_catalog.slice_array(hstore,text[])
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_slice_to_array'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -61,17 +61,17 @@ CREATE OPERATOR -> (
PROCEDURE = slice_array
);
CREATE FUNCTION slice(hstore,text[])
CREATE FUNCTION pg_catalog.slice(hstore,text[])
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_slice_to_hstore'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION isexists(hstore,text)
CREATE FUNCTION pg_catalog.isexists(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION exist(hstore,text)
CREATE FUNCTION pg_catalog.exist(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -84,7 +84,7 @@ CREATE OPERATOR ? (
JOIN = contjoinsel
);
CREATE FUNCTION exists_any(hstore,text[])
CREATE FUNCTION pg_catalog.exists_any(hstore,text[])
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists_any'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -97,7 +97,7 @@ CREATE OPERATOR ?| (
JOIN = contjoinsel
);
CREATE FUNCTION exists_all(hstore,text[])
CREATE FUNCTION pg_catalog.exists_all(hstore,text[])
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists_all'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -110,27 +110,27 @@ CREATE OPERATOR ?& (
JOIN = contjoinsel
);
CREATE FUNCTION isdefined(hstore,text)
CREATE FUNCTION pg_catalog.isdefined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_defined'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION defined(hstore,text)
CREATE FUNCTION pg_catalog.defined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_defined'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION delete(hstore,text)
CREATE FUNCTION pg_catalog.delete(hstore,text)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_delete'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION delete(hstore,text[])
CREATE FUNCTION pg_catalog.delete(hstore,text[])
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_delete_array'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION delete(hstore,hstore)
CREATE FUNCTION pg_catalog.delete(hstore,hstore)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_delete_hstore'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -153,7 +153,7 @@ CREATE OPERATOR - (
PROCEDURE = delete
);
CREATE FUNCTION hs_concat(hstore,hstore)
CREATE FUNCTION pg_catalog.hs_concat(hstore,hstore)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_concat'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -164,12 +164,12 @@ CREATE OPERATOR || (
PROCEDURE = hs_concat
);
CREATE FUNCTION hs_contains(hstore,hstore)
CREATE FUNCTION pg_catalog.hs_contains(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_contains'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION hs_contained(hstore,hstore)
CREATE FUNCTION pg_catalog.hs_contained(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_contained'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -211,12 +211,12 @@ CREATE OPERATOR ~ (
JOIN = contjoinsel
);
CREATE FUNCTION tconvert(text,text)
CREATE FUNCTION pg_catalog.tconvert(text,text)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_from_text'
LANGUAGE C IMMUTABLE NOT FENCED; -- not STRICT; needs to allow (key,NULL)
CREATE FUNCTION hstore(text,text)
CREATE FUNCTION pg_catalog.hstore(text,text)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_from_text'
LANGUAGE C IMMUTABLE; -- not STRICT; needs to allow (key,NULL)
@ -227,25 +227,25 @@ CREATE OPERATOR => (
PROCEDURE = hstore
);
CREATE FUNCTION hstore(text[],text[])
CREATE FUNCTION pg_catalog.hstore(text[],text[])
RETURNS hstore
AS 'MODULE_PATHNAME', 'hstore_from_arrays'
LANGUAGE C IMMUTABLE NOT FENCED; -- not STRICT; allows (keys,null)
CREATE FUNCTION hstore(text[])
CREATE FUNCTION pg_catalog.hstore(text[])
RETURNS hstore
AS 'MODULE_PATHNAME', 'hstore_from_array'
LANGUAGE C IMMUTABLE STRICT NOT FENCED;
CREATE CAST (text[] AS hstore)
WITH FUNCTION hstore(text[]);
WITH FUNCTION pg_catalog.hstore(text[]);
CREATE FUNCTION hstore(record)
CREATE FUNCTION pg_catalog.hstore(record)
RETURNS hstore
AS 'MODULE_PATHNAME', 'hstore_from_record'
LANGUAGE C IMMUTABLE NOT FENCED; -- not STRICT; allows (null::recordtype)
CREATE FUNCTION hstore_to_array(hstore)
CREATE FUNCTION pg_catalog.hstore_to_array(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_to_array'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -255,7 +255,7 @@ CREATE OPERATOR %% (
PROCEDURE = hstore_to_array
);
CREATE FUNCTION hstore_to_matrix(hstore)
CREATE FUNCTION pg_catalog.hstore_to_matrix(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_to_matrix'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
@ -265,27 +265,27 @@ CREATE OPERATOR %# (
PROCEDURE = hstore_to_matrix
);
CREATE FUNCTION akeys(hstore)
CREATE FUNCTION pg_catalog.akeys(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_akeys'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION avals(hstore)
CREATE FUNCTION pg_catalog.avals(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_avals'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION skeys(hstore)
CREATE FUNCTION pg_catalog.skeys(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME','hstore_skeys'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION svals(hstore)
CREATE FUNCTION pg_catalog.svals(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME','hstore_svals'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION each(IN hs hstore,
CREATE FUNCTION pg_catalog.each(IN hs hstore,
OUT key text,
OUT value text)
RETURNS SETOF record
@ -521,7 +521,7 @@ AS
OPERATOR 9 ?(hstore,text),
OPERATOR 10 ?|(hstore,text[]),
OPERATOR 11 ?&(hstore,text[]),
FUNCTION 1 bttextcmp(text,text),
FUNCTION 1 pg_catalog.bttextcmp(text,text),
FUNCTION 2 gin_extract_hstore(internal, internal),
FUNCTION 3 gin_extract_hstore_query(internal, internal, int2, internal, internal),
FUNCTION 4 gin_consistent_hstore(internal, int2, internal, int4, internal, internal),

View File

@ -5,22 +5,22 @@
CREATE TYPE hstore;
CREATE FUNCTION hstore_in(cstring)
CREATE FUNCTION pg_catalog.hstore_in(cstring)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION hstore_out(hstore)
CREATE FUNCTION pg_catalog.hstore_out(hstore)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;
CREATE FUNCTION hstore_recv(internal)
CREATE FUNCTION pg_catalog.hstore_recv(internal)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION hstore_send(hstore)
CREATE FUNCTION pg_catalog.hstore_send(hstore)
RETURNS bytea
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
@ -34,145 +34,145 @@ CREATE TYPE hstore (
STORAGE = extended
);
CREATE FUNCTION hstore_version_diag(hstore)
CREATE FUNCTION pg_catalog.hstore_version_diag(hstore)
RETURNS integer
AS 'MODULE_PATHNAME','hstore_version_diag'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION fetchval(hstore,text)
CREATE FUNCTION pg_catalog.fetchval(hstore,text)
RETURNS text
AS 'MODULE_PATHNAME','hstore_fetchval'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION slice_array(hstore,text[])
CREATE FUNCTION pg_catalog.slice_array(hstore,text[])
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_slice_to_array'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION slice(hstore,text[])
CREATE FUNCTION pg_catalog.slice(hstore,text[])
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_slice_to_hstore'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION isexists(hstore,text)
CREATE FUNCTION pg_catalog.isexists(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION exist(hstore,text)
CREATE FUNCTION pg_catalog.exist(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION exists_any(hstore,text[])
CREATE FUNCTION pg_catalog.exists_any(hstore,text[])
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists_any'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION exists_all(hstore,text[])
CREATE FUNCTION pg_catalog.exists_all(hstore,text[])
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists_all'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION isdefined(hstore,text)
CREATE FUNCTION pg_catalog.isdefined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_defined'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION defined(hstore,text)
CREATE FUNCTION pg_catalog.defined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_defined'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION delete(hstore,text)
CREATE FUNCTION pg_catalog.delete(hstore,text)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_delete'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION delete(hstore,text[])
CREATE FUNCTION pg_catalog.delete(hstore,text[])
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_delete_array'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION delete(hstore,hstore)
CREATE FUNCTION pg_catalog.delete(hstore,hstore)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_delete_hstore'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION hs_concat(hstore,hstore)
CREATE FUNCTION pg_catalog.hs_concat(hstore,hstore)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_concat'
LANGUAGE C IMMUTABLE NOT FENCED;;
CREATE FUNCTION hs_contains(hstore,hstore)
CREATE FUNCTION pg_catalog.hs_contains(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_contains'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION hs_contained(hstore,hstore)
CREATE FUNCTION pg_catalog.hs_contained(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_contained'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION tconvert(text,text)
CREATE FUNCTION pg_catalog.tconvert(text,text)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_from_text'
LANGUAGE C IMMUTABLE NOT FENCED;; -- not STRICT; needs to allow (key,NULL)
CREATE FUNCTION hstore(text,text)
CREATE FUNCTION pg_catalog.hstore(text,text)
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_from_text'
LANGUAGE C IMMUTABLE NOT FENCED;; -- not STRICT; needs to allow (key,NULL)
CREATE FUNCTION hstore(text[],text[])
CREATE FUNCTION pg_catalog.hstore(text[],text[])
RETURNS hstore
AS 'MODULE_PATHNAME', 'hstore_from_arrays'
LANGUAGE C IMMUTABLE NOT FENCED;; -- not STRICT; allows (keys,null)
CREATE FUNCTION hstore(text[])
CREATE FUNCTION pg_catalog.hstore(text[])
RETURNS hstore
AS 'MODULE_PATHNAME', 'hstore_from_array'
LANGUAGE C IMMUTABLE STRICT NOT FENCED;;
CREATE CAST (text[] AS hstore)
WITH FUNCTION hstore(text[]);
WITH FUNCTION pg_catalog.hstore(text[]);
CREATE FUNCTION hstore(record)
CREATE FUNCTION pg_catalog.hstore(record)
RETURNS hstore
AS 'MODULE_PATHNAME', 'hstore_from_record'
LANGUAGE C IMMUTABLE NOT FENCED;; -- not STRICT; allows (null::recordtype)
CREATE FUNCTION hstore_to_array(hstore)
CREATE FUNCTION pg_catalog.hstore_to_array(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_to_array'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION hstore_to_matrix(hstore)
CREATE FUNCTION pg_catalog.hstore_to_matrix(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_to_matrix'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION akeys(hstore)
CREATE FUNCTION pg_catalog.akeys(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_akeys'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION avals(hstore)
CREATE FUNCTION pg_catalog.avals(hstore)
RETURNS text[]
AS 'MODULE_PATHNAME','hstore_avals'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION skeys(hstore)
CREATE FUNCTION pg_catalog.skeys(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME','hstore_skeys'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION svals(hstore)
CREATE FUNCTION pg_catalog.svals(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME','hstore_svals'
LANGUAGE C STRICT IMMUTABLE NOT FENCED;;
CREATE FUNCTION each(IN hs hstore,
CREATE FUNCTION pg_catalog.each(IN hs hstore,
OUT key text,
OUT value text)
RETURNS SETOF record

View File

@ -4,55 +4,55 @@
\echo Use "CREATE EXTENSION hstore" to load this file. \quit
ALTER EXTENSION hstore ADD type hstore;
ALTER EXTENSION hstore ADD function hstore_in(cstring);
ALTER EXTENSION hstore ADD function hstore_out(hstore);
ALTER EXTENSION hstore ADD function hstore_recv(internal);
ALTER EXTENSION hstore ADD function hstore_send(hstore);
ALTER EXTENSION hstore ADD function hstore_version_diag(hstore);
ALTER EXTENSION hstore ADD function fetchval(hstore,text);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_in(cstring);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_out(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_recv(internal);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_send(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_version_diag(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.fetchval(hstore,text);
ALTER EXTENSION hstore ADD operator ->(hstore,text);
ALTER EXTENSION hstore ADD function slice_array(hstore,text[]);
ALTER EXTENSION hstore ADD function pg_catalog.slice_array(hstore,text[]);
ALTER EXTENSION hstore ADD operator ->(hstore,text[]);
ALTER EXTENSION hstore ADD function slice(hstore,text[]);
ALTER EXTENSION hstore ADD function isexists(hstore,text);
ALTER EXTENSION hstore ADD function exist(hstore,text);
ALTER EXTENSION hstore ADD function pg_catalog.slice(hstore,text[]);
ALTER EXTENSION hstore ADD function pg_catalog.isexists(hstore,text);
ALTER EXTENSION hstore ADD function pg_catalog.exist(hstore,text);
ALTER EXTENSION hstore ADD operator ?(hstore,text);
ALTER EXTENSION hstore ADD function exists_any(hstore,text[]);
ALTER EXTENSION hstore ADD function pg_catalog.exists_any(hstore,text[]);
ALTER EXTENSION hstore ADD operator ?|(hstore,text[]);
ALTER EXTENSION hstore ADD function exists_all(hstore,text[]);
ALTER EXTENSION hstore ADD function pg_catalog.exists_all(hstore,text[]);
ALTER EXTENSION hstore ADD operator ?&(hstore,text[]);
ALTER EXTENSION hstore ADD function isdefined(hstore,text);
ALTER EXTENSION hstore ADD function defined(hstore,text);
ALTER EXTENSION hstore ADD function delete(hstore,text);
ALTER EXTENSION hstore ADD function delete(hstore,text[]);
ALTER EXTENSION hstore ADD function delete(hstore,hstore);
ALTER EXTENSION hstore ADD function pg_catalog.isdefined(hstore,text);
ALTER EXTENSION hstore ADD function pg_catalog.defined(hstore,text);
ALTER EXTENSION hstore ADD function pg_catalog.delete(hstore,text);
ALTER EXTENSION hstore ADD function pg_catalog.delete(hstore,text[]);
ALTER EXTENSION hstore ADD function pg_catalog.delete(hstore,hstore);
ALTER EXTENSION hstore ADD operator -(hstore,text);
ALTER EXTENSION hstore ADD operator -(hstore,text[]);
ALTER EXTENSION hstore ADD operator -(hstore,hstore);
ALTER EXTENSION hstore ADD function hs_concat(hstore,hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hs_concat(hstore,hstore);
ALTER EXTENSION hstore ADD operator ||(hstore,hstore);
ALTER EXTENSION hstore ADD function hs_contains(hstore,hstore);
ALTER EXTENSION hstore ADD function hs_contained(hstore,hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hs_contains(hstore,hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hs_contained(hstore,hstore);
ALTER EXTENSION hstore ADD operator <@(hstore,hstore);
ALTER EXTENSION hstore ADD operator @>(hstore,hstore);
ALTER EXTENSION hstore ADD operator ~(hstore,hstore);
ALTER EXTENSION hstore ADD operator @(hstore,hstore);
ALTER EXTENSION hstore ADD function tconvert(text,text);
ALTER EXTENSION hstore ADD function hstore(text,text);
ALTER EXTENSION hstore ADD function pg_catalog.tconvert(text,text);
ALTER EXTENSION hstore ADD function pg_catalog.hstore(text,text);
ALTER EXTENSION hstore ADD operator =>(text,text);
ALTER EXTENSION hstore ADD function hstore(text[],text[]);
ALTER EXTENSION hstore ADD function hstore(text[]);
ALTER EXTENSION hstore ADD function pg_catalog.hstore(text[],text[]);
ALTER EXTENSION hstore ADD function pg_catalog.hstore(text[]);
ALTER EXTENSION hstore ADD cast (text[] as hstore);
ALTER EXTENSION hstore ADD function hstore(record);
ALTER EXTENSION hstore ADD function hstore_to_array(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hstore(record);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_to_array(hstore);
ALTER EXTENSION hstore ADD operator %%(NONE,hstore);
ALTER EXTENSION hstore ADD function hstore_to_matrix(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.hstore_to_matrix(hstore);
ALTER EXTENSION hstore ADD operator %#(NONE,hstore);
ALTER EXTENSION hstore ADD function akeys(hstore);
ALTER EXTENSION hstore ADD function avals(hstore);
ALTER EXTENSION hstore ADD function skeys(hstore);
ALTER EXTENSION hstore ADD function svals(hstore);
ALTER EXTENSION hstore ADD function each(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.akeys(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.avals(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.skeys(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.svals(hstore);
ALTER EXTENSION hstore ADD function pg_catalog.each(hstore);
ALTER EXTENSION hstore ADD function populate_record(anyelement,hstore);
ALTER EXTENSION hstore ADD operator #=(anyelement,hstore);
ALTER EXTENSION hstore ADD function hstore_eq(hstore,hstore);

View File

@ -50,99 +50,99 @@ select ' '::hstore;
-- -> operator
select fetchval('aa=>b, c=>d , b=>16'::hstore, 'c');
select fetchval('aa=>b, c=>d , b=>16'::hstore, 'b');
select fetchval('aa=>b, c=>d , b=>16'::hstore, 'aa');
select (fetchval('aa=>b, c=>d , b=>16'::hstore, 'gg')) is null;
select (fetchval('aa=>NULL, c=>d , b=>16'::hstore, 'aa')) is null;
select (fetchval('aa=>"NULL", c=>d , b=>16'::hstore, 'aa')) is null;
select pg_catalog.fetchval('aa=>b, c=>d , b=>16'::hstore, 'c');
select pg_catalog.fetchval('aa=>b, c=>d , b=>16'::hstore, 'b');
select pg_catalog.fetchval('aa=>b, c=>d , b=>16'::hstore, 'aa');
select (pg_catalog.fetchval('aa=>b, c=>d , b=>16'::hstore, 'gg')) is null;
select (pg_catalog.fetchval('aa=>NULL, c=>d , b=>16'::hstore, 'aa')) is null;
select (pg_catalog.fetchval('aa=>"NULL", c=>d , b=>16'::hstore, 'aa')) is null;
-- -> array operator
select slice_array('aa=>"NULL", c=>d , b=>16'::hstore, ARRAY['aa','c']);
select slice_array('aa=>"NULL", c=>d , b=>16'::hstore, ARRAY['c','aa']);
select slice_array('aa=>NULL, c=>d , b=>16'::hstore, ARRAY['aa','c',null]);
select slice_array('aa=>1, c=>3, b=>2, d=>4'::hstore, ARRAY[['b','d'],['aa','c']]);
select pg_catalog.slice_array('aa=>"NULL", c=>d , b=>16'::hstore, ARRAY['aa','c']);
select pg_catalog.slice_array('aa=>"NULL", c=>d , b=>16'::hstore, ARRAY['c','aa']);
select pg_catalog.slice_array('aa=>NULL, c=>d , b=>16'::hstore, ARRAY['aa','c',null]);
select pg_catalog.slice_array('aa=>1, c=>3, b=>2, d=>4'::hstore, ARRAY[['b','d'],['aa','c']]);
-- exists/defined
select exist('a=>NULL, b=>qq', 'a');
select exist('a=>NULL, b=>qq', 'b');
select exist('a=>NULL, b=>qq', 'c');
select exist('a=>"NULL", b=>qq', 'a');
select defined('a=>NULL, b=>qq', 'a');
select defined('a=>NULL, b=>qq', 'b');
select defined('a=>NULL, b=>qq', 'c');
select defined('a=>"NULL", b=>qq', 'a');
select pg_catalog.exist('a=>NULL, b=>qq', 'a');
select pg_catalog.exist('a=>NULL, b=>qq', 'b');
select pg_catalog.exist('a=>NULL, b=>qq', 'c');
select pg_catalog.exist('a=>"NULL", b=>qq', 'a');
select pg_catalog.defined('a=>NULL, b=>qq', 'a');
select pg_catalog.defined('a=>NULL, b=>qq', 'b');
select pg_catalog.defined('a=>NULL, b=>qq', 'c');
select pg_catalog.defined('a=>"NULL", b=>qq', 'a');
-- delete
select delete('a=>1 , b=>2, c=>3'::hstore, 'a');
select delete('a=>null , b=>2, c=>3'::hstore, 'a');
select delete('a=>1 , b=>2, c=>3'::hstore, 'b');
select delete('a=>1 , b=>2, c=>3'::hstore, 'c');
select delete('a=>1 , b=>2, c=>3'::hstore, 'd');
select pg_column_size(delete('a=>1 , b=>2, c=>3'::hstore, 'b'::text))
= pg_column_size('a=>1, b=>2'::hstore);
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, 'a');
select pg_catalog.delete('a=>null , b=>2, c=>3'::hstore, 'a');
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, 'b');
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, 'c');
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, 'd');
select pg_catalog.pg_column_size(pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, 'b'::text))
= pg_catalog.pg_column_size('a=>1, b=>2'::hstore);
-- delete (array)
select delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['d','e']);
select delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['d','b']);
select delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['a','c']);
select delete('a=>1 , b=>2, c=>3'::hstore, ARRAY[['b'],['c'],['a']]);
select delete('a=>1 , b=>2, c=>3'::hstore, '{}'::text[]);
select pg_column_size(delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['a','c']))
= pg_column_size('b=>2'::hstore);
select pg_column_size(delete('a=>1 , b=>2, c=>3'::hstore, '{}'::text[]))
= pg_column_size('a=>1, b=>2, c=>3'::hstore);
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['d','e']);
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['d','b']);
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['a','c']);
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, ARRAY[['b'],['c'],['a']]);
select pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, '{}'::text[]);
select pg_catalog.pg_column_size(pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, ARRAY['a','c']))
= pg_catalog.pg_column_size('b=>2'::hstore);
select pg_catalog.pg_column_size(pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, '{}'::text[]))
= pg_catalog.pg_column_size('a=>1, b=>2, c=>3'::hstore);
-- delete (hstore)
select delete('aa=>1 , b=>2, c=>3'::hstore, 'aa=>4, b=>2'::hstore);
select delete('aa=>1 , b=>2, c=>3'::hstore, 'aa=>NULL, c=>3'::hstore);
select delete('aa=>1 , b=>2, c=>3'::hstore, 'aa=>1, b=>2, c=>3'::hstore);
select delete('aa=>1 , b=>2, c=>3'::hstore, 'b=>2'::hstore);
select delete('aa=>1 , b=>2, c=>3'::hstore, ''::hstore);
select pg_column_size(delete('a=>1 , b=>2, c=>3'::hstore, 'b=>2'::hstore))
= pg_column_size('a=>1, c=>3'::hstore);
select pg_column_size(delete('a=>1 , b=>2, c=>3'::hstore, ''::hstore))
= pg_column_size('a=>1, b=>2, c=>3'::hstore);
select pg_catalog.delete('aa=>1 , b=>2, c=>3'::hstore, 'aa=>4, b=>2'::hstore);
select pg_catalog.delete('aa=>1 , b=>2, c=>3'::hstore, 'aa=>NULL, c=>3'::hstore);
select pg_catalog.delete('aa=>1 , b=>2, c=>3'::hstore, 'aa=>1, b=>2, c=>3'::hstore);
select pg_catalog.delete('aa=>1 , b=>2, c=>3'::hstore, 'b=>2'::hstore);
select pg_catalog.delete('aa=>1 , b=>2, c=>3'::hstore, ''::hstore);
select pg_catalog.pg_column_size(pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, 'b=>2'::hstore))
= pg_catalog.pg_column_size('a=>1, c=>3'::hstore);
select pg_catalog.pg_column_size(pg_catalog.delete('a=>1 , b=>2, c=>3'::hstore, ''::hstore))
= pg_catalog.pg_column_size('a=>1, b=>2, c=>3'::hstore);
-- hs_concat
select hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f');
select hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'aq=>l');
select hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'aa=>l');
select hs_concat('aa=>1 , b=>2, cq=>3'::hstore, '');
select hs_concat(''::hstore, 'cq=>l, b=>g, fg=>f');
select pg_column_size(hs_concat(''::hstore, ''::hstore)) = pg_column_size(''::hstore);
select pg_column_size(hs_concat('aa=>1'::hstore, 'b=>2'::hstore))
= pg_column_size('aa=>1, b=>2'::hstore);
select pg_column_size(hs_concat('aa=>1, b=>2'::hstore, ''::hstore))
= pg_column_size('aa=>1, b=>2'::hstore);
select pg_column_size(hs_concat(''::hstore, 'aa=>1, b=>2'::hstore))
= pg_column_size('aa=>1, b=>2'::hstore);
select pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f');
select pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'aq=>l');
select pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'aa=>l');
select pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, '');
select pg_catalog.hs_concat(''::hstore, 'cq=>l, b=>g, fg=>f');
select pg_catalog.pg_column_size(pg_catalog.hs_concat(''::hstore, ''::hstore)) = pg_catalog.pg_column_size(''::hstore);
select pg_catalog.pg_column_size(pg_catalog.hs_concat('aa=>1'::hstore, 'b=>2'::hstore))
= pg_catalog.pg_column_size('aa=>1, b=>2'::hstore);
select pg_catalog.pg_column_size(pg_catalog.hs_concat('aa=>1, b=>2'::hstore, ''::hstore))
= pg_catalog.pg_column_size('aa=>1, b=>2'::hstore);
select pg_catalog.pg_column_size(pg_catalog.hs_concat(''::hstore, 'aa=>1, b=>2'::hstore))
= pg_catalog.pg_column_size('aa=>1, b=>2'::hstore);
-- hstore(text,text)
select hs_concat('a=>g, b=>c'::hstore, hstore('asd', 'gf'));
select hs_concat('a=>g, b=>c'::hstore, hstore('b', 'gf'));
select hs_concat('a=>g, b=>c'::hstore, hstore('b', 'NULL'));
select hs_concat('a=>g, b=>c'::hstore, hstore('b', NULL));
select (hs_concat('a=>g, b=>c'::hstore, hstore(NULL, 'b'))) is null;
select pg_column_size(hstore('b', 'gf'))
= pg_column_size('b=>gf'::hstore);
select pg_column_size(hs_concat('a=>g, b=>c'::hstore, hstore('b', 'gf')))
= pg_column_size('a=>g, b=>gf'::hstore);
select pg_catalog.hs_concat('a=>g, b=>c'::hstore, pg_catalog.hstore('asd', 'gf'));
select pg_catalog.hs_concat('a=>g, b=>c'::hstore, pg_catalog.hstore('b', 'gf'));
select pg_catalog.hs_concat('a=>g, b=>c'::hstore, pg_catalog.hstore('b', 'NULL'));
select pg_catalog.hs_concat('a=>g, b=>c'::hstore, pg_catalog.hstore('b', NULL));
select (pg_catalog.hs_concat('a=>g, b=>c'::hstore, pg_catalog.hstore(NULL, 'b'))) is null;
select pg_catalog.pg_column_size(pg_catalog.hstore('b', 'gf'))
= pg_catalog.pg_column_size('b=>gf'::hstore);
select pg_catalog.pg_column_size(pg_catalog.hs_concat('a=>g, b=>c'::hstore, pg_catalog.hstore('b', 'gf')))
= pg_catalog.pg_column_size('a=>g, b=>gf'::hstore);
-- slice()
select slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['g','h','i']);
select slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b']);
select slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['aa','b']);
select slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b','aa']);
select pg_column_size(slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b']))
= pg_column_size('b=>2, c=>3'::hstore);
select pg_column_size(slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b','aa']))
= pg_column_size('aa=>1, b=>2, c=>3'::hstore);
select pg_catalog.slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['g','h','i']);
select pg_catalog.slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b']);
select pg_catalog.slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['aa','b']);
select pg_catalog.slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b','aa']);
select pg_catalog.pg_column_size(pg_catalog.slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b']))
= pg_catalog.pg_column_size('b=>2, c=>3'::hstore);
select pg_catalog.pg_column_size(pg_catalog.slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b','aa']))
= pg_catalog.pg_column_size('aa=>1, b=>2, c=>3'::hstore);
-- array input
select '{}'::text[]::hstore;
@ -151,66 +151,66 @@ select ARRAY['a','g','b','h','asd','i']::hstore;
select ARRAY[['a','g'],['b','h'],['asd','i']]::hstore;
select ARRAY[['a','g','b'],['h','asd','i']]::hstore;
select ARRAY[[['a','g'],['b','h'],['asd','i']]]::hstore;
select hstore('{}'::text[]);
select hstore(ARRAY['a','g','b','h','asd']);
select hstore(ARRAY['a','g','b','h','asd','i']);
select hstore(ARRAY[['a','g'],['b','h'],['asd','i']]);
select hstore(ARRAY[['a','g','b'],['h','asd','i']]);
select hstore(ARRAY[[['a','g'],['b','h'],['asd','i']]]);
select hstore('[0:5]={a,g,b,h,asd,i}'::text[]);
select hstore('[0:2][1:2]={{a,g},{b,h},{asd,i}}'::text[]);
select pg_catalog.hstore('{}'::text[]);
select pg_catalog.hstore(ARRAY['a','g','b','h','asd']);
select pg_catalog.hstore(ARRAY['a','g','b','h','asd','i']);
select pg_catalog.hstore(ARRAY[['a','g'],['b','h'],['asd','i']]);
select pg_catalog.hstore(ARRAY[['a','g','b'],['h','asd','i']]);
select pg_catalog.hstore(ARRAY[[['a','g'],['b','h'],['asd','i']]]);
select pg_catalog.hstore('[0:5]={a,g,b,h,asd,i}'::text[]);
select pg_catalog.hstore('[0:2][1:2]={{a,g},{b,h},{asd,i}}'::text[]);
-- pairs of arrays
select hstore(ARRAY['a','b','asd'], ARRAY['g','h','i']);
select hstore(ARRAY['a','b','asd'], ARRAY['g','h',NULL]);
select hstore(ARRAY['z','y','x'], ARRAY['1','2','3']);
select hstore(ARRAY['aaa','bb','c','d'], ARRAY[null::text,null,null,null]);
select hstore(ARRAY['aaa','bb','c','d'], null);
select quote_literal(hstore('{}'::text[], '{}'::text[]));
select quote_literal(hstore('{}'::text[], null));
select hstore(ARRAY['a'], '{}'::text[]); -- error
select hstore('{}'::text[], ARRAY['a']); -- error
select pg_column_size(hstore(ARRAY['a','b','asd'], ARRAY['g','h','i']))
= pg_column_size('a=>g, b=>h, asd=>i'::hstore);
select pg_catalog.hstore(ARRAY['a','b','asd'], ARRAY['g','h','i']);
select pg_catalog.hstore(ARRAY['a','b','asd'], ARRAY['g','h',NULL]);
select pg_catalog.hstore(ARRAY['z','y','x'], ARRAY['1','2','3']);
select pg_catalog.hstore(ARRAY['aaa','bb','c','d'], ARRAY[null::text,null,null,null]);
select pg_catalog.hstore(ARRAY['aaa','bb','c','d'], null);
select pg_catalog.quote_literal(pg_catalog.hstore('{}'::text[], '{}'::text[]));
select pg_catalog.quote_literal(pg_catalog.hstore('{}'::text[], null));
select pg_catalog.hstore(ARRAY['a'], '{}'::text[]); -- error
select pg_catalog.hstore('{}'::text[], ARRAY['a']); -- error
select pg_catalog.pg_column_size(pg_catalog.hstore(ARRAY['a','b','asd'], ARRAY['g','h','i']))
= pg_catalog.pg_column_size('a=>g, b=>h, asd=>i'::hstore);
-- keys/values
select akeys(hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select akeys('""=>1');
select akeys('');
select avals(hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select avals(hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>NULL'));
select avals('""=>1');
select avals('');
select pg_catalog.akeys(pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select pg_catalog.akeys('""=>1');
select pg_catalog.akeys('');
select pg_catalog.avals(pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select pg_catalog.avals(pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>NULL'));
select pg_catalog.avals('""=>1');
select pg_catalog.avals('');
select hstore_to_array('aa=>1, cq=>l, b=>g, fg=>NULL'::hstore);
select pg_catalog.hstore_to_array('aa=>1, cq=>l, b=>g, fg=>NULL'::hstore);
select hstore_to_matrix('aa=>1, cq=>l, b=>g, fg=>NULL'::hstore);
select pg_catalog.hstore_to_matrix('aa=>1, cq=>l, b=>g, fg=>NULL'::hstore);
select * from skeys(hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select * from skeys('""=>1');
select * from skeys('');
select * from svals(hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select *, svals is null from svals(hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>NULL'));
select * from svals('""=>1');
select * from svals('');
select * from pg_catalog.skeys(pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select * from pg_catalog.skeys('""=>1');
select * from pg_catalog.skeys('');
select * from pg_catalog.svals(pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>f'));
select *, svals is null from pg_catalog.svals(pg_catalog.hs_concat('aa=>1 , b=>2, cq=>3'::hstore, 'cq=>l, b=>g, fg=>NULL'));
select * from pg_catalog.svals('""=>1');
select * from pg_catalog.svals('');
select * from each('aaa=>bq, b=>NULL, ""=>1 ');
select * from pg_catalog.each('aaa=>bq, b=>NULL, ""=>1 ');
-- hs_contains
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b'::hstore);
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b, c=>NULL'::hstore);
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b, g=>NULL'::hstore);
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'g=>NULL'::hstore);
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>c'::hstore);
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b'::hstore);
select hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b, c=>q'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b, c=>NULL'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b, g=>NULL'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'g=>NULL'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>c'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b'::hstore);
select pg_catalog.hs_contains('a=>b, b=>1, c=>NULL'::hstore, 'a=>b, c=>q'::hstore);
CREATE TABLE testhstore (h hstore);
\copy testhstore from 'data/hstore.data'
select count(*) from testhstore where hs_contains(h, 'wait=>NULL'::hstore);
select count(*) from testhstore where hs_contains(h, 'wait=>CC'::hstore);
select count(*) from testhstore where hs_contains(h, 'wait=>CC, public=>t'::hstore);
select count(*) from testhstore where exist(h, 'public');
select count(*) from testhstore where exists_any(h, ARRAY['public','disabled']);
select count(*) from testhstore where exists_all(h, ARRAY['public','disabled']);
select pg_catalog.count(*) from testhstore where pg_catalog.hs_contains(h, 'wait=>NULL'::hstore);
select pg_catalog.count(*) from testhstore where pg_catalog.hs_contains(h, 'wait=>CC'::hstore);
select pg_catalog.count(*) from testhstore where pg_catalog.hs_contains(h, 'wait=>CC, public=>t'::hstore);
select pg_catalog.count(*) from testhstore where pg_catalog.exist(h, 'public');
select pg_catalog.count(*) from testhstore where pg_catalog.exists_any(h, ARRAY['public','disabled']);
select pg_catalog.count(*) from testhstore where pg_catalog.exists_all(h, ARRAY['public','disabled']);

View File

@ -10,12 +10,12 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION log_fdw" to load this file. \quit
CREATE FUNCTION log_fdw_handler()
CREATE FUNCTION pg_catalog.log_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;
CREATE FUNCTION log_fdw_validator(text[], oid)
CREATE FUNCTION pg_catalog.log_fdw_validator(text[], oid)
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;
@ -26,7 +26,7 @@ CREATE FOREIGN DATA WRAPPER log_fdw
CREATE SERVER log_srv FOREIGN DATA WRAPPER log_fdw;
create or replace function gs_create_log_tables()
create or replace function pg_catalog.gs_create_log_tables()
RETURNS void
AS $$
declare

View File

@ -54,21 +54,15 @@ PG_MODULE_MAGIC;
extern "C" void _PG_init(void);
extern "C" void _PG_output_plugin_init(OutputPluginCallbacks* cb);
typedef struct {
MemoryContext context;
bool include_xids;
bool include_timestamp;
bool skip_empty_xacts;
bool xact_wrote_changes;
bool only_local;
} TestDecodingData;
static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions* opt, bool is_init);
static void pg_decode_shutdown(LogicalDecodingContext* ctx);
static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_output_begin(
LogicalDecodingContext* ctx, TestDecodingData* data, ReorderBufferTXN* txn, bool last_write);
LogicalDecodingContext* ctx, PluginTestDecodingData* data, ReorderBufferTXN* txn, bool last_write);
static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, XLogRecPtr commit_lsn);
static void pg_decode_abort_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_decode_prepare_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_decode_change(
LogicalDecodingContext* ctx, ReorderBufferTXN* txn, Relation rel, ReorderBufferChange* change);
static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id);
@ -87,6 +81,8 @@ void _PG_output_plugin_init(OutputPluginCallbacks* cb)
cb->begin_cb = pg_decode_begin_txn;
cb->change_cb = pg_decode_change;
cb->commit_cb = pg_decode_commit_txn;
cb->abort_cb = pg_decode_abort_txn;
cb->prepare_cb = pg_decode_prepare_txn;
cb->filter_by_origin_cb = pg_decode_filter;
cb->shutdown_cb = pg_decode_shutdown;
}
@ -95,84 +91,33 @@ void _PG_output_plugin_init(OutputPluginCallbacks* cb)
static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions* opt, bool is_init)
{
ListCell* option = NULL;
TestDecodingData* data = NULL;
PluginTestDecodingData* data = NULL;
data = (TestDecodingData*)palloc0(sizeof(TestDecodingData));
data = (PluginTestDecodingData*)palloc0(sizeof(PluginTestDecodingData));
data->context = AllocSetContextCreate(ctx->context,
"text conversion context",
ALLOCSET_DEFAULT_MINSIZE,
ALLOCSET_DEFAULT_INITSIZE,
ALLOCSET_DEFAULT_MAXSIZE);
data->include_xids = true;
data->include_timestamp = false;
data->include_timestamp = true;
data->skip_empty_xacts = false;
data->only_local = true;
data->tableWhiteList = NIL;
ctx->output_plugin_private = data;
opt->output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT;
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)
data->include_xids = true;
else if (!parse_bool(strVal(elem->arg), &data->include_xids))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else if (strcmp(elem->defname, "include-timestamp") == 0) {
if (elem->arg == NULL)
data->include_timestamp = true;
else if (!parse_bool(strVal(elem->arg), &data->include_timestamp))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else if (strcmp(elem->defname, "force-binary") == 0) {
bool force_binary = false;
if (elem->arg == NULL)
continue;
else if (!parse_bool(strVal(elem->arg), &force_binary))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
if (force_binary)
opt->output_type = OUTPUT_PLUGIN_BINARY_OUTPUT;
} else if (strcmp(elem->defname, "skip-empty-xacts") == 0) {
if (elem->arg == NULL)
data->skip_empty_xacts = true;
else if (!parse_bool(strVal(elem->arg), &data->skip_empty_xacts))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else if (strcmp(elem->defname, "only-local") == 0) {
if (elem->arg == NULL)
data->only_local = true;
else if (!parse_bool(strVal(elem->arg), &data->only_local))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else {
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg(
"option \"%s\" = \"%s\" is unknown", elem->defname, elem->arg ? strVal(elem->arg) : "(null)")));
}
ParseDecodingOptionPlugin(option, data, opt);
}
}
/* cleanup this plugin's resources */
static void pg_decode_shutdown(LogicalDecodingContext* ctx)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
/* cleanup our own resources via memory context reset */
MemoryContextDelete(data->context);
@ -181,7 +126,7 @@ static void pg_decode_shutdown(LogicalDecodingContext* ctx)
/* BEGIN callback */
static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
data->xact_wrote_changes = false;
if (data->skip_empty_xacts)
@ -190,7 +135,8 @@ static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* t
pg_output_begin(ctx, data, txn, true);
}
static void pg_output_begin(LogicalDecodingContext* ctx, TestDecodingData* data, ReorderBufferTXN* txn, bool last_write)
static void pg_output_begin(LogicalDecodingContext* ctx, PluginTestDecodingData* data, ReorderBufferTXN* txn,
bool last_write)
{
OutputPluginPrepareWrite(ctx, last_write);
if (data->include_xids)
@ -203,7 +149,7 @@ static void pg_output_begin(LogicalDecodingContext* ctx, TestDecodingData* data,
/* COMMIT callback */
static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, XLogRecPtr commit_lsn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes)
return;
@ -221,65 +167,57 @@ static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN*
OutputPluginWrite(ctx, true);
}
/* ABORT callback */
static void pg_decode_abort_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes)
return;
OutputPluginPrepareWrite(ctx, true);
if (data->include_xids)
appendStringInfo(ctx->out, "ABORT %lu", txn->xid);
else
appendStringInfoString(ctx->out, "ABORT");
if (data->include_timestamp)
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
OutputPluginWrite(ctx, true);
}
/* PREPARE callback */
static void pg_decode_prepare_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes)
return;
OutputPluginPrepareWrite(ctx, true);
if (data->include_xids)
appendStringInfo(ctx->out, "PREPARE %lu", txn->xid);
else
appendStringInfoString(ctx->out, "PREPARE");
if (data->include_timestamp)
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
OutputPluginWrite(ctx, true);
}
static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->only_local && origin_id != InvalidRepOriginId)
return true;
return false;
}
/*
* Print literal `outputstr' already represented as string of type `typid'
* into stringbuf `s'.
*
* Some builtin types aren't quoted, the rest is quoted. Escaping is done as
* if u_sess->parser_cxt.standard_conforming_strings were enabled.
*/
static void print_literal(StringInfo s, Oid typid, char* outputstr)
{
const char* valptr = NULL;
switch (typid) {
case INT1OID:
case INT2OID:
case INT4OID:
case INT8OID:
case OIDOID:
case FLOAT4OID:
case FLOAT8OID:
case NUMERICOID:
/* NB: We don't care about Inf, NaN et al. */
appendStringInfoString(s, outputstr);
break;
case BITOID:
case VARBITOID:
appendStringInfo(s, "B'%s'", outputstr);
break;
case BOOLOID:
if (strcmp(outputstr, "t") == 0)
appendStringInfoString(s, "true");
else
appendStringInfoString(s, "false");
break;
default:
appendStringInfoChar(s, '\'');
for (valptr = outputstr; *valptr; valptr++) {
char ch = *valptr;
if (SQL_STR_DOUBLE(ch, false))
appendStringInfoChar(s, ch);
appendStringInfoChar(s, ch);
}
appendStringInfoChar(s, '\'');
break;
}
}
/* print the tuple 'tuple' into the StringInfo s */
static void TupleToJsoninfo(
cJSON* cols_name, cJSON* cols_type, cJSON* cols_val, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
@ -348,11 +286,11 @@ static void TupleToJsoninfo(
if (isnull)
appendStringInfoString(val_str, "null");
else if (!typisvarlena)
print_literal(val_str, typid, OidOutputFunctionCall(typoutput, origval));
PrintLiteral(val_str, typid, OidOutputFunctionCall(typoutput, origval));
else {
Datum val; /* definitely detoasted Datum */
val = PointerGetDatum(PG_DETOAST_DATUM(origval));
print_literal(val_str, typid, OidOutputFunctionCall(typoutput, val));
PrintLiteral(val_str, typid, OidOutputFunctionCall(typoutput, val));
}
cJSON* col_val = cJSON_CreateString(val_str->data);
cJSON_AddItemToArray(cols_val, col_val);
@ -365,13 +303,12 @@ static void TupleToJsoninfo(
static void pg_decode_change(
LogicalDecodingContext* ctx, ReorderBufferTXN* txn, Relation relation, ReorderBufferChange* change)
{
TestDecodingData* data = NULL;
PluginTestDecodingData* data = NULL;
Form_pg_class class_form;
TupleDesc tupdesc;
MemoryContext old;
char* res = NULL;
data = (TestDecodingData*)ctx->output_plugin_private;
u_sess->attr.attr_common.extra_float_digits = 0;
data = (PluginTestDecodingData*)ctx->output_plugin_private;
/* output BEGIN if we haven't yet */
if (data->skip_empty_xacts && !data->xact_wrote_changes) {
@ -385,11 +322,18 @@ static void pg_decode_change(
/* Avoid leaking memory by using and resetting our own context */
old = MemoryContextSwitchTo(data->context);
char *schema = get_namespace_name(class_form->relnamespace);
char *table = NameStr(class_form->relname);
if (data->tableWhiteList != NIL && !CheckWhiteList(data->tableWhiteList, schema, table)) {
(void)MemoryContextSwitchTo(old);
MemoryContextReset(data->context);
return;
}
OutputPluginPrepareWrite(ctx, true);
cJSON* root = cJSON_CreateObject();
cJSON* table_name = cJSON_CreateString(quote_qualified_identifier(
get_namespace_name(get_rel_namespace(RelationGetRelid(relation))), NameStr(class_form->relname)));
cJSON* table_name = cJSON_CreateString(quote_qualified_identifier(schema, table));
cJSON_AddItemToObject(root, "table_name", table_name);
cJSON* op_type = NULL;

View File

@ -2,21 +2,22 @@
# pagehack
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TGT_pagehack_SRC)
set(TGT_pagehack_INC
${TGT_pq_INC} ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SRC_DIR}/lib/gstrace
${TGT_pq_INC} ${ZSTD_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SRC_DIR}/lib/gstrace ${PROJECT_SRC_DIR}/lib/page_compression
)
set(pagehack_DEF_OPTIONS ${MACRO_OPTIONS})
if(${ENABLE_DEBUG} STREQUAL "ON")
set(pagehack_DEF_OPTIONS ${pagehack_DEF_OPTIONS} -DDEBUG)
set(pagehack_DEF_OPTIONS ${pagehack_DEF_OPTIONS} -DDEBUG -DFRONTEND)
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 -lsecurec -lrt -lz -lminiunz)
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)
add_dependencies(pagehack pgport_static pagecompression)
target_link_directories(pagehack PUBLIC
${LIBOPENSSL_LIB_PATH} ${PROTOBUF_LIB_PATH} ${LIBPARQUET_LIB_PATH} ${LIBCURL_LIB_PATH} ${SECURE_LIB_PATH}
${ZLIB_LIB_PATH} ${LIBOBS_LIB_PATH} ${LIBEDIT_LIB_PATH} ${LIBCGROUP_LIB_PATH} ${CMAKE_BINARY_DIR}/lib
${ZSTD_LIB_PATH} ${PROJECT_SRC_DIR}/lib/page_compression
)
install(TARGETS pagehack RUNTIME DESTINATION bin)

View File

@ -4,6 +4,7 @@ OBJS = pagehack.o
# executable program, even there is no database server/client
PROGRAM = pagehack
all: submake-pagecompression
ifdef USE_PGXS
PG_CONFIG = pg_config
@ -13,8 +14,9 @@ else
subdir = contrib/pagehack
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
enable_shared = false
override CPPFLAGS += -I${top_builddir}/src/lib/page_compression
override LDFLAGS += -L${top_builddir}/src/lib/page_compression
override CFLAGS += -lpagecompression -lzstd
ifeq ($(enable_debug), yes)
PG_CPPFLAGS += -DDEBUG
endif

File diff suppressed because it is too large Load Diff

View File

@ -106,11 +106,7 @@ static void GetBTPageStatistics(BlockNumber blkno, Buffer buffer, BTPageStat* st
/* page type (flags) */
if (P_ISDELETED(opaque)) {
stat->type = 'd';
if (PageIs4BXidVersion(page))
stat->btpo.xact = opaque->btpo.xact_old;
else
stat->btpo.xact = ((BTPageOpaque)opaque)->xact;
stat->btpo.xact = ((BTPageOpaque)opaque)->xact;
return;
} else if (P_IGNORE(opaque))
stat->type = 'e';
@ -212,44 +208,45 @@ Datum bt_page_stats(PG_FUNCTION_ARGS)
elog(ERROR, "return type must be a row type");
j = 0;
int ret = 0;
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.blkno);
errno_t ret = 0;
const int charLen = 32;
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.blkno);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%c", stat.type);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%c", stat.type);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.live_items);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.live_items);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.dead_items);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.dead_items);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.avg_item_size);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.avg_item_size);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.page_size);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.page_size);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.free_size);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.free_size);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.btpo_prev);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.btpo_prev);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.btpo_next);
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.btpo_next);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(32);
if (stat.type == 'd'){
ret = snprintf_s(values[j++], 64, 63, XID_FMT, stat.btpo.xact);
securec_check_ss(ret, "", "");
if (stat.type == 'd') {
values[j] = (char*)palloc(charLen * 2);
ret = snprintf_s(values[j++], charLen * 2, charLen * 2 - 1, XID_FMT, stat.btpo.xact);
} else {
ret = snprintf_s(values[j++], 32, 31, "%d", stat.btpo.level);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.btpo.level);
}
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", stat.btpo_flags);
securec_check_ss(ret, "", "");
values[j] = (char*)palloc(charLen);
ret = snprintf_s(values[j++], charLen, charLen - 1, "%d", stat.btpo_flags);
securec_check_ss(ret, "", "");
tuple = BuildTupleFromCStrings(TupleDescGetAttInMetadata(tupleDesc), values);
@ -286,6 +283,7 @@ Datum bt_page_items(PG_FUNCTION_ARGS)
FuncCallContext* fctx = NULL;
MemoryContext mctx;
struct user_args* uargs;
errno_t rc;
if (!superuser())
ereport(ERROR,
@ -333,8 +331,7 @@ Datum bt_page_items(PG_FUNCTION_ARGS)
uargs = (user_args*)palloc(sizeof(struct user_args));
uargs->page = (char*)palloc(BLCKSZ);
int rc = memcpy_s(uargs->page, BLCKSZ, BufferGetPage(buffer), BLCKSZ);
securec_check_c(rc, "\0", "\0");
rc = memcpy_s(uargs->page, BLCKSZ, BufferGetPage(buffer), BLCKSZ);
UnlockReleaseBuffer(buffer);
relation_close(rel, AccessShareLock);
@ -380,21 +377,21 @@ Datum bt_page_items(PG_FUNCTION_ARGS)
j = 0;
values[j] = (char*)palloc(32);
int ret = 0;
ret = snprintf_s(values[j++], 32, 31, "%d", uargs->offset);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", uargs->offset);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "(%u,%u)", BlockIdGetBlockNumber(&(itup->t_tid.ip_blkid)), itup->t_tid.ip_posid);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "(%u,%u)",
BlockIdGetBlockNumber(&(itup->t_tid.ip_blkid)), itup->t_tid.ip_posid);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", (int)IndexTupleSize(itup));
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", (int)IndexTupleSize(itup));
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%c", IndexTupleHasNulls(itup) ? 't' : 'f');
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%c", IndexTupleHasNulls(itup) ? 't' : 'f');
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%c", IndexTupleHasVarwidths(itup) ? 't' : 'f');
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%c", IndexTupleHasVarwidths(itup) ? 't' : 'f');
securec_check_ss(rc, "", "");
ptr = (char*)itup + IndexInfoFindDataOffset(itup->t_info);
dlen = IndexTupleSize(itup) - IndexInfoFindDataOffset(itup->t_info);
@ -406,8 +403,8 @@ Datum bt_page_items(PG_FUNCTION_ARGS)
*dump++ = ' ';
length--;
}
ret = sprintf_s(dump, length, "%02x", *(ptr + off) & 0xff);
securec_check_ss(ret, "", "");
rc = sprintf_s(dump, length, "%02x", *(ptr + off) & 0xff);
securec_check_ss(rc, "", "");
dump += 2;
length -= 2;
}
@ -477,26 +474,25 @@ Datum bt_metap(PG_FUNCTION_ARGS)
elog(ERROR, "return type must be a row type");
j = 0;
int ret = 0;
errno_t rc;
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", metad->btm_magic);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", metad->btm_magic);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", metad->btm_version);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", metad->btm_version);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", metad->btm_root);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", metad->btm_root);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", metad->btm_level);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", metad->btm_level);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", metad->btm_fastroot);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", metad->btm_fastroot);
securec_check_ss(rc, "", "");
values[j] = (char*)palloc(32);
ret = snprintf_s(values[j++], 32, 31, "%d", metad->btm_fastlevel);
securec_check_ss(ret, "", "");
rc = snprintf_s(values[j++], 32, 31, "%d", metad->btm_fastlevel);
securec_check_ss(rc, "", "");
tuple = BuildTupleFromCStrings(TupleDescGetAttInMetadata(tupleDesc), values);

View File

@ -67,9 +67,8 @@ Datum gin_metapage_info(PG_FUNCTION_ARGS)
metadata = GinPageGetMeta(page);
int nRet = 0;
nRet = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(nRet, "\0", "\0");
errno_t rc = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(rc, "\0", "\0");
values[0] = Int64GetDatum(metadata->head);
values[1] = Int64GetDatum(metadata->tail);
@ -146,9 +145,8 @@ Datum gin_page_opaque_info(PG_FUNCTION_ARGS)
flags[nflags++] = DirectFunctionCall1(to_hex32, Int32GetDatum(flagbits));
}
int nRet = 0;
nRet = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(nRet, "\0", "\0");
errno_t rc = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(rc, "\0", "\0");
values[0] = Int64GetDatum(opaq->rightlink);
values[1] = Int64GetDatum(opaq->maxoff);
@ -238,9 +236,8 @@ Datum gin_leafpage_items(PG_FUNCTION_ARGS)
ItemPointer tids;
Datum* tids_datum = NULL;
int nRet = 0;
nRet = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(nRet, "\0", "\0");
errno_t rc = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(rc, "\0", "\0");
values[0] = ItemPointerGetDatum(&cur->first);
values[1] = UInt16GetDatum(cur->nbytes);

View File

@ -121,9 +121,8 @@ Datum heap_page_items(PG_FUNCTION_ARGS)
uint16 lp_flags;
uint16 lp_len;
int nRet = 0;
nRet = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(nRet, "\0", "\0");
errno_t rc = memset_s(nulls, sizeof(nulls), 0, sizeof(nulls));
securec_check_c(rc, "\0", "\0");
/* Extract information from the line pointer */

View File

@ -154,7 +154,7 @@ static bytea* get_raw_page_internal(text* relname, ForkNumber forknum, BlockNumb
buf = ReadBufferExtended(rel, forknum, blkno, RBM_NORMAL, NULL);
LockBuffer(buf, BUFFER_LOCK_SHARE);
int rc = memcpy_s(raw_page_data, BLCKSZ, BufferGetPage(buf), BLCKSZ);
errno_t rc = memcpy_s(raw_page_data, BLCKSZ, BufferGetPage(buf), BLCKSZ);
securec_check_c(rc, "\0", "\0");
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
@ -306,7 +306,7 @@ Datum page_compress_meta(PG_FUNCTION_ARGS)
bytea* dumpVal = (bytea*)palloc(VARHDRSZ + output->len);
SET_VARSIZE(dumpVal, VARHDRSZ + output->len);
int rc = memcpy_s(VARDATA(dumpVal), output->len, output->data, output->len);
errno_t rc = memcpy_s(VARDATA(dumpVal), output->len, output->data, output->len);
securec_check_c(rc, "\0", "\0");
pfree(output->data);
pfree(output);
@ -326,7 +326,7 @@ Datum page_compress_meta_usage(PG_FUNCTION_ARGS)
bytea* dumpVal = (bytea*)palloc(VARHDRSZ + help_size);
SET_VARSIZE(dumpVal, VARHDRSZ + help_size);
int rc = memcpy_s(VARDATA(dumpVal), help_size, help, help_size);
errno_t rc = memcpy_s(VARDATA(dumpVal), help_size, help, help_size);
securec_check_c(rc, "\0", "\0");
PG_RETURN_TEXT_P(dumpVal);
@ -413,7 +413,7 @@ static char* read_raw_page(Relation rel, ForkNumber forknum, BlockNumber blkno)
raw_page = (char*)palloc(BLCKSZ);
buf = ReadBufferExtended(rel, forknum, blkno, RBM_NORMAL, NULL);
LockBuffer(buf, BUFFER_LOCK_SHARE);
int rc = memcpy_s(raw_page, BLCKSZ, BufferGetPage(buf), BLCKSZ);
errno_t rc = memcpy_s(raw_page, BLCKSZ, BufferGetPage(buf), BLCKSZ);
securec_check_c(rc, "\0", "\0");
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
ReleaseBuffer(buf);

View File

@ -177,6 +177,7 @@ static void SetWALFileNameForCleanup(void)
{
bool fnameOK = false;
errno_t errorno = EOK;
int segLen = 32;
TrimExtension(restartWALFileName, additional_ext);
@ -204,7 +205,7 @@ static void SetWALFileNameForCleanup(void)
* Use just the prefix of the filename, ignore everything after
* first period
*/
XLogFileName(exclusiveCleanupFileName, tli, ((uint64)log) << 32 | seg);
XLogFileName(exclusiveCleanupFileName, MAXFNAMELEN, tli, ((uint64)log) << segLen | seg);
}
}

View File

@ -125,9 +125,9 @@ struct stat stat_buf;
#define XLOG_DATA_FNAME_LEN 24
/* Reworked from access/xlog_internal.h */
#define XLogFileName(fname, tli, logSegNo) \
#define XLogFileName(fname, len, tli, logSegNo) \
snprintf(fname, \
XLOG_DATA_FNAME_LEN + 1, \
len, \
"%08X%08X%08X", \
tli, \
(uint32)((logSegNo) / XLogSegmentsPerXLogId), \
@ -345,7 +345,7 @@ static bool SetWALFileNameForCleanup(void)
}
}
XLogFileName(exclusiveCleanupFileName, tli, (((uint32)log) << 32) | seg);
XLogFileName(exclusiveCleanupFileName, MAXFNAMELEN, tli, (((uint32)log) << 32) | seg);
return cleanup;
}

View File

@ -17,6 +17,3 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
exclude_option=-fPIE
override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS))

View File

@ -135,7 +135,7 @@ typedef struct pgssEntry {
* Global shared state
*/
typedef struct pgssSharedState {
LWLock* lock; /* protects hashtable search/modification */
LWLockId lock; /* protects hashtable search/modification */
int query_size; /* max query length in bytes */
double cur_median_usage; /* current median usage in hashtable */
} pgssSharedState;
@ -172,20 +172,20 @@ typedef struct pgssJumbleState {
/*---- Local variables ----*/
/* Current nesting depth of ExecutorRun+ProcessUtility calls */
static THR_LOCAL int nested_level = 0;
static int nested_level = 0;
/* Saved hook values in case of unload */
static THR_LOCAL shmem_startup_hook_type prev_shmem_startup_hook = NULL;
static THR_LOCAL post_parse_analyze_hook_type prev_post_parse_analyze_hook = NULL;
static THR_LOCAL ExecutorStart_hook_type prev_ExecutorStart = NULL;
static THR_LOCAL ExecutorRun_hook_type prev_ExecutorRun = NULL;
static THR_LOCAL ExecutorFinish_hook_type prev_ExecutorFinish = NULL;
static THR_LOCAL ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
static THR_LOCAL ProcessUtility_hook_type prev_ProcessUtility = NULL;
static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
static post_parse_analyze_hook_type prev_post_parse_analyze_hook = NULL;
static ExecutorStart_hook_type prev_ExecutorStart = NULL;
static ExecutorRun_hook_type prev_ExecutorRun = NULL;
static ExecutorFinish_hook_type prev_ExecutorFinish = NULL;
static ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
static ProcessUtility_hook_type prev_ProcessUtility = NULL;
/* Links to shared memory state */
static THR_LOCAL pgssSharedState* pgss = NULL;
static THR_LOCAL HTAB* pgss_hash = NULL;
static pgssSharedState* pgss = NULL;
static HTAB* pgss_hash = NULL;
/*---- GUC variables ----*/
@ -210,8 +210,8 @@ static bool pgss_save; /* whether to save stats across shutdown */
void _PG_init(void);
void _PG_fini(void);
extern "C" Datum pg_stat_statements_reset(PG_FUNCTION_ARGS);
extern "C" Datum pg_stat_statements(PG_FUNCTION_ARGS);
Datum pg_stat_statements_reset(PG_FUNCTION_ARGS);
Datum pg_stat_statements(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(pg_stat_statements_reset);
PG_FUNCTION_INFO_V1(pg_stat_statements);
@ -260,7 +260,7 @@ void _PG_init(void)
* module isn't active. The functions must protect themselves against
* being called then, however.)
*/
if (!u_sess->misc_cxt.process_shared_preload_libraries_in_progress)
if (!process_shared_preload_libraries_in_progress)
return;
/*
@ -389,7 +389,7 @@ static void pgss_shmem_startup(void)
if (!found) {
/* First time through ... */
pgss->lock = LWLockAssign(LWTRANCHE_BUFFER_CONTENT);
pgss->lock = LWLockAssign();
pgss->query_size = g_instance.attr.attr_common.pgstat_track_activity_query_size;
pgss->cur_median_usage = ASSUMED_MEDIAN_INIT;
}
@ -456,7 +456,7 @@ static void pgss_shmem_startup(void)
buffer_size = temp.query_len + 1;
}
if (fread(buffer, 1, temp.query_len, file) != (size_t)temp.query_len)
if (fread(buffer, 1, temp.query_len, file) != temp.query_len)
goto error;
buffer[temp.query_len] = '\0';
@ -536,7 +536,7 @@ static void pgss_shmem_shutdown(int code, Datum arg)
while ((entry = (pgssEntry*)hash_seq_search(&hash_seq)) != NULL) {
int len = entry->query_len;
if (fwrite(entry, offsetof(pgssEntry, mutex), 1, file) != 1 || fwrite(entry->query, 1, len, file) != (size_t)len)
if (fwrite(entry, offsetof(pgssEntry, mutex), 1, file) != 1 || fwrite(entry->query, 1, len, file) != len)
goto error;
}
@ -748,8 +748,8 @@ static void pgss_ProcessUtility(Node* parsetree, const char* queryString, ParamL
BufferUsage bufusage_start, bufusage;
uint32 queryId;
bufusage_start = *(u_sess->instr_cxt.pg_buffer_usage);
INSTR_TIME_SET_CURRENT(start);
bufusage_start = u_sess->instr_cxt.pg_buffer_usage->INSTR_TIME_SET_CURRENT(start);
nested_level++;
PG_TRY();
{
@ -1661,12 +1661,6 @@ static void JumbleExpr(pgssJumbleState* jstate, Node* node)
JumbleExpr(jstate, (Node*)lfirst(temp));
}
break;
case T_IntList:
foreach(temp, (List *) node)
{
APP_JUMB(lfirst_int(temp));
}
break;
case T_SortGroupClause: {
SortGroupClause* sgc = (SortGroupClause*)node;
@ -1680,7 +1674,6 @@ static void JumbleExpr(pgssJumbleState* jstate, Node* node)
JumbleExpr(jstate, (Node*)gsnode->content);
}
break;
case T_WindowClause: {
WindowClause* wc = (WindowClause*)node;

View File

@ -25,6 +25,7 @@ execute_process(
COMMAND ln -fs ${PROJECT_SRC_DIR}/gausskernel/storage/access/transam/xlogreader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/xlogreader.cpp
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
)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TGT_xlogdump_SRC)
@ -34,7 +35,7 @@ SET(TGT_xlogdump_INC
SET(xlogdump_DEF_OPTIONS ${MACRO_OPTIONS} -DFRONTEND)
SET(xlogdump_COMPILE_OPTIONS ${OS_OPTIONS} ${PROTECT_OPTIONS} ${WARNING_OPTIONS} ${CHECK_OPTIONS} ${BIN_SECURE_OPTIONS} ${OPTIMIZE_OPTIONS})
SET(xlogdump_LINK_OPTIONS ${BIN_LINK_OPTIONS})
SET(xlogdump_LINK_LIBS libpgcommon.a -lpgport -lcrypt -ldl -lm -ledit -lssl -lcrypto -lsecurec -lrt -lz -lminiunz)
SET(xlogdump_LINK_LIBS libpgcommon.a -lpgport -lcrypt -ldl -lm -ledit -lssl -lcrypto -l${SECURE_C_CHECK} -lrt -lz -lminiunz)
add_bintarget(pg_xlogdump TGT_xlogdump_SRC TGT_xlogdump_INC "${xlogdump_DEF_OPTIONS}" "${xlogdump_COMPILE_OPTIONS}" "${xlogdump_LINK_OPTIONS}" "${xlogdump_LINK_LIBS}")
add_dependencies(pg_xlogdump pgport_static pgcommon_static)
target_link_directories(pg_xlogdump PUBLIC

View File

@ -41,6 +41,8 @@ typedef struct XLogDumpPrivate {
XLogRecPtr startptr;
XLogRecPtr endptr;
bool endptr_reached;
char* shareStorageXlogFilePath;
long shareStorageXlogSize;
} XLogDumpPrivate;
typedef struct XLogDumpConfig {
@ -76,7 +78,7 @@ typedef struct XLogDumpStats {
static void XLogDumpTablePage(XLogReaderState* record, int block_id, RelFileNode rnode, BlockNumber blk);
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* readBuff, TimeLineID* curFileTLI, char* xlog_path = NULL);
static void XLogDumpCountRecord(XLogDumpConfig* config, XLogDumpStats* stats, XLogReaderState* record);
static void XLogDumpDisplayRecord(XLogDumpConfig* config, XLogReaderState* record);
static void XLogDumpStatsRow(const char* name, uint64 n, uint64 total_count, uint64 rec_len, uint64 total_rec_len,
@ -254,6 +256,71 @@ static void XLogDumpTablePage(XLogReaderState* record, int block_id, RelFileNode
printf(" write FPW page %s to disk", block_path);
}
// for dorado storage
static void XLogDumpReadSharedStorage(char* directory, XLogRecPtr startptr, long xlogSize, char* buf, Size count)
{
char* p = buf;
XLogRecPtr recptr;
Size nbytes;
static int sendFile = -1;
static uint64 sendOff = 0;
recptr = startptr;
nbytes = count;
while (nbytes > 0) {
int segbytes;
int readbytes;
uint64 startoff = (recptr % xlogSize) + XLogSegSize;
if (sendFile < 0) {
canonicalize_path(directory);
sendFile = open(directory, O_RDONLY | PG_BINARY, 0);
if (sendFile < 0) {
fatal_error("could not find file \"%s\": %s", directory, strerror(errno));
}
sendOff = 0;
}
/* Need to seek in the file? */
if (sendOff != startoff) {
if (lseek(sendFile, (off_t)startoff, SEEK_SET) < 0) {
int err = errno;
fatal_error("could not seek in log segment %s to offset %lu: %s", directory, startoff, strerror(err));
}
sendOff = startoff;
}
/* How many bytes are within this segment? */
if (nbytes > (xlogSize - startoff)) {
segbytes = xlogSize - startoff;
} else {
segbytes = nbytes;
}
readbytes = read(sendFile, p, segbytes);
if (readbytes <= 0) {
int err = errno;
fatal_error("could not read from log segment %s, offset %ld, length %d: %s",
directory,
sendOff,
segbytes,
strerror(err));
}
/* Update state for read */
XLByteAdvance(recptr, readbytes);
sendOff += readbytes;
nbytes -= readbytes;
p += readbytes;
}
}
/*
* Read count bytes from a segment file in the specified directory, for the
* given timeline, containing the specified record pointer; store the data in
@ -289,7 +356,7 @@ static void XLogDumpXLogRead(const char* directory, TimeLineID timeline_id, XLog
XLByteToSeg(recptr, sendSegNo);
XLogFileName(fname, timeline_id, sendSegNo);
XLogFileName(fname, MAXFNAMELEN, timeline_id, sendSegNo);
sendFile = fuzzy_open_file(directory, fname);
@ -304,7 +371,7 @@ static void XLogDumpXLogRead(const char* directory, TimeLineID timeline_id, XLog
int err = errno;
char fname[MAXPGPATH];
XLogFileName(fname, timeline_id, sendSegNo);
XLogFileName(fname, MAXFNAMELEN, timeline_id, sendSegNo);
fatal_error("could not seek in log segment %s to offset %u: %s", fname, startoff, strerror(err));
}
@ -322,7 +389,7 @@ static void XLogDumpXLogRead(const char* directory, TimeLineID timeline_id, XLog
int err = errno;
char fname[MAXPGPATH];
XLogFileName(fname, timeline_id, sendSegNo);
XLogFileName(fname, MAXFNAMELEN, timeline_id, sendSegNo);
fatal_error("could not read from log segment %s, offset %d, length %d: %s",
fname,
@ -344,14 +411,13 @@ static void XLogDumpXLogRead(const char* directory, TimeLineID timeline_id, XLog
* XLogReader read_page callback
*/
static int XLogDumpReadPage(XLogReaderState* state, XLogRecPtr targetPagePtr, int reqLen, XLogRecPtr targetPtr,
char* readBuff, TimeLineID* curFileTLI)
char* readBuff, TimeLineID* curFileTLI, char* xlog_path)
{
XLogDumpPrivate* dumpprivate = (XLogDumpPrivate*)state->private_data;
int count = XLOG_BLCKSZ;
if (!XLByteEQ(dumpprivate->endptr, InvalidXLogRecPtr)) {
int recptrdiff = XLByteDifference(dumpprivate->endptr, targetPagePtr);
if (XLOG_BLCKSZ <= recptrdiff)
count = XLOG_BLCKSZ;
else if (reqLen <= recptrdiff)
@ -362,7 +428,12 @@ static int XLogDumpReadPage(XLogReaderState* state, XLogRecPtr targetPagePtr, in
}
}
XLogDumpXLogRead(dumpprivate->inpath, dumpprivate->timeline, targetPagePtr, readBuff, count);
if (dumpprivate->shareStorageXlogFilePath == NULL) {
XLogDumpXLogRead(dumpprivate->inpath, dumpprivate->timeline, targetPagePtr, readBuff, count);
} else {
XLogDumpReadSharedStorage(dumpprivate->shareStorageXlogFilePath, targetPagePtr,
dumpprivate->shareStorageXlogSize, readBuff, count);
}
return count;
}
@ -715,6 +786,8 @@ static void usage(void)
printf(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n");
printf(" use --rmgr=list to list valid resource manager names\n");
printf(" -s, --start=RECPTR start reading at log position RECPTR\n");
printf(" -S, --size=n for share storage, the length of xlog file size(not include ctl info length)\n");
printf(" default: 512*1024*1024*1024(512GB)\n");
printf(" -t, --timeline=TLI timeline from which to read log records\n");
printf(" (default: 1 or the value used in STARTSEG)\n");
printf(" -V, --version output version information, then exit\n");
@ -748,6 +821,7 @@ int main(int argc, char** argv)
{"timeline", required_argument, NULL, 't'},
{"write-fpw", no_argument, NULL, 'w'},
{"xid", required_argument, NULL, 'x'},
{"size", required_argument, NULL, 'S'},
{"version", no_argument, NULL, 'V'},
{"verbose", no_argument, NULL, 'v'},
{"stats", no_argument, NULL, 'z'},
@ -766,6 +840,9 @@ int main(int argc, char** argv)
dumpprivate.startptr = InvalidXLogRecPtr;
dumpprivate.endptr = InvalidXLogRecPtr;
dumpprivate.endptr_reached = false;
dumpprivate.shareStorageXlogFilePath = NULL;
const long defaultShareStorageXlogSize = 512 * 1024 * 1024 * 1024L;
dumpprivate.shareStorageXlogSize = defaultShareStorageXlogSize;
config.bkp_details = false;
config.write_fpw = false;
@ -783,7 +860,7 @@ int main(int argc, char** argv)
goto bad_argument;
}
while ((option = getopt_long(argc, argv, "be:?fn:p:r:s:t:Vvwx:z", long_options, &optindex)) != -1) {
while ((option = getopt_long(argc, argv, "be:?fn:p:r:s:S:t:Vvwx:z", long_options, &optindex)) != -1) {
switch (option) {
case 'b':
config.bkp_details = true;
@ -838,6 +915,13 @@ int main(int argc, char** argv)
}
dumpprivate.startptr = (((uint64)hi) << 32) | lo;
break;
case 'S':
dumpprivate.shareStorageXlogSize = atol(optarg);
if (dumpprivate.shareStorageXlogSize == 0) {
fprintf(stderr, "%s: could not parse share storage xlog size \"%s\"\n", progname, optarg);
goto bad_argument;
}
break;
case 't':
if (sscanf(optarg, "%d", &dumpprivate.timeline) != 1) {
fprintf(stderr, "%s: could not parse timeline \"%s\"\n", progname, optarg);
@ -891,6 +975,11 @@ int main(int argc, char** argv)
split_path(argv[optind], &directory, &fname);
if (strspn(fname, "0123456789ABCDEFabcdef") != strlen(fname)) {
dumpprivate.shareStorageXlogFilePath = strdup(argv[optind]);
goto begin_read;
}
if (dumpprivate.inpath == NULL && directory != NULL) {
dumpprivate.inpath = directory;
@ -949,7 +1038,9 @@ int main(int argc, char** argv)
targetsegno = endsegno;
}
if (!XLByteInSeg(dumpprivate.endptr, targetsegno) && dumpprivate.endptr != (targetsegno + 1) * XLogSegSize) {
bool reachEnd = !XLByteInSeg(dumpprivate.endptr, targetsegno) &&
(dumpprivate.endptr != (targetsegno + 1) * XLogSegSize);
if (reachEnd) {
fprintf(stderr,
"%s: end log position %X/%X is not inside file \"%s\"\n",
progname,
@ -960,6 +1051,7 @@ int main(int argc, char** argv)
}
}
begin_read:
/* we don't know what to print */
if (XLogRecPtrIsInvalid(dumpprivate.startptr)) {
fprintf(stderr, "%s: no start log position given.\n", progname);
@ -996,7 +1088,7 @@ int main(int argc, char** argv)
for (;;) {
/* try to read the next record */
record = XLogReadRecord(xlogreader_state, first_record, &errormsg, false);
record = XLogReadRecord(xlogreader_state, first_record, &errormsg);
if (!record) {
if (!config.follow || dumpprivate.endptr_reached)
break;

View File

@ -29,6 +29,7 @@
#include "commands/sequence.h"
#include "commands/tablespace.h"
#include "replication/slot.h"
#include "replication/origin.h"
#ifdef PGXC
#include "pgxc/barrier.h"
#endif
@ -42,7 +43,8 @@
#include "access/ustore/knl_uredo.h"
#define PG_RMGR(symname, name, redo, desc, startup, cleanup, safe_restartpoint, undo, undo_desc) {name, desc},
#define PG_RMGR(symname, name, redo, desc, startup, cleanup, safe_restartpoint, undo, undo_desc, type_name) \
{name, desc},
const RmgrDescData RmgrDescTable[RM_MAX_ID + 1] = {
#include "access/rmgrlist.h"

View File

@ -2,6 +2,7 @@
* contrib/pgstattuple/pgstattuple.c
*
* Copyright (c) 2001,2002 Tatsuo Ishii
* Portions Copyright (c) 2021, openGauss Contributors
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose, without fee, and without a
@ -196,6 +197,7 @@ static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
case RELKIND_TOASTVALUE:
case RELKIND_UNCATALOGED:
case RELKIND_SEQUENCE:
case RELKIND_LARGE_SEQUENCE:
return pgstat_heap(rel, fcinfo);
case RELKIND_INDEX:
switch (rel->rd_rel->relam) {

View File

@ -158,8 +158,8 @@ PGconn *GetConnection(ForeignServer *server, UserMapping *user, bool will_prep_s
RegisterXactCallback(pgfdw_xact_callback, NULL);
RegisterSubXactCallback(pgfdw_subxact_callback, NULL);
CacheRegisterSyscacheCallback(FOREIGNSERVEROID, pgfdw_inval_callback, (Datum)0);
CacheRegisterSyscacheCallback(USERMAPPINGOID, pgfdw_inval_callback, (Datum)0);
CacheRegisterSessionSyscacheCallback(FOREIGNSERVEROID, pgfdw_inval_callback, (Datum)0);
CacheRegisterSessionSyscacheCallback(USERMAPPINGOID, pgfdw_inval_callback, (Datum)0);
if (IS_THREAD_POOL_SESSION) {
u_sess->ext_fdw_ctx[POSTGRES_TYPE_FDW].fdwExitFunc = pg_fdw_exit;

View File

@ -46,6 +46,7 @@
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "libpq/pqexpbuffer.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/clauses.h"
#include "optimizer/var.h"
@ -1178,6 +1179,36 @@ static void deparseRelation(StringInfo buf, Relation rel)
relname = RelationGetRelationName(rel);
}
/* In current version, there are some unpredictable operations (delete/update, etc.) of foreign table built on
* partitioned table. We forbid all operations in this condition by default. */
if (!ENABLE_SQL_BETA_FEATURE(PARTITION_FDW_ON)) {
char parttype = PARTTYPE_NON_PARTITIONED_RELATION;
UserMapping* user = GetUserMapping(GetUserId(), table->serverid);
ForeignServer *server = GetForeignServer(table->serverid);
PGconn* conn = GetConnection(server, user, false);
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query,
"SELECT c.parttype FROM pg_class c, pg_namespace n "
"WHERE c.relname = '%s' and c.relnamespace = n.oid and n.nspname = '%s'",
quote_identifier(relname), quote_identifier(nspname));
PGresult* res = pgfdw_exec_query(conn, query->data);
if (PQresultStatus(res) != PGRES_TUPLES_OK) {
pgfdw_report_error(ERROR, res, conn, true, query->data);
}
/* res may be empty as the relname/nspname validation is not checked */
if (PQntuples(res) > 0) {
parttype = *PQgetvalue(res, 0, 0);
}
PQclear(res);
destroyPQExpBuffer(query);
if ((parttype == PARTTYPE_PARTITIONED_RELATION || parttype == PARTTYPE_SUBPARTITIONED_RELATION)) {
ereport(ERROR, (errmsg("could not operate foreign table on partitioned table")));
}
}
appendStringInfo(buf, "%s.%s", quote_identifier(nspname), quote_identifier(relname));
}

View File

@ -654,10 +654,18 @@ static ForeignScan *postgresGetForeignPlan(PlannerInfo *root, RelOptInfo *basere
* complete information about, and (b) it wouldn't work anyway on
* older remote servers. Likewise, we don't worry about NOWAIT.
*/
if (rc->forUpdate) {
appendStringInfoString(&sql, " FOR UPDATE");
} else {
appendStringInfoString(&sql, " FOR SHARE");
switch (rc->strength) {
case LCS_FORKEYSHARE:
case LCS_FORSHARE:
appendStringInfoString(&sql, " FOR SHARE");
break;
case LCS_FORNOKEYUPDATE:
case LCS_FORUPDATE:
appendStringInfoString(&sql, " FOR UPDATE");
break;
default:
ereport(ERROR, (errmsg("unknown lock type: %d", rc->strength)));
break;
}
}
}

View File

@ -37,17 +37,17 @@ CREATE TABLE "S 1"."T 2" (
INSERT INTO "S 1"."T 1"
SELECT id,
id % 10,
to_char(id, 'FM00000'),
pg_catalog.to_char(id, 'FM00000'),
'1970-01-01'::timestamptz + ((id % 100) || ' days')::interval,
'1970-01-01'::timestamp + ((id % 100) || ' days')::interval,
id % 10,
id % 10,
'foo'::user_enum
FROM generate_series(1, 1000) id;
FROM pg_catalog.generate_series(1, 1000) id;
INSERT INTO "S 1"."T 2"
SELECT id,
'AAA' || to_char(id, 'FM000')
FROM generate_series(1, 100) id;
'AAA' || pg_catalog.to_char(id, 'FM000')
FROM pg_catalog.generate_series(1, 100) id;
ANALYZE "S 1"."T 1";
ANALYZE "S 1"."T 2";
@ -188,7 +188,7 @@ SELECT 'fixed', NULL FROM ft1 t1 WHERE c1 = 1;
-- user-defined operator/function
CREATE FUNCTION postgres_fdw_abs(int) RETURNS int AS $$
BEGIN
RETURN abs($1);
RETURN pg_catalog.abs($1);
END
$$ LANGUAGE plpgsql IMMUTABLE;
CREATE OPERATOR === (
@ -200,7 +200,7 @@ CREATE OPERATOR === (
);
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2);
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2;
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 = abs(t1.c2);
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 = pg_catalog.abs(t1.c2);
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 = t1.c2;
-- ===================================================================
@ -210,7 +210,7 @@ EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 = 1; --
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE t1.c1 = 100 AND t1.c2 = 0; -- BoolExpr
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE c1 IS NULL; -- NullTest
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE c1 IS NOT NULL; -- NullTest
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE round(abs(c1), 0) = 1; -- FuncExpr
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE pg_catalog.round(pg_catalog.abs(c1), 0) = 1; -- FuncExpr
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- OpExpr(l)
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE 1 = c1!; -- OpExpr(r)
EXPLAIN (VERBOSE, COSTS false) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr
@ -225,9 +225,9 @@ SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2;
-- check both safe and unsafe join conditions
EXPLAIN (VERBOSE, COSTS false)
SELECT * FROM ft2 a, ft2 b
WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7);
WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = pg_catalog.upper(a.c7);
SELECT * FROM ft2 a, ft2 b
WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7);
WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = pg_catalog.upper(a.c7);
-- bug before 9.3.5 due to sloppy handling of remote-estimate parameters
SELECT * FROM ft1 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft2 WHERE c1 < 5));
SELECT * FROM ft2 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft1 WHERE c1 < 5));
@ -267,12 +267,12 @@ EXPLAIN (VERBOSE, COSTS false) EXECUTE st1(1, 2);
EXECUTE st1(1, 1);
EXECUTE st1(101, 101);
-- subquery using stable function (can't be sent to remote)
PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c4) = '1970-01-17'::date) ORDER BY c1;
PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND pg_catalog.date(c4) = '1970-01-17'::date) ORDER BY c1;
EXPLAIN (VERBOSE, COSTS false) EXECUTE st2(10, 20);
EXECUTE st2(10, 20);
EXECUTE st2(101, 121);
-- subquery using immutable function (can be sent to remote)
PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c5) = '1970-01-17'::date) ORDER BY c1;
PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND pg_catalog.date(c5) = '1970-01-17'::date) ORDER BY c1;
EXPLAIN (VERBOSE, COSTS false) EXECUTE st3(10, 20);
EXECUTE st3(10, 20);
EXECUTE st3(20, 30);
@ -448,34 +448,34 @@ INSERT INTO ft1(c1, c2) VALUES(1111, -2); -- c2positive
UPDATE ft1 SET c2 = -c2 WHERE c1 = 1; -- c2positive
-- Test savepoint/rollback behavior
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, count(*) from "S 1"."T 1" where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from "S 1"."T 1" where c2 < 500 group by 1 order by 1;
begin;
update ft2 set c2 = 42 where c2 = 0;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
savepoint s1;
update ft2 set c2 = 44 where c2 = 4;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
release savepoint s1;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
savepoint s2;
update ft2 set c2 = 46 where c2 = 6;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
rollback to savepoint s2;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
release savepoint s2;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
savepoint s3;
update ft2 set c2 = -2 where c2 = 42 and c1 = 10; -- fail on remote side
rollback to savepoint s3;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
release savepoint s3;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
-- none of the above is committed yet remotely
select c2, count(*) from "S 1"."T 1" where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from "S 1"."T 1" where c2 < 500 group by 1 order by 1;
commit;
select c2, count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, count(*) from "S 1"."T 1" where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from ft2 where c2 < 500 group by 1 order by 1;
select c2, pg_catalog.count(*) from "S 1"."T 1" where c2 < 500 group by 1 order by 1;
-- ===================================================================
-- test serial columns (ie, sequence-based defaults)
@ -530,14 +530,14 @@ begin
tg_name, argstr, TG_when, TG_level, TG_OP, relid;
oldnew := '{}'::text[];
if TG_OP != 'INSERT' then
oldnew := array_append(oldnew, format('OLD: %s', OLD));
oldnew := pg_catalog.array_append(oldnew, pg_catalog.format('OLD: %s', OLD));
end if;
if TG_OP != 'DELETE' then
oldnew := array_append(oldnew, format('NEW: %s', NEW));
oldnew := pg_catalog.array_append(oldnew, pg_catalog.format('NEW: %s', NEW));
end if;
RAISE NOTICE '%', array_to_string(oldnew, ',');
RAISE NOTICE '%', pg_catalog.array_to_string(oldnew, ',');
if TG_OP = 'DELETE' then
return OLD;

View File

@ -240,8 +240,11 @@ void check_access_table(const policy_set *policy_ids, RangeVar *rel, int access_
if (rel == NULL) {
return;
}
PolicyLabelItem item(rel->schemaname, rel->relname, "", object_type);
/* PolicyLabelItem construction will append schema oid by relid */
PolicyLabelItem item;
PolicyLabelItem view_item(0, 0, O_VIEW);
gen_policy_labelitem(item, (const ListCell *)rel, object_type);
policy_result pol_result;
int block_behaviour = 0;
check_audit_policy_access(&item, &view_item, access_type, policy_ids, &pol_result,
@ -257,18 +260,17 @@ void audit_open_relation(List *list, Var *col_att, PolicyLabelItem *full_column,
}
RangeTblEntry *rte = (RangeTblEntry *)list_nth(list, relation_pos);
if (rte && rte->relid > 0) {
if (rte->relid > 0) {
Relation tbl_rel = relation_open(rte->relid, AccessShareLock);
if (tbl_rel) {
/* schema */
if (tbl_rel->rd_rel) {
full_column->m_schema = tbl_rel->rd_rel->relnamespace;
}
relation_close(tbl_rel, AccessShareLock);
}
Relation tbl_rel = relation_open(rte->relid, AccessShareLock);
if (tbl_rel->rd_rel) {
/* schema */
full_column->m_schema = tbl_rel->rd_rel->relnamespace;
}
/* subquery in from */
if (rte->rtekind == RTE_SUBQUERY) {
relation_close(tbl_rel, AccessShareLock);
if (rte->rtekind == RTE_REMOTE_DUMMY) {
return;
} else if (rte->rtekind == RTE_SUBQUERY) {
/* subquery in from */
if (rte->subquery) {
audit_open_relation(rte->subquery->rtable, col_att, full_column, is_found);
}
@ -286,8 +288,8 @@ void audit_open_relation(List *list, Var *col_att, PolicyLabelItem *full_column,
}
}
static void audit_open_view(RuleLock *rules, Var *col_att, PolicyLabelItem* full_column,
PolicyLabelItem *view_full_column)
static void audit_cursor_view(RuleLock *rules, Var *col_att, PolicyLabelItem *full_column,
PolicyLabelItem *view_full_column)
{
if (col_att == NULL)
return;
@ -362,7 +364,7 @@ void get_fqdn_by_relid(RangeTblEntry *rte, PolicyLabelItem *full_column, Var *co
/* schema */
full_column->m_schema = tbl_rel->rd_rel->relnamespace;
if (tbl_rel->rd_rules) { /* view */
audit_open_view(tbl_rel->rd_rules, col_att, full_column, view_full_column);
audit_cursor_view(tbl_rel->rd_rules, col_att, full_column, view_full_column);
if (view_full_column) {
view_full_column->m_schema = tbl_rel->rd_rel->relnamespace;
view_full_column->set_object(rte->relid, O_VIEW);
@ -450,12 +452,15 @@ void handle_subquery(RangeTblEntry *rte, int commandType, policy_result *pol_res
}
ListCell *lc = NULL;
foreach(lc, rte->subquery->rtable) {
RangeTblEntry *sub_rte = (RangeTblEntry *) lfirst(lc);
if (sub_rte == NULL)
RangeTblEntry *sub_rte = (RangeTblEntry *)lfirst(lc);
if (sub_rte == NULL) {
break;
}
/* recursive call handle_subquery till find a table object */
if (sub_rte->rtekind == RTE_SUBQUERY && sub_rte->subquery) {
if (sub_rte->rtekind == RTE_REMOTE_DUMMY) {
continue;
} else if (sub_rte->rtekind == RTE_SUBQUERY && sub_rte->subquery) {
/* recursive call handle_subquery till find a table object */
handle_subquery(sub_rte, commandType, pol_result, checked_tables, policy_ids,
security_policy_ids, &(++(*recursion_deep)));
} else if (sub_rte->relname) {
@ -465,12 +470,67 @@ void handle_subquery(RangeTblEntry *rte, int commandType, policy_result *pol_res
if (checked_tables->insert(sub_rte->relname).second) {
CmdType cmd_type = get_rte_commandtype(rte);
cmd_type = (cmd_type == CMD_UNKNOWN) ? (CmdType)commandType : cmd_type;
if (!handle_table_entry(sub_rte, cmd_type, policy_ids,
security_policy_ids, pol_result))
if (!handle_table_entry(sub_rte, cmd_type, policy_ids, security_policy_ids, pol_result)) {
continue;
}
flush_policy_result(pol_result, cmd_type);
}
}
}
}
void access_audit_policy_run(const List* rtable, CmdType cmd_type)
{
if (rtable == NULL) {
return;
}
/* filt audit policys by application info */
policy_set policy_ids;
IPV6 ip;
get_remote_addr(&ip);
FilterData filter_item(get_session_app_name(), ip);
check_audit_policy_filter(&filter_item, &policy_ids);
ListCell *lc = NULL;
policy_set security_policy_ids;
_checked_tables checked_tables;
foreach (lc, rtable) {
/* table object */
RangeTblEntry *rte = (RangeTblEntry *)lfirst(lc);
policy_result pol_result;
if (rte == NULL || rte->rtekind == RTE_REMOTE_DUMMY) {
continue;
}
if (rte->rtekind == RTE_SUBQUERY && rte->subquery) { /* relation is subquery */
int recursion_deep = 0;
handle_subquery(rte, rte->subquery->commandType, &pol_result, &checked_tables, &policy_ids,
&security_policy_ids, &recursion_deep);
} else if (rte->relname != NULL &&
checked_tables.insert(rte->relname).second) { /* verify if table object already checked */
/* use query plan commandtype here but not get it from rte directly */
if (!handle_table_entry(rte, cmd_type, &policy_ids, &security_policy_ids, &pol_result)) {
continue;
}
flush_policy_result(&pol_result, cmd_type);
}
}
flush_access_logs(AUDIT_OK);
}
void opfusion_unified_audit_executor(const PlannedStmt *plannedstmt)
{
/* verify parameter and audit policy */
if (!u_sess->attr.attr_security.Enable_Security_Policy || u_sess->proc_cxt.IsInnerMaintenanceTools ||
IsConnFromCoord() || !is_audit_policy_exist_load_policy_info()) {
return;
}
ereport(DEBUG1, (errmsg("opfusion_unified_audit_executor routine enter")));
if (!plannedstmt) {
return;
}
access_audit_policy_run(plannedstmt->rtable, plannedstmt->commandType);
}

View File

@ -52,5 +52,6 @@ void open_relation(List *list, Var *col_att, PolicyLabelItem *full_column, bool
void handle_subquery(RangeTblEntry *rte, int commandType, policy_result *pol_result, _checked_tables *checked_tables,
const policy_set *policy_ids, const policy_set *security_policy_ids, int *recursion_deep);
void audit_open_relation(List *list, Var *col_att, PolicyLabelItem *full_column, bool *is_found);
void access_audit_policy_run(const List* rtable, CmdType cmd_type);
void opfusion_unified_audit_executor(const PlannedStmt *plannedstmt);
#endif /* ACCESS_AUDIT_H_ */

View File

@ -491,78 +491,81 @@ bool check_audit_policy_access(const PolicyLabelItem *item, const PolicyLabelIte
}
}
PolicyLabelItem view_object_item(view_item->m_schema, view_item->m_object,
O_COLUMN, view_item->m_column);
/*
* walk through all the access audit label info to match with label of object
*/
if (labels.empty()) {
return false;
}
bool has_column = false;
if (labels.size()) {
AccessPair object_item("", item->m_obj_type);
{
gs_stl::gs_string value;
item->get_fqdn_value(&value);
object_item.first = value.c_str();
PolicyLabelItem view_object_item(view_item->m_schema, view_item->m_object,
O_COLUMN, view_item->m_column);
AccessPair object_item("", item->m_obj_type);
{
gs_stl::gs_string value;
item->get_fqdn_value(&value);
object_item.first = value.c_str();
}
loaded_labels *tmp_labels = get_policy_labels();
policy_label_map::const_iterator lit = labels.begin();
policy_label_map::const_iterator elit = labels.end();
for (; lit != elit; ++lit) {
const PolicyPair &pol_item = *(lit.first);
loaded_labels::const_iterator it;
if (tmp_labels != NULL) {
it = tmp_labels->find(lit->second->c_str());
}
loaded_labels *tmp_labels = get_policy_labels();
policy_label_map::const_iterator lit = labels.begin();
policy_label_map::const_iterator elit = labels.end();
for (; lit != elit; ++lit) {
const PolicyPair& pol_item = *(lit.first);
loaded_labels::const_iterator it;
if (tmp_labels != NULL) {
it = tmp_labels->find(lit->second->c_str());
if ((tmp_labels == NULL || it == tmp_labels->end()) && *(lit->second) == "all") {
(*pol_result)[pol_item.m_id][object_item];
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
}
if ((tmp_labels == NULL || it == tmp_labels->end()) && *(lit->second) == "all") {
(*pol_result)[pol_item.m_id][object_item];
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
} else if (it != tmp_labels->end()) {
/* <label_type, PolicyLabelItem> */
typed_labels::const_iterator fit = it->second->begin();
typed_labels::const_iterator feit = it->second->end();
for (; fit != feit; ++fit) {
bool is_columnn = (*(fit->first) == O_COLUMN);
has_column = has_column || is_columnn;
if (*(fit->first) != item->m_obj_type && (*fit->first) != O_SCHEMA) {
continue;
}
} else if (it != tmp_labels->end()) {
typed_labels::const_iterator fit = it->second->begin();
typed_labels::const_iterator feit = it->second->end();
for (; fit != feit; ++fit) {
bool is_columnn = (*(fit->first) == O_COLUMN);
has_column = has_column || is_columnn;
if (*(fit->first) != item->m_obj_type && (*fit->first) != O_SCHEMA) {
continue;
}
const gs_policy_label_set& objects = *(fit->second);
if (is_columnn) {
if (view_object_item.m_object && !view_object_item.empty() &&
objects.find(view_object_item) != objects.end()) {
gs_stl::gs_string value;
view_object_item.get_fqdn_value(&value);
object_item.first = value.c_str();
const gs_policy_label_set &objects = *(fit->second);
if (is_columnn) {
if (view_object_item.m_object && !view_object_item.empty() &&
objects.find(view_object_item) != objects.end()) {
gs_stl::gs_string value;
view_object_item.get_fqdn_value(&value);
object_item.first = value.c_str();
(*pol_result)[pol_item.m_id][object_item].insert(view_object_item.m_column);
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
}
}
if (objects.find(*item) != objects.end()) {
(*pol_result)[pol_item.m_id][object_item].insert(item->m_column);
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
}
}
} else if (*(fit->first) == O_SCHEMA) {
PolicyLabelItem sch_item;
sch_item.m_schema = item->m_schema;
if (objects.find(sch_item) != objects.end()) {
(*pol_result)[pol_item.m_id][object_item];
}
} else if (objects.find(*item) != objects.end()) {
(*pol_result)[pol_item.m_id][object_item];
(*pol_result)[pol_item.m_id][object_item].insert(view_object_item.m_column);
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
}
}
if (objects.find(*item) != objects.end()) {
(*pol_result)[pol_item.m_id][object_item].insert(item->m_column);
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
}
}
} else if (*(fit->first) == O_SCHEMA) {
PolicyLabelItem sch_item;
sch_item.m_schema = item->m_schema;
if (objects.find(sch_item) != objects.end()) {
(*pol_result)[pol_item.m_id][object_item];
}
} else if (objects.find(*item) != objects.end()) {
(*pol_result)[pol_item.m_id][object_item];
if (pol_item.m_block_type > 0) {
*block_behaviour = pol_item.m_block_type;
return has_column;
}
}
}
}

View File

@ -113,8 +113,6 @@ typedef void (*Reset_security_privilige_hook_type)();
typedef bool (*CheckSecurityPolicyFilter_hook_type)(const FilterData arg, policy_set *policy_ids);
typedef bool (*Security_isRoleInUse_hook_type)(Oid roleid);
typedef bool (*Security_Check_acl_privilige_hook_type)(int privilige);
typedef bool (*Security_LoginHandle_access_hook_type)(const char *dbname, const char *username,
bool success, bool login);
typedef bool (*Reload_security_policy_hook_type)();
#endif

View File

@ -177,7 +177,16 @@ static bool is_valid_language(Oid lang_oid)
static bool is_valid_for_masking(const char* func_name, Oid funcnsp, int& funcid,
const char* func_parameters, bool* invalid_params)
{
CatCList *catlist = SearchSysCacheList1(PROCNAMEARGSNSP, CStringGetDatum(func_name));
CatCList *catlist = NULL;
#ifndef ENABLE_MULTIPLE_NODES
if (t_thrd.proc->workingVersionNum < 92470) {
catlist = SearchSysCacheList1(PROCNAMEARGSNSP, CStringGetDatum(func_name));
} else {
catlist = SearchSysCacheList1(PROCALLARGS, CStringGetDatum(func_name));
}
#else
catlist = SearchSysCacheList1(PROCNAMEARGSNSP, CStringGetDatum(func_name));
#endif
bool is_found = false;
if (catlist != NULL) {
func_params f_params;
@ -187,7 +196,7 @@ static bool is_valid_for_masking(const char* func_name, Oid funcnsp, int& funcid
bool is_valid = true;
/* try to find function on pg_proc */
for (int i = 0; i < catlist->n_members && is_valid; ++i) {
HeapTuple proctup = &catlist->members[i]->tuple;
HeapTuple proctup = t_thrd.lsc_cxt.FetchTupleFromCatCList(catlist, i);
Form_pg_proc procform = (Form_pg_proc) GETSTRUCT(proctup);
/* verify namespace */
if (procform->pronamespace != funcnsp) {

View File

@ -36,6 +36,8 @@
#include "utils/snapmgr.h"
#include "utils/syscache.h"
#include "utils/lsyscache.h"
#include "gs_mask_policy.h"
#include "gs_policy_plugin.h"
static THR_LOCAL loaded_labels *all_labels = NULL;
@ -192,13 +194,13 @@ bool check_label_has_object(const PolicyLabelItem *object,
return false;
}
Assert(CheckLabelBoundPolicy != NULL);
loaded_labels *all_labels = get_policy_labels();
if (all_labels == NULL) {
loaded_labels *cur_all_labels = get_policy_labels();
if (cur_all_labels == NULL) {
return false;
}
loaded_labels::const_iterator it = all_labels->begin();
loaded_labels::const_iterator eit = all_labels->end();
loaded_labels::const_iterator it = cur_all_labels->begin();
loaded_labels::const_iterator eit = cur_all_labels->end();
for (; it != eit; ++it) {
/* for each item of loaded existing labels, and match labels */
if (labels != NULL && labels->find(*(it->first)) == labels->end()) {
@ -238,4 +240,41 @@ void clear_thread_local_label()
delete all_labels;
all_labels = NULL;
}
}
void verify_drop_column(AlterTableStmt *stmt)
{
ListCell *lcmd = NULL;
foreach (lcmd, stmt->cmds) {
AlterTableCmd *cmd = (AlterTableCmd *)lfirst(lcmd);
switch (cmd->subtype) {
case AT_DropColumn: {
/* check by column */
PolicyLabelItem find_obj(stmt->relation->schemaname, stmt->relation->relname, cmd->name, O_COLUMN);
if (check_label_has_object(&find_obj, is_masking_has_object)) {
char buff[512] = {0};
int rc = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
"Column: %s is part of some resource label, can not be renamed.", find_obj.m_column);
securec_check_ss(rc, "\0", "\0");
gs_audit_issue_syslog_message("PGAUDIT", buff, AUDIT_POLICY_EVENT, AUDIT_FAILED);
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\"", buff)));
}
break;
}
case AT_AlterColumnType: {
PolicyLabelItem find_obj(stmt->relation->schemaname, stmt->relation->relname, cmd->name, O_COLUMN);
if (check_label_has_object(&find_obj, is_masking_has_object, true)) {
char buff[512] = {0};
int ret = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
"Column: %s is part of some masking policy, can not be changed.", find_obj.m_column);
securec_check_ss(ret, "\0", "\0");
gs_audit_issue_syslog_message("PGAUDIT", buff, AUDIT_POLICY_EVENT, AUDIT_FAILED);
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\"", buff)));
}
break;
}
default:
break;
}
}
}

View File

@ -56,4 +56,5 @@ bool update_label_value(const gs_stl::gs_string object_name,
void reset_policy_labels();
void clear_thread_local_label();
void verify_drop_column(AlterTableStmt *stmt);
#endif /* GS_POLICY_GS_POLICY_LABELS_H_ */

View File

@ -22,6 +22,7 @@
*
* -------------------------------------------------------------------------
*/
#include "parser/parse_func.h"
#include "postgres.h"
#include "access/htup.h"
#include "access/heapam.h"
@ -31,10 +32,12 @@
#include "catalog/pg_proc.h"
#include "commands/user.h"
#include "gs_policy_object_types.h"
#include "gs_policy_plugin.h"
#include "utils/syscache.h"
#include "utils/lsyscache.h"
#include "utils/builtins.h"
#include "utils/acl.h"
#include "catalog/objectaddress.h"
/*
* get_relation_schema
@ -541,6 +544,19 @@ typedef struct ObjectTypeInfo
const char* object_name;
} ObjectTypeInfo;
typedef struct CmdCursorInfo {
CmdType cmd_type;
const char *object_name;
} CmdCursorInfo;
static CmdCursorInfo cmd_cursorinfo[] = {
{CMD_SELECT, "FOR SELECT FROM"},
{CMD_INSERT, "FOR INSERT TO"},
{CMD_UPDATE, "FOR UPDATE FROM"},
{CMD_DELETE, "FOR DELETE FROM"},
{CMD_UNKNOWN, NULL}
};
static OperInfo oper_infos[] = {
{"create", T_CREATE},
{"alter", T_ALTER},
@ -557,7 +573,7 @@ static OperInfo oper_infos[] = {
{"login_success", T_LOGIN_SUCCESS},
{"login_failure", T_LOGIN_FAILURE},
{"copy", T_COPY},
{"open", T_OPEN},
{"cursor", T_CURSOR},
{"fetch", T_FETCH},
{"close", T_CLOSE},
{"all", T_ALL},
@ -618,6 +634,20 @@ static ObjectTypeInfo object_type_infos[] =
{O_UNKNOWN, NULL}
};
/*
* get_cursorinfo
* return cursor operation object
*/
const char *get_cursorinfo(CmdType type)
{
for (int i = 0; cmd_cursorinfo[i].object_name != NULL; ++i) {
if (cmd_cursorinfo[i].cmd_type == type) {
return cmd_cursorinfo[i].object_name;
}
}
return "UNKNOWN";
}
/*
* get_privilege_type
* return privilege type in enum PrivType by its name
@ -792,4 +822,156 @@ bool verify_proc_params(const func_params* func_params, const func_types* proc_t
}
}
return true;
}
void load_function_label(const Query *query, bool audit_exist)
{
if (audit_exist && query->rtable != NIL) {
ListCell *lc = NULL;
foreach (lc, query->rtable) {
RangeTblEntry *rte = (RangeTblEntry *)lfirst(lc);
if (rte->rtekind == RTE_REMOTE_DUMMY) {
continue;
} else if (rte && rte->rtekind == RTE_FUNCTION && rte->funcexpr) {
FuncExpr *fe = (FuncExpr *)rte->funcexpr;
PolicyLabelItem func_label;
get_function_name(fe->funcid, &func_label);
set_result_set_function(func_label);
}
}
}
}
/*
* ListCell could be RangeVar nodes, FuncWithArgs nodes,
* or plain names (as Value strings) according to objtype
*/
void gen_policy_labelitem(PolicyLabelItem &item, const ListCell *rel, int objtype)
{
if (rel == NULL) {
return;
}
switch (objtype) {
case O_VIEW:
case O_TABLE: {
Oid relid = RangeVarGetRelid((RangeVar *)rel, NoLock, false);
if (!OidIsValid(relid)) {
return;
}
item = PolicyLabelItem(0, relid, objtype, "");
break;
}
case O_FUNCTION: {
FuncWithArgs *func = (FuncWithArgs *)(rel);
Oid funcid = LookupFuncNameTypeNames(func->funcname, func->funcargs, false);
if (!OidIsValid(funcid)) {
return;
}
item = PolicyLabelItem(0, funcid, objtype, "");
break;
}
case O_SCHEMA: {
char *nspname = strVal(rel);
item = PolicyLabelItem(nspname, NULL, NULL, objtype);
break;
}
default:
break;
}
return;
}
void gen_policy_label_for_commentstmt(PolicyLabelItem &item, const CommentStmt *commentstmt)
{
ObjectAddress address;
Relation relation;
address = get_object_address(commentstmt->objtype, commentstmt->objname, commentstmt->objargs, &relation,
ShareUpdateExclusiveLock, false);
switch (commentstmt->objtype) {
case OBJECT_COLUMN: {
item = PolicyLabelItem(0, address.objectId, O_COLUMN, strVal(lfirst(list_tail(commentstmt->objname))));
break;
}
case OBJECT_TABLE: {
item = PolicyLabelItem(0, address.objectId, O_TABLE, "");
break;
}
case OBJECT_FUNCTION: {
item = PolicyLabelItem(0, address.objectId, O_FUNCTION, "");
break;
}
case OBJECT_SCHEMA: {
item = PolicyLabelItem(address.objectId, 0, O_SCHEMA, "");
}
default:
break;
}
if (relation != NULL) {
relation_close(relation, NoLock);
}
}
int get_objtype(int object_type)
{
int objtype = O_UNKNOWN;
switch (object_type) {
case OBJECT_ROLE:
objtype = O_ROLE;
break;
case OBJECT_USER:
objtype = O_USER;
break;
case OBJECT_SCHEMA:
objtype = O_SCHEMA;
break;
case OBJECT_SEQUENCE:
objtype = O_SEQUENCE;
break;
case OBJECT_DATABASE:
objtype = O_DATABASE;
break;
case OBJECT_FOREIGN_SERVER:
objtype = O_SERVER;
break;
case OBJECT_FOREIGN_TABLE:
case OBJECT_STREAM:
case OBJECT_TABLE:
objtype = (object_type == OBJECT_TABLE) ? O_TABLE : O_FOREIGNTABLE;
break;
case OBJECT_COLUMN:
objtype = O_COLUMN;
break;
case OBJECT_FUNCTION:
objtype = O_FUNCTION;
break;
case OBJECT_CONTQUERY:
case OBJECT_VIEW:
objtype = O_VIEW;
break;
case OBJECT_INDEX:
objtype = O_INDEX;
break;
case OBJECT_TABLESPACE:
objtype = O_TABLESPACE;
break;
default:
break;
}
return objtype;
}
CmdType get_rte_commandtype(RangeTblEntry *rte)
{
if (rte->selectedCols) {
return CMD_SELECT;
} else if (rte->insertedCols) {
return CMD_INSERT;
} else if (rte->updatedCols) {
return CMD_UPDATE;
} else {
return CMD_UNKNOWN;
}
}

View File

@ -66,7 +66,7 @@ enum PrivType {
T_LOGIN_SUCCESS,
T_LOGIN_FAILURE,
T_COPY,
T_OPEN,
T_CURSOR,
T_FETCH,
T_CLOSE,
T_ALL
@ -266,8 +266,16 @@ bool get_function_name(long long funcid, PolicyLabelItem *name);
int get_privilege_type(const char *name);
int get_privilege_object_type(const char *name);
const char *get_privilege_object_name(int type);
void load_function_label(const Query *query, bool audit_exist);
bool name_list_to_string(List *names, gs_stl::gs_string *name, int max_const_count = -1 /* unlimited */);
bool name_list_to_label(PolicyLabelItem *item, List *names, char *name = NULL, size_t name_size = 0);
/* build PolicyLabelItem helper function*/
void gen_policy_labelitem(PolicyLabelItem &item, const ListCell *rel, int objtype);
void gen_policy_label_for_commentstmt(PolicyLabelItem &item, const CommentStmt *commentstmt);
int get_objtype(int object_type);
CmdType get_rte_commandtype(RangeTblEntry *rte);
const char *get_cursorinfo(CmdType type);
#endif /* GS_POLICY_OBJECT_TYPES_H_ */

View File

@ -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
@ -137,10 +138,7 @@ static THR_LOCAL char original_query[256];
static THR_LOCAL MngEventsVector *mng_events = NULL;
using StrMap = gs_stl::gs_map<gs_stl::gs_string, masking_result>;
static THR_LOCAL StrMap* masked_prepared_stmts = NULL;
static THR_LOCAL StrMap* masked_cursor_stmts = NULL;
static void process_masking(ParseState *pstate, Query *query, const policy_set *policy_ids, bool audit_exist);
static void gsaudit_next_PostParseAnalyze_hook(ParseState *pstate, Query *query);
static void destroy_local_parameter();
static void destory_thread_variables()
@ -182,13 +180,22 @@ static void set_view_query_state(bool state)
query_inside_view = state;
}
/*
* parse remote host ip to IPV6 struct including local/ipv4/ipv6
*/
void get_remote_addr(IPV6 *ip)
{
struct sockaddr* remote_addr = (struct sockaddr *)&u_sess->proc_cxt.MyProcPort->raddr.addr;
const int MAX_IP_ADDRESS_LEN = 129;
char ip_str[MAX_IP_ADDRESS_LEN] = { 0 };
/* parse the remote ip address */
get_client_ip(remote_addr, ip_str);
char ip_str[MAX_IP_LEN] = { 0 };
get_session_ip(ip_str, MAX_IP_LEN);
// format local unix
errno_t rc = EOK;
char *local = "127.0.0.1";
if (!strcmp("local", ip_str)) {
rc = memcpy_s(ip_str, MAX_IP_LEN, local, strlen(local));
securec_check_c(rc, "\0", "\0");
}
IPRange iprange;
iprange.str_to_ip(ip_str, ip);
return;
@ -276,12 +283,12 @@ static void destroy_local_parameter()
mng_events = NULL;
}
if (masked_cursor_stmts != NULL) {
delete masked_cursor_stmts;
masked_cursor_stmts = NULL;
}
free_masked_cursor_stmts();
}
/*
* append object name, the format is: schema.table
*/
void get_name_range_var(const RangeVar *rangevar, gs_stl::gs_string *buffer, bool enforce)
{
if (rangevar == NULL) {
@ -502,77 +509,6 @@ bool verify_copy_command_is_reparsed(List* parsetree_list, const char* query_str
return false;
}
static void free_masked_prepared_stmts()
{
if (masked_prepared_stmts) {
delete masked_prepared_stmts;
masked_prepared_stmts = NULL;
}
}
template< class T>
static inline void flush_stmt_masking_result(const char* name, T* stmts)
{
if (stmts) {
StrMap::const_iterator it = stmts->find(name);
if (it != stmts->end()) {
flush_masking_result(it->second);
}
}
}
static void flush_cursor_stmt_masking_result(const char* name)
{
flush_stmt_masking_result(name, masked_cursor_stmts);
}
static void flush_prepare_stmt_masking_result(const char* name)
{
flush_stmt_masking_result(name, masked_prepared_stmts);
}
static void close_cursor_stmt_as_masked(const char* name)
{
if (masked_cursor_stmts == NULL) {
return;
}
masked_cursor_stmts->erase(name);
if (masked_cursor_stmts->empty() || (strcasecmp(name, "all") == 0)) {
delete masked_cursor_stmts;
masked_cursor_stmts = NULL;
}
}
static void unprepare_stmt_as_masked(const char* name)
{
unprepare_stmt(name);
if (!masked_prepared_stmts) {
return;
}
masked_prepared_stmts->erase(name);
if (masked_prepared_stmts->empty() || !strcasecmp(name, "all")) {
delete masked_prepared_stmts;
masked_prepared_stmts = NULL;
}
}
static inline void set_prepare_stmt_as_masked(const char* name, const masking_result *result)
{
if (!masked_prepared_stmts) {
masked_prepared_stmts = new StrMap;
}
(*masked_prepared_stmts)[name] = (*result);
}
static inline void set_cursor_stmt_as_masked(const char* name, const masking_result *result)
{
if (!masked_cursor_stmts) {
masked_cursor_stmts = new StrMap;
}
(*masked_cursor_stmts)[name] = (*result);
}
void set_result_set_function(const PolicyLabelItem &func)
{
if (result_set_functions == NULL) {
@ -583,146 +519,6 @@ void set_result_set_function(const PolicyLabelItem &func)
}
}
/*
* Do masking for given target list
* this function will parse each RTE of the list
* and then will check wether each node need to do mask.
*/
static bool handle_masking(List* targetList, ParseState *pstate,
const policy_set *policy_ids, List* rtable, Node* utilityNode)
{
if (targetList == NIL || policy_ids->empty()) {
return false;
}
ListCell* temp = NULL;
masking_result masking_result;
foreach(temp, targetList) {
TargetEntry *old_tle = (TargetEntry *) lfirst(temp);
/* Shuffle masking columns can only select directly with out other operations */
parser_target_entry(pstate, old_tle, policy_ids, &masking_result, rtable, true);
}
if (masking_result.size() > 0) {
if (strlen(t_thrd.security_policy_cxt.prepare_stmt_name) > 0) {
/* prepare statement was masked */
set_prepare_stmt_as_masked(t_thrd.security_policy_cxt.prepare_stmt_name,
&masking_result); /* save masking event for executing case */
} else if (utilityNode != NULL) {
switch (nodeTag(utilityNode)) {
case T_DeclareCursorStmt:
{
DeclareCursorStmt* stmt = (DeclareCursorStmt *)utilityNode;
/* save masking event for fetching case */
set_cursor_stmt_as_masked(stmt->portalname, &masking_result);
}
break;
default:
flush_masking_result(&masking_result); /* invoke masking event */
}
} else {
flush_masking_result(&masking_result); /* invoke masking event */
}
return true;
}
return false;
}
static void select_PostParseAnalyze(ParseState *pstate, Query *&query, const policy_set *policy_ids, bool audit_exist)
{
if (query == NULL) {
return;
}
List *targetList = NIL;
if (query->targetList != NIL) {
targetList = query->targetList;
} else {
targetList = pstate->p_target_list;
}
handle_masking(targetList, pstate, policy_ids, query->rtable, query->utilityStmt);
/* deal with function type label */
if (audit_exist && query->rtable != NIL) {
ListCell *lc = NULL;
foreach(lc, query->rtable) {
RangeTblEntry *rte = (RangeTblEntry *) lfirst(lc);
if (rte && rte->rtekind == RTE_FUNCTION && rte->funcexpr) {
FuncExpr* fe = (FuncExpr *)rte->funcexpr;
PolicyLabelItem func_label;
get_function_name(fe->funcid, &func_label);
set_result_set_function(func_label);
}
}
}
}
static bool process_union_masking(Node *union_node,
ParseState *pstate, const Query *query, const policy_set *policy_ids, bool audit_exist)
{
if (union_node == NULL) {
return false;
}
switch (nodeTag(union_node)) {
/* For each union, we get its query recursively for masking until it doesn't have any union query */
case T_SetOperationStmt:
{
SetOperationStmt *stmt = (SetOperationStmt *)union_node;
if (stmt->op != SETOP_UNION) {
return false;
}
process_union_masking((Node *)(stmt->larg), pstate, query, policy_ids, audit_exist);
process_union_masking((Node *)(stmt->rarg), pstate, query, policy_ids, audit_exist);
}
break;
case T_RangeTblRef:
{
RangeTblRef *ref = (RangeTblRef *)union_node;
if (ref->rtindex <= 0 || ref->rtindex > list_length(query->rtable)) {
return false;
}
Query* mostQuery = rt_fetch(ref->rtindex, query->rtable)->subquery;
process_masking(pstate, mostQuery, policy_ids, audit_exist);
}
break;
default:
break;
}
return true;
}
/*
* Main entrance for masking
* Identify components in query tree that need to do masking.
* This function will find all parts which need masking of select query,
* mainly includes CTE / setOperation / normal select columns.
*/
static void process_masking(ParseState *pstate, Query *query, const policy_set *policy_ids, bool audit_exist)
{
if (query == NULL) {
return;
}
/* set-operation tree UNION query */
if (!process_union_masking(query->setOperations, pstate, query, policy_ids, audit_exist)) {
ListCell *lc = NULL;
/* For each Cte, we get its query recursively for masking, and then handle this query in normal way */
if (query->cteList != NIL) {
foreach(lc, query->cteList) {
CommonTableExpr *cte = (CommonTableExpr *) lfirst(lc);
Query *cte_query = (Query *)cte->ctequery;
process_masking(pstate, cte_query, policy_ids, audit_exist);
}
}
/* find subquery and process each subquery node */
if (query->rtable != NULL) {
foreach(lc, query->rtable) {
RangeTblEntry *rte = (RangeTblEntry *) lfirst(lc);
Query *subquery = (Query *)rte->subquery;
process_masking(pstate, subquery, policy_ids, audit_exist);
}
}
select_PostParseAnalyze(pstate, query, policy_ids, audit_exist);
}
}
/*
* check exchange partition list contains masked table.
* For given AlterTableCmd list, check whether ordinary
@ -844,7 +640,9 @@ static void gsaudit_next_PostParseAnalyze_hook(ParseState *pstate, Query *query)
foreach (lc, query->rtable) {
RangeTblEntry *rte = (RangeTblEntry *)lfirst(lc);
if (rte->rtekind == RTE_SUBQUERY && rte->subquery != NULL) { /* check masking */
if (rte->rtekind == RTE_REMOTE_DUMMY) {
continue;
} else if (rte->rtekind == RTE_SUBQUERY && rte->subquery != NULL) { /* check masking */
reset_node_location();
handle_masking(rte->subquery->targetList, pstate,
&masking_policy_ids, rte->subquery->rtable, rte->subquery->utilityStmt);
@ -963,44 +761,6 @@ static void verify_drop_user(const char *rolename)
}
}
static void verify_drop_column(AlterTableStmt *stmt)
{
ListCell *lcmd = NULL;
foreach (lcmd, stmt->cmds) {
AlterTableCmd *cmd = (AlterTableCmd *)lfirst(lcmd);
switch (cmd->subtype) {
case AT_DropColumn: {
/* check by column */
PolicyLabelItem find_obj(stmt->relation->schemaname, stmt->relation->relname, cmd->name, O_COLUMN);
if (check_label_has_object(&find_obj, is_masking_has_object)) {
char buff[512] = {0};
int rc = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
"Column: %s is part of some resource label, can not be renamed.", find_obj.m_column);
securec_check_ss(rc, "\0", "\0");
gs_audit_issue_syslog_message("PGAUDIT", buff, AUDIT_POLICY_EVENT, AUDIT_FAILED);
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\"", buff)));
}
break;
}
case AT_AlterColumnType: {
PolicyLabelItem find_obj(stmt->relation->schemaname, stmt->relation->relname, cmd->name, O_COLUMN);
if (check_label_has_object(&find_obj, is_masking_has_object, true))
{
char buff[512] = {0};
int ret = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
"Column: %s is part of some masking policy, can not be changed.", find_obj.m_column);
securec_check_ss(ret, "\0", "\0");
gs_audit_issue_syslog_message("PGAUDIT", buff, AUDIT_POLICY_EVENT, AUDIT_FAILED);
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\"", buff)));
}
break;
}
default:
break;
}
}
}
/*
* Hook ProcessUtility to do session auditing for DDL and utility commands.
*/
@ -1027,7 +787,7 @@ static inline void get_copy_table_name(CopyStmt *stmt, gs_stl::gs_string *name)
}
}
static bool is_audit_policy_exist_load_policy_info()
bool is_audit_policy_exist_load_policy_info()
{
load_database_policy_info();
gs_policy_set *policies = get_audit_policies();
@ -1043,24 +803,12 @@ static void light_unified_audit_executor(const Query *query)
return;
}
IPV6 ip;
get_remote_addr(&ip);
FilterData filter_item(u_sess->attr.attr_common.application_name, ip);
policy_set audit_policy_ids;
check_audit_policy_filter(&filter_item, &audit_policy_ids);
ereport(DEBUG1, (errmsg("light_unified_audit_executor routine enter")));
ListCell *lc = NULL;
foreach (lc, query->rtable) {
RangeTblEntry *rte = (RangeTblEntry*)lfirst(lc);
char *object_name = rte->relname ? rte->relname : rte->eref->aliasname;
if (object_name == NULL) {
break;
}
check_access_table(&audit_policy_ids, object_name, query->commandType, O_UNKNOWN, object_name);
if (!query->rtable) {
return;
}
flush_access_logs(AUDIT_OK);
access_audit_policy_run(query->rtable, query->commandType);
}
static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString, ParamListInfoData *params,
@ -1092,13 +840,13 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
if (parsetree != NULL) {
switch (nodeTag(parsetree)) {
case T_PlannedStmt: {
if (!check_audited_privilige(T_OPEN) && !SECURITY_CHECK_ACL_PRIV(T_OPEN)) {
if (!check_audited_privilige(T_CURSOR) && !SECURITY_CHECK_ACL_PRIV(T_CURSOR)) {
break;
}
char buff[POLICY_STR_BUFF_LEN] = {0};
PlannedStmt *stmt = (PlannedStmt *)parsetree;
get_open_cursor_info(stmt, buff, sizeof(buff));
internal_audit_str(&security_policy_ids, &audit_policy_ids, buff, T_OPEN, "OPEN", O_CURSOR);
internal_audit_str(&security_policy_ids, &audit_policy_ids, buff, T_CURSOR, "OPEN", O_CURSOR);
break;
}
case T_FetchStmt: {
@ -1112,12 +860,12 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
gs_stl::gs_vector<PolicyLabelItem> cursor_objects;
if (portal && portal->queryDesc && portal->queryDesc->plannedstmt &&
portal->queryDesc->plannedstmt->rtable) {
get_cursor_tables(portal->queryDesc->plannedstmt->rtable, buff, sizeof(buff),
printed_size, &cursor_objects);
get_cursor_tables(portal->queryDesc->plannedstmt->rtable, buff, sizeof(buff), printed_size,
&cursor_objects);
}
for (const PolicyLabelItem item : cursor_objects) {
internal_audit_object_str(&security_policy_ids, &audit_policy_ids, &item, T_FETCH,
"FETCH", stmt->portalname);
internal_audit_object_str(&security_policy_ids, &audit_policy_ids, &item, T_FETCH, "FETCH",
stmt->portalname);
}
flush_cursor_stmt_masking_result(stmt->portalname); /* invoke masking event in this case */
}
@ -1201,14 +949,8 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
case T_DeallocateStmt: {
DeallocateStmt *stmt = (DeallocateStmt *)parsetree;
char tmp[POLICY_TMP_BUFF_LEN] = {0};
int rc;
if (stmt->name == NULL) {
rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "ALL");
securec_check_ss(rc, "\0", "\0");
} else {
rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "%s", stmt->name);
securec_check_ss(rc, "\0", "\0");
}
int rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "%s", stmt->name == NULL ? "ALL" : stmt->name);
securec_check_ss(rc, "\0", "\0");
check_access_table(&audit_policy_ids, tmp, CMD_DEALLOCATE, O_UNKNOWN, tmp);
unprepare_stmt_as_masked(tmp);
break;
@ -1332,14 +1074,15 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
forboth(lc1, stmt->grantees, lc2, stmt->objects)
{
PrivGrantee *rte1 = (PrivGrantee *)lfirst(lc1);
ListCell *rel2 = (ListCell *)lfirst(lc2);
gs_stl::gs_string tmp;
const char *granted_name = ACL_get_object_name(stmt->targtype, stmt->objtype, lc2, &tmp);
if (granted_name != NULL) {
acl_audit_object(&security_policy_ids, &audit_policy_ids,
acl_audit_object(&security_policy_ids, &audit_policy_ids, rel2,
names_pair(granted_name,
rte1->rolname ? rte1->rolname : "ALL" /* grantee_name */),
stmt->is_grant ? T_GRANT : T_REVOKE, stmt->is_grant ? "GRANT" : "REVOKE",
stmt->objtype);
stmt->objtype, stmt->targtype);
}
}
}
@ -1359,10 +1102,32 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
PrivGrantee *rte1 = (PrivGrantee *)lfirst(lc1);
PrivGrantee *rte2 = (PrivGrantee *)lfirst(lc2);
internal_audit_object_str(&security_policy_ids, &audit_policy_ids,
internal_audit_object_str(&security_policy_ids, &audit_policy_ids, NULL,
names_pair(rte2->rolname /* granted_name */, rte1->rolname /* grantee_name */),
grantrolestmt->is_grant ? T_GRANT : T_REVOKE, grantrolestmt->is_grant ? "GRANT" : "REVOKE",
O_ROLE, true);
O_ROLE, ACL_TARGET_OBJECT, true, true);
}
}
break;
}
case T_GrantDbStmt: {
if (!check_audited_privilige(T_GRANT) && !check_audited_privilige(T_REVOKE) &&
!SECURITY_CHECK_ACL_PRIV(T_GRANT) && !SECURITY_CHECK_ACL_PRIV(T_REVOKE)) {
break;
}
GrantDbStmt *grantdbstmt = (GrantDbStmt *)(parsetree);
ListCell *lc1 = NULL;
ListCell *lc2 = NULL;
if (grantdbstmt && grantdbstmt->grantees && grantdbstmt->privileges) {
forboth(lc1, grantdbstmt->grantees, lc2, grantdbstmt->privileges)
{
PrivGrantee *rte1 = (PrivGrantee *)lfirst(lc1);
DbPriv *rte2 = (DbPriv*)lfirst(lc2);
internal_audit_object_str(&security_policy_ids, &audit_policy_ids, NULL,
names_pair(rte2->db_priv_name, rte1->rolname /* grantee_name */),
grantdbstmt->is_grant ? T_GRANT : T_REVOKE, grantdbstmt->is_grant ? "GRANT" : "REVOKE",
O_UNKNOWN, ACL_TARGET_OBJECT, true, false);
}
}
break;
@ -1374,7 +1139,8 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
VacuumStmt *stmt = (VacuumStmt *)parsetree;
if (stmt) {
if (stmt->relation) {
PolicyLabelItem item(stmt->relation->schemaname, stmt->relation->relname);
PolicyLabelItem item;
gen_policy_labelitem(item, (const ListCell *)stmt->relation, O_TABLE);
if (stmt->va_cols) {
ListCell *citem = NULL;
foreach (citem, stmt->va_cols) {
@ -1402,14 +1168,18 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
break;
}
case T_CommentStmt: {
if (!check_audited_privilige(T_COMMENT) && !SECURITY_CHECK_ACL_PRIV(T_COMMENT)) {
if (!check_audited_privilige(T_COMMENT)) {
break;
}
CommentStmt *commentstmt = (CommentStmt *)(parsetree);
PolicyLabelItem item(0, 0, get_objtype(commentstmt->objtype), "");
gen_policy_label_for_commentstmt(item, commentstmt);
gs_stl::gs_string objectname;
add_current_path(commentstmt->objtype, commentstmt->objname, &objectname);
audit_object(&security_policy_ids, &audit_policy_ids, objectname.c_str(), T_COMMENT,
"COMMENT", commentstmt->objtype);
internal_audit_object_str(&security_policy_ids, &audit_policy_ids, &item, T_COMMENT, "COMMENT",
objectname.c_str());
break;
}
case T_VariableSetStmt: {
@ -1561,14 +1331,32 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
break;
}
IndexStmt *stmt = (IndexStmt *)parsetree;
if (stmt && stmt->relation) {
if (stmt && stmt->relation && stmt->idxname) {
gs_stl::gs_string objectname;
get_name_range_var(stmt->relation, &objectname);
if (!objectname.empty()) {
objectname.push_back('.');
}
objectname.append(stmt->idxname);
internal_audit_str(&security_policy_ids, &audit_policy_ids, objectname.c_str(), T_CREATE,
"CREATE", O_INDEX);
}
break;
}
case T_CreateDataSourceStmt:
{
if (!check_audited_privilige(T_CREATE) && !SECURITY_CHECK_ACL_PRIV(T_CREATE)) {
break;
}
CreateDataSourceStmt *stmt = (CreateDataSourceStmt *)parsetree;
gs_stl::gs_string objectname;
if (stmt && stmt->srcname) {
objectname.append(stmt->srcname);
}
internal_audit_str(&security_policy_ids, &audit_policy_ids, objectname.c_str(), T_CREATE,
"CREATE", O_DATA_SOURCE);
break;
}
case T_ViewStmt: /* create View */
{
if (!check_audited_privilige(T_CREATE) && !SECURITY_CHECK_ACL_PRIV(T_CREATE)) {
@ -1688,6 +1476,10 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
break;
}
case T_TruncateStmt: {
/*
* truncate is dml sql but go through the processutility routine
* so that use access function to deal with it in privilege hook entrance
*/
if (!check_audited_access(CMD_TRUNCATE)) {
break;
}
@ -1705,11 +1497,9 @@ static void gsaudit_ProcessUtility_hook(Node *parsetree, const char *queryString
break;
}
CreateTableAsStmt *createtablestmt = (CreateTableAsStmt *)(parsetree);
if (createtablestmt != NULL) {
IntoClause *intoclause = createtablestmt->into;
if (intoclause != NULL)
audit_table(&security_policy_ids, &audit_policy_ids, intoclause->rel, T_CREATE,
"CREATE", O_TABLE);
if (createtablestmt != NULL && createtablestmt->into != NULL) {
audit_table(&security_policy_ids, &audit_policy_ids, createtablestmt->into->rel, T_CREATE, "CREATE",
O_TABLE);
}
break;
}
@ -1900,24 +1690,12 @@ static const char *ACL_get_object_name(int targetype, int objtype, ListCell *obj
return NULL;
}
CmdType get_rte_commandtype(RangeTblEntry *rte)
{
if (rte->selectedCols) {
return CMD_SELECT;
} else if (rte->insertedCols) {
return CMD_INSERT;
} else if (rte->updatedCols) {
return CMD_UPDATE;
} else {
return CMD_UNKNOWN;
}
}
static void gs_audit_executor_start_hook(QueryDesc *queryDesc, int eflags)
{
/* verify parameter and audit policy */
if (!u_sess->attr.attr_security.Enable_Security_Policy ||
u_sess->proc_cxt.IsInnerMaintenanceTools || IsConnFromCoord() ||
!is_audit_policy_exist_load_policy_info()) {
!is_audit_policy_exist_load_policy_info() || queryDesc == NULL) {
if (next_ExecutorStart_hook) {
next_ExecutorStart_hook(queryDesc, eflags);
} else {
@ -1926,45 +1704,13 @@ static void gs_audit_executor_start_hook(QueryDesc *queryDesc, int eflags)
return;
}
if (queryDesc != NULL) {
IPV6 ip;
get_remote_addr(&ip);
FilterData filter_item(get_session_app_name(), ip);
policy_set policy_ids;
check_audit_policy_filter(&filter_item, &policy_ids);
policy_set security_policy_ids;
if (checkSecurityPolicyFilter_hook != NULL) {
checkSecurityPolicyFilter_hook(filter_item, &security_policy_ids);
}
if (queryDesc->plannedstmt && queryDesc->plannedstmt->rtable) {
ListCell *lc = NULL;
_checked_tables checked_tables;
foreach (lc, queryDesc->plannedstmt->rtable) {
/* table object */
RangeTblEntry *rte = (RangeTblEntry *) lfirst(lc);
policy_result pol_result;
if (rte && rte->relname) {
if (rte->rtekind == RTE_SUBQUERY && rte->subquery) { /* relation is subquery */
int recursion_deep = 0;
handle_subquery(rte, rte->subquery->commandType, &pol_result, &checked_tables,
&policy_ids, &security_policy_ids, &recursion_deep);
/* verify if table object already checked */
} else if (checked_tables.insert(rte->relname).second) {
CmdType cmd_type = get_rte_commandtype(rte);
cmd_type = (cmd_type == CMD_UNKNOWN) ? queryDesc->plannedstmt->commandType : cmd_type;
if (!handle_table_entry(rte, cmd_type, &policy_ids,
&security_policy_ids, &pol_result)) {
continue;
}
flush_policy_result(&pol_result, cmd_type);
}
}
}
}
/* execute audit policy by target application info/object/operation */
const PlannedStmt *plannedstmt = queryDesc->plannedstmt;
if (plannedstmt != NULL) {
access_audit_policy_run(plannedstmt->rtable, plannedstmt->commandType);
}
/* flush the audit logs with result flag */
PG_TRY();
{
if (next_ExecutorStart_hook) {
@ -2036,7 +1782,7 @@ void install_audit_hook()
* preserve the chains.
*/
next_ExecutorStart_hook = ExecutorStart_hook;
next_ProcessUtility_hook = ProcessUtility_hook;
set_gsaudit_prehook(ProcessUtility_hook);
/*
* Install audit hooks, the interface for GaussDB kernel user as below
@ -2044,11 +1790,15 @@ void install_audit_hook()
* ExecutorStart_hook: hook when ExecutorStart is called, which will run the audit process for DML subtables
* ProcessUtility_hook: hook when when ProcessUtility is called, which will run the DDL auti process
* light_unified_audit_executor_hook : hook when cn light proxy
* opfusion_unified_audit_executor_hook: hook for sqlbypass
* opfusion_unified_audit_flush_logs_hook: hook for sqlbypass
*/
user_login_hook = NULL;
ExecutorStart_hook = gs_audit_executor_start_hook;
ProcessUtility_hook = gsaudit_ProcessUtility_hook;
light_unified_audit_executor_hook = light_unified_audit_executor;
opfusion_unified_audit_executor_hook = opfusion_unified_audit_executor;
opfusion_unified_audit_flush_logs_hook = flush_access_logs;
}
void install_masking_hook()
@ -2072,6 +1822,15 @@ void install_label_hook()
}
}
/*
* This function is used for setting prev_ProcessUtility to rewrite
* standard_ProcessUtility by other extension.
*/
void set_gsaudit_prehook(ProcessUtility_hook_type func)
{
next_ProcessUtility_hook = func;
}
/*
* Define GUC variables and install hooks upon module load.
* NOTE: _PG_init will be invoked(installed) many times
@ -2104,15 +1863,9 @@ void _PG_init(void)
/*
* Uninstall hooks and release local memory context
* NOTE: Now the uninstall hooks process is disabled referring funciton internal_unload_library
* we just put the release function pointers here to adapt the uninstall process in the feature.
* we just put the release function here to adapt the uninstall process in the feature.
*/
void _PG_fini(void)
{
user_login_hook = NULL;
ExecutorStart_hook = next_ExecutorStart_hook;
ProcessUtility_hook = next_ProcessUtility_hook;
post_parse_analyze_hook = next_post_parse_analyze_hook;
copy_need_to_be_reparse = NULL;
light_unified_audit_executor_hook = NULL;
ereport(LOG, (errmsg("Gsaudit extension finished")));
}

View File

@ -46,9 +46,9 @@ void get_remote_addr(IPV6 *ip);
const char* get_session_app_name();
const char* GetUserName(char* user_name, size_t user_name_size);
bool get_ipaddress(gs_stl::gs_string& ipaddress);
void set_result_set_function(const PolicyLabelItem &func);
extern void set_result_set_function(const PolicyLabelItem &func);
void get_name_range_var(const RangeVar *rangevar, gs_stl::gs_string *buffer, bool enforce = true);
CmdType get_rte_commandtype(RangeTblEntry *rte);
extern void load_database_policy_info();
bool is_audit_policy_exist_load_policy_info();
#endif /* GS_POLICY_PLUGIN_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +1,53 @@
/*
* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* masking.h
*
* IDENTIFICATION
* contrib/security_plugin/masking.h
*
* -------------------------------------------------------------------------
*/
#ifndef MASKING_H_
#define MASKING_H_
#include <string>
#include "parser/parse_node.h"
#include "nodes/primnodes.h"
#include "gs_mask_policy.h"
bool parser_target_entry(ParseState *pstate, TargetEntry*& old_tle, const policy_set *policy_ids,
masking_result *result, List* rtable, bool can_mask = true);
void reset_node_location();
/* col_type for integer should be int8, int4, int2, int1 */
Node* create_integer_node(ParseState *pstate, int value, int location, int col_type = INT4OID, bool make_cast = true);
#endif /* MASKING_H_ */
/*
* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* masking.h
*
* IDENTIFICATION
* contrib/security_plugin/masking.h
*
* -------------------------------------------------------------------------
*/
#ifndef MASKING_H_
#define MASKING_H_
#include <string>
#include "parser/parse_node.h"
#include "nodes/primnodes.h"
#include "gs_mask_policy.h"
bool parser_target_entry(ParseState *pstate, TargetEntry*& old_tle, const policy_set *policy_ids,
masking_result *result, List* rtable, bool can_mask = true);
void reset_node_location();
/* col_type for integer should be int8, int4, int2, int1 */
Node* create_integer_node(ParseState *pstate, int value, int location, int col_type = INT4OID, bool make_cast = true);
void free_masked_cursor_stmts();
void free_masked_prepared_stmts();
void close_cursor_stmt_as_masked(const char* name);
void unprepare_stmt_as_masked(const char* name);
void set_prepare_stmt_as_masked(const char* name, const masking_result *result);
void set_cursor_stmt_as_masked(const char* name, const masking_result *result);
void flush_cursor_stmt_masking_result(const char* name);
void flush_prepare_stmt_masking_result(const char* name);
bool process_union_masking(Node *union_node,
ParseState *pstate, const Query *query, const policy_set *policy_ids, bool audit_exist);
void process_masking(ParseState *pstate, Query *query, const policy_set *policy_ids, bool audit_exist);
void select_PostParseAnalyze(ParseState *pstate, Query *&query, const policy_set *policy_ids, bool audit_exist);
bool handle_masking(List* targetList, ParseState *pstate,
const policy_set *policy_ids, List* rtable, Node* utilityNode);
#endif /* MASKING_H_ */

View File

@ -25,6 +25,7 @@
#include "gs_audit_policy.h"
#include <memory>
#include "access_audit.h"
#include "parser/parse_func.h"
#include "postgres.h"
#include "catalog/namespace.h"
#include "commands/dbcommands.h"
@ -48,24 +49,63 @@
#define ACCESS_CONTROL_CHECK_ACL_PRIVILIGE(type) \
((check_acl_privilige_hook == NULL) ? true : check_acl_privilige_hook(type))
static Security_LoginHandle_access_hook_type security_LoginHandle_access_hook = NULL;
typedef struct AclObjectType {
GrantObjectType grant_type;
PrivObject privi_type;
} AclObjectType;
static AclObjectType aclobject_infos[] = {
{ACL_OBJECT_COLUMN, O_COLUMN},
{ACL_OBJECT_RELATION, O_TABLE},
{ACL_OBJECT_SEQUENCE, O_SEQUENCE},
{ACL_OBJECT_DATABASE, O_DATABASE},
{ACL_OBJECT_DOMAIN, O_DOMAIN},
{ACL_OBJECT_FOREIGN_SERVER, O_SERVER},
{ACL_OBJECT_FUNCTION, O_FUNCTION},
{ACL_OBJECT_LANGUAGE, O_LANGUAGE},
{ACL_OBJECT_NAMESPACE, O_SCHEMA},
{ACL_OBJECT_TABLESPACE, O_TABLESPACE},
{ACL_OBJECT_DATA_SOURCE, O_DATA_SOURCE},
};
void add_current_path(int objtype, List *fqdn, gs_stl::gs_string *buffer);
/* function overloading, notice - different implementation */
void internal_audit_object_str(const policy_set *security_policy_ids, const policy_set *policy_ids,
const names_pair names, int priv_type, const char *priv_name, int objtype, bool ignore_db)
/*
* grant/revoke sql audit routine
* policy_ids: policy ids after filt by app
* rel: ListCell object
* priv_type: privilege type, grant or revoke
* priv_name: grant or revoke
* objtype: object type, table...
* ignore_db: whether ignore database
*/
void internal_audit_object_str(const policy_set *security_policy_ids, const policy_set *policy_ids, const ListCell *rel,
const names_pair names, int priv_type, const char *priv_name, int objtype,
int target_type, bool is_rolegrant, bool ignore_db)
{
/*
* Note PolicyLabelItem just support table/function/view/column
* so that only "all" label will work for other object type
*/
PolicyLabelItem item;
if (target_type == ACL_TARGET_OBJECT) {
gen_policy_labelitem(item, rel, objtype);
}
/* PolicyLabelItem construction will append schema oid by relid */
policy_simple_set policy_result;
PolicyLabelItem item(0, 0, objtype);
bool security_auditobject_res = (accesscontrol_securityAuditObject_hook != NULL) ?
accesscontrol_securityAuditObject_hook(security_policy_ids, &item, priv_type, priv_name) :
true;
if (security_auditobject_res && check_audit_policy_privileges(policy_ids, &policy_result, priv_type,&item)) {
if (security_auditobject_res && check_audit_policy_privileges(policy_ids, &policy_result, priv_type, &item)) {
char buff[2048] = {0};
char user_name[USERNAME_LEN];
const char *direction = (priv_type == T_GRANT) ? "TO" : "FROM";
const char *dbname = get_database_name(u_sess->proc_cxt.MyDatabaseId);
gs_stl::gs_string obj_value;
item.get_fqdn_value(&obj_value);
policy_simple_set::iterator it = policy_result.begin();
policy_simple_set::iterator eit = policy_result.end();
int rc;
@ -78,8 +118,9 @@ void internal_audit_object_str(const policy_set *security_policy_ids, const poli
"%s], "
"policy id: [%lld]",
GetUserName(user_name, sizeof(user_name)), get_session_app_name(), session_ip, priv_name,
get_privilege_object_name(item.m_obj_type), names.first.c_str(), direction, names.second.c_str(),
*it);
get_privilege_object_name(objtype),
(is_rolegrant || obj_value == "") ? names.first.c_str() : obj_value.c_str(), direction,
names.second.c_str(), *it);
securec_check_ss(rc, "\0", "\0");
} else {
rc = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
@ -87,7 +128,8 @@ void internal_audit_object_str(const policy_set *security_policy_ids, const poli
"%s], "
"policy id: [%lld]",
GetUserName(user_name, sizeof(user_name)), get_session_app_name(), session_ip, priv_name,
get_privilege_object_name(item.m_obj_type), dbname, names.first.c_str(), direction,
get_privilege_object_name(objtype), dbname,
(is_rolegrant || obj_value == "") ? names.first.c_str() : obj_value.c_str(), direction,
names.second.c_str(), *it);
securec_check_ss(rc, "\0", "\0");
}
@ -97,58 +139,6 @@ void internal_audit_object_str(const policy_set *security_policy_ids, const poli
}
}
void login_object_audit(const policy_set security_policy_ids, const policy_set policy_ids,
const char *login_str, int priv_type, const char *priv_name, const char *dbname)
{
policy_simple_set policy_result;
PolicyLabelItem item(0, 0, T_LOGIN);
if (check_audit_policy_privileges(&policy_ids, &policy_result, priv_type, &item, dbname)) {
char buff[2048] = {0};
policy_simple_set::iterator it = policy_result.begin();
policy_simple_set::iterator eit = policy_result.end();
for (; it != eit; ++it) {
char session_ip[MAX_IP_LEN] = {0};
get_session_ip(session_ip, MAX_IP_LEN);
int rc = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
"AUDIT EVENT: app_name: [%s], client_ip: [%s], privilege type: [%s], policy id: [%lld]",
get_session_app_name(), session_ip, login_str, *it);
securec_check_ss(rc, "\0", "\0");
save_access_logs(AUDIT_POLICY_EVENT, buff);
}
}
return;
}
void login_handle_audit(const char *dbname, const char *username, bool success, bool login)
{
IPV6 ip;
get_remote_addr(&ip);
FilterData filter_item(u_sess->attr.attr_common.application_name, ip);
policy_set audit_policy_ids, security_policy_ids;
check_audit_policy_filter(&filter_item, &audit_policy_ids, dbname);
char tmp[512] = {0};
int rc;
if (login && success) {
rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "LOGIN SUCCESS: [%s] to DATABASE: [%s]", username, dbname);
securec_check_ss(rc, "\0", "\0");
login_object_audit(security_policy_ids, audit_policy_ids, tmp, T_LOGIN_SUCCESS, "LOGIN SUCCESS", dbname);
} else if (login && !success) {
rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "LOGIN FAILED: [%s] to DATABASE: [%s]", username, dbname);
securec_check_ss(rc, "\0", "\0");
login_object_audit(security_policy_ids, audit_policy_ids, tmp, T_LOGIN_FAILURE, "LOGIN FAILED", dbname);
} else if (!login && success) {
rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "LOGOUT: [%s] to DATABASE: [%s]", username, dbname);
securec_check_ss(rc, "\0", "\0");
login_object_audit(security_policy_ids, audit_policy_ids, tmp, T_LOGOUT, "LOGOUT", dbname);
} else { /* !login && !success */
rc = snprintf_s(tmp, sizeof(tmp), sizeof(tmp) - 1, "LOGOUT: [%s] to DATABASE: [%s]", username, dbname);
securec_check_ss(rc, "\0", "\0");
login_object_audit(security_policy_ids, audit_policy_ids, tmp, T_LOGOUT, "LOGOUT", dbname);
}
}
static void gen_priv_audit_logs(policy_simple_set& policy_result, bool ignore_db, const char* priv_name, const PolicyLabelItem* item,
const char *obj_value)
{
@ -218,124 +208,42 @@ bool internal_audit_object_str(const policy_set* security_policy_ids, const poli
bool is_found = false;
policy_simple_set policy_result;
bool security_auditobject_res = (accesscontrol_securityAuditObject_hook != NULL) ?
accesscontrol_securityAuditObject_hook(security_policy_ids, item, priv_type, priv_name) :
true;
if (security_auditobject_res && check_audit_policy_privileges(policy_ids, &policy_result, priv_type, item)) {
gs_stl::gs_string obj_value;
switch (item->m_obj_type) {
case O_DATABASE:
case O_ROLE:
obj_value = objname;
break;
case O_SCHEMA:
item->get_fqdn_value(&obj_value);
break;
default:
item->get_fqdn_value(&obj_value);
if (!item->m_object && strlen(objname) > 0) {
obj_value.push_back('.');
obj_value.append(objname);
}
break;
}
is_found = !policy_result.empty();
gen_priv_audit_logs(policy_result, ignore_db, priv_name, item, obj_value.c_str());
if (!check_audit_policy_privileges(policy_ids, &policy_result, priv_type, item)) {
return is_found;
}
gs_stl::gs_string obj_value;
switch (item->m_obj_type) {
case O_DATABASE:
case O_ROLE:
obj_value = objname;
break;
case O_SCHEMA:
item->get_fqdn_value(&obj_value);
break;
default:
item->get_fqdn_value(&obj_value);
if (!item->m_object && strlen(objname) > 0) {
if (!obj_value.empty()) {
obj_value.push_back('.');
}
obj_value.append(objname);
}
break;
}
is_found = !policy_result.empty();
gen_priv_audit_logs(policy_result, ignore_db, priv_name, item, obj_value.c_str());
return is_found;
}
void audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids, const char *relname,
int priv_type, const char *priv_name, int objtype)
void acl_audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids, const ListCell *rel,
const names_pair names, int priv_type, const char *priv_name, int objtype, int target_type)
{
switch (objtype) {
case OBJECT_ROLE:
internal_audit_str(security_policy_ids, policy_ids, relname, priv_type, priv_name, O_ROLE);
break;
case OBJECT_USER:
internal_audit_str(security_policy_ids, policy_ids, relname, priv_type, priv_name, O_USER);
break;
case OBJECT_SCHEMA:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_SCHEMA);
break;
case OBJECT_SEQUENCE:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_SEQUENCE);
break;
case OBJECT_DATABASE:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_DATABASE);
break;
case OBJECT_FOREIGN_SERVER:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_SERVER);
break;
case OBJECT_FOREIGN_TABLE:
case OBJECT_STREAM:
case OBJECT_TABLE:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name,
(objtype == OBJECT_TABLE) ? O_TABLE : O_FOREIGNTABLE);
break;
case OBJECT_COLUMN:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_COLUMN);
break;
case OBJECT_TRIGGER:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_TRIGGER);
break;
case OBJECT_FUNCTION:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_FUNCTION);
break;
case OBJECT_CONTQUERY:
case OBJECT_VIEW:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_VIEW);
break;
case OBJECT_INDEX:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_INDEX);
break;
case OBJECT_TABLESPACE:
internal_audit_str(policy_ids, policy_ids, relname, priv_type, priv_name, O_TABLESPACE);
break;
default:
break;
}
}
void acl_audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids,
const names_pair names, int priv_type, const char *priv_name, int objtype)
{
switch (objtype) {
case ACL_OBJECT_COLUMN:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_COLUMN);
break;
case ACL_OBJECT_RELATION:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_RELATION);
break;
case ACL_OBJECT_SEQUENCE:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_SEQUENCE);
break;
case ACL_OBJECT_DATABASE:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_DATABASE, true);
break;
case ACL_OBJECT_DOMAIN:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_DOMAIN);
break;
case ACL_OBJECT_FOREIGN_SERVER:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_SERVER);
break;
case ACL_OBJECT_FUNCTION:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_FUNCTION);
break;
case ACL_OBJECT_LANGUAGE:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_LANGUAGE);
break;
case ACL_OBJECT_NAMESPACE:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_SCHEMA);
break;
case ACL_OBJECT_TABLESPACE:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_TABLESPACE);
break;
case ACL_OBJECT_DATA_SOURCE:
internal_audit_object_str(security_policy_ids, policy_ids, names, priv_type, priv_name, O_DATA_SOURCE);
break;
default:
break;
PrivObject type = get_privtype_from_aclobject((GrantObjectType)objtype);
if (type == O_DATABASE) {
internal_audit_object_str(security_policy_ids, policy_ids, rel, names, priv_type, priv_name, type, target_type,
false, true);
} else {
internal_audit_object_str(security_policy_ids, policy_ids, rel, names, priv_type, priv_name, type, target_type);
}
}
@ -350,7 +258,12 @@ void audit_table(const policy_set *security_policy_ids, const policy_set *policy
{
if (rel->relname == NULL)
return;
PolicyLabelItem item(rel->schemaname, rel->relname, "", objtype);
PolicyLabelItem item;
if (priv_type == T_CREATE) {
item = PolicyLabelItem(rel->schemaname, rel->relname, "", objtype);
} else {
gen_policy_labelitem(item, (const ListCell *)rel, objtype);
}
char buff[2048] = {0};
if (priv_type == T_DROP) {
if (check_label_has_object(&item, is_masking_has_object)) {
@ -360,7 +273,7 @@ void audit_table(const policy_set *security_policy_ids, const policy_set *policy
"Table: %s is part of some resource label, can not be dropped.", table_name.c_str());
securec_check_ss(rc, "\0", "\0");
gs_audit_issue_syslog_message("PGAUDIT", buff, AUDIT_POLICY_EVENT, AUDIT_FAILED);
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\"", buff)));
ereport(ERROR, (errcode(ERRCODE_DEPENDENT_OBJECTS_STILL_EXIST), errmsg("\"%s\"", buff)));
return;
}
}
@ -400,6 +313,16 @@ void audit_schema(const policy_set security_policy_ids, const policy_set policy_
policy_simple_set policy_result;
int check_type = (priv_type == T_RENAME) ? T_ALTER : priv_type;
PolicyLabelItem item(schemaname, "", "", O_SCHEMA);
if (priv_type == T_DROP) {
if (check_label_has_object(&item, is_masking_has_object)) {
int rc = snprintf_s(buff, sizeof(buff), sizeof(buff) - 1,
"Schema: %s is part of some resource label, can not be dropped.", schemaname);
securec_check_ss(rc, "\0", "\0");
gs_audit_issue_syslog_message("PGAUDIT", buff, AUDIT_POLICY_EVENT, AUDIT_FAILED);
ereport(ERROR, (errcode(ERRCODE_DEPENDENT_OBJECTS_STILL_EXIST), errmsg("\"%s\"", buff)));
return;
}
}
bool security_auditobject_res = (accesscontrol_securityAuditObject_hook != NULL) ?
accesscontrol_securityAuditObject_hook(&security_policy_ids, &item, check_type, priv_name) :
true;
@ -670,10 +593,6 @@ void rename_object(RenameStmt *stmt, const policy_set policy_ids, const policy_s
item.m_obj_type = O_TRIGGER;
objectname = stmt->subname;
break;
case OBJECT_FOREIGN_SERVER:
objectname = stmt->subname;
item.m_obj_type = O_SERVER;
break;
case OBJECT_FUNCTION: {
item.m_obj_type = O_FUNCTION;
name_list_to_label(&item, stmt->object);
@ -810,7 +729,7 @@ void get_cursor_tables(List *rtable, char *buff, size_t buff_size, int _printed_
int printed_size = _printed_size;
foreach (lc, rtable) {
RangeTblEntry *rte = (RangeTblEntry *)lfirst(lc);
if (rte->relname && rte->rtekind == RTE_RELATION) {
if (rte != NULL && rte->relname && rte->rtekind == RTE_RELATION) {
PolicyLabelItem item;
get_fqdn_by_relid(rte, &item);
if (cursor_objects) {
@ -850,71 +769,21 @@ void get_open_cursor_info(PlannedStmt *stmt, char *buff, size_t buff_size)
printed_size = snprintf_s(buff, buff_size, buff_size - 1, "%s ", cstmt->portalname);
securec_check_ss(printed_size, "\0", "\0");
}
switch (stmt->commandType) {
case CMD_SELECT: {
rc = snprintf_s(buff + printed_size, buff_size - printed_size, buff_size - printed_size - 1,
"FOR SELECT FROM");
securec_check_ss(rc, "\0", "\0");
printed_size += rc;
break;
}
case CMD_INSERT: {
rc = snprintf_s(buff + printed_size, buff_size - printed_size, buff_size - printed_size - 1,
"FOR INSERT TO");
securec_check_ss(rc, "\0", "\0");
printed_size += rc;
break;
}
case CMD_UPDATE: {
rc = snprintf_s(buff + printed_size, buff_size - printed_size, buff_size - printed_size - 1,
"FOR UPDATE FROM");
securec_check_ss(rc, "\0", "\0");
printed_size += rc;
break;
}
case CMD_DELETE: {
rc = snprintf_s(buff + printed_size, buff_size - printed_size, buff_size - printed_size - 1,
"FOR DELETE FROM");
securec_check_ss(rc, "\0", "\0");
printed_size += rc;
break;
}
default:
break;
}
rc = snprintf_s(buff + printed_size, buff_size - printed_size, buff_size - printed_size - 1,
get_cursorinfo(stmt->commandType));
securec_check_ss(rc, "\0", "\0");
printed_size += rc;
get_cursor_tables(stmt->rtable, buff, buff_size, printed_size);
}
void login_handle(const char *dbname, const char *username, bool success, bool login)
PrivObject get_privtype_from_aclobject(GrantObjectType acl_type)
{
/* do nothing when enable_security_policy is off */
if (!u_sess->attr.attr_security.Enable_Security_Policy ||
!IsConnFromApp() || !OidIsValid(u_sess->proc_cxt.MyDatabaseId)) {
return;
for (unsigned int i = 0; i < (sizeof(aclobject_infos) / sizeof(aclobject_infos[0])); ++i) {
if (aclobject_infos[i].grant_type == acl_type) {
return aclobject_infos[i].privi_type;
}
}
ResourceOwnerData *old_owner = NULL;
if (t_thrd.utils_cxt.CurrentResourceOwner == NULL) {
old_owner = create_temp_resourceowner();
}
/* dbname is necessary for login hook as u_sess info may not be ok now so that invalid oid */
if (!is_database_valid(dbname) || !is_audit_policy_exist(dbname)) {
return;
}
/* if access control policy worked, no need to run the audit policy
* related audit logs would be recorded in LoginHandle_access
*/
if ((security_LoginHandle_access_hook != NULL) ?
security_LoginHandle_access_hook(dbname, username, success, login) : true) {
login_handle_audit(dbname, username, success, login);
}
if (old_owner != NULL) {
release_temp_resourceowner(old_owner);
}
flush_access_logs(success ? AUDIT_OK : AUDIT_FAILED);
return O_UNKNOWN;
}

View File

@ -26,13 +26,14 @@
#include "nodes/primnodes.h"
#include "nodes/parsenodes.h"
#include "gs_policy/gs_vector.h"
#include "gs_policy_object_types.h"
#define SET_DB_SCHEMA_TABLE buffer->append(schemaname); \
buffer->push_back('.');
typedef std::pair<gs_stl::gs_string, gs_stl::gs_string> names_pair;
void acl_audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids,
const names_pair names, int priv_type, const char *priv_name, int objtype);
void acl_audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids, const ListCell *rel,
const names_pair names, int priv_type, const char *priv_name, int objtype, int target_type);
bool internal_audit_object_str(const policy_set* security_policy_ids, const policy_set* policy_ids,
const PolicyLabelItem* item, int priv_type, const char* priv_name, const char* objname = "",
bool ignore_db = false);
@ -40,10 +41,8 @@ void internal_audit_str(const policy_set *security_policy_ids, const policy_set
int priv_type, const char *priv_name, int objtype, bool ignore_db = false);
void login_object(const policy_set *security_policy_ids, const policy_set *policy_ids, const char *login_str,
int priv_type, const char *priv_name);
void internal_audit_object_str(const policy_set *security_policy_ids, const policy_set *policy_ids,
const names_pair names, int priv_type, const char *priv_name, int objtype, bool ignore_db = false);
void audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids,
const char *relname, int priv_type, const char *priv_name, int objtype);
void internal_audit_object_str(const policy_set *security_policy_ids, const policy_set *policy_ids, const ListCell *rel,
const names_pair names, int priv_type, const char *priv_name, int objtype, int target_type = ACL_TARGET_OBJECT, bool is_rolegrant = false, bool ignore_db = false);
void audit_table(const policy_set *security_policy_ids, const policy_set *policy_ids,
RangeVar *rel, int priv_type, const char *priv_name, int objtype);
void alter_table(const policy_set *security_policy_ids, const policy_set *policy_ids,
@ -57,12 +56,9 @@ void alter_owner(AlterOwnerStmt *stmt, const policy_set policy_ids, const policy
void add_current_path(int objtype, List *fqdn, gs_stl::gs_string *buffer);
void fill_label_item(PolicyLabelItem *item, int objtype, List *fqdn);
void destroy_logs();
void login_object_audit(const policy_set security_policy_ids, const policy_set policy_ids, const char *login_str,
int priv_type, const char *priv_name, const char *dbname = NULL);
void login_handle_audit(const char *dbname, const char *username, bool success, bool login);
void get_cursor_tables(List *rtable, char *buff, size_t buff_size, int _printed_size,
gs_stl::gs_vector<PolicyLabelItem> *cursor_objects = nullptr);
void get_open_cursor_info(PlannedStmt *stmt, char *buff, size_t buff_size);
void login_handle(const char *dbname, const char *username, bool success, bool logino);
PrivObject get_privtype_from_aclobject(GrantObjectType acl_type);
#endif /* PRIVILEGES_AUDIT_H_ */

View File

@ -3,8 +3,8 @@ create or replace function pg_catalog.creditcardmasking(col text,letter char def
declare
size INTEGER := 4;
begin
return CASE WHEN length(col) >= size THEN
REGEXP_REPLACE(left(col, size*(-1)), '[\d+]', letter, 'g') || right(col, size)
return CASE WHEN pg_catalog.length(col) >= size THEN
pg_catalog.REGEXP_REPLACE(pg_catalog.left(col, size*(-1)), '[\d+]', letter, 'g') || pg_catalog.right(col, size)
ELSE
col
end;
@ -16,7 +16,7 @@ declare
pos INTEGER := position('@' in col);
begin
return CASE WHEN pos > 1 THEN
repeat(letter, pos - 1) || substring(col, pos, length(col) - pos +1)
pg_catalog.repeat(letter, pos - 1) || pg_catalog.substring(col, pos, pg_catalog.length(col) - pos +1)
ELSE
col
end;
@ -26,10 +26,10 @@ $$ LANGUAGE plpgsql;
create or replace function pg_catalog.fullemailmasking(col text, letter char default 'x') RETURNS text AS $$
declare
pos INTEGER := position('@' in col);
dot_pos INTEGER := length(col) - position('.' in reverse(col)) + 1;
dot_pos INTEGER := pg_catalog.length(col) - position('.' in pg_catalog.reverse(col)) + 1;
begin
return CASE WHEN pos > 2 and dot_pos > pos THEN
repeat(letter, pos - 1) || '@' || repeat(letter, dot_pos - pos - 1) || substring(col, dot_pos, length(col) - dot_pos +1)
pg_catalog.repeat(letter, pos - 1) || '@' || pg_catalog.repeat(letter, dot_pos - pos - 1) || pg_catalog.substring(col, dot_pos, pg_catalog.length(col) - dot_pos +1)
ELSE
col
end;
@ -38,7 +38,7 @@ $$ LANGUAGE plpgsql;
create or replace function pg_catalog.alldigitsmasking(col text, letter char default '0') RETURNS text AS $$
begin
return REGEXP_REPLACE(col, '[\d+]', letter, 'g');
return pg_catalog.REGEXP_REPLACE(col, '[\d+]', letter, 'g');
end;
$$ LANGUAGE plpgsql;
@ -46,14 +46,14 @@ create or replace function pg_catalog.shufflemasking(col text) RETURNS text AS $
declare
index INTEGER := 0;
rd INTEGER;
size INTEGER := length(col);
size INTEGER := pg_catalog.length(col);
tmp text := col;
res text;
begin
while size > 0 loop
rd := floor(random() * length(tmp) + 1);
res := res || right(left(tmp, rd), 1);
tmp := left(tmp, rd - 1) || right(tmp, length(tmp) - rd);
rd := pg_catalog.floor(pg_catalog.random() * pg_catalog.length(tmp) + 1);
res := res || pg_catalog.right(pg_catalog.left(tmp, rd), 1);
tmp := pg_catalog.left(tmp, rd - 1) || pg_catalog.right(tmp, pg_catalog.length(tmp) - rd);
size := size - 1;
END loop;
return res;
@ -62,13 +62,13 @@ $$ LANGUAGE plpgsql;
create or replace function pg_catalog.randommasking(col text) RETURNS text AS $$
begin
return left(MD5(random()::text), length(col));
return pg_catalog.left(pg_catalog.MD5(pg_catalog.random()::text), pg_catalog.length(col));
end;
$$ LANGUAGE plpgsql;
create or replace function pg_catalog.regexpmasking(col text, reg text, replace_text text, pos INTEGER default 0, reg_len INTEGER default -1) RETURNS text AS $$
declare
size INTEGER := length(col);
size INTEGER := pg_catalog.length(col);
endpos INTEGER;
startpos INTEGER;
lstr text;
@ -81,9 +81,9 @@ begin
endpos := reg_len + startpos - 1;
IF reg_len < 0 THEN endpos := size - 1; END IF;
IF reg_len + startpos >= size THEN endpos := size - 1; END IF;
lstr := left(col, startpos);
rstr := right(col, size - endpos - 1);
ltarget := substring(col, startpos+1, endpos - startpos + 1);
lstr := pg_catalog.left(col, startpos);
rstr := pg_catalog.right(col, size - endpos - 1);
ltarget := pg_catalog.substring(col, startpos+1, endpos - startpos + 1);
ltarget := pg_catalog.REGEXP_REPLACE(ltarget, reg, replace_text, 'g');
return lstr || ltarget || rstr;
end;

View File

@ -5,6 +5,7 @@
* Routines to handle DML permission checks
*
* Copyright (c) 2010-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 2021, openGauss Contributors
*
* -------------------------------------------------------------------------
*/
@ -181,6 +182,7 @@ static bool check_relation_privileges(Oid relOid, Bitmapset* selected, Bitmapset
break;
case RELKIND_SEQUENCE:
case RELKIND_LARGE_SEQUENCE:
Assert((required & ~SEPG_DB_TABLE__SELECT) == 0);
if (required & SEPG_DB_TABLE__SELECT)

View File

@ -5,6 +5,7 @@
* Routines to support SELinux labels (security context)
*
* Copyright (c) 2010-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 2021, openGauss Contributors
*
* -------------------------------------------------------------------------
*/
@ -680,7 +681,7 @@ static void exec_object_restorecon(struct selabel_handle* sehnd, Oid catalogId)
if (relForm->relkind == RELKIND_RELATION)
objtype = SELABEL_DB_TABLE;
else if (relForm->relkind == RELKIND_SEQUENCE)
else if (RELKIND_IS_SEQUENCE(relForm->relkind))
objtype = SELABEL_DB_SEQUENCE;
else if (relForm->relkind == RELKIND_VIEW || (relForm->relkind == RELKIND_CONTQUERY)
objtype = SELABEL_DB_VIEW;

View File

@ -346,7 +346,7 @@ void sepgsql_relation_drop(Oid relOid)
attrList = SearchSysCacheList1(ATTNUM, ObjectIdGetDatum(relOid));
for (i = 0; i < attrList->n_members; i++) {
atttup = &attrList->members[i]->tuple;
atttup = t_thrd.lsc_cxt.FetchTupleFromCatCList(attrList, i);
attForm = (Form_pg_attribute)GETSTRUCT(atttup);
if (attForm->attisdropped)
@ -360,7 +360,7 @@ void sepgsql_relation_drop(Oid relOid)
sepgsql_avc_check_perms(&object, SEPG_CLASS_DB_COLUMN, SEPG_DB_COLUMN__DROP, audit_name, true);
pfree(audit_name);
}
ReleaseCatCacheList(attrList);
ReleaseSysCacheList(attrList);
}
}

View File

@ -0,0 +1,11 @@
#This is the main CMAKE for build all components.
AUX_SOURCE_DIRECTORY(${PROJECT_OPENGS_DIR}/contrib/sql_decoding TGT_sql_decoding_SRC)
set(sql_decoding_DEF_OPTIONS -D_GLIBCXX_USE_CXX11_ABI=0 -DSTREAMPLAN -DPGXC -DENABLE_GSTRACE -D_GNU_SOURCE)
set(sql_decoding_COMPILE_OPTIONS ${OPTIMIZE_OPTIONS} ${OS_OPTIONS} ${PROTECT_OPTIONS} ${WARNING_OPTIONS} ${LIB_SECURE_OPTIONS} ${CHECK_OPTIONS} -fstack-protector-all)
list(REMOVE_ITEM sql_decoding_COMPILE_OPTIONS -fstack-protector)
set(sql_decoding_LINK_OPTIONS ${LIB_LINK_OPTIONS})
add_shared_libtarget(sql_decoding TGT_sql_decoding_SRC "" "${sql_decoding_DEF_OPTIONS}" "${sql_decoding_COMPILE_OPTIONS}" "${sql_decoding_LINK_OPTIONS}")
set_target_properties(sql_decoding PROPERTIES PREFIX "")
install(TARGETS sql_decoding LIBRARY DESTINATION lib/postgresql)

View File

@ -0,0 +1,2 @@
wal_level = logical
max_replication_slots = 8

View File

@ -0,0 +1,5 @@
# roach_api extension
comment = 'sql_decoding wrapper'
default_version = '1.0'
module_pathname = '$libdir/sql_decoding'
relocatable = true

View File

@ -0,0 +1,516 @@
/*
* Portions Copyright (c) 2020 Huawei Technologies Co.,Ltd.
* Portions Copyright (c) 2012-2014, PostgreSQL Global Development Group
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* ---------------------------------------------------------------------------------------
*
* sql_decoding.cpp
* logical decoding output plugin (sql)
*
*
*
* IDENTIFICATION
* contrib/sql_decoding/sql_decoding.cpp
*
* ---------------------------------------------------------------------------------------
*/
#include "postgres.h"
#include "knl/knl_variable.h"
#include "access/sysattr.h"
#include "access/ustore/knl_utuple.h"
#include "catalog/pg_class.h"
#include "catalog/pg_type.h"
#include "nodes/parsenodes.h"
#include "replication/logical.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/relcache.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
#include "replication/output_plugin.h"
#include "replication/logical.h"
PG_MODULE_MAGIC;
/* These must be available to pg_dlsym() */
extern "C" void _PG_init(void);
extern "C" void _PG_output_plugin_init(OutputPluginCallbacks* cb);
static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions* opt, bool is_init);
static void pg_decode_shutdown(LogicalDecodingContext* ctx);
static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, XLogRecPtr commit_lsn);
static void pg_decode_abort_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_decode_change(
LogicalDecodingContext* ctx, ReorderBufferTXN* txn, Relation rel, ReorderBufferChange* change);
static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id);
typedef struct {
MemoryContext context;
bool include_xids;
bool include_timestamp;
bool skip_empty_xacts;
bool xact_wrote_changes;
bool only_local;
} TestDecodingData;
/* specify output plugin callbacks */
void _PG_output_plugin_init(OutputPluginCallbacks* cb)
{
AssertVariableIsOfType(&_PG_output_plugin_init, LogicalOutputPluginInit);
cb->startup_cb = pg_decode_startup;
cb->begin_cb = pg_decode_begin_txn;
cb->change_cb = pg_decode_change;
cb->commit_cb = pg_decode_commit_txn;
cb->abort_cb = pg_decode_abort_txn;
cb->filter_by_origin_cb = pg_decode_filter;
cb->shutdown_cb = pg_decode_shutdown;
}
void _PG_init(void)
{
/* other plugins can perform things here */
}
/* initialize this plugin */
static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions* opt, bool is_init = true)
{
ListCell* option = NULL;
TestDecodingData *data = (TestDecodingData*)palloc0(sizeof(TestDecodingData));
data->context = AllocSetContextCreate(ctx->context,
"text conversion context", ALLOCSET_DEFAULT_SIZES);
data->include_xids = true;
data->include_timestamp = false;
data->skip_empty_xacts = false;
data->only_local = true;
ctx->output_plugin_private = data;
opt->output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT;
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) {
data->include_xids = true;
} else if (!parse_bool(strVal(elem->arg), &data->include_xids)) {
ereport(ERROR, (errmodule(MOD_LOGICAL_DECODE), errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname),
errdetail("N/A"), errcause("Wrong input value"), erraction("Input \"on\" or \"off\"")));
}
} else if (strcmp(elem->defname, "include-timestamp") == 0) {
if (elem->arg == NULL) {
data->include_timestamp = true;
} else if (!parse_bool(strVal(elem->arg), &data->include_timestamp)) {
ereport(ERROR, (errmodule(MOD_LOGICAL_DECODE), errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname),
errdetail("N/A"), errcause("Wrong input value"), erraction("Input \"on\" or \"off\"")));
}
} else if (strcmp(elem->defname, "skip-empty-xacts") == 0) {
if (elem->arg == NULL) {
data->skip_empty_xacts = true;
} else if (!parse_bool(strVal(elem->arg), &data->skip_empty_xacts)) {
ereport(ERROR, (errmodule(MOD_LOGICAL_DECODE), errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname),
errdetail("N/A"), errcause("Wrong input value"), erraction("Input \"on\" or \"off\"")));
}
} else if (strcmp(elem->defname, "only-local") == 0) {
if (elem->arg == NULL) {
data->only_local = true;
} else if (!parse_bool(strVal(elem->arg), &data->only_local)) {
ereport(ERROR, (errmodule(MOD_LOGICAL_DECODE), errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname),
errdetail("N/A"), errcause("Wrong input value"), erraction("Input \"on\" or \"off\"")));
}
} else {
ereport(ERROR, (errmodule(MOD_LOGICAL_DECODE), errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("option \"%s\" = \"%s\" is unknown", elem->defname, elem->arg ? strVal(elem->arg) : "(null)"),
errdetail("N/A"), errcause("Wrong input option"),
erraction("Check the product documentation for legal options")));
}
}
}
/* cleanup this plugin's resources */
static void pg_decode_shutdown(LogicalDecodingContext* ctx)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
/* cleanup our own resources via memory context reset */
MemoryContextDelete(data->context);
}
/*
* Prepare output plugin.
*/
void pg_output_begin(LogicalDecodingContext* ctx, TestDecodingData* data, ReorderBufferTXN* txn, bool last_write)
{
OutputPluginPrepareWrite(ctx, last_write);
appendStringInfo(ctx->out, "BEGIN %lu", txn->csn);
OutputPluginWrite(ctx, last_write);
}
/* BEGIN callback */
static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
data->xact_wrote_changes = false;
if (data->skip_empty_xacts) {
return;
}
pg_output_begin(ctx, data, txn, true);
}
/* COMMIT callback */
static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, XLogRecPtr commit_lsn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes) {
return;
}
OutputPluginPrepareWrite(ctx, true);
appendStringInfoString(ctx->out, "COMMIT");
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
appendStringInfo(ctx->out, " %lu", txn->csn);
OutputPluginWrite(ctx, true);
}
/* ABORT callback */
static void pg_decode_abort_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes) {
return;
}
OutputPluginPrepareWrite(ctx, true);
if (data->include_xids) {
appendStringInfo(ctx->out, "ABORT %lu", txn->xid);
} else {
appendStringInfoString(ctx->out, "ABORT");
}
if (data->include_timestamp) {
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
}
OutputPluginWrite(ctx, true);
}
static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
if (data->only_local && origin_id != InvalidRepOriginId) {
return true;
}
return false;
}
/*
* Print literal `outputstr' already represented as string of type `typid'
* into stringbuf `s'.
*
* Some builtin types aren't quoted, the rest is quoted. Escaping is done as
* if u_sess->parser_cxt.standard_conforming_strings were enabled.
*/
static void print_literal(StringInfo s, Oid typid, char* outputstr)
{
const char* valptr = NULL;
switch (typid) {
case FLOAT4OID:
case FLOAT8OID:
case NUMERICOID:
case INT1OID:
case INT2OID:
case INT4OID:
case INT8OID:
case OIDOID:
/* NB: We don't care about Inf, NaN et al. */
appendStringInfoString(s, outputstr);
break;
case BITOID:
case VARBITOID:
appendStringInfo(s, "B'%s'", outputstr);
break;
case BOOLOID:
if (strcmp(outputstr, "t") == 0) {
appendStringInfoString(s, "true");
} else {
appendStringInfoString(s, "false");
}
break;
default:
appendStringInfoChar(s, '\'');
for (valptr = outputstr; *valptr; valptr++) {
char ch = *valptr;
if (SQL_STR_DOUBLE(ch, false)) {
appendStringInfoChar(s, ch);
}
appendStringInfoChar(s, ch);
}
appendStringInfoChar(s, '\'');
break;
}
}
/*
* Decode tuple into stringinfo.
*/
static void TupleToStringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
{
Assert(tuple != NULL);
if ((tuple->tupTableType == HEAP_TUPLE) && (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data) ||
(int)HeapTupleHeaderGetNatts(tuple->t_data, tupdesc) > tupdesc->natts)) {
return;
}
appendStringInfoChar(s, '(');
/* print all columns individually */
for (int natt = 0; natt < tupdesc->natts; natt++) {
bool isnull = false; /* column is null? */
bool typisvarlena = false;
Oid typoutput = 0; /* output function */
Datum origval = 0; /* possibly toasted Datum */
Form_pg_attribute attr = tupdesc->attrs[natt]; /* the attribute itself */
if (attr->attisdropped || attr->attnum < 0) {
continue;
}
/* 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);
}
if (skip_nulls && isnull) {
continue;
}
/* query output function */
Oid typid = attr->atttypid; /* type of current attribute */
getTypeOutputInfo(typid, &typoutput, &typisvarlena);
/* print data */
if (isnull) {
appendStringInfoString(s, "null");
} else if (!typisvarlena) {
print_literal(s, typid, OidOutputFunctionCall(typoutput, origval));
} else {
Datum val = PointerGetDatum(PG_DETOAST_DATUM(origval));
print_literal(s, typid, OidOutputFunctionCall(typoutput, val));
}
if (natt < tupdesc->natts - 1) {
appendStringInfoString(s, ", ");
}
}
appendStringInfoChar(s, ')');
}
/*
* Decode tuple into stringinfo.
* This function is used for UPDATE or DELETE statements.
*/
static void TupleToStringinfoUpd(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
{
if ((tuple->tupTableType == HEAP_TUPLE) && (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data) ||
(int)HeapTupleHeaderGetNatts(tuple->t_data, tupdesc) > tupdesc->natts)) {
return;
}
bool isFirstAtt = true;
/* print all columns individually */
for (int natt = 0; natt < tupdesc->natts; natt++) {
Oid typoutput = 0; /* output function */
Datum origval = 0; /* possibly toasted Datum */
bool isnull = false; /* column is null? */
bool typisvarlena = false;
Form_pg_attribute attr = tupdesc->attrs[natt]; /* the attribute itself */
if (attr->attisdropped || attr->attnum < 0) {
continue;
}
/* 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);
}
if (isnull && skip_nulls) {
continue;
}
if (!isFirstAtt) {
appendStringInfoString(s, " and ");
} else {
isFirstAtt = false;
}
/* print attribute name */
appendStringInfoString(s, quote_identifier(NameStr(attr->attname)));
appendStringInfoString(s, " = ");
/* query output function */
Oid typid = attr->atttypid;
getTypeOutputInfo(typid, &typoutput, &typisvarlena);
/* print data */
if (isnull) {
appendStringInfoString(s, "null");
} else if (!typisvarlena) {
print_literal(s, typid, OidOutputFunctionCall(typoutput, origval));
} else {
Datum val = PointerGetDatum(PG_DETOAST_DATUM(origval));
print_literal(s, typid, OidOutputFunctionCall(typoutput, val));
}
}
}
/*
* Callback for handle decoded tuple.
* Additional info will be added if the tuple is found null.
*/
static void TupleHandler(StringInfo s, TupleDesc tupdesc, ReorderBufferChange* change, bool isHeap, bool isNewTuple)
{
if (isHeap && isNewTuple) {
if (change->data.tp.newtuple == NULL) {
appendStringInfoString(s, " (no-tuple-data)");
} else {
TupleToStringinfo(s, tupdesc, &change->data.tp.newtuple->tuple, false);
}
} else if (isHeap && !isNewTuple) {
if (change->data.tp.oldtuple == NULL) {
appendStringInfoString(s, " (no-tuple-data)");
} else {
TupleToStringinfoUpd(s, tupdesc, &change->data.tp.oldtuple->tuple, true);
}
} else if (!isHeap && isNewTuple) {
if (change->data.utp.newtuple == NULL) {
appendStringInfoString(s, " (no-tuple-data)");
} else {
TupleToStringinfo(s, tupdesc, (HeapTuple)(&change->data.utp.newtuple->tuple), false);
}
} else {
if (change->data.utp.oldtuple == NULL) {
appendStringInfoString(s, " (no-tuple-data)");
} else {
TupleToStringinfoUpd(s, tupdesc, (HeapTuple)(&change->data.utp.oldtuple->tuple), true);
}
}
}
/*
* Callback for individual changed tuples.
*/
static void pg_decode_change(
LogicalDecodingContext* ctx, ReorderBufferTXN* txn, Relation relation, ReorderBufferChange* change)
{
Form_pg_class class_form = NULL;
TupleDesc tupdesc = NULL;
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
u_sess->attr.attr_common.extra_float_digits = 0;
bool isHeap = true;
/* output BEGIN if we haven't yet */
if (txn != NULL && data->skip_empty_xacts && !data->xact_wrote_changes) {
pg_output_begin(ctx, data, txn, false);
}
data->xact_wrote_changes = true;
class_form = RelationGetForm(relation);
tupdesc = RelationGetDescr(relation);
/* Avoid leaking memory by using and resetting our own context */
MemoryContext old = MemoryContextSwitchTo(data->context);
char *schema = NULL;
char *table = NULL;
schema = get_namespace_name(class_form->relnamespace);
table = NameStr(class_form->relname);
OutputPluginPrepareWrite(ctx, true);
switch (change->action) {
case REORDER_BUFFER_CHANGE_INSERT:
case REORDER_BUFFER_CHANGE_UINSERT:
appendStringInfoString(ctx->out, "insert into ");
appendStringInfoString(ctx->out, quote_qualified_identifier(schema, table));
if (change->action == REORDER_BUFFER_CHANGE_UINSERT) {
isHeap = false;
}
appendStringInfoString(ctx->out, " values ");
TupleHandler(ctx->out, tupdesc, change, isHeap, true);
break;
case REORDER_BUFFER_CHANGE_UPDATE:
case REORDER_BUFFER_CHANGE_UUPDATE:
appendStringInfoString(ctx->out, "delete from ");
appendStringInfoString(ctx->out, quote_qualified_identifier(schema, table));
if (change->action == REORDER_BUFFER_CHANGE_UUPDATE) {
isHeap = false;
}
appendStringInfoString(ctx->out, " where ");
TupleHandler(ctx->out, tupdesc, change, isHeap, false);
appendStringInfoChar(ctx->out, ';');
appendStringInfoString(ctx->out, "insert into ");
appendStringInfoString(ctx->out, quote_qualified_identifier(schema, table));
appendStringInfoString(ctx->out, " values ");
TupleHandler(ctx->out, tupdesc, change, isHeap, true);
break;
case REORDER_BUFFER_CHANGE_DELETE:
case REORDER_BUFFER_CHANGE_UDELETE:
appendStringInfoString(ctx->out, "delete from ");
appendStringInfoString(ctx->out, quote_qualified_identifier(schema, table));
if (change->action == REORDER_BUFFER_CHANGE_UDELETE) {
isHeap = false;
}
appendStringInfoString(ctx->out, " where ");
TupleHandler(ctx->out, tupdesc, change, isHeap, false);
break;
default:
Assert(false);
}
appendStringInfoChar(ctx->out, ';');
MemoryContextSwitchTo(old);
MemoryContextReset(data->context);
OutputPluginWrite(ctx, true);
}

View File

@ -707,7 +707,6 @@ static HTAB* load_categories_hash(char* cats_sql, MemoryContext per_query_ctx)
MemoryContextSwitchTo(SPIcontext);
}
}
if (SPI_finish() != SPI_OK_FINISH)
/* internal error */
elog(ERROR, "load_categories_hash: SPI_finish() failed");

View File

@ -36,21 +36,15 @@ PG_MODULE_MAGIC;
extern "C" void _PG_init(void);
extern "C" void _PG_output_plugin_init(OutputPluginCallbacks* cb);
typedef struct {
MemoryContext context;
bool include_xids;
bool include_timestamp;
bool skip_empty_xacts;
bool xact_wrote_changes;
bool only_local;
} TestDecodingData;
static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions* opt, bool is_init);
static void pg_decode_shutdown(LogicalDecodingContext* ctx);
static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_output_begin(
LogicalDecodingContext* ctx, TestDecodingData* data, ReorderBufferTXN* txn, bool last_write);
LogicalDecodingContext* ctx, PluginTestDecodingData* data, ReorderBufferTXN* txn, bool last_write);
static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, XLogRecPtr commit_lsn);
static void pg_decode_abort_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_decode_prepare_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn);
static void pg_decode_change(
LogicalDecodingContext* ctx, ReorderBufferTXN* txn, Relation rel, ReorderBufferChange* change);
static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id);
@ -69,6 +63,8 @@ void _PG_output_plugin_init(OutputPluginCallbacks* cb)
cb->begin_cb = pg_decode_begin_txn;
cb->change_cb = pg_decode_change;
cb->commit_cb = pg_decode_commit_txn;
cb->abort_cb = pg_decode_abort_txn;
cb->prepare_cb = pg_decode_prepare_txn;
cb->filter_by_origin_cb = pg_decode_filter;
cb->shutdown_cb = pg_decode_shutdown;
}
@ -77,84 +73,33 @@ void _PG_output_plugin_init(OutputPluginCallbacks* cb)
static void pg_decode_startup(LogicalDecodingContext* ctx, OutputPluginOptions* opt, bool is_init)
{
ListCell* option = NULL;
TestDecodingData* data = NULL;
PluginTestDecodingData* data = NULL;
data = (TestDecodingData*)palloc0(sizeof(TestDecodingData));
data = (PluginTestDecodingData*)palloc0(sizeof(PluginTestDecodingData));
data->context = AllocSetContextCreate(ctx->context,
"text conversion context",
ALLOCSET_DEFAULT_MINSIZE,
ALLOCSET_DEFAULT_INITSIZE,
ALLOCSET_DEFAULT_MAXSIZE);
data->include_xids = true;
data->include_timestamp = false;
data->include_timestamp = true;
data->skip_empty_xacts = false;
data->only_local = true;
data->tableWhiteList = NIL;
ctx->output_plugin_private = data;
opt->output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT;
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)
data->include_xids = true;
else if (!parse_bool(strVal(elem->arg), &data->include_xids))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else if (strcmp(elem->defname, "include-timestamp") == 0) {
if (elem->arg == NULL)
data->include_timestamp = true;
else if (!parse_bool(strVal(elem->arg), &data->include_timestamp))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else if (strcmp(elem->defname, "force-binary") == 0) {
bool force_binary = false;
if (elem->arg == NULL)
continue;
else if (!parse_bool(strVal(elem->arg), &force_binary))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
if (force_binary)
opt->output_type = OUTPUT_PLUGIN_BINARY_OUTPUT;
} else if (strcmp(elem->defname, "skip-empty-xacts") == 0) {
if (elem->arg == NULL)
data->skip_empty_xacts = true;
else if (!parse_bool(strVal(elem->arg), &data->skip_empty_xacts))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else if (strcmp(elem->defname, "only-local") == 0) {
if (elem->arg == NULL)
data->only_local = true;
else if (!parse_bool(strVal(elem->arg), &data->only_local))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not parse value \"%s\" for parameter \"%s\"", strVal(elem->arg), elem->defname)));
} else {
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg(
"option \"%s\" = \"%s\" is unknown", elem->defname, elem->arg ? strVal(elem->arg) : "(null)")));
}
ParseDecodingOptionPlugin(option, data, opt);
}
}
/* cleanup this plugin's resources */
static void pg_decode_shutdown(LogicalDecodingContext* ctx)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
/* cleanup our own resources via memory context reset */
MemoryContextDelete(data->context);
@ -163,16 +108,18 @@ static void pg_decode_shutdown(LogicalDecodingContext* ctx)
/* BEGIN callback */
static void pg_decode_begin_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
data->xact_wrote_changes = false;
if (data->skip_empty_xacts)
if (data->skip_empty_xacts) {
return;
}
pg_output_begin(ctx, data, txn, true);
}
static void pg_output_begin(LogicalDecodingContext* ctx, TestDecodingData* data, ReorderBufferTXN* txn, bool last_write)
static void pg_output_begin(LogicalDecodingContext* ctx, PluginTestDecodingData* data, ReorderBufferTXN* txn,
bool last_write)
{
OutputPluginPrepareWrite(ctx, last_write);
if (data->include_xids)
@ -185,7 +132,7 @@ static void pg_output_begin(LogicalDecodingContext* ctx, TestDecodingData* data,
/* COMMIT callback */
static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn, XLogRecPtr commit_lsn)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes)
return;
@ -203,65 +150,55 @@ static void pg_decode_commit_txn(LogicalDecodingContext* ctx, ReorderBufferTXN*
OutputPluginWrite(ctx, true);
}
/* ABORT callback */
static void pg_decode_abort_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes)
return;
OutputPluginPrepareWrite(ctx, true);
if (data->include_xids)
appendStringInfo(ctx->out, "ABORT %lu", txn->xid);
else
appendStringInfoString(ctx->out, "ABORT");
if (data->include_timestamp)
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
OutputPluginWrite(ctx, true);
}
/* PREPARE callback */
static void pg_decode_prepare_txn(LogicalDecodingContext* ctx, ReorderBufferTXN* txn)
{
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->skip_empty_xacts && !data->xact_wrote_changes)
return;
OutputPluginPrepareWrite(ctx, true);
if (data->include_xids)
appendStringInfo(ctx->out, "PREPARE %lu", txn->xid);
else
appendStringInfoString(ctx->out, "PREPARE");
if (data->include_timestamp)
appendStringInfo(ctx->out, " (at %s)", timestamptz_to_str(txn->commit_time));
OutputPluginWrite(ctx, true);
}
static bool pg_decode_filter(LogicalDecodingContext* ctx, RepOriginId origin_id)
{
TestDecodingData* data = (TestDecodingData*)ctx->output_plugin_private;
PluginTestDecodingData* data = (PluginTestDecodingData*)ctx->output_plugin_private;
if (data->only_local && origin_id != InvalidRepOriginId)
return true;
return false;
}
/*
* Print literal `outputstr' already represented as string of type `typid'
* into stringbuf `s'.
*
* Some builtin types aren't quoted, the rest is quoted. Escaping is done as
* if u_sess->parser_cxt.standard_conforming_strings were enabled.
*/
static void print_literal(StringInfo s, Oid typid, char* outputstr)
{
const char* valptr = NULL;
switch (typid) {
case INT1OID:
case INT2OID:
case INT4OID:
case INT8OID:
case OIDOID:
case FLOAT4OID:
case FLOAT8OID:
case NUMERICOID:
/* NB: We don't care about Inf, NaN et al. */
appendStringInfoString(s, outputstr);
break;
case BITOID:
case VARBITOID:
appendStringInfo(s, "B'%s'", outputstr);
break;
case BOOLOID:
if (strcmp(outputstr, "t") == 0)
appendStringInfoString(s, "true");
else
appendStringInfoString(s, "false");
break;
default:
appendStringInfoChar(s, '\'');
for (valptr = outputstr; *valptr; valptr++) {
char ch = *valptr;
if (SQL_STR_DOUBLE(ch, false))
appendStringInfoChar(s, ch);
appendStringInfoChar(s, ch);
}
appendStringInfoChar(s, '\'');
break;
}
}
static void tuple_to_stringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple, bool skip_nulls)
{
if (HEAP_TUPLE_IS_COMPRESSED(tuple->t_data))
@ -337,11 +274,11 @@ static void tuple_to_stringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple
else if (typisvarlena && VARATT_IS_EXTERNAL_ONDISK_B(origval))
appendStringInfoString(s, "unchanged-toast-datum");
else if (!typisvarlena)
print_literal(s, typid, OidOutputFunctionCall(typoutput, origval));
PrintLiteral(s, typid, OidOutputFunctionCall(typoutput, origval));
else {
Datum val; /* definitely detoasted Datum */
val = PointerGetDatum(PG_DETOAST_DATUM(origval));
print_literal(s, typid, OidOutputFunctionCall(typoutput, val));
PrintLiteral(s, typid, OidOutputFunctionCall(typoutput, val));
}
}
}
@ -351,13 +288,12 @@ static void tuple_to_stringinfo(StringInfo s, TupleDesc tupdesc, HeapTuple tuple
static void pg_decode_change(
LogicalDecodingContext* ctx, ReorderBufferTXN* txn, Relation relation, ReorderBufferChange* change)
{
TestDecodingData* data = NULL;
PluginTestDecodingData* data = NULL;
Form_pg_class class_form;
TupleDesc tupdesc;
MemoryContext old;
data = (TestDecodingData*)ctx->output_plugin_private;
u_sess->attr.attr_common.extra_float_digits = 0;
data = (PluginTestDecodingData*)ctx->output_plugin_private;
/* output BEGIN if we haven't yet */
if (data->skip_empty_xacts && !data->xact_wrote_changes) {
@ -371,12 +307,18 @@ static void pg_decode_change(
/* Avoid leaking memory by using and resetting our own context */
old = MemoryContextSwitchTo(data->context);
char *schema = get_namespace_name(class_form->relnamespace);
char *table = NameStr(class_form->relname);
if (data->tableWhiteList != NIL && !CheckWhiteList(data->tableWhiteList, schema, table)) {
(void)MemoryContextSwitchTo(old);
MemoryContextReset(data->context);
return;
}
OutputPluginPrepareWrite(ctx, true);
appendStringInfoString(ctx->out, "table ");
appendStringInfoString(ctx->out,
quote_qualified_identifier(
get_namespace_name(get_rel_namespace(RelationGetRelid(relation))), NameStr(class_form->relname)));
appendStringInfoString(ctx->out, quote_qualified_identifier(schema, table));
appendStringInfoString(ctx->out, ":");
switch (change->action) {

View File

@ -5,63 +5,73 @@
<repoType>Generic</repoType>
<id>
<offering>${offering}</offering>
<version>${BVersion}</version>
<version>${version}</version>
<snapshot>${snapshot}</snapshot>
</id>
<isClear>Y</isClear>
<isClear>N</isClear>
<copies>
<copy>
<source></source>
<DEL></DEL>
</copy>
</copies>
</artifact>
</artifact>
<dependencies>
<dependency>
<dependency>
<versionType>BVersion</versionType>
<repoType>Generic</repoType>
<id>
<offering>Huawei Secure C</offering>
<version>Huawei Secure C V100R001C01SPC010B002</version>
</id>
<isClear>Y</isClear>
<copies>
<copy>
<source></source>
<dest></dest>
</copy>
</copies>
</dependency>
<dependency>
</dependency>
<dependency>
<versionType>BVersion</versionType>
<repoType>Generic</repoType>
<id>
<offering>DOPRA SSP</offering>
<version>DOPRA SSP V300R005C10SPC102B500</version>
<version>DOPRA SSP V300R021C10SPC010B100</version>
</id>
<isClear>Y</isClear>
<copies>
<copy>
<source></source>
<dest></dest>
<DEL>Y</DEL>
<dest>dopra_ssp</dest>
</copy>
</copies>
</dependency>
<dependency>
</dependency>
<dependency>
<versionType>BVersion</versionType>
<repoType>Generic</repoType>
<id>
<offering>Huawei JDK</offering>
<version>Huawei_JDK_V100R001C00SPC290B001</version>
<offering>BiSheng JDK Enterprise</offering>
<version>BiSheng JDK Enterprise 2.1.0.320.B001</version>
</id>
<copies>
<copy>
<source></source>
<dest>huaweijdk</dest>
</copy>
</copies>
</dependency>
<dependency>
<versionType>BVersion</versionType>
<repoType>Generic</repoType>
<id>
<offering>KMC</offering>
<version>KMC 21.1.0.B006</version>
</id>
<isClear>Y</isClear>
<copies>
<copy>
<source></source>
<dest></dest>
<DEL>Y</DEL>
</copy>
</copies>
</dependency>
</dependency>
</dependencies>
</project>
</project>

4964
distribute_errmsg.txt Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More