From 1ff476b415cacc616f68af542b75793d064367ae Mon Sep 17 00:00:00 2001 From: Lawrin Novitsky Date: Mon, 12 Sep 2022 14:39:12 +0200 Subject: MDEV-29490 Renaming internally used client API to avoid name conflicts with C/C. The patch introduces mariadb_capi_rename.h which is included into mysql.h. The hew header contains macro definitions for the names being renamed. In versions 10.6+(i.e. where sql service exists) the renaming condition in the mariadb_capi_rename.h should be added with && !defined(MYSQL_DYNAMIC_PLUGIN) and look like The patch also contains removal of mysql.h from the api check. Disabling false_duper-6543 test for embedded. ha_federated.so uses C API. C API functions are being renamed in the server, but not renamed in embedded, since embedded server library should have proper C API, as expected by programs using it. Thus the same ha_federated.so cannot work both for server and embedded server library. As all federated tests are already disabled for embedded, federated isn't supposed to work for embedded anyway, and thus the test is being disabled. --- storage/federatedx/ha_federatedx.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'storage/federatedx/ha_federatedx.cc') diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 21c37907ee0..ad1d9e47ca3 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -314,6 +314,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MYSQL_SERVER 1 #include #include +#include #include "ha_federatedx.h" #include "sql_servers.h" #include "sql_analyse.h" // append_escaped() -- cgit v1.2.1 From 5f296f3a181eb63b6112153c6d4f9186180e6c50 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Tue, 25 Oct 2022 19:30:42 +0700 Subject: MDEV-29640 FederatedX does not properly handle pushdown in case of difference in local and remote table names FederatedX table may refer to a table with a different name on the remote server: test> CREATE TABLE t2 (...) ENGINE="FEDERATEDX" CONNECTION="mysql://user:pass@192.168.1.111:9308/federatedx/t1"; test> select * from t2 where ...; This could cause an issue with federated_pushdown=1, because FederatedX pushes the query (or derived table's) text to the remote server. The remote server will try to read from table t2 (while it should read from t1). Solution: do not allow pushing down queries with tables that have different db_name.table name on the local and remote server. This patch also fixes: MDEV-29863 Server crashes in federatedx_txn::acquire after select from the FederatedX table with partitions Solution: disallow pushdown when partitioned FederatedX tables are used. --- storage/federatedx/ha_federatedx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage/federatedx/ha_federatedx.cc') diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 085422e6016..e329f5df177 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -609,7 +609,7 @@ error: parse_url() mem_root MEM_ROOT pointer for memory allocation share pointer to FEDERATEDX share - table pointer to current TABLE class + table_s pointer to current TABLE_SHARE class table_create_flag determines what error to throw DESCRIPTION -- cgit v1.2.1