dolthub / doltgresql

DoltgreSQL - Version Controlled PostgreSQL
Apache License 2.0
1.12k stars 25 forks source link

Unable to set `statement_timeout` #943

Closed al-sabr closed 1 week ago

al-sabr commented 1 week ago

We started a thread concerning connection issues with HeidSQL and other GUI interface used to connect to doltgress.

https://discord.com/channels/746150696465727668/1305855201390886912

time="2024-11-12T19:23:33+01:00" level=warning msg="error running query" connectTime="2024-11-12 19:23:33.4210092 +0100 CET m=+392.647117201" connectionDb=doltgres connectionID=2 error="Variable 'statement_timeout' is a read only variable"

PR : https://github.com/dolthub/doltgresql/pull/944

This is the debug log with HeidiSQL based on the previous PR username: doltgres pass: doltgress

time="2024-11-12T21:54:22+01:00" level=info msg=NewConnection DisableClientMultiStatements=true connectionID=1
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionID=1 query="SET database TO 'doltgres';"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 2 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SET database TO 'doltgres';"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SET database TO 'doltgres';"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 0 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SET database TO 'doltgres';"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"SELECT NOW()\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT NOW()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 1 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT NOW()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT NOW()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 1 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT NOW()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"SELECT 'citext'::regtype::oid\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT 'citext'::regtype::oid"
time="2024-11-12T21:54:22+01:00" level=warning msg="error running query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 error="type \"citext\" does not exist" query="SELECT 'citext'::regtype::oid"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT 'citext'::regtype::oid"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 0 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT 'citext'::regtype::oid"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"SELECT VERSION()\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT VERSION()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 1 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT VERSION()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT VERSION()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Query finished in 0 ms" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SELECT VERSION()"
time="2024-11-12T21:54:22+01:00" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"SET statement_timeout TO 0\"}"
time="2024-11-12T21:54:22+01:00" level=debug msg="Starting query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 query="SET statement_timeout TO 0"
time="2024-11-12T21:54:22+01:00" level=warning msg="error running query" connectTime="2024-11-12 21:54:22.4457597 +0100 CET m=+16.282241701" connectionDb=doltgres connectionID=1 error="Variable 'statement_timeout' is a read only variable" query="SET statement_timeout TO 0"
time="2024-11-12T21:54:24+01:00" level=debug msg="Received message: {\"Type\":\"Terminate\"}"
time="2024-11-12T21:54:24+01:00" level=info msg=ConnectionClosed connectionID=1
fulghum commented 1 week ago

Thanks for reporting this bug @al-sabr. 🙏 Sure enough, we had an incorrect value configured for the statement_timeout setting, and that prevented users from being able to set it. I've fixed the configuration in https://github.com/dolthub/doltgresql/pull/947 and added a test that asserts users can set the value.

When you pull the latest changes from main and rebuild, you should see this statement working. Let us know if you hit more issues with HeidiSQL and we'll be happy to dig in and get things working.

al-sabr commented 1 week ago

Thanks for reporting this bug @al-sabr. 🙏 Sure enough, we had an incorrect value configured for the statement_timeout setting, and that prevented users from being able to set it. I've fixed the configuration in #947 and added a test that asserts users can set the value.

Thank you for having fixed it 👍