Skip to content

Commit

Permalink
Merge pull request #489 from ApsaraDB/POLARDB_11_DEV
Browse files Browse the repository at this point in the history
merge: 20240310
  • Loading branch information
mrdrivingduck authored Mar 10, 2024
2 parents e6aa579 + ffb3160 commit c5ff2c3
Show file tree
Hide file tree
Showing 29 changed files with 1,534 additions and 194 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docs-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: docs format check
on:
# trigger deployment on every PR to branch POLARDB_11_DEV in docs/
pull_request:
branches: [POLARDB_11_DEV]
branches: [ POLARDB_11_DEV ]
paths:
- ".github/workflows/docs.yml"
- "docs/**"
Expand All @@ -16,20 +16,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch all commits to get last updated time or other git log info
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
# choose node.js version to use
node-version: "16"

# cache node_modules
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch all commits to get last updated time or other git log info
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
# choose node.js version to use
node-version: "16"

# cache node_modules
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: |
Expand All @@ -50,7 +50,7 @@ jobs:
# please check out the docs of the workflow for more details
# @see https://github.com/crazy-max/ghaction-github-pages
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
uses: crazy-max/ghaction-github-pages@v4
with:
# deploy to gh-pages branch
target_branch: gh-pages
Expand Down
72 changes: 43 additions & 29 deletions .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,16 @@ on:
workflow_dispatch:

jobs:
build:
build_normal:
runs-on: ubuntu-latest
strategy:
matrix:
container_image: [ centos7 ]
instance_type: [ oltp, htap, dma ]

container_image: [ ubuntu20.04, ubuntu22.04 ]
instance_type: [ oltp, htap ]
steps:
-
name: Fetch PolarDB source code
uses: actions/checkout@v3

-
name: Create and start the container
- name: Fetch PolarDB source code
uses: actions/checkout@v4
- name: Create and start the container
run: |
docker create \
-t \
Expand All @@ -47,63 +43,81 @@ jobs:
polardb/polardb_pg_devel:${{ matrix.container_image }} \
bash && \
docker start polardb_${{ matrix.container_image }}
-
name: Change ownership of the source code
- name: Change ownership of the source code
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sudo chown -R postgres:postgres ./"
-
name: Ignore some test cases for OLTP regression testing
- name: Ignore some test cases for OLTP regression testing
if: ${{ matrix.instance_type == 'oltp' }}
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL"
-
name: Build and run OLTP regression testing
- name: Build and run OLTP regression testing
if: ${{ matrix.instance_type == 'oltp' }}
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
source /etc/bashrc && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
./polardb_build.sh --withrep -r -e -r-external \
-r-contrib -r-pl --with-tde"
-
name: Ignore some test cases for HTAP regression testing
- name: Ignore some test cases for HTAP regression testing
if: ${{ matrix.instance_type == 'htap' }}
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sed -i 's/test: polar-px-dev\/polar_partition_huge/#&/g' src/test/regress/polar-px-dev-schedule"
-
name: Build and run HTAP regression testing
- name: Build and run HTAP regression testing
if: ${{ matrix.instance_type == 'htap' }}
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
source /etc/bashrc && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
./polardb_build.sh -r-px -e -r-external \
-r-contrib -r-pl --with-tde"
- name: Change ownership of the source code
run: |
sudo chown -R runner:runner `pwd`
build_dma:
runs-on: ubuntu-latest
strategy:
matrix:
container_image: [ centos7 ]
instance_type: [ dma ]
steps:
- name: Fetch PolarDB source code
uses: actions/checkout@v4

