New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define strerror() for Windows #1834
Conversation
22b5432
to
44f64d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits and suggestions.
#endif | ||
} | ||
|
||
/* We cannot define `pg_strerror` here because there is a #define in PG12 that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The markdown formatting seems unnecessary in C comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this to avoid confusion when mixing English text with references to symbols in the code.
@@ -25,6 +27,24 @@ set_error(int err) | |||
#endif | |||
} | |||
|
|||
static int | |||
get_error(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_error(void) | |
get_socket_error(void) |
Given that this is, at least on Windows, only used for Winsock-related errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, the function itself is not restricted to socket-related errors, it is generic, and there is a corresponding function set_error
above this one, so it makes sense to stick to the conventions already established by this.
22cf766
to
7648c3f
Compare
The symbol `pgwin32_socket_strerror` was undefined on windows builds at PG12 and later. This because the function was removed and instead `pg_strerror` was introduced to be used on all platforms. This commit fixes the issue by ensuring to use `pg_strerror` on PG12 and later, and `pgwin32_socket_strerror` on Windows builds before PG12. Found using `clang-tidy`
7648c3f
to
81d9b71
Compare
Codecov Report
@@ Coverage Diff @@
## master #1834 +/- ##
==========================================
- Coverage 89.72% 89.60% -0.12%
==========================================
Files 150 144 -6
Lines 22696 22118 -578
==========================================
- Hits 20364 19819 -545
+ Misses 2332 2299 -33
Continue to review full report at Codecov.
|
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1861 Fix qual pushodwn for compressed hypertables where quals have casts * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries **Thanks** * @frostwind for reporting issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @dhodyn for reporting an issue with UNION ALL queries * @pehlert for reporting an issue with pg_upgrade * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1861 Fix qual pushodwn for compressed hypertables where quals have casts * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries **Thanks** * @frostwind for reporting issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @dhodyn for reporting an issue with UNION ALL queries * @pehlert for reporting an issue with pg_upgrade * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries **Thanks** * @frostwind for reporting issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @pehlert for reporting an issue with pg_upgrade * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries * timescale#1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @frostwind for reporting issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @pehlert for reporting an issue with pg_upgrade * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1854 Fix reorder policy job to skip compressed chunks * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries * timescale#1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @pehlert for reporting an issue with pg_upgrade * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1854 Fix reorder policy job to skip compressed chunks * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries * timescale#1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @pehlert for reporting an issue with pg_upgrade * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading and high priority for users with multiple continuous aggregates. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1854 Fix reorder policy job to skip compressed chunks * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1869 Fix real time aggregate support for multiple continuous aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries * timescale#1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @louisth for reporting an issue with real-time aggregation and multiple continuous aggregates * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @pehlert for reporting an issue with pg_upgrade
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading and high priority for users with multiple continuous aggregates. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1854 Fix reorder policy job to skip compressed chunks * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1869 Fix real time aggregate support for multiple continuous aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries * timescale#1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @louisth for reporting an issue with real-time aggregation and multiple continuous aggregates * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @pehlert for reporting an issue with pg_upgrade
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading and high priority for users with multiple continuous aggregates. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * timescale#1834 Define strerror() for Windows * timescale#1846 Fix segfault on COPY to hypertable * timescale#1850 Fix scheduler failure due to bad next_start_time for jobs * timescale#1851 Fix hypertable expansion for UNION ALL * timescale#1854 Fix reorder policy job to skip compressed chunks * timescale#1861 Fix qual pushdown for compressed hypertables where quals have casts * timescale#1864 Fix issue with subplan selection in parallel ChunkAppend * timescale#1868 Add support for WHERE, HAVING clauses with real time aggregates * timescale#1869 Fix real time aggregate support for multiple continuous aggregates * timescale#1871 Don't rely on timescaledb.restoring for upgrade * timescale#1875 Fix hypertable detection in subqueries * timescale#1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @louisth for reporting an issue with real-time aggregation and multiple continuous aggregates * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @pehlert for reporting an issue with pg_upgrade
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading and high priority for users with multiple continuous aggregates. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * #1834 Define strerror() for Windows * #1846 Fix segfault on COPY to hypertable * #1850 Fix scheduler failure due to bad next_start_time for jobs * #1851 Fix hypertable expansion for UNION ALL * #1854 Fix reorder policy job to skip compressed chunks * #1861 Fix qual pushdown for compressed hypertables where quals have casts * #1864 Fix issue with subplan selection in parallel ChunkAppend * #1868 Add support for WHERE, HAVING clauses with real time aggregates * #1869 Fix real time aggregate support for multiple continuous aggregates * #1871 Don't rely on timescaledb.restoring for upgrade * #1875 Fix hypertable detection in subqueries * #1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @louisth for reporting an issue with real-time aggregation and multiple continuous aggregates * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @pehlert for reporting an issue with pg_upgrade
This maintenance release contains bugfixes since the 1.7.0 release. We deem it medium priority for upgrading and high priority for users with multiple continuous aggregates. In particular the fixes contained in this maintenance release address bugs in continuous aggregates with real-time aggregation and PostgreSQL 12 support. **Bugfixes** * #1834 Define strerror() for Windows * #1846 Fix segfault on COPY to hypertable * #1850 Fix scheduler failure due to bad next_start_time for jobs * #1851 Fix hypertable expansion for UNION ALL * #1854 Fix reorder policy job to skip compressed chunks * #1861 Fix qual pushdown for compressed hypertables where quals have casts * #1864 Fix issue with subplan selection in parallel ChunkAppend * #1868 Add support for WHERE, HAVING clauses with real time aggregates * #1869 Fix real time aggregate support for multiple continuous aggregates * #1871 Don't rely on timescaledb.restoring for upgrade * #1875 Fix hypertable detection in subqueries * #1884 Fix crash on SELECT WHERE NOT with empty table **Thanks** * @airton-neto for reporting an issue with queries over UNIONs of hypertables * @dhodyn for reporting an issue with UNION ALL queries * @frostwind for reporting an issue with casts in where clauses on compressed hypertables * @fvannee for reporting an issue with hypertable detection in inlined SQL functions and an issue with COPY * @hgiasac for reporting missing where clause with real time aggregates * @louisth for reporting an issue with real-time aggregation and multiple continuous aggregates * @michael-sayapin for reporting an issue with INSERTs and WHERE NOT EXISTS * @Olernov for reporting and fixing an issue with compressed chunks in the reorder policy * @pehlert for reporting an issue with pg_upgrade
The symbol
pgwin32_socket_strerror
was undefined on windows builds atPG12 and later. This because the function was removed and instead
pg_strerror
was introduced to be used on all platforms.This commit fixes the issue by ensuring to use
pg_strerror
on PG12and later, and
pgwin32_socket_strerror
on Windows builds before PG12.