6 Commits

Author SHA1 Message Date
Sven Klemm
f89fd07c5b Remove year from SQL file license text
This changes the license text for SQL files to be identical
with the license text for C files.
2019-01-13 23:30:22 +01:00
Sven Klemm
787cc0470e Replace hardcoded database name from regression tests
Replace hardcoded database name from regression tests with :TEST_DBNAME
Remove creation of database single_2 from test runner and add it to
bgw_launcher and loader test since no other tests used those
use SQL comments in test scripts
2018-12-28 19:26:27 +01:00
Joshua Lockerman
20ec6914c0 Add license headers to SQL files and test code 2018-10-29 13:28:19 -04:00
Joshua Lockerman
974788516a Prefix public C functions with ts_
We've decided to adopt the ts_ prefix on all exported C functions in
order to avoid having symbol conflicts with future postgres functions.
We've already started using this prefix on new functions and this commit
adds the prefix to to the old functions.
2018-09-27 11:45:04 -04:00
Erik Nordström
ebe0915669 Refactor telemetry and fixes
The installation metadata has been refactored:

- The installation metadata store now takes Datums of any
  type as input and output
- Move metadata functions from uuid.c -> metadata.c
- Make metadata functions return native types rather than text,
  including for tests

Telemetry tests for ssl and nossl have been combined.

Note that PG 9.6 does not have pg_backend_random() that gives us a
secure random numbers for UUIDs that we send in telemetry. Therefore,
we fall back to the generating the UUID from the timestamp if we are
on PG 9.6.

This change also fixes a number of test issues. For instance, in the
telemetry test the escape char `E` was passed on as part of the
response string when set as a variable with `\set`. This was not
detected before because the response parser didn't parse the start of
the response properly.

A number of fixes have been made to the formatting of log messages for
telemetry to conform to the PostgreSQL standard as well as being
consistent with other messages.

Numerous build issues on Windows have been resolved. There is also new
functionality to get OS version info on Windows (for telemetry),
including a SQL function get_os_info() to retrieve this information.

The net library will now allow connecting to a servicename, e.g., http
or https. A port is resolved from this service name via getaddrinfo().
An explicit port can still be given, and it that case it will not
resolve the service name.

Databases the are updated to the new version of the extension will
have an install_timestamp in their installation metadata that does not
reflect the actual original install date of the extension. To be able
to distinguish these updated installations from those that are freshly
installed, we add a bogus "epoch" install_timestamp in the update
script.

Parsing of the version string in the telemetry response has been
refactored to be more amenable to testing. Tests have been added.
2018-09-10 13:29:59 -04:00
Erik Nordström
4f6b92ab37 Refactor net lib functionality and fix build issues
This makes the following changes related to the net lib:

- A CMake run now fails in case OpenSSL is not found when the local
  PostgreSQL installation has been compiled with SSL enabled. The
  reason why it is best to fail the CMake run in this case is because
  USE_OPENSSL will be defined and 1 in `pg_config.h` and thus we will
  compile with SSL support.

- Use palloc/pfree in connection library.

- Split net library into separate source files. The net library is
  refactored so that the code for different connection types live in
  their separate source files. In particular, the source code for mock
  connections is now moved to `test/src/net`.

- The generate_typedefs.sh script now runs in subdirectories so that
  source files in those subdirectories are properly pgindented.

- The pgindent target previously did not cover files under
  `test/src`. This is now fixed. An exclude file has also been added
  that avoids running pgindent in hidden directories. This fixes issues
  with, e.g., trying to indent files in cquery caches.

- Fix formatting with pgindent Fix parameter types in HTTP lib. Add
  `const` to parameter types, such as strings.  Use `size_t` for
  length parameters

- Parse and validate the status line of HTTP responses. The beginning
  of HTTP responses weren't properly parsed and validated, allowing
  invalid character sequences at the start of requests.
2018-09-10 13:29:59 -04:00