-
name: Build and run DMA regression testing
- name: Create and start the container
run: |
docker create \
-t \
--name polardb_${{ matrix.container_image }} \
-v `pwd`:/home/postgres/PolarDB-for-PostgreSQL \
polardb/polardb_pg_devel:${{ matrix.container_image }} \
bash && \
docker start polardb_${{ matrix.container_image }}
- name: Change ownership of the source code
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sudo chown -R postgres:postgres ./"
- name: Build and run DMA regression testing
if: ${{ matrix.instance_type == 'dma' }}
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
source /etc/bashrc && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
./polardb_build.sh -r -e -r-external \
-r-contrib -r-pl --with-tde --with-dma"
- name: Change ownership of the source code
run: |
sudo chown -R runner:runner `pwd`
95 changes: 95 additions & 0 deletions contrib/pgcrypto/expected/blowfish_1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
--
-- Blowfish cipher
--
-- ensure consistent test output regardless of the default bytea format
SET bytea_output TO escape;
-- some standard Blowfish testvalues
SELECT encode(encrypt(
decode('0000000000000000', 'hex'),
decode('0000000000000000', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
SELECT encode(encrypt(
decode('ffffffffffffffff', 'hex'),
decode('ffffffffffffffff', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
SELECT encode(encrypt(
decode('1000000000000001', 'hex'),
decode('3000000000000000', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
SELECT encode(encrypt(
decode('1111111111111111', 'hex'),
decode('1111111111111111', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
SELECT encode(encrypt(
decode('0123456789abcdef', 'hex'),
decode('fedcba9876543210', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
SELECT encode(encrypt(
decode('01a1d6d039776742', 'hex'),
decode('fedcba9876543210', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
SELECT encode(encrypt(
decode('ffffffffffffffff', 'hex'),
decode('0000000000000000', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- setkey
SELECT encode(encrypt(
decode('fedcba9876543210', 'hex'),
decode('f0e1d2c3b4a5968778695a4b3c2d1e0f', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- with padding
SELECT encode(encrypt(
decode('01234567890123456789', 'hex'),
decode('33443344334433443344334433443344', 'hex'),
'bf-ecb'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- cbc
-- 28 bytes key
SELECT encode(encrypt(
decode('6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5', 'hex'),
decode('37363534333231204e6f77206973207468652074696d6520666f7220', 'hex'),
'bf-cbc'), 'hex');
ERROR: encrypt error: Key was too big
-- 29 bytes key
SELECT encode(encrypt(
decode('6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc', 'hex'),
decode('37363534333231204e6f77206973207468652074696d6520666f722000', 'hex'),
'bf-cbc'), 'hex');
ERROR: encrypt error: Key was too big
-- blowfish-448
SELECT encode(encrypt(
decode('fedcba9876543210', 'hex'),
decode('f0e1d2c3b4a5968778695a4b3c2d1e0f001122334455667704689104c2fd3b2f584023641aba61761f1f1f1f0e0e0e0effffffffffffffff', 'hex'),
'bf-ecb/pad:none'), 'hex');
ERROR: encrypt error: Key was too big
-- result: c04504012e4e1f53
-- empty data
select encode(encrypt('', 'foo', 'bf'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- 10 bytes key
select encode(encrypt('foo', '0123456789', 'bf'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- 22 bytes key
select encode(encrypt('foo', '0123456789012345678901', 'bf'), 'hex');
ERROR: encrypt error: Key was too big
-- decrypt
select decrypt(encrypt('foo', '0123456', 'bf'), '0123456', 'bf');
ERROR: encrypt error: Cipher cannot be initialized ?
-- iv
select encode(encrypt_iv('foo', '0123456', 'abcd', 'bf'), 'hex');
ERROR: encrypt_iv error: Cipher cannot be initialized ?
select decrypt_iv(decode('95c7e89322525d59', 'hex'), '0123456', 'abcd', 'bf');
ERROR: decrypt_iv error: Cipher cannot be initialized ?
-- long message
select encode(encrypt('Lets try a longer message.', '0123456789', 'bf'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
select decrypt(encrypt('Lets try a longer message.', '0123456789', 'bf'), '0123456789', 'bf');
ERROR: encrypt error: Cipher cannot be initialized ?
48 changes: 48 additions & 0 deletions contrib/pgcrypto/expected/cast5_1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--
-- Cast5 cipher
--
-- ensure consistent test output regardless of the default bytea format
SET bytea_output TO escape;
-- test vectors from RFC2144
-- 128 bit key
SELECT encode(encrypt(
decode('01 23 45 67 89 AB CD EF', 'hex'),
decode('01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A', 'hex'),
'cast5-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- result: 23 8B 4F E5 84 7E 44 B2
-- 80 bit key
SELECT encode(encrypt(
decode('01 23 45 67 89 AB CD EF', 'hex'),
decode('01 23 45 67 12 34 56 78 23 45', 'hex'),
'cast5-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- result: EB 6A 71 1A 2C 02 27 1B
-- 40 bit key
SELECT encode(encrypt(
decode('01 23 45 67 89 AB CD EF', 'hex'),
decode('01 23 45 67 12', 'hex'),
'cast5-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- result: 7A C8 16 D1 6E 9B 30 2E
-- cbc
-- empty data
select encode( encrypt('', 'foo', 'cast5'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- 10 bytes key
select encode( encrypt('foo', '0123456789', 'cast5'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- decrypt
select decrypt(encrypt('foo', '0123456', 'cast5'), '0123456', 'cast5');
ERROR: encrypt error: Cipher cannot be initialized ?
-- iv
select encode(encrypt_iv('foo', '0123456', 'abcd', 'cast5'), 'hex');
ERROR: encrypt_iv error: Cipher cannot be initialized ?
select decrypt_iv(decode('384a970695ce016a', 'hex'),
'0123456', 'abcd', 'cast5');
ERROR: decrypt_iv error: Cipher cannot be initialized ?
-- long message
select encode(encrypt('Lets try a longer message.', '0123456789', 'cast5'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
select decrypt(encrypt('Lets try a longer message.', '0123456789', 'cast5'), '0123456789', 'cast5');
ERROR: encrypt error: Cipher cannot be initialized ?
31 changes: 31 additions & 0 deletions contrib/pgcrypto/expected/des_1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--
-- DES cipher
--
-- ensure consistent test output regardless of the default bytea format
SET bytea_output TO escape;
-- no official test vectors atm
-- from blowfish.sql
SELECT encode(encrypt(
decode('0123456789abcdef', 'hex'),
decode('fedcba9876543210', 'hex'),
'des-ecb/pad:none'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- empty data
select encode( encrypt('', 'foo', 'des'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- 8 bytes key
select encode( encrypt('foo', '01234589', 'des'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
-- decrypt
select decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des');
ERROR: encrypt error: Cipher cannot be initialized ?
-- iv
select encode(encrypt_iv('foo', '0123456', 'abcd', 'des'), 'hex');
ERROR: encrypt_iv error: Cipher cannot be initialized ?
select decrypt_iv(decode('50735067b073bb93', 'hex'), '0123456', 'abcd', 'des');
ERROR: decrypt_iv error: Cipher cannot be initialized ?
-- long message
select encode(encrypt('Lets try a longer message.', '01234567', 'des'), 'hex');
ERROR: encrypt error: Cipher cannot be initialized ?
select decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des');
ERROR: encrypt error: Cipher cannot be initialized ?
Loading

0 comments on commit c5ff2c3

Please sign in to comment.