From ff865b088f5b985e9856f761c098045269dcaa7b Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 12 Aug 2024 21:30:32 +0200 Subject: [PATCH] MDEV-34741 - remove LOCK TABLE from mariadb-import It currently serves no real purpose, but is suspected to cause occasional error when foreign keys are used. "Error: 1100, Table 'child' was not locked with LOCK TABLES, when using table: parent" as seen on CI --- client/mysqlimport.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/mysqlimport.cc b/client/mysqlimport.cc index 4b45ecdc4c5..4a0cfe95c9c 100644 --- a/client/mysqlimport.cc +++ b/client/mysqlimport.cc @@ -628,8 +628,6 @@ static int handle_one_table(const table_load_params *params, MYSQL *mysql) } if (tz_utc && exec_sql(mysql, "SET TIME_ZONE='+00:00';")) DBUG_RETURN(1); - if (exec_sql(mysql, std::string("LOCK TABLE ") + full_tablename + "WRITE")) - DBUG_RETURN(1); if (exec_sql(mysql, std::string("ALTER TABLE ") + full_tablename + " DISABLE KEYS")) DBUG_RETURN(1); } @@ -716,8 +714,6 @@ static int handle_one_table(const table_load_params *params, MYSQL *mysql) if (exec_sql(mysql, std::string("FLUSH TABLE ").append(full_tablename).c_str())) DBUG_RETURN(1); } - if (exec_sql(mysql, "UNLOCK TABLES")) - DBUG_RETURN(1); } if (tz_utc)