From 50c377f1f80b6d723e985b5dde8fbfdbb390484f Mon Sep 17 00:00:00 2001 From: David Liedle Date: Sat, 9 Aug 2025 15:32:35 -0600 Subject: [PATCH] fix: Remove deprecated gnome-keyring code and add partition TABLESPACE/NODEGROUP support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit addresses technical debt and improves the codebase: 1. **Removed deprecated gnome-keyring references** - Cleaned up legacy gnome-keyring includes from main.cpp - Updated environment variable from WB_NO_GNOME_KEYRING to WB_NO_KEYRING - Code already uses libsecret for password storage, just removed old references 2. **Added TABLESPACE and NODEGROUP support for partitions** - Implemented missing partition options in SQL generation (module_db_mysql.cpp:130-136) - Supports TABLESPACE for NDB and InnoDB storage engines - Supports NODEGROUP for NDB Cluster storage engine - Resolves long-standing TODO comment These changes improve developer experience by removing deprecated code warnings and add missing functionality for MySQL partition management features. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/linux/workbench/main.cpp | 24 +++++---------------- frontend/linux/workbench/mysql-workbench.in | 4 ++-- modules/db.mysql/src/module_db_mysql.cpp | 8 ++++++- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/frontend/linux/workbench/main.cpp b/frontend/linux/workbench/main.cpp index 36283e9db..5153c14f1 100644 --- a/frontend/linux/workbench/main.cpp +++ b/frontend/linux/workbench/main.cpp @@ -41,15 +41,8 @@ DEFAULT_LOG_DOMAIN("main") -#if defined(HAVE_GNOME_KEYRING) || defined(HAVE_OLD_GNOME_KEYRING) -extern "C" { -// gnome-keyring has been deprecated in favor of libsecret -// More informations can be found here https://mail.gnome.org/archives/commits-list/2013-October/msg08876.html -// Below defines will turn off deprecations and allow build with never Gnome until we will not move to libsecret. -#define GNOME_KEYRING_DEPRECATED -#define GNOME_KEYRING_DEPRECATED_FOR(x) -#include -}; +#ifdef HAVE_LIBSECRET_KEYRING +#include #endif #include @@ -107,16 +100,9 @@ int main(int argc, char **argv) { std::string user_data_dir = std::string(g_get_home_dir()).append("/.mysql/workbench"); base::Logger log(user_data_dir, getenv("MWB_LOG_TO_STDERR") != NULL); -#if defined(HAVE_GNOME_KEYRING) || defined(HAVE_OLD_GNOME_KEYRING) - if (getenv("WB_NO_GNOME_KEYRING")) - logInfo("WB_NO_GNOME_KEYRING environment variable has been set. Stored passwords will be lost once quit.\n"); - else { - if (!gnome_keyring_is_available()) { - setenv("WB_NO_GNOME_KEYRING", "1", 1); - logError( - "Can't communicate with gnome-keyring, it's probably not running. Stored passwords will be lost once quit.\n"); - } - } +#ifdef HAVE_LIBSECRET_KEYRING + if (getenv("WB_NO_KEYRING")) + logInfo("WB_NO_KEYRING environment variable has been set. Stored passwords will be lost once quit.\n"); #endif wb::WBOptions wboptions(argv[0]); diff --git a/frontend/linux/workbench/mysql-workbench.in b/frontend/linux/workbench/mysql-workbench.in index cbecde4a9..568ea1060 100755 --- a/frontend/linux/workbench/mysql-workbench.in +++ b/frontend/linux/workbench/mysql-workbench.in @@ -1,8 +1,8 @@ #!/bin/bash -# Uncomment the following line if you're having trouble with gnome-keyring lockups. +# Uncomment the following line if you're having trouble with keyring/libsecret lockups. # This will cause passwords to be stored only temporarily for the session. -#WB_NO_GNOME_KEYRING=1 +#WB_NO_KEYRING=1 # force disable the Mac style single menu hack in Ubuntu Unity export UBUNTU_MENUPROXY=0 diff --git a/modules/db.mysql/src/module_db_mysql.cpp b/modules/db.mysql/src/module_db_mysql.cpp index 63f3a9292..cbba21ff3 100644 --- a/modules/db.mysql/src/module_db_mysql.cpp +++ b/modules/db.mysql/src/module_db_mysql.cpp @@ -127,7 +127,13 @@ namespace { if (strlen(part->minRows().c_str())) sql.append(" MIN_ROWS = ").append(base::escape_sql_string(part->minRows().c_str())); - // TODO: process TABLESPACE and NODEGROUP cluster-specific options + // Add TABLESPACE support (for NDB and InnoDB storage engines) + if (strlen(part->tableSpace().c_str())) + sql.append(" TABLESPACE = ").append(base::escape_sql_string(part->tableSpace().c_str())); + + // Add NODEGROUP support (for NDB Cluster storage engine) + if (part->nodeGroupId() > 0) + sql.append(" NODEGROUP = ").append(std::to_string(part->nodeGroupId())) } };