List:Internals« Previous MessageNext Message »
From:jon Date:July 19 2005 12:51pm
Subject:bk commit - mysqldoc@docsrva tree (jon:1.3066)
View as plain text  
Below is the list of changes that have just been committed into a local
mysqldoc repository of jon. When jon does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.3066 05/07/19 20:51:51 jon@stripped +5 -0
  Propagating fix for Bug#11327 to
  refman and refman-4.1 trees.
  
  (Documenting -e/--execute option
  for MySQL client programs.)

  refman/using-mysql-programs.xml
    1.2 05/07/19 20:51:49 jon@stripped +73 -0
    Documenting -e option.
    
    (Part of fix for Bug#11327.)

  refman/ndbcluster.xml
    1.9 05/07/19 20:51:49 jon@stripped +5 -2
    Added pointer to documentation for
    -e option. (Fixing Bug#11327.)

  refman-5.0/ndbcluster.xml
    1.12 05/07/19 20:51:49 jon@stripped +1 -1
    Fix typo.

  refman-4.1/using-mysql-programs.xml
    1.2 05/07/19 20:51:49 jon@stripped +73 -0
    Sync.

  refman-4.1/ndbcluster.xml
    1.9 05/07/19 20:51:48 jon@stripped +5 -2
    Sync.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jon
# Host:	gigan.
# Root:	/home/jon/bk/mysqldoc

--- 1.8/refman-4.1/ndbcluster.xml	2005-07-19 20:31:10 +10:00
+++ 1.9/refman-4.1/ndbcluster.xml	2005-07-19 20:51:48 +10:00
@@ -1330,9 +1330,12 @@
 
    <para>
     This will cause the <command>ndb_mgm</command>,
-    <command>ndb_mgm</command>, and any <command>ndbd</command>
+    <command>ndb_mgmd</command>, and any <command>ndbd</command>
     processes to terminate gracefully. Any SQL nodes can be terminated
-    using <command>mysqladmin shutdown</command> and other means.
+    using <command>mysqladmin shutdown</command> and other means. Note 
+    that the <literal>-e</literal> option here is used to pass a command 
+    to the <command>ndb_mgm</command> client from the shell. See 
+    <xref linkend="command-line-options"/>.
    </para>
 
    <para>

--- 1.1/refman-4.1/using-mysql-programs.xml	2005-06-17 05:35:23 +10:00
+++ 1.2/refman-4.1/using-mysql-programs.xml	2005-07-19 20:51:49 +10:00
@@ -463,6 +463,79 @@
     convention.
    </para>
 
+   
+   <para>
+     Another option which may be occasionally useful with 
+     <command>mysql</command> is the <literal>-e</literal> or 
+     <literal>--execute</literal> option, which can be used to pass SQL 
+     statements to the server. The statements must be surrounded by 
+     (single or double) quotation marks. (However, if you wish to use 
+     quoted values within the query, then you should use double quotes 
+     for the query, and single quotes for any quoted values within the 
+     query.) When this option is used, the statements are executed, and 
+     then <command>mysql</command> exits to the command shell 
+     immediately thereafter.
+   </para>
+   
+   <para>
+     For example, you can use the following to obtain a list 
+     of user accounts:
+   </para>
+
+<programlisting>
+shell&gt; mysql -u root -p -e "SELECT User, Host FROM user" mysql
+Enter password: <userinput>******</userinput>
++------+-----------+
+| User | Host      |
++------+-----------+
+|      | gigan     |
+| root | gigan     |
+|      | localhost |
+| jon  | localhost |
+| root | localhost |
++------+-----------+
+shell&gt;
+</programlisting>
+
+    <para>
+      Note that the name of the <literal>mysql</literal> database was 
+      passed as a separate argument. However, the same query could have 
+      been executed using <command>mysql -u root -p -e "SELECT User, 
+        Host FROM mysql.user"</command> from the shell prompt.
+    </para>
+
+    <para>
+      Multiple SQL statements may be passed in this way, separated by 
+      semicolons:
+    </para>
+
+<programlisting>
+shell&gt; mysql -u root -p --execute="SELECT Name FROM Country WHERE Name LIKE 'AU%';SELECT COUNT(*) FROM City" world
+Enter password: <userinput>******</userinput>
++-----------+
+| Name      |
++-----------+
+| Australia |
+| Austria   |
++-----------+
++----------+
+| COUNT(*) |
++----------+
+|     4079 |
++----------+
+</programlisting>
+
+    <para>
+      Note that the long form (<literal>--execute</literal>) must be 
+      followed by an equals sign (<literal>=</literal>).
+    </para>
+
+    <para>The <literal>-e</literal> option may also be used to pass 
+      commands in an analogous fashion to the <command>ndb_mgm</command> 
+      management client for MySQL Cluster. See 
+      <xref linkend="multi-shutdown-restart"/> for an example.
+    </para>
+
   </section>
 
   <section id="option-files">

--- 1.11/refman-5.0/ndbcluster.xml	2005-07-19 20:31:10 +10:00
+++ 1.12/refman-5.0/ndbcluster.xml	2005-07-19 20:51:49 +10:00
@@ -3790,7 +3790,7 @@
     </para>
 
     <para>
-     These buffers are used as front-ends to the file system when
+     These buffers are used as front ends to the file system when
      writing log records to disk. If the node is running in diskless
      mode, then these parameters can be set to their minimum values
      without penalty due to the fact that disk writes are "faked" by the

--- 1.8/refman/ndbcluster.xml	2005-07-19 20:31:11 +10:00
+++ 1.9/refman/ndbcluster.xml	2005-07-19 20:51:49 +10:00
@@ -1330,9 +1330,12 @@
 
    <para>
     This will cause the <command>ndb_mgm</command>,
-    <command>ndb_mgm</command>, and any <command>ndbd</command>
+    <command>ndb_mgmd</command>, and any <command>ndbd</command>
     processes to terminate gracefully. Any SQL nodes can be terminated
-    using <command>mysqladmin shutdown</command> and other means.
+    using <command>mysqladmin shutdown</command> and other means. Note 
+    that the <literal>-e</literal> option here is used to pass a command 
+    to the <command>ndb_mgm</command> client from the shell. See 
+    <xref linkend="command-line-options"/>.
    </para>
 
    <para>

--- 1.1/refman/using-mysql-programs.xml	2005-06-16 09:46:58 +10:00
+++ 1.2/refman/using-mysql-programs.xml	2005-07-19 20:51:49 +10:00
@@ -462,6 +462,79 @@
     earlier versions know nothing of the <literal>--loose</literal>
     convention.
    </para>
+   
+   
+   <para>
+     Another option which may be occasionally useful with 
+     <command>mysql</command> is the <literal>-e</literal> or 
+     <literal>--execute</literal> option, which can be used to pass SQL 
+     statements to the server. The statements must be surrounded by 
+     (single or double) quotation marks. (However, if you wish to use 
+     quoted values within the query, then you should use double quotes 
+     for the query, and single quotes for any quoted values within the 
+     query.) When this option is used, the statements are executed, and 
+     then <command>mysql</command> exits to the command shell 
+     immediately thereafter.
+   </para>
+   
+   <para>
+     For example, you can use the following to obtain a list 
+     of user accounts:
+   </para>
+
+<programlisting>
+shell&gt; mysql -u root -p -e "SELECT User, Host FROM user" mysql
+Enter password: <userinput>******</userinput>
++------+-----------+
+| User | Host      |
++------+-----------+
+|      | gigan     |
+| root | gigan     |
+|      | localhost |
+| jon  | localhost |
+| root | localhost |
++------+-----------+
+shell&gt;
+</programlisting>
+
+    <para>
+      Note that the name of the <literal>mysql</literal> database was 
+      passed as a separate argument. However, the same query could have 
+      been executed using <command>mysql -u root -p -e "SELECT User, 
+        Host FROM mysql.user"</command> from the shell prompt.
+    </para>
+
+    <para>
+      Multiple SQL statements may be passed in this way, separated by 
+      semicolons:
+    </para>
+
+<programlisting>
+shell&gt; mysql -u root -p --execute="SELECT Name FROM Country WHERE Name LIKE 'AU%';SELECT COUNT(*) FROM City" world
+Enter password: <userinput>******</userinput>
++-----------+
+| Name      |
++-----------+
+| Australia |
+| Austria   |
++-----------+
++----------+
+| COUNT(*) |
++----------+
+|     4079 |
++----------+
+</programlisting>
+
+    <para>
+      Note that the long form (<literal>--execute</literal>) must be 
+      followed by an equals sign (<literal>=</literal>).
+    </para>
+
+    <para>The <literal>-e</literal> option may also be used to pass 
+      commands in an analogous fashion to the <command>ndb_mgm</command> 
+      management client for MySQL Cluster. See 
+      <xref linkend="multi-shutdown-restart"/> for an example.
+    </para>
 
   </section>
 
Thread
bk commit - mysqldoc@docsrva tree (jon:1.3066)jon19 Jul