List:Internals« Previous MessageNext Message »
From:jon Date:June 29 2005 4:33am
Subject:bk commit - mysqldoc@docsrva tree (jon:1.2900)
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.2900 05/06/29 14:33:19 jon@stripped +6 -0
  news.xml, functions.xml: SUBSTRING() can
  take negative positive values.
  (Sync refman-4.1, refman-5.0 to refman.)

  refman/news.xml
    1.37 05/06/29 14:33:17 jon@stripped +6 -0
    news-4-1-x: SUBSTRING can take a negative position argument.

  refman/functions.xml
    1.6 05/06/29 14:33:17 jon@stripped +20 -2
    string-functions: SUBSTRING() can take a negative value
    for the position value as of 4.1.

  refman-5.0/news.xml
    1.32 05/06/29 14:33:17 jon@stripped +6 -23
    news-4-1-x: SUBSTRING can take a negative position argument.
    (Sync to refman.)

  refman-5.0/functions.xml
    1.6 05/06/29 14:33:17 jon@stripped +20 -2
    string-functions: SUBSTRING() can take a negative value
    for the position value as of 4.1.
    (Sync to refman.)

  refman-4.1/news.xml
    1.32 05/06/29 14:33:17 jon@stripped +6 -23
    news-4-1-x: SUBSTRING can take a negative position argument.
    (Sync to refman.)

  refman-4.1/functions.xml
    1.6 05/06/29 14:33:16 jon@stripped +20 -2
    string-functions: SUBSTRING() can take a negative value
    for the position value as of 4.1.
    (Sync to refman.)

# 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.site
# Root:	/home/jon/bk/mysqldoc

--- 1.5/refman-4.1/functions.xml	2005-06-25 03:41:10 +10:00
+++ 1.6/refman-4.1/functions.xml	2005-06-29 14:33:16 +10:00
@@ -3378,7 +3378,13 @@
     <replaceable>len</replaceable> characters long from string
     <replaceable>str</replaceable>, starting at position
     <replaceable>pos</replaceable>. The forms that use
-    <literal>FROM</literal> are standard SQL syntax.
+    <literal>FROM</literal> are standard SQL syntax. Beginning with 
+    MySQL 4.1, it is possible to use a negative value for 
+    <replaceable>pos</replaceable>. In this case, the beginning of the 
+    substring is <replaceable>pos</replaceable> characters from the end 
+    of the string, rather than the beginning. A negative value may be 
+    used for <replaceable>pos</replaceable> in any of the forms of this 
+    function.
 
 <!--  end_description_for_help_topic -->
    </para>
@@ -3394,12 +3400,24 @@
 mysql&gt; SELECT SUBSTRING('foobarbar' FROM 4);
         -&gt; 'barbar'
 mysql&gt; SELECT SUBSTRING('Quadratically',5,6);
-        -&gt; 'ratica'
+        -&gt; 'ratica'        
+mysql&gt; SELECT SUBSTRING('Sakila', -3);
+        -&gt; 'ila'        
+mysql&gt; SELECT SUBSTRING('Sakila', -5, 3);
+        -&gt; 'aki'
+mysql&gt; SELECT SUBSTRING('Sakila' FROM -4 FOR 2);
+        -&gt; 'ki'
 </programlisting>
    </para>
 
    <para>
     This function is multi-byte safe.
+   </para>
+   
+   <para>
+     Note that if you use a value less than than 1 for 
+     <replaceable>len</replaceable>, the result is always an empty 
+     string.
    </para>
 
    <para>

