List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:February 9 2007 12:28pm
Subject:bk commit into 5.0 tree (cmiller:1.2402)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-02-09 13:27:40+01:00, cmiller@stripped +1 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
  into  calliope.local.cmiller:/Volumes/Source/src/mysql-5.0-maint
  MERGE: 1.2400.1.8

  client/mysql.cc@stripped, 2007-02-09 13:27:21+01:00, cmiller@stripped +0 -0
    Auto merged
    MERGE: 1.230.1.1

# 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:	cmiller
# Host:	calliope.ndb.mysql.com
# Root:	/Volumes/Source/src/mysql-5.0-maint/RESYNC

--- 1.231/client/mysql.cc	2007-01-31 15:25:53 +01:00
+++ 1.232/client/mysql.cc	2007-02-09 13:27:21 +01:00
@@ -39,6 +39,8 @@
 #include <signal.h>
 #include <violite.h>
 
+#include "server_tokens.h"
+
 #if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H)
 #include <locale.h>
 #endif
@@ -279,25 +281,6 @@
     "Show warnings after every statement." },
   { "nowarning", 'w', com_nowarnings, 0,
     "Don't show warnings after every statement." },
-  /* Get bash-like expansion for some commands */
-  { "create table",     0, 0, 0, ""},
-  { "create database",  0, 0, 0, ""},
-  { "drop",             0, 0, 0, ""},
-  { "select",           0, 0, 0, ""},
-  { "insert",           0, 0, 0, ""},
-  { "replace",          0, 0, 0, ""},
-  { "update",           0, 0, 0, ""},
-  { "delete",           0, 0, 0, ""},
-  { "explain",          0, 0, 0, ""},
-  { "show databases",   0, 0, 0, ""},
-  { "show fields from", 0, 0, 0, ""},
-  { "show keys from",   0, 0, 0, ""},
-  { "show tables",      0, 0, 0, ""},
-  { "load data from",   0, 0, 0, ""},
-  { "alter table",      0, 0, 0, ""},
-  { "set option",       0, 0, 0, ""},
-  { "lock tables",      0, 0, 0, ""},
-  { "unlock tables",    0, 0, 0, ""},
   { (char *)NULL,       0, 0, 0, ""}
 };
 
@@ -1632,11 +1615,6 @@
   if (status.batch || quick || !current_db)
     DBUG_VOID_RETURN;			// We don't need completion in batches
 
-  /* hash SQL commands */
-  while (cmd->name) {
-    add_word(&ht,(char*) cmd->name);
-    cmd++;
-  }
   if (!rehash)
     DBUG_VOID_RETURN;
 
@@ -1646,7 +1624,44 @@
   completion_hash_clean(&ht);
   free_root(&hash_mem_root,MYF(0));
 
-  /* hash MySQL functions (to be implemented) */
+  /* hash client commands */
+  while (cmd->name) 
+  {
+    add_word(&ht, (char*) cmd->name);
+    cmd++;
+  }
+
+  /* hash SQL tokens */
+  for (unsigned int i= 0; i < (sizeof(symbols) / sizeof(char *)); i++)
+  {
+    add_word(&ht, (char *) symbols[i]);  /* (discard const qualifier) */
+
+    /* Also add lowercase version of word */
+    /* Don't free until hash is unused. */
+    char *lowercase_symbol= strdup_root(&hash_mem_root, symbols[i]); 
+    if (lowercase_symbol)
+    {
+      for (char *p= lowercase_symbol; *p != '\0'; p++)
+        *p= tolower(*p);
+      add_word(&ht, lowercase_symbol);
+    }
+  }
+
+  /* hash MySQL functions (user funcs to be implemented) */
+  for (unsigned int i= 0; i < (sizeof(sql_functions) / sizeof(char *)); i++)
+  {
+    add_word(&ht, (char *) sql_functions[i]);  /* (discard const qualifier) */
+
+    /* Also add lowercase version of word */
+    /* Don't free until hash is unused. */
+    char *lowercase_sql_function= strdup_root(&hash_mem_root, sql_functions[i]); 
+    if (lowercase_sql_function)
+    {
+      for (char *p= lowercase_sql_function; *p != '\0'; p++)
+        *p= tolower(*p);
+      add_word(&ht, lowercase_sql_function);
+    }
+  }
 
   /* hash all database names */
   if (mysql_query(&mysql,"show databases") == 0)
Thread
bk commit into 5.0 tree (cmiller:1.2402)Chad MILLER12 Feb