From a5a21739a96cb35d3fcd523a83ceb5b26474d54d Mon Sep 17 00:00:00 2001 From: Jeevan Chalke Date: Wed, 15 Feb 2023 15:13:50 +0530 Subject: [PATCH] Rename mysql_connect() function to mysql_fdw_connect(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On MariaDB, mysql.h do have function named mysql_connect() conflicting with our version. So rename it. Reported on GitHub through pull request #145 by Glyn Astill (glynastill). Another user, Михаил (mkgrgis), also requested these changes. Glyn Astill, revised by Jeevan Chalke. --- connection.c | 4 ++-- mysql_fdw.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/connection.c b/connection.c index 67b1283..501cc0b 100644 --- a/connection.c +++ b/connection.c @@ -119,7 +119,7 @@ mysql_get_connection(ForeignServer *server, UserMapping *user, mysql_opt *opt) if (entry->conn == NULL) { - entry->conn = mysql_connect(opt); + entry->conn = mysql_fdw_connect(opt); elog(DEBUG3, "new mysql_fdw connection %p for server \"%s\"", entry->conn, server->servername); @@ -195,7 +195,7 @@ mysql_release_connection(MYSQL *conn) } MYSQL * -mysql_connect(mysql_opt *opt) +mysql_fdw_connect(mysql_opt *opt) { MYSQL *conn; char *svr_database = opt->svr_database; diff --git a/mysql_fdw.h b/mysql_fdw.h index 515aa5c..e014afa 100644 --- a/mysql_fdw.h +++ b/mysql_fdw.h @@ -345,7 +345,7 @@ extern void mysql_deparse_truncate_sql(StringInfo buf, Relation rel); /* connection.c headers */ MYSQL *mysql_get_connection(ForeignServer *server, UserMapping *user, mysql_opt *opt); -MYSQL *mysql_connect(mysql_opt *opt); +MYSQL *mysql_fdw_connect(mysql_opt *opt); void mysql_cleanup_connection(void); void mysql_release_connection(MYSQL *conn);