--- 1.31/refman-4.1/news.xml	2005-06-29 00:34:51 +10:00
+++ 1.32/refman-4.1/news.xml	2005-06-29 14:33:17 +10:00
@@ -850,24 +850,6 @@
      prepared statements. (Bug #7306)
     </para></listitem>
 
-    <listitem>
-      <para><emphasis role="bold">Security update</emphasis>: A user
-      with limited privileges could obtain information about the
-      privileges of other users by querying objects in the
-      <literal>INFORMATION_SCHEMA</literal> database for which that user
-      did not have the requisite privileges. (Bug #10964)</para>
-    </listitem>
-
-    <listitem>
-      <para>Issuing a write lock for a table from one client prevented
-      other clients from accessing the table's metadata. For example, if
-      one client issued a <literal>LOCK TABLES
-      <replaceable>mydb</replaceable>.<replaceable>mytable</replaceable>
-      WRITE</literal>, then a second client attempting to execute a
-      <literal>USE <replaceable>mydb</replaceable>;</literal> would
-      hang. (Bug #9998)</para>
-    </listitem>
-
     <listitem><para>
      <literal>SHOW BINARY LOGS</literal> now displays a
      <literal>File_size</literal> column that indicates the size of each
@@ -4528,6 +4510,12 @@
   </para>
 
   <itemizedlist>
+    
+    <listitem>
+      <para>The <literal>SUBSTRING()</literal> function can now take a 
+      negative value for the <replaceable>pos</replaceable> (position) 
+      argument. See <xref linkend="string-functions"/>.</para>
+    </listitem>
 
    <listitem><para>
     Subqueries and derived tables (unnamed views). See
@@ -4752,11 +4740,6 @@
      Setting <literal>@@SQL_MODE = NULL</literal> caused an erroneous
      error message. (Bug #10732)
     </para></listitem>
-
-    <listitem>
-      <para>Setting <literal>@@SQL_MODE = NULL</literal> caused an
-      erroneous error message. (Bug #10732)</para>
-    </listitem>
 
     <listitem><para>
      Server crashed when using <literal>GROUP BY</literal> on the result

--- 1.5/refman-5.0/functions.xml	2005-06-25 03:41:10 +10:00
+++ 1.6/refman-5.0/functions.xml	2005-06-29 14:33:17 +10:00
@@ -3378,7 +3378,13 @@
     <replaceable>len</replaceable> characters long from string
     <replaceable>str</replaceable>, starting at position
     <replaceable>pos</replaceable>. The forms that use
-    <literal>FROM</literal> are standard SQL syntax.
+    <literal>FROM</literal> are standard SQL syntax. Beginning with 
+    MySQL 4.1, it is possible to use a negative value for 
+    <replaceable>pos</replaceable>. In this case, the beginning of the 
+    substring is <replaceable>pos</replaceable> characters from the end 
+    of the string, rather than the beginning. A negative value may be 
+    used for <replaceable>pos</replaceable> in any of the forms of this 
+    function.
 
 <!--  end_description_for_help_topic -->
    </para>
@@ -3394,12 +3400,24 @@
 mysql&gt; SELECT SUBSTRING('foobarbar' FROM 4);
         -&gt; 'barbar'
 mysql&gt; SELECT SUBSTRING('Quadratically',5,6);
-        -&gt; 'ratica'
+        -&gt; 'ratica'        
+mysql&gt; SELECT SUBSTRING('Sakila', -3);
+        -&gt; 'ila'        
+mysql&gt; SELECT SUBSTRING('Sakila', -5, 3);
+        -&gt; 'aki'
+mysql&gt; SELECT SUBSTRING('Sakila' FROM -4 FOR 2);
+        -&gt; 'ki'
 </programlisting>
    </para>
 
    <para>
     This function is multi-byte safe.
+   </para>
+   
+   <para>
+     Note that if you use a value less than than 1 for 
+     <replaceable>len</replaceable>, the result is always an empty 
+     string.
    </para>
 
    <para>

--- 1.31/refman-5.0/news.xml	2005-06-29 00:34:51 +10:00
+++ 1.32/refman-5.0/news.xml	2005-06-29 14:33:17 +10:00
@@ -850,24 +850,6 @@
      prepared statements. (Bug #7306)
     </para></listitem>
 
-    <listitem>
-      <para><emphasis role="bold">Security update</emphasis>: A user
-      with limited privileges could obtain information about the
-      privileges of other users by querying objects in the
-      <literal>INFORMATION_SCHEMA</literal> database for which that user
-      did not have the requisite privileges. (Bug #10964)</para>
-    </listitem>
-
-    <listitem>
-      <para>Issuing a write lock for a table from one client prevented
-      other clients from accessing the table's metadata. For example, if
-      one client issued a <literal>LOCK TABLES
-      <replaceable>mydb</replaceable>.<replaceable>mytable</replaceable>
-      WRITE</literal>, then a second client attempting to execute a
-      <literal>USE <replaceable>mydb</replaceable>;</literal> would
-      hang. (Bug #9998)</para>
-    </listitem>
-
     <listitem><para>
      <literal>SHOW BINARY LOGS</literal> now displays a
      <literal>File_size</literal> column that indicates the size of each
@@ -4528,6 +4510,12 @@
   </para>
 
   <itemizedlist>
+    
+    <listitem>
+      <para>The <literal>SUBSTRING()</literal> function can now take a 
+      negative value for the <replaceable>pos</replaceable> (position) 
+      argument. See <xref linkend="string-functions"/>.</para>
+    </listitem>
 
    <listitem><para>
     Subqueries and derived tables (unnamed views). See
@@ -4752,11 +4740,6 @@
      Setting <literal>@@SQL_MODE = NULL</literal> caused an erroneous
      error message. (Bug #10732)
     </para></listitem>
-
-    <listitem>
-      <para>Setting <literal>@@SQL_MODE = NULL</literal> caused an
-      erroneous error message. (Bug #10732)</para>
-    </listitem>
 
     <listitem><para>
      Server crashed when using <literal>GROUP BY</literal> on the result

--- 1.5/refman/functions.xml	2005-06-25 03:41:10 +10:00
+++ 1.6/refman/functions.xml	2005-06-29 14:33:17 +10:00
@@ -3378,7 +3378,13 @@
     <replaceable>len</replaceable> characters long from string
     <replaceable>str</replaceable>, starting at position
     <replaceable>pos</replaceable>. The forms that use
-    <literal>FROM</literal> are standard SQL syntax.
+    <literal>FROM</literal> are standard SQL syntax. Beginning with 
+    MySQL 4.1, it is possible to use a negative value for 
+    <replaceable>pos</replaceable>. In this case, the beginning of the 
+    substring is <replaceable>pos</replaceable> characters from the end 
+    of the string, rather than the beginning. A negative value may be 
+    used for <replaceable>pos</replaceable> in any of the forms of this 
+    function.
 
 <!--  end_description_for_help_topic -->
    </para>
@@ -3394,12 +3400,24 @@
 mysql&gt; SELECT SUBSTRING('foobarbar' FROM 4);
         -&gt; 'barbar'
 mysql&gt; SELECT SUBSTRING('Quadratically',5,6);
-        -&gt; 'ratica'
+        -&gt; 'ratica'        
+mysql&gt; SELECT SUBSTRING('Sakila', -3);
+        -&gt; 'ila'        
+mysql&gt; SELECT SUBSTRING('Sakila', -5, 3);
+        -&gt; 'aki'
+mysql&gt; SELECT SUBSTRING('Sakila' FROM -4 FOR 2);
+        -&gt; 'ki'
 </programlisting>
    </para>
 
    <para>
     This function is multi-byte safe.
+   </para>
+   
+   <para>
+     Note that if you use a value less than than 1 for 
+     <replaceable>len</replaceable>, the result is always an empty 
+     string.
    </para>
 
    <para>

--- 1.36/refman/news.xml	2005-06-29 00:34:51 +10:00
+++ 1.37/refman/news.xml	2005-06-29 14:33:17 +10:00
@@ -4510,6 +4510,12 @@
   </para>
 
   <itemizedlist>
+    
+    <listitem>
+      <para>The <literal>SUBSTRING()</literal> function can now take a 
+      negative value for the <replaceable>pos</replaceable> (position) 
+      argument. See <xref linkend="string-functions"/>.</para>
+    </listitem>
 
    <listitem><para>
     Subqueries and derived tables (unnamed views). See
Thread
bk commit - mysqldoc@docsrva tree (jon:1.2900)jon29 Jun