summaryrefslogtreecommitdiff
path: root/development/mysql-workbench/mysql-workbench-column-label.patch
diff options
context:
space:
mode:
Diffstat (limited to 'development/mysql-workbench/mysql-workbench-column-label.patch')
-rw-r--r--development/mysql-workbench/mysql-workbench-column-label.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/development/mysql-workbench/mysql-workbench-column-label.patch b/development/mysql-workbench/mysql-workbench-column-label.patch
new file mode 100644
index 0000000000..ee6d3cd0b7
--- /dev/null
+++ b/development/mysql-workbench/mysql-workbench-column-label.patch
@@ -0,0 +1,44 @@
+diff --git a/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp b/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
+index 1b69f22..82de11f 100644
+--- a/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
++++ b/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
+@@ -241,7 +241,11 @@ public:
+ const int last_column= meta->getColumnCount();
+ for (int i = 1; i <= last_column; i++)
+ {
++#ifdef MYSQLCPPCONN_VERSION_1_1_5
++ column_by_name[meta->getColumnLabel(i)]= i;
++#else
+ column_by_name[meta->getColumnName(i)]= i;
++#endif
+
+ std::string type;
+ switch (meta->getColumnType(i))
+@@ -308,7 +312,11 @@ public:
+ db_query_ResultsetColumnRef column(aself->get_grt());
+
+ column->owner(aself);
++#ifdef MYSQLCPPCONN_VERSION_1_1_5
++ column->name(std::string(meta->getColumnLabel(i)));
++#else
+ column->name(std::string(meta->getColumnName(i)));
++#endif
+ column->columnType(type);
+
+ self->columns().insert(column);
+diff --git a/modules/db.mysql.query/src/dbquery.cpp b/modules/db.mysql.query/src/dbquery.cpp
+index 428bad3..74db1dc 100644
+--- a/modules/db.mysql.query/src/dbquery.cpp
++++ b/modules/db.mysql.query/src/dbquery.cpp
+@@ -521,7 +521,11 @@ std::string DbMySQLQueryImpl::resultFieldName(int result, int field)
+ throw std::invalid_argument("Invalid resultset");
+ sql::ResultSet *res = _resultsets[result];
+
++#ifdef MYSQLCPPCONN_VERSION_1_1_5
++ return res->getMetaData()->getColumnLabel(field);
++#else
+ return res->getMetaData()->getColumnName(field);
++#endif
+ }
+
+