Bug #48574 Missing command "system" in mysql client for cluster-7.0.*
Submitted: 5 Nov 2009 15:01 Modified: 9 Mar 2010 8:56
Reporter: Geir Green Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: John David Duncan CPU Architecture:Any
Tags: regression, Server version: 5.0.99-agent-manager MyS

[5 Nov 2009 15:01] Geir Green
Description:
In the longevity test of the MySQL Cluster Manager Agent a command string is used containing some commands separated by ";" ,some of these commands is "system sleep 30" causing error when testing on Solaris SPARC for cluster-7.0.*. But this problem does not occur on other platforms nor on SPARC for cluster-6.3.20.

How to repeat:
#start an agent
[gg136786@techra14]~/MCM/solarissparc/install: ./bin/mysql-proxy --defaults-file=/export/home/tmp/gg136786/conf-mgt-agent-techra14.ini&
[1] 28546
#start the client
[gg136786@techra14]/usr/local/cluster-mgt/cluster-7.0.7: ./bin/mysql -h techra14 -P 40000 -u admin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.99-agent-manager MySQL Cluster Manager

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> system sleep 30;
ERROR 2 (00MGR): Unrecognized command : system
mysql> quit
Bye
[5 Nov 2009 15:40] Valeriy Kravchuk
Thank you for the problem report. Please, send the results of:

./bin/mysql --version
[5 Nov 2009 15:58] Geir Green
[gg136786@techra14]/usr/local/cluster-mgt/cluster-7.0.7: ./bin/mysql --version
./bin/mysql  Ver 14.14 Distrib 5.1.35-ndb-7.0.7, for sun-solaris2.10 (sparc) using readline 5.1
[11 Nov 2009 11:56] Gunn Olaussen
Working on cluster verison 6.3.20:

khepri03$ /usr/local/cluster-mgt/cluster-6.3.20/bin/mysql -h nanna11 -P 56500 -u admin --password=super -e "system sleep 2"

khepri03$ /usr/local/cluster-mgt/cluster-6.3.20/bin/mysql --version
/usr/local/cluster-mgt/cluster-6.3.20/bin/mysql  Ver 14.14 Distrib 5.1.30-ndb-6.3.20, for pc-solaris2.10 (x86_64) using  EditLine wrapper

Not working on 7.0.6:

khepri03$ /usr/local/cluster-mgt/cluster-7.0.6/bin/mysql -h nanna11 -P 56500 -u admin --password=super -e "system sleep 2"          
ERROR 2 (00MGR) at line 1: Unrecognized command : system

khepri03$ /usr/local/cluster-mgt/cluster-7.0.6/bin/mysql --version/usr/local/cluster-mgt/cluster-7.0.6/bin/mysql  Ver 14.14 Distrib 5.1.34-ndb-7.0.6, for pc-solaris2.10 (x86_64) using readline 5.1

The above was tested on solaris 10 x86. The other missing commands are "edit", "nopager" and "pager".

Problem exist on linux too (tested on RHEL5.3 and SLES10):

loki44$ /usr/local/cluster-mgt/cluster-7.0.6/bin/mysql -h nanna11 -P 56500 -u admin --password=super -e "system sleep 2"
ERROR 2 (00MGR) at line 1: Unrecognized command : system

tyr12$ /usr/local/cluster-mgt/cluster-7.0.6/bin/mysql -h nanna11 -P 56500 -u admin --password=super -e "system sleep 2"
ERROR 2 (00MGR) at line 1: Unrecognized command : system

tyr12$ /usr/local/cluster-mgt/cluster-7.0.6/bin/mysql --version
/usr/local/cluster-mgt/cluster-7.0.6/bin/mysql  Ver 14.14 Distrib 5.1.34-ndb-7.0.6, for unknown-linux-gnu (x86_64) using readline 5.1
[19 Nov 2009 17:45] Sveta Smirnova
Thank you for the report.

Verified as described with mysql-cluster-gpl-7.0.6-linux-x86_64-glibc23 and mysql-cluster-gpl-7.0.8a-linux-x86_64-glibc23 packages.
[24 Nov 2009 7:18] Sveta Smirnova
This is only observed with command line client bundled with Cluster.
[24 Nov 2009 12:29] Daniel Fischer
Threaded clients don't have access to a handful of commands, including system and pager. Normally, my_global.h undefines THREAD in a client build, which in turn causes mysql.cc to define USE_POPEN, which in turn enables the system command along with the others that were mentioned.

The cause of the bug is that cluster's my_global.h includes my_socket.h after undefining THREAD, which in turn includes my_socket_posix.h on UNIX, which in turn includes my_config.h, which defines THREAD.

The bug was likely introduced by the Windows port of Cluster, which introduced my_socket.h. This file doesn't exist in non-Cluster or cluster before the 6.4 revision that introduced the Windows port, which is why regular MySQL Server packages and Cluster 6.3 packages don't exhibit the bug.

Assigning to Cluster team.
[26 Feb 2010 4:18] jack andrews
stewart (the author) had the intention that my_socket
would get included in mainline mysql.  let me know
what you think of that.

are you able to try this patch, or would you like 
a binary package?

=== modified file 'include/my_socket_posix.h'
--- include/my_socket_posix.h   2009-06-01 15:34:34 +0000
+++ include/my_socket_posix.h   2010-02-26 03:47:16 +0000
@@ -7,7 +7,9 @@
 #include <sys/socket.h>
 #include <netinet/in.h>

+#define SAVE_THREAD THREAD
 #include <my_config.h>
+#define THREAD SAVE_THREAD

 #define MY_SOCKET_FORMAT "%d"
 #define MY_SOCKET_FORMAT_VALUE(x) (x.fd)
[26 Feb 2010 23:17] John David Duncan
That patch doesn't work for me, but here is one fixes the issue.
  
It turns out (on my one particular platform, at least) that my_socket_posix.h does not really need to include my_config.h. 

==== modified file 'include/my_socket_posix.h'
--- include/my_socket_posix.h	2009-06-01 15:34:34 +0000
+++ include/my_socket_posix.h	2010-02-26 22:45:40 +0000
@@ -7,8 +7,6 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-#include <my_config.h>
-
 #define MY_SOCKET_FORMAT "%d"
 #define MY_SOCKET_FORMAT_VALUE(x) (x.fd)
[1 Mar 2010 0:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/101781

3416 Jack Andrews	2010-03-01
      bug #48574: Missing command "system" in mysql client for cluster-7.0.*
[1 Mar 2010 21:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/101959

3422 John David Duncan	2010-03-01
      Possible fix for bug#48574
[1 Mar 2010 22:00] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/101963

3422 John David Duncan	2010-03-01 [merge]
      Possible fix for bug#48574
[1 Mar 2010 22:01] Bugs System
Pushed into 5.1.41-ndb-7.0.14 (revid:jdd@sun.com-20100301220005-yuqe7vh23a39gaum) (version source revid:jdd@sun.com-20100301220005-yuqe7vh23a39gaum) (merge vers: 5.1.41-ndb-7.0.14) (pib:16)
[5 Mar 2010 22:07] John David Duncan
Fixed in MySQL Cluster 7.0 and 7.1
[9 Mar 2010 8:56] Jon Stephens
Documented in the NDB-7.0.14 and 7.1.3 changelogs as follows:

        The mysql client system command did not work properly. This
        issue was only known to affect the version of the mysql client 
        that was included with MySQL Cluster NDB 7.0 and MySQL Cluster 
        NDB 7.1 releases.

Closed.