Skip to content

Commit

Permalink
Merge pull request #5 from aanhh/RELEASE_v2.6.2
Browse files Browse the repository at this point in the history
RELEASE v2.6.2
  • Loading branch information
t-hiroshige authored Dec 23, 2021
2 parents 6da2027 + 0baa554 commit ec4f20d
Show file tree
Hide file tree
Showing 70 changed files with 3,738 additions and 1,861 deletions.
88 changes: 88 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Contributing to `mysql_fdw`
===========================

Following these guidelines helps to facilitate relevant discussion in
pull requests and issues so the developers managing and developing this
open source project can address patches and bugs as efficiently as
possible.


Using Issues
------------

`mysql_fdw`'s maintainers prefer that bug reports, feature requests, and
pull requests are submitted as [GitHub Issues][1].


Bug Reports
-----------

Before opening a bug report:

1. Search for a duplicate issue using GitHub's issue search
2. Check whether the bug remains in the latest `master` or `develop`
commit
3. Create a reduced test case: remove code and data not relevant to
the bug

A contributor should be able to begin work on your bug without asking
too many followup questions. If you include the following information,
your bug will be serviced more quickly:

* Short, descriptive title
* Your OS
* Versions of dependencies
* Any custom modifications

Once the background information is out of the way, you are free to
present the bug itself. You should explain:

* Steps you took to exercise the bug
* The expected outcome
* What actually occurred


Feature Requests
----------------

We are open to adding features but ultimately control the scope and aims
of the project. If a proposed feature is likely to incur high testing,
maintenance, or performance costs it is also unlikely to be accepted.
If a _strong_ case exists for a given feature, we may be persuaded on
merit. Be specific.


Pull Requests
-------------

Well-constructed pull requests are very welcome. By _well-constructed_,
we mean they do not introduce unrelated changes or break backwards
compatibility. Just fork this repo and open a request against `develop`.

Some examples of things likely to increase the likelihood a pull request
is rejected:

* Large structural changes, including:
* Re-factoring for its own sake
* Adding languages to the project
* Unnecessary whitespace changes
* Deviation from obvious conventions
* Introduction of incompatible intellectual property

Please do not change version numbers in your pull request: they will be
updated by the project owners prior to the next release.


License
-------

By submitting a patch, you agree to allow the project owners to license
your work under the terms of the [`LICENSE`][2]. Additionally, you grant
the project owners a license under copyright covering your contribution
to the extent permitted by law. Finally, you confirm that you own said
copyright, have the legal authority to grant said license, and in doing
so are not violating any grant of rights you have made to third parties,
including your employer.

[1]: https://github.com/EnterpriseDB/mysql_fdw/issues
[2]: LICENSE
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ SEMI, and ANTI join. This is a performance feature.
- Support discard cached connections to remote servers by using function mysql_fdw_disconnect(), mysql_fdw_disconnect_all().
- Support bulk insert by using batch_size option.
- Whole row reference is implemented by modifying the target list to select all whole row reference members and form new row for the whole row in FDW when interate foreign scan.
- Support returning system attribute (`ctid`, `tableiod`)
### Prepared Statement
(Refactoring for `select` queries to use prepared statement)
Expand All @@ -223,6 +224,9 @@ The following parameters can be set on a MySQL foreign server object:
MySQL server.
* `use_remote_estimate`: Controls whether mysql_fdw issues remote
EXPLAIN commands to obtain cost estimates. Default is `false`
* `reconnect`: Enable or disable automatic reconnection to the
MySQL server if the existing connection is found to have been lost.
Default is `false`.
* `ssl_key`: The path name of the client private key file.
* `ssl_cert`: The path name of the client public key certificate file.
* `ssl_ca`: The path name of the Certificate Authority (CA) certificate
Expand All @@ -231,6 +235,10 @@ The following parameters can be set on a MySQL foreign server object:
* `ssl_capath`: The path name of the directory that contains trusted
SSL CA certificate files.
* `ssl_cipher`: The list of permissible ciphers for SSL encryption.
* `fetch_size`: This option specifies the number of rows mysql_fdw should
get in each fetch operation. It can be specified for a foreign table or
a foreign server. The option specified on a table overrides an option
specified for the server. The default is `100`.
The following parameters can be set on a MySQL foreign table object:
Expand All @@ -239,6 +247,7 @@ The following parameters can be set on a MySQL foreign table object:
* `table_name`: Name of the MySQL table, default is the same as
foreign table.
* `max_blob_size`: Max blob size to read without truncation.
* `fetch_size`: Same as `fetch_size` parameter for foreign server.
The following parameters need to supplied while creating user mapping.
Expand Down
10 changes: 8 additions & 2 deletions connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PG_FUNCTION_INFO_V1(mysql_fdw_disconnect_all);

/* prototypes of private functions */
static void mysql_make_new_connection(ConnCacheEntry *entry, UserMapping *user, mysql_opt * opt);
#if (PG_VERSION_NUM >= 140000)
#if PG_VERSION_NUM >= 140000
static bool disconnect_cached_connections(Oid serverid);
#endif
static void disconnect_mysql_server(ConnCacheEntry *entry);
Expand Down Expand Up @@ -121,7 +121,7 @@ mysql_get_connection(ForeignServer *server, UserMapping *user, mysql_opt * opt)
ctl.hcxt = CacheMemoryContext;
ConnectionHash = hash_create("mysql_fdw connections", 8,
&ctl,
#if (PG_VERSION_NUM >= 140000)
#if PG_VERSION_NUM >= 140000
HASH_ELEM | HASH_BLOBS);
#else
HASH_ELEM | HASH_FUNCTION | HASH_CONTEXT);
Expand Down Expand Up @@ -377,6 +377,12 @@ mysql_connect(mysql_opt * opt)
if (svr_init_command != NULL)
mysql_options(conn, MYSQL_INIT_COMMAND, svr_init_command);

/*
* Enable or disable automatic reconnection to the MySQL server if the
* existing connection is found to have been lost.
*/
mysql_options(conn, MYSQL_OPT_RECONNECT, &opt->reconnect);

mysql_ssl_set(conn, opt->ssl_key, opt->ssl_cert, opt->ssl_ca,
opt->ssl_capath, ssl_cipher);

Expand Down
Loading

0 comments on commit ec4f20d

Please sign in to comment.