Let mysqlcc work correctly with mysql 5.x.

ok brad@, wilfried@
This commit is contained in:
bernd 2006-07-24 09:18:13 +00:00
parent 64522860ee
commit e4091875b6
2 changed files with 27 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.4 2005/09/07 00:41:04 brad Exp $
# $OpenBSD: Makefile,v 1.5 2006/07/24 09:18:13 bernd Exp $
COMMENT= "GUI client for MySQL"
VERSION= 0.9.4
DISTNAME= mysqlcc-${VERSION}-src
PKGNAME= mysqlcc-${VERSION}p1
PKGNAME= mysqlcc-${VERSION}p2
CATEGORIES= databases
HOMEPAGE= http://mysql.com/products/mysqlcc/index.html

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_CQueryWindow_cpp,v 1.1 2006/07/24 09:18:13 bernd Exp $
Let mysqlcc work with mysql5. See: http://lists.mysql.com/gui-tools/1842
--- src/CQueryWindow.cpp.orig Sun Dec 14 00:10:44 2003
+++ src/CQueryWindow.cpp Tue Jul 18 13:31:58 2006
@@ -467,8 +467,16 @@ bool CQuerySet::execQuery(const QString
if (explain_rows == 1)
{
explain_query->next(true);
- default_table = explain_query->row(mysql()->mysql()->version().major >= 4 &&
- mysql()->mysql()->version().minor >= 1 ? 2 : 0);
+
+ if (mysql()->mysql()->version().major >= 5 ||
+ (mysql()->mysql()->version().major == 4 &&
+ mysql()->mysql()->version().minor >= 1))
+ {
+ default_table = explain_query->row(2);
+ }
+ else
+ default_table = explain_query->row(0);
+
if (!default_table.isEmpty())
{
finished_evt->read_only = default_database.isEmpty() ||