Permalink
Browse files

Merge branch 'release-6.3.8'

  • Loading branch information...
2 parents 406ec7d + dcfa27f commit 138d3c866fcfb7a5fc7cc1aefd75bf82c77ed450 @mike-lischke mike-lischke committed Oct 27, 2016
Showing with 540 additions and 495 deletions.
  1. +1 −1 Info.plist
  2. +46 −27 backend/wbprivate/sqlide/wb_sql_editor_form.cpp
  3. +7 −5 backend/wbprivate/sqlide/wb_sql_editor_form.h
  4. +1 −1 backend/wbprivate/workbench/wb_version.h
  5. +17 −10 backend/wbpublic/grt/grt_manager.cpp
  6. +5 −4 backend/wbpublic/grtdb/db_helpers.cpp
  7. +13 −6 backend/wbpublic/grtui/grtdb_connect_panel.cpp
  8. +1 −1 backend/wbpublic/grtui/grtdb_connect_panel.h
  9. +114 −123 backend/wbpublic/sqlide/recordset_cdbc_storage.cpp
  10. +7 −10 backend/wbpublic/sqlide/recordset_cdbc_storage.h
  11. +1 −2 backend/wbpublic/sqlide/sql_editor_be.cpp
  12. +11 −3 backend/wbpublic/sqlide/unit-tests/recordset_test.cpp
  13. +6 −0 build/debian.in/changelog
  14. +3 −3 build/mysql-workbench.spec.in
  15. +7 −5 frontend/mac/components/WBTabView/WBTabView/Sources/ResponderLayer.m
  16. +7 −2 frontend/mac/components/WBTabView/WBTabView/Sources/WBTabItem.h
  17. +9 −7 frontend/mac/components/WBTabView/WBTabView/Sources/WBTabItem.m
  18. +7 −2 frontend/mac/components/WBTabView/WBTabView/Sources/WBTabView.h
  19. +2 −1 frontend/mac/resultset/MGridView.h
  20. +8 −5 frontend/mac/resultset/MGridView.mm
  21. +3 −4 frontend/mac/resultset/MResultsetViewer.mm
  22. +2 −2 frontend/windows/MySQLWorkbench/Properties/AssemblyInfo.cs
  23. BIN images/home/wb_doc_model@2x.png
  24. BIN images/home/wb_starter_edelivery_52@2x.png
  25. BIN images/home/wb_starter_grt_shell_52@2x.png
  26. BIN images/home/wb_starter_mysql_bug_reporter_52@2x.png
  27. BIN images/home/wb_starter_mysql_doc_lib_52@2x.png
  28. BIN images/home/wb_starter_mysql_forums_52@2x.png
  29. BIN images/home/wb_starter_mysql_migration_52@2x.png
  30. BIN images/home/wb_starter_mysql_utilities_52@2x.png
  31. BIN images/home/wb_starter_mysql_wb_blog_52@2x.png
  32. BIN images/home/wb_starter_planet_mysql_52@2x.png
  33. BIN images/home/wb_starter_support_52@2x.png
  34. BIN images/home/wb_tile_fabric@2x.png
  35. BIN images/home/wb_tile_folder_mini@2x.png
  36. BIN images/home/wb_tile_schema@2x.png
  37. BIN images/home/wb_tile_time@2x.png
  38. BIN images/ui/MySQL-WB-about-screen.png
  39. BIN images/ui/MySQL-WB-about-screen@2x.png
  40. +17 −4 library/base/string_utilities.cpp
  41. +3 −1 library/base/util_functions.cpp
  42. +2 −1 library/forms/code_editor.cpp
  43. +2 −2 library/forms/gtk/src/lf_popover.cpp
  44. +2 −1 library/forms/gtk/src/lf_popup.cpp
  45. +3 −3 library/forms/mforms/code_editor.h
  46. +8 −4 library/mysql.parser/grammar/MySQL.g
  47. +7 −4 library/mysql.parser/grammar/MySQLSimpleParser.g
  48. +3 −3 library/python/workbench/utils.py
  49. +11 −7 modules/db.mssql/db_mssql_grt.py
  50. +54 −54 modules/db.mysql/res/mysql_rdbms_info.xml
  51. +1 −1 modules/db.sybase/db_sybase_re_grt.py
  52. +5 −5 plugins/db.mysql.editors/macosx/MySQLTableEditor.xib
  53. +3 −5 plugins/migration/backend/DataMigrator.py
  54. +18 −5 plugins/migration/backend/migration.py
  55. +79 −139 plugins/migration/copytable/copytable.cpp
  56. +1 −2 plugins/migration/copytable/copytable.h
  57. +1 −1 plugins/migration/dbcopy/db_copy_progress.py
  58. +6 −1 plugins/migration/frontend/migration_data_transfer.py
  59. +29 −24 plugins/wb.admin/backend/wb_admin_user_privileges.py
  60. +2 −2 plugins/wb.admin/frontend/wb_admin_export.py
  61. +1 −1 plugins/wb.admin/frontend/wb_admin_monitor.py
  62. +4 −1 set_wb_version
