ERROR 1146 Solved in mysqlcc when using Mysql 5.0

NetVicious <[email protected]>
Newsgroups gmane.comp.db.mysql.mycc
Message-ID <[email protected]>
Hi to all!

When I updated my mysql daemon to 5.0 version mysqlcc showed one 1146
ERROR when I tried to edit any table.

I asked days ago where I could download the source of mysqlcc. Looking
on the inet for the error I got some info about it and I solved the
problem

Years/months ago this problem raised with the change of 4.0 to 4.1 of
mysql server. The problem was an EXPLAIN command done before a SELECT,
in this EXPLAIN command appears the table name mysqlcc uses later for
edit the fields.

This bug show me the light ;-)

http://lists.mysql.com/gui-tools/424

Mysql 5 changed another time the explain columns so mysqlcc 0.9.4
tried to open the 1 table every time we try to edit a table

I compiled mysqlcc using libmysqlclient15 of Debian (5.0.18-9) without
any problem.

I could try to create a debian package with the corrected version but
I thinks the original mysqlcc has static libraries because the binary
file has 9MB and mine has 3MB.

I did some changes to get a good compilation. Here are they. I'm not
an expert patch creator please don't be evil with me ;-)

Any questions here. Thanks to Jorge del Conde for mysqlcc and a pray,
please create a 0.9.5 with this bug solved for all the world ;-)


Here are the changes:

I need to change one file in the includes because gcc don't liked it
****** Changes on /usr/include/asm-i486/system.h ******

This function used "new" as a variable name, I changed the name of the
variable to "neww" in the definition and in all the source of the
function

static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
                                      unsigned long neww, int size)

***** Changes on CMySQL.cpp **********
--- mysqlcc-0.9.4-src/shared/src/CMySQL.cpp     2003-12-14
00:10:44.000000000 +0100
+++ ../src/mysqlcc-0.9.4-src/shared/src/CMySQL.cpp      2006-03-16
11:52:44.000000000 +0100
@@ -451,7 +451,7 @@
   if (!isConnected())
     return false;

-  if (mysql_shutdown(mysql) != 0)
+  if (mysql_shutdown(mysql, SHUTDOWN_DEFAULT) != 0)
   {
     if (emiterror)
       emitError();

***** Changes on CQueryWindow.cpp **********

--- mysqlcc-0.9.4-src/src/CQueryWindow.cpp      2003-12-14
00:10:44.000000000 +0100
+++ ../src/mysqlcc-0.9.4-src/src/CQueryWindow.cpp       2006-03-16
12:54:40.000000000 +0100
@@ -467,8 +467,18 @@
           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);
+                               // NetVicious modification
+                               if ( mysql()->mysql()->version().major == 5 )
+                               {
+                                       default_table = explain_query->row(2);
+                               }
+                               else
+                               {
+               default_table =
explain_query->row(mysql()->mysql()->version().major >= 4 &&
+                       mysql()->mysql()->version().minor >= 1 ? 2 : 0);
+                               }
+                               // End NetVicious modification
+
             if (!default_table.isEmpty())
             {
               finished_evt->read_only = default_database.isEmpty() ||

--
.. //\/ e t . \/ i c i o u s ..

-- 
MySQL GUI Tools Mailing List
For list archives: http://lists.mysql.com/gui-tools
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.