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
2 changes: 1 addition & 1 deletion src/pgduckdb_duckdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ DuckDBManager::Initialize() {
SET_DUCKDB_OPTION(autoinstall_known_extensions);
SET_DUCKDB_OPTION(autoload_known_extensions);

if (duckdb_maximum_memory != NULL && strlen(duckdb_maximum_memory) == 0) {
if (duckdb_maximum_memory != NULL && strlen(duckdb_maximum_memory) != 0) {
config.options.maximum_memory = duckdb::DBConfig::ParseMemoryLimit(duckdb_maximum_memory);
elog(DEBUG2, "[PGDuckDB] Set DuckDB option: 'maximum_memory'=%s", duckdb_maximum_memory);
}
Expand Down
28 changes: 28 additions & 0 deletions test/regression/expected/gucs.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
show duckdb.memory_limit;
duckdb.memory_limit
---------------------
4GB
(1 row)

select * from duckdb.query($$ select current_setting('memory_limit') == '3.7 GiB' $$);
(current_setting('memory_limit') = '3.7 GiB')
-----------------------------------------------
t
(1 row)

set duckdb.memory_limit = '1GiB';
CALL duckdb.recycle_ddb();
select * from duckdb.query($$ select current_setting('memory_limit') $$);
current_setting('memory_limit')
---------------------------------
1.0 GiB
(1 row)

set duckdb.memory_limit = '';
CALL duckdb.recycle_ddb();
select * from duckdb.query($$ select current_setting('memory_limit') != '3.7 GiB' $$);
(current_setting('memory_limit') != '3.7 GiB')
------------------------------------------------
t
(1 row)

1 change: 1 addition & 0 deletions test/regression/schedule
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test: transactions
test: transaction_errors
test: secrets
test: prepare
test: gucs
test: function
test: issue_410
test: timestamp_with_interval
Expand Down
10 changes: 10 additions & 0 deletions test/regression/sql/gucs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
show duckdb.memory_limit;
select * from duckdb.query($$ select current_setting('memory_limit') == '3.7 GiB' $$);

set duckdb.memory_limit = '1GiB';
CALL duckdb.recycle_ddb();
select * from duckdb.query($$ select current_setting('memory_limit') $$);

set duckdb.memory_limit = '';
CALL duckdb.recycle_ddb();
select * from duckdb.query($$ select current_setting('memory_limit') != '3.7 GiB' $$);