summaryrefslogtreecommitdiff
path: root/development/mysql-workbench/mysql-workbench-column-label.patch
blob: ee6d3cd0b710c2b53dafa6d5f8b74c786b055129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
 }