summaryrefslogtreecommitdiffstats
path: root/mysql-workbench-5.2.45-cppconn.patch
blob: 35127997d0ec7187fbb62ecf6f120a703fa03f0d (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
diff -up mysql-workbench-gpl-5.2.45-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp.cppconn mysql-workbench-gpl-5.2.45-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp
--- mysql-workbench-gpl-5.2.45-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp.cppconn	2012-12-27 16:43:00.000000000 +0100
+++ mysql-workbench-gpl-5.2.45-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp	2012-12-29 11:29:22.252002525 +0100
@@ -49,7 +49,7 @@
 // this doesn't belong here, but there's no other workaround for having access to mysql_info
 // because of that we also need to link wbprivate directly to the connector, making their
 // dynamic loading pretty much useless
-#include <cppconn/../driver/mysql_connection.h>
+#include <mysql_connection.h>
 
 #include <boost/foreach.hpp>
 #include <boost/scoped_ptr.hpp>
diff -up mysql-workbench-gpl-5.2.45-src/backend/wbpublic/grtdb/diff_dbobjectmatch.cpp.cppconn mysql-workbench-gpl-5.2.45-src/backend/wbpublic/grtdb/diff_dbobjectmatch.cpp
--- mysql-workbench-gpl-5.2.45-src/backend/wbpublic/grtdb/diff_dbobjectmatch.cpp.cppconn	2012-12-27 16:42:42.000000000 +0100
+++ mysql-workbench-gpl-5.2.45-src/backend/wbpublic/grtdb/diff_dbobjectmatch.cpp	2012-12-29 11:29:22.253002528 +0100
@@ -22,7 +22,7 @@
 // this doesn't belong here, but there's no other workaround for having access to mysql_info
 // because of that we also need to link wbprivate directly to the connector, making their
 // dynamic loading pretty much useless
-#include <cppconn/../driver/mysql_connection.h>
+#include <mysql_connection.h>
 #include <cppconn/metadata.h>
 
 
diff -up mysql-workbench-gpl-5.2.45-src/configure.in.cppconn mysql-workbench-gpl-5.2.45-src/configure.in
--- mysql-workbench-gpl-5.2.45-src/configure.in.cppconn	2012-12-27 16:43:02.000000000 +0100
+++ mysql-workbench-gpl-5.2.45-src/configure.in	2012-12-29 11:29:22.254002532 +0100
@@ -487,8 +487,6 @@ res/mysql.profiles/Makefile
 res/sqlidedata/Makefile
 ext/Makefile
 ext/scintilla/gtk/Makefile
-ext/cppconn/Makefile
-ext/cppconn/driver/Makefile
 ext/vsqlite++/Makefile
 ext/vsqlite++/src/sqlite/Makefile
 backend/Makefile
diff -up mysql-workbench-gpl-5.2.45-src/ext/Makefile.am.cppconn mysql-workbench-gpl-5.2.45-src/ext/Makefile.am
--- mysql-workbench-gpl-5.2.45-src/ext/Makefile.am.cppconn	2012-12-27 16:42:46.000000000 +0100
+++ mysql-workbench-gpl-5.2.45-src/ext/Makefile.am	2012-12-29 11:29:22.254002532 +0100
@@ -7,7 +7,7 @@ if BUILD_ANTLR_RUNTIME
 antlr_dirs=antlr-runtime
 endif
 
-SUBDIRS=scintilla/gtk cppconn vsqlite++ $(antlr_dirs) $(ctemplate_dirs)
+SUBDIRS=scintilla/gtk vsqlite++ $(antlr_dirs) $(ctemplate_dirs)
 
 if BUNDLE_UTILITIES
 all-am:
diff -up mysql-workbench-gpl-5.2.45-src/frontend/linux/workbench/Makefile.am.cppconn mysql-workbench-gpl-5.2.45-src/frontend/linux/workbench/Makefile.am
--- mysql-workbench-gpl-5.2.45-src/frontend/linux/workbench/Makefile.am.cppconn	2012-12-27 16:42:46.000000000 +0100
+++ mysql-workbench-gpl-5.2.45-src/frontend/linux/workbench/Makefile.am	2012-12-29 11:36:21.491488325 +0100
@@ -38,7 +38,6 @@ INCLUDES=@GLIB_CFLAGS@ @SIGC_CFLAGS@ @GR
 	-I$(top_srcdir)/modules/wb.model/src\
 	-I$(top_srcdir)/modules/interfaces\
 	-I$(top_srcdir)/ext\
-	-I$(top_srcdir)/ext/cppconn\
 	-I$(top_srcdir)/modules\
   -I$(top_srcdir)/ext/vsqlite++/include\
   -I$(top_srcdir)/ext/scintilla/include\
@@ -54,14 +53,13 @@ mysql_workbench_bin_LDADD=\
 	$(top_srcdir)/library/base/libwbbase.la\
 	$(top_srcdir)/library/grt/src/libgrt.la\
 	$(top_srcdir)/library/dbc/libcdbc.la\
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la\
 	$(top_srcdir)/ext/scintilla/gtk/libwbscintilla.la\
 	$(top_srcdir)/library/canvas/src/libmdcanvasgtk.la\
 	$(top_srcdir)/library/canvas/src/libmdcanvas.la\
 	$(top_srcdir)/library/mysql-parser/libmysqlparser.la\
 	@CTEMPLATE_LIBS@\
 	@GNOME_LIBS@ @GRT_LIBS@ @PCRE_LIBS@ @GLIB_LIBS@ @CAIRO_LIBS@ @ZIP_LIBS@ @MYSQL_LIBS@ @SQLITE3_LIBS@\
-	-lX11
+	-lmysqlcppconn -lX11
 
 #precompiled.h.gch: precompiled.h
 #	$(CXXCOMPILE) precompiled.h -o precompiled.h.gch
diff -up mysql-workbench-gpl-5.2.45-src/library/dbc/src/driver_manager.cpp.cppconn mysql-workbench-gpl-5.2.45-src/library/dbc/src/driver_manager.cpp
--- mysql-workbench-gpl-5.2.45-src/library/dbc/src/driver_manager.cpp.cppconn	2012-12-27 16:42:54.000000000 +0100
+++ mysql-workbench-gpl-5.2.45-src/library/dbc/src/driver_manager.cpp	2012-12-29 11:29:22.255002536 +0100
@@ -212,6 +212,8 @@ ConnectionWrapper DriverManager::getConn
 
 ConnectionWrapper DriverManager::getConnection(const db_mgmt_ConnectionRef &connectionProperties, boost::shared_ptr<TunnelConnection> tunnel, Authentication::Ref password, ConnectionInitSlot connection_init_slot)
 {
+  gchar *p = NULL;
+  GModule *gmodule = NULL;
   // 0. determine correct driver filename
   
   db_mgmt_DriverRef drv = connectionProperties->driver();
@@ -221,21 +223,21 @@ ConnectionWrapper DriverManager::getConn
     library = drv->driverLibraryName();
   else
     throw SQLException("Invalid connection settings: undefined connection driver");
-#ifdef _WIN32
-  library.append(".dll");
-#elif defined(__APPLE__)
-  library.append(".dylib");
-#else
-  library.append(".so");
-#endif
+
+  // Patch : use library in standard path
+  p = g_module_build_path (NULL, library.c_str());
 
   // 1. find driver
 
-  GModule *gmodule= g_module_open((_driver_path + "/" + library).c_str(), G_MODULE_BIND_LOCAL);
+  if (p) {
+    gmodule = g_module_open(std::string(p).append(".6").c_str(), G_MODULE_BIND_LOCAL);
+    g_free(p);
+  }
+
   if (NULL == gmodule)
   {
     fprintf(stderr, "Error: %s", g_module_error());
-    throw SQLException(std::string("Database driver: Failed to open library '").append(_driver_path + "/" + library).append("'. Check settings.").c_str());
+    throw SQLException(std::string("Database driver: Failed to open library '").append(library).append("'. Check settings.").c_str());
   }
   
   Driver *(* get_driver_instance)()= NULL;