View
@@ -72,7 +72,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>6.3.7</string>
+ <string>6.3.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
@@ -391,7 +391,7 @@ void SqlEditorForm::finish_startup()
try
{
_auto_completion_cache = new AutoCompleteCache(sanitize_file_name(get_session_name()),
- boost::bind(&SqlEditorForm::get_autocompletion_connection, this, _1), cache_dir,
+ boost::bind(&SqlEditorForm::getAuxConnection, this, _1, false), cache_dir,
boost::bind(&SqlEditorForm::on_cache_action, this, _1));
_auto_completion_cache->refresh_schema_list(); // Start fetching schema names immediately.
}
@@ -444,6 +444,26 @@ void SqlEditorForm::finish_startup()
//--------------------------------------------------------------------------------------------------
+base::RecMutexLock SqlEditorForm::getAuxConnection(sql::Dbc_connection_handler::Ref &conn, bool lockOnly)
+ {
+ RecMutexLock lock(ensure_valid_aux_connection(false, lockOnly));
+ conn = _aux_dbc_conn;
+ return lock;
+ }
+
+
+
+//--------------------------------------------------------------------------------------------------
+
+base::RecMutexLock SqlEditorForm::getUserConnection(sql::Dbc_connection_handler::Ref &conn, bool lockOnly)
+{
+ RecMutexLock lock(ensure_valid_usr_connection(false, lockOnly));
+ conn = _usr_dbc_conn;
+ return lock;
+}
+
+//--------------------------------------------------------------------------------------------------
+
db_query_EditorRef SqlEditorForm::grtobj()
{
return wbsql()->get_grt_editor_object(this);
@@ -1504,15 +1524,6 @@ grt::StringRef SqlEditorForm::do_connect(grt::GRT *grt, boost::shared_ptr<sql::T
//--------------------------------------------------------------------------------------------------
-base::RecMutexLock SqlEditorForm::get_autocompletion_connection(sql::Dbc_connection_handler::Ref &conn)
-{
- RecMutexLock lock(ensure_valid_aux_connection());
- conn = _aux_dbc_conn;
- return lock;
-}
-
-//--------------------------------------------------------------------------------------------------
-
/**
* Triggered when the auto completion cache switches activity. We use this to update our busy
* indicator.
@@ -1604,23 +1615,23 @@ bool SqlEditorForm::ping() const
return false;
}
-base::RecMutexLock SqlEditorForm::ensure_valid_aux_connection(sql::Dbc_connection_handler::Ref &conn)
+base::RecMutexLock SqlEditorForm::ensure_valid_aux_connection(sql::Dbc_connection_handler::Ref &conn, bool lockOnly)
{
- RecMutexLock lock(ensure_valid_dbc_connection(_aux_dbc_conn, _aux_dbc_conn_mutex));
+ RecMutexLock lock(ensure_valid_dbc_connection(_aux_dbc_conn, _aux_dbc_conn_mutex, lockOnly));
conn = _aux_dbc_conn;
return lock;
}
-RecMutexLock SqlEditorForm::ensure_valid_aux_connection(bool throw_on_block)
+RecMutexLock SqlEditorForm::ensure_valid_aux_connection(bool throw_on_block, bool lockOnly)
{
- return ensure_valid_dbc_connection(_aux_dbc_conn, _aux_dbc_conn_mutex, throw_on_block);
+ return ensure_valid_dbc_connection(_aux_dbc_conn, _aux_dbc_conn_mutex, throw_on_block, lockOnly);
}
-RecMutexLock SqlEditorForm::ensure_valid_usr_connection(bool throw_on_block)
+RecMutexLock SqlEditorForm::ensure_valid_usr_connection(bool throw_on_block, bool lockOnly)
{
- return ensure_valid_dbc_connection(_usr_dbc_conn, _usr_dbc_conn_mutex, throw_on_block);
+ return ensure_valid_dbc_connection(_usr_dbc_conn, _usr_dbc_conn_mutex, throw_on_block, lockOnly);
}
@@ -1642,14 +1653,17 @@ void SqlEditorForm::close_connection(sql::Dbc_connection_handler::Ref &dbc_conn)
RecMutexLock SqlEditorForm::ensure_valid_dbc_connection(sql::Dbc_connection_handler::Ref &dbc_conn, base::RecMutex &dbc_conn_mutex,
- bool throw_on_block)
+ bool throw_on_block, bool lockOnly)
{
RecMutexLock mutex_lock(dbc_conn_mutex, throw_on_block);
bool valid = false;
sql::Dbc_connection_handler::Ref myref(dbc_conn);
if (dbc_conn && dbc_conn->ref.get_ptr())
{
+ if (lockOnly) //this is a special case, we need it in some situations like for example recordset_cdbc
+ return mutex_lock;
+
try
{
//use connector::isValid to check if server connection is valid
@@ -2075,8 +2089,8 @@ grt::StringRef SqlEditorForm::do_exec_sql(grt::GRT *grt, Ptr self_ptr, boost::sh
data_storage= Recordset_cdbc_storage::create(_grtm);
data_storage->set_gather_field_info(true);
data_storage->rdbms(rdbms());
- data_storage->dbms_conn(_usr_dbc_conn);
- data_storage->aux_dbms_conn(_aux_dbc_conn);
+ data_storage->setUserConnectionGetter(boost::bind(&SqlEditorForm::getUserConnection, this, _1, _2));
+ data_storage->setAuxConnectionGetter(boost::bind(&SqlEditorForm::getAuxConnection, this, _1, _2));
SqlFacade::String_tuple_list column_names;
@@ -2183,10 +2197,10 @@ grt::StringRef SqlEditorForm::do_exec_sql(grt::GRT *grt, Ptr self_ptr, boost::sh
{
int count= 0;
const sql::SQLWarning *w = warnings;
- while (w)
+ while (w)
{
warnings_message.append(strfmt("\n%i %s", w->getErrorCode(), w->getMessage().c_str()));
- count++;
+ count++;
w= w->getNextWarning();
}
message.append(strfmt(_(", %i warning(s):"), count));
@@ -2197,7 +2211,7 @@ grt::StringRef SqlEditorForm::do_exec_sql(grt::GRT *grt, Ptr self_ptr, boost::sh
}
if (!last_statement_info->empty())
message.append("\n").append(last_statement_info);
- set_log_message(log_message_index, has_warning ? DbSqlEditorLog::WarningMsg : DbSqlEditorLog::OKMsg, message, statement, statement_exec_timer.duration_formatted());
+ set_log_message(log_message_index, has_warning ? DbSqlEditorLog::WarningMsg : DbSqlEditorLog::OKMsg, message, statement, statement_exec_timer.duration_formatted());
}
if (query_ps_stats)
@@ -2289,8 +2303,8 @@ grt::StringRef SqlEditorForm::do_exec_sql(grt::GRT *grt, Ptr self_ptr, boost::sh
data_storage= Recordset_cdbc_storage::create(_grtm);
data_storage->set_gather_field_info(true);
data_storage->rdbms(rdbms());
- data_storage->dbms_conn(_usr_dbc_conn);
- data_storage->aux_dbms_conn(_aux_dbc_conn);
+ data_storage->setUserConnectionGetter(boost::bind(&SqlEditorForm::getUserConnection, this, _1, _2));
+ data_storage->setAuxConnectionGetter(boost::bind(&SqlEditorForm::getAuxConnection, this, _1, _2));
if (table_name.empty())
data_storage->sql_query(statement);
data_storage->schema_name(schema_name);
@@ -2603,11 +2617,15 @@ void SqlEditorForm::apply_changes_to_recordset(Recordset::Ptr rs_ptr)
try
{
- RecMutexLock usr_dbc_conn_mutex= ensure_valid_usr_connection();
+ bool auto_commit = false;
+
// we need transaction to enforce atomicity of change set
// so if autocommit is currently enabled disable it temporarily
- bool auto_commit= _usr_dbc_conn->ref->getAutoCommit();
+ {
+ RecMutexLock usr_dbc_conn_mutex = ensure_valid_usr_connection();
+ auto_commit = _usr_dbc_conn->ref->getAutoCommit();
+ }
ScopeExitTrigger autocommit_mode_keeper;
int res= -2;
@@ -2626,6 +2644,7 @@ void SqlEditorForm::apply_changes_to_recordset(Recordset::Ptr rs_ptr)
autocommit_mode_keeper.slot= boost::bind(
&sql::Connection::setAutoCommit, _usr_dbc_conn->ref.get(),
auto_commit);
+ RecMutexLock usr_dbc_conn_mutex = ensure_valid_usr_connection();
_usr_dbc_conn->ref->setAutoCommit(false);
}
@@ -296,12 +296,12 @@ class MYSQLWBBACKEND_PUBLIC_FUNC SqlEditorForm : public bec::UIForm, grt::GRTObs
void create_connection(sql::Dbc_connection_handler::Ref &dbc_conn, db_mgmt_ConnectionRef db_mgmt_conn, boost::shared_ptr<sql::TunnelConnection> tunnel, sql::Authentication::Ref auth, bool autocommit_mode, bool user_connection);
void init_connection(sql::Connection* dbc_conn_ref, const db_mgmt_ConnectionRef& connectionProperties, sql::Dbc_connection_handler::Ref& dbc_conn, bool user_connection);
void close_connection(sql::Dbc_connection_handler::Ref &dbc_conn);
- base::RecMutexLock ensure_valid_dbc_connection(sql::Dbc_connection_handler::Ref &dbc_conn, base::RecMutex &dbc_conn_mutex, bool throw_on_block = false);
- base::RecMutexLock ensure_valid_usr_connection(bool throw_on_block = false);
- base::RecMutexLock ensure_valid_aux_connection(bool throw_on_block = false);
+ base::RecMutexLock ensure_valid_dbc_connection(sql::Dbc_connection_handler::Ref &dbc_conn, base::RecMutex &dbc_conn_mutex, bool throw_on_block = false, bool lockOnly = false);
+ base::RecMutexLock ensure_valid_usr_connection(bool throw_on_block = false, bool lockOnly = false);
+ base::RecMutexLock ensure_valid_aux_connection(bool throw_on_block = false, bool lockOnly = false);
public:
- base::RecMutexLock ensure_valid_aux_connection(sql::Dbc_connection_handler::Ref &conn);
+ base::RecMutexLock ensure_valid_aux_connection(sql::Dbc_connection_handler::Ref &conn, bool lockOnly = false);
parser::ParserContext::Ref work_parser_context() { return _work_parser_context; };
private:
@@ -325,8 +325,10 @@ class MYSQLWBBACKEND_PUBLIC_FUNC SqlEditorForm : public bec::UIForm, grt::GRTObs
ServerState _last_server_running_state;
AutoCompleteCache *_auto_completion_cache;
- base::RecMutexLock get_autocompletion_connection(sql::Dbc_connection_handler::Ref &conn);
void on_cache_action(bool active);
+ base::RecMutexLock getAuxConnection(sql::Dbc_connection_handler::Ref &conn, bool lockOnly = false);
+ base::RecMutexLock getUserConnection(sql::Dbc_connection_handler::Ref &conn, bool lockOnly = false);
+
ColumnWidthCache *_column_width_cache;
public:
@@ -1,7 +1,7 @@
#define APP_MAJOR_NUMBER 6
#define APP_MINOR_NUMBER 3
-#define APP_RELEASE_NUMBER 7
+#define APP_RELEASE_NUMBER 8
#define APP_BUILD_NUMBER 0
#define APP_RELEASE_TYPE ""
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,15 +17,18 @@
* 02110-1301 USA
*/
-#include <grtpp_module_python.h>
-#include <grtpp_module_cpp.h>
+#include "base/threading.h"
+#include "base/log.h"
+#include "base/file_utilities.h"
+
+#include "grtpp_module_python.h"
+#include "grtpp_module_cpp.h"
-#include <python_context.h>
+#include "python_context.h"
#include "grt/grt_manager.h"
-#include "base/threading.h"
+
#include "glib/gstdio.h"
-#include "base/log.h"
#include "objimpl/wrapper/grt_PyObject_impl.h"
#include "base/notifications.h"
@@ -878,13 +881,17 @@ long GRTManager::get_app_option_int(const std::string &name, long default_)
std::string GRTManager::get_tmp_dir()
{
- std::string res;
+ // Add the current process ID to the path to make this unique.
+ std::string res = g_get_tmp_dir();
+ if( base::ends_with(res, "/") || base::ends_with(res, "\\"))
+ res.resize( res.size() - 1 );
+ res += "/" + std::string("mysql-workbench-");
#ifdef _WIN32
- res.append(g_get_tmp_dir()).append("/MySQL Workbench/");
+ res += base::to_string(GetCurrentProcessId()) + "/";
#else
- res.append(g_get_tmp_dir()).append("/mysql-workbench.").append(g_get_user_name()).append("/");
+ res += base::to_string(::getpid()) + "/";
#endif
- g_mkdir(res.c_str(), 0700);
+ base::create_directory(res, 0700, true);
return res;
}
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -269,8 +269,9 @@ bool bec::version_greater(GrtVersionRef a, GrtVersionRef b)
*/
bool bec::is_supported_mysql_version(int mysql_major, int mysql_minor, int mysql_release)
{
- return (mysql_major == 5 &&
- (mysql_minor == 1 || mysql_minor == 5 || mysql_minor == 6 || mysql_minor == 7));
+ return ((mysql_major == 5 &&
+ (mysql_minor == 1 || mysql_minor == 5 || mysql_minor == 6 || mysql_minor == 7)) ||
+ (mysql_major == 8 && mysql_minor == 0));
}
@@ -301,7 +302,7 @@ bool bec::is_supported_mysql_version_at_least(int mysql_major, int mysql_minor,
// if the available release number is negative, that's meant to signify "any release number", so we make it the max value possible
unsigned int available = mysql_major * 100000 + mysql_minor * 1000 + (mysql_release < 0 ? 999 : mysql_release);
- if (major < 5 || (major == 5 && minor < 6))
+ if (major < 5 || (major == 5 && minor < 6) || (major == 8 && minor == 0))
{
return (required <= available);
}
@@ -260,8 +260,16 @@ void DbConnectPanel::init(const db_mgmt_ManagementRef &mgmt, const db_mgmt_Conne
}
-db_mgmt_ConnectionRef DbConnectPanel::get_connection()
+db_mgmt_ConnectionRef DbConnectPanel::get_connection(bool initInvalid)
{
+ if (!_connection->get_connection().is_valid() && initInvalid)
+ {
+ db_mgmt_ConnectionRef connection(get_be()->get_grt());
+ connection->owner(get_be()->get_db_mgmt());
+ connection->driver(selected_driver());
+ set_connection(connection);
+ change_active_stored_conn();
+ }
return _connection->get_connection();
}
@@ -495,7 +503,7 @@ void DbConnectPanel::change_active_driver()
// When switching to/from ssh based connections the value for the host name gets another
// semantic. In ssh based connections the sshHost is the remote server name (what is otherwise
// the host name) and the host name is relative to the ssh host (usually localhost).
- db_mgmt_ConnectionRef actual_connection = get_connection();
+ db_mgmt_ConnectionRef actual_connection = get_connection(true);
if (*current_driver->name() == "MysqlNativeSSH")
{
std::string machine = actual_connection->parameterValues().get_string("sshHost");
@@ -840,9 +848,8 @@ void DbConnectPanel::launch_ssl_wizard()
mforms::Form *parent = get_parent_form();
grt::BaseListRef args(get_be()->get_grt());
args.ginsert(mforms_to_grt(get_be()->get_grt(), parent, "Form"));
- args.ginsert(get_connection());
- args.ginsert(grt::StringRef(get_connection()->id()));
-
+ args.ginsert(get_connection(true));
+ args.ginsert(grt::StringRef(get_connection(true)->id()));
get_be()->get_grt()->call_module_function("PyWbUtils", "generateCertificates", args);
_connection->update();
@@ -966,7 +973,7 @@ void DbConnectPanel::set_keychain_password(DbDriverParam *param, bool clear)
{
std::string storage_key;
std::string username;
- grt::DictRef paramValues(get_connection()->parameterValues());
+ grt::DictRef paramValues(get_connection(true)->parameterValues());
std::vector<std::string> tokens = base::split(param->object()->paramTypeDetails().get_string("storageKeyFormat"), "::");
if (tokens.size() == 2)
{
@@ -72,7 +72,7 @@ class WBPUBLICBACKEND_PUBLIC_FUNC DbConnectPanel : public mforms::Box
db_mgmt_ConnectionRef get_default_connection() { return _anonymous_connection; }
- db_mgmt_ConnectionRef get_connection();
+ db_mgmt_ConnectionRef get_connection(bool initInvalid = false);
void set_connection(const db_mgmt_ConnectionRef& conn);
boost::signals2::signal<void (std::string,bool)>* signal_validation_state_changed() { return &_signal_validation_state_changed; }
Oops, something went wrong.

0 comments on commit 138d3c8

Please sign in to comment.