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-04 10:32:33-05:00, cmiller@stripped +2 -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.2359.1.3
client/Makefile.am@stripped, 2007-02-04 10:32:14-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.61.1.2
client/mysql.cc@stripped, 2007-02-04 10:32:15-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.229.1.2
# 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.local
# Root: /Volumes/Source/src/mysql-5.0-maint/RESYNC
--- 1.63/client/Makefile.am 2006-12-30 15:02:04 -05:00
+++ 1.64/client/Makefile.am 2007-02-04 10:32:14 -05:00
@@ -28,7 +28,7 @@
mysql_upgrade \
mysqltestmanagerc mysqltestmanager-pwgen
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
- client_priv.h
+ client_priv.h server_tokens.h
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
mysqladmin_SOURCES = mysqladmin.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
@@ -59,6 +59,11 @@
-DDATADIR="\"$(localstatedir)\""
EXTRA_DIST = get_password.c CMakeLists.txt
+
+mysql.$(OBJEXT): server_tokens.h
+
+server_tokens.h: ../sql/lex.h
+ @PERL@ -n -e 's/\{\s*("[^"]*")\s*,[^}]+\}/\1/;' -e 's/^\s*#.*//;' -e 's/^(SYMBOL|SYM_GROUP) .*//;' -e 's/SYMBOL/const char* const/;' -e 's!/\*!/* D''o n''ot ed''it. Th''is fi''le gen''erated fr''om $< . \n!;' -p $< > $@
link_sources:
for f in $(sql_src) ; do \
--- 1.230/client/mysql.cc 2006-12-23 14:04:04 -05:00
+++ 1.231/client/mysql.cc 2007-02-04 10:32:15 -05: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.2401) | Chad MILLER | 4 Feb |