Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/IntegrationTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
run: |
source ./create-postgres-tables.sh
psql -d postgresscanner -c "SELECT 42"
make test
./build/release/test/unittest 'test/sql/*'

linux-pgbouncer:
name: Linux PgBouncer
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
LOCAL_EXTENSION_REPO: 'build/release/repository'
run: |
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
make test
./build/release/test/unittest 'test/sql/*'

- name: Run tests directly
env:
Expand All @@ -242,7 +242,7 @@ jobs:
LOCAL_EXTENSION_REPO: 'build/release/repository'
run: |
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
make test
./build/release/test/unittest 'test/sql/*'

- name: Upload log
if: always()
Expand Down Expand Up @@ -283,7 +283,9 @@ jobs:
sudo apt-get install -y -q -o=Dpkg::Use-Pty=0 \
build-essential \
ccache \
cmake
cmake \
mold \
ninja-build

- name: Cache Key
id: cache_key
Expand Down Expand Up @@ -341,7 +343,7 @@ jobs:
run: |
source ./create-postgres-tables.sh
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
make test
./build/relassert/test/unittest 'test/sql/*'

windows-tests:
name: Windows Tests
Expand Down Expand Up @@ -466,4 +468,4 @@ jobs:
shell: bash
run: |
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
make test
./build/release/test/unittest 'test/sql/*'
12 changes: 6 additions & 6 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ concurrency:
jobs:
duckdb-stable-build:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.5-variegata
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
with:
duckdb_version: v1.5.3
ci_tools_version: v1.5-variegata
duckdb_version: main
ci_tools_version: main
extension_name: postgres_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw'
opt_in_archs: 'linux_amd64_musl;linux_arm64_musl;windows_amd64_arm'
Expand All @@ -24,11 +24,11 @@ jobs:
duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@v1.5-variegata
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@main
secrets: inherit
with:
duckdb_version: v1.5.3
ci_tools_version: v1.5-variegata
duckdb_version: main
ci_tools_version: main
extension_name: postgres_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw'
opt_in_archs: 'linux_amd64_musl;linux_arm64_musl;windows_amd64_arm'
Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 7993 files
2 changes: 1 addition & 1 deletion extension-ci-tools
4 changes: 0 additions & 4 deletions scripts/time_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ def run_and_time_unit_tests():
env_vars['LOCAL_EXTENSION_REPO'] = extension_repo_path

test_files = sorted(test_files)
for test_file_full_path in test_files:
print(test_file_full_path)

sys.exit(1)

for test_file_full_path in test_files:
# Get the path relative to the project root, as required by the unittest executable
Expand Down
7 changes: 5 additions & 2 deletions src/include/postgres_binary_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "duckdb.hpp"
#include "duckdb/common/types/interval.hpp"
#include "duckdb/common/serializer/memory_stream.hpp"
#include "duckdb/common/vector/list_vector.hpp"
#include "duckdb/common/vector/map_vector.hpp"
#include "duckdb/common/vector/struct_vector.hpp"
#include "postgres_conversion.hpp"

namespace duckdb {
Expand All @@ -29,7 +32,7 @@
} else if (sizeof(T) == sizeof(uint32_t)) {
return htonl(val);
} else if (sizeof(T) == sizeof(uint64_t)) {
return htonll(val);

Check warning on line 35 in src/include/postgres_binary_writer.hpp

View workflow job for this annotation

GitHub Actions / Windows Tests

'>>': shift count negative or too big, undefined behavior
} else {
D_ASSERT(0);
return val;
Expand Down Expand Up @@ -427,9 +430,9 @@
WriteRawInteger<int32_t>(0); // data size (nop for now)
WriteRawInteger<uint32_t>(child_entries.size()); // column count
for (auto &child : child_entries) {
auto value_oid = PostgresUtils::ToPostgresOid(child->GetType());
auto value_oid = PostgresUtils::ToPostgresOid(child.GetType());
WriteRawInteger<uint32_t>(value_oid); // value oid
WriteValue(*child, r);
WriteValue(child, r);
}
auto end_position = stream.GetPosition();
// after writing all list elements update the field size
Expand Down
14 changes: 8 additions & 6 deletions src/include/postgres_filter_pushdown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

#pragma once

#include "duckdb/planner/table_filter.hpp"
#include "duckdb/planner/filter/conjunction_filter.hpp"
#include "duckdb/planner/filter/constant_filter.hpp"
#include "duckdb/planner/table_filter_set.hpp"
#include "duckdb/planner/filter/expression_filter.hpp"

namespace duckdb {

Expand All @@ -21,10 +20,13 @@ class PostgresFilterPushdown {

private:
static string TransformCTIDLiteral(const Value &val);
static string TransformConstantFilter(string &column_name, ConstantFilter &filter, column_t column_id);
static string TransformFilter(string &column_name, TableFilter &filter, column_t column_id);
static string TransformConstantFilter(const string &column_name, ExpressionType comparison_type,
const Value &constant, column_t column_id);
static string TransformFilter(const string &column_name, const TableFilter &filter, column_t column_id);
static string TransformExpression(const string &column_name, const Expression &expr, column_t column_id);
static string TransformExpressionSubject(const string &column_name, const Expression &expr);
static string TransformComparison(ExpressionType type);
static string CreateExpression(string &column_name, vector<unique_ptr<TableFilter>> &filters, string op,
static string CreateExpression(const string &column_name, const vector<unique_ptr<Expression>> &filters, string op,
column_t column_id);
};

Expand Down
6 changes: 6 additions & 0 deletions src/include/storage/postgres_catalog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ class PostgresCatalog : public Catalog {
bool InMemory() override;
string GetDBPath() override;

bool Supports(RemoteCapability capability) const override {
return capability == RemoteCapability::IS_REMOTE || capability == RemoteCapability::CONNECT;
}
unique_ptr<TableRef> RemoteExecute(ClientContext &context, const string &sql) override;
string GetConnectDisplay() override;

PostgresConnectionPool &GetConnectionPool() {
return *connection_pool;
}
Expand Down
Loading
Loading