Commit f0495434 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Added DO command

parent ee9a6f54
Loading
Loading
Loading
Loading
+27 −2
Original line number Diff line number Diff line
@@ -3628,7 +3628,7 @@ Use of @code{REPLACE} instead of @code{DELETE} + @code{INSERT}.
@xref{REPLACE, , @code{REPLACE}}.
@item
The @code{FLUSH flush_option} statement.
The @code{FLUSH}, @code{RESET} and @code{DO} statements.
@item
The possibility to set variables in a statement with @code{:=}:
@@ -31993,6 +31993,9 @@ and @code{NULL} if the named lock didn't exist. The lock will not exist if
it was never obtained by a call to @code{GET_LOCK()} or if it already has
been released.
The @code{DO} statement is convinient to use with @code{RELEASE_LOCK()}.
@xref{DO}.
@findex BENCHMARK()
@item BENCHMARK(count,expr)
The @code{BENCHMARK()} function executes the expression @code{expr}
@@ -32064,6 +32067,7 @@ facilitate replication testing.
* TRUNCATE::                    @code{TRUNCATE} Syntax
* REPLACE::                     @code{REPLACE} Syntax
* LOAD DATA::                   @code{LOAD DATA INFILE} Syntax
* DO::                          @code{DO} Syntax
@end menu
@node SELECT, INSERT, Data Manipulation, Data Manipulation
@@ -32973,7 +32977,7 @@ The above makes it easy to check if @code{REPLACE} added or replaced a
row.
@node LOAD DATA,  , REPLACE, Data Manipulation
@node LOAD DATA, DO, REPLACE, Data Manipulation
@subsection @code{LOAD DATA INFILE} Syntax
@findex LOAD DATA INFILE
@@ -33469,6 +33473,23 @@ For more information about the efficiency of @code{INSERT} versus
@xref{Insert speed}.
@node DO,  , LOAD DATA, Data Manipulation
@subsection @code{DO} Syntax
@findex DO
@example
DO expression, [expression, ...]
@end example
Execute the expression but don't return any results.  This is a
shorthand of @code{SELECT expression, expression}, but has the advantage
that it's slightly faster when you don't care about the result.
This is mainly useful with functions that has side effects, like
@code{RELEASE_LOCK}.
@node Data Definition, Basic User Commands, Data Manipulation, Reference
@section Data Definition: @code{CREATE}, @code{DROP}, @code{ALTER}
@@ -46867,6 +46888,10 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.47
@itemize @bullet
@item
Fixed core-dump bug in replication when using SELECT RELEASE_LOCK();
@item
Added new statement DO expression,[expression].
@item
Added @code{slave-skip-errors} option
@item
Added statistics variables for all MySQL commands. (@code{SHOW STATUS} is
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ mysqld_SOURCES = sql_lex.cc \
			mysqld.cc password.c hash_filo.cc hostname.cc \
			convert.cc sql_parse.cc sql_yacc.yy \
			sql_base.cc table.cc sql_select.cc sql_insert.cc \
			sql_update.cc sql_delete.cc \
			sql_update.cc sql_delete.cc sql_do.cc \
			procedure.cc item_uniq.cc sql_test.cc \
			log.cc log_event.cc init.cc derror.cc sql_acl.cc \
			unireg.cc \
+13 −4
Original line number Diff line number Diff line
@@ -278,8 +278,17 @@ void print_arrays()

  for (i=0;i<size;i++)
  {
    ulong order = tab_index_function ((i < how_long_symbols) ? symbols[i].name : sql_functions[i - how_long_symbols].name,function_plus,function_type);
    const char *name= ((i < how_long_symbols) ?
		       symbols[i].name :
		       sql_functions[i - how_long_symbols].name);
    ulong order = tab_index_function(name,function_plus,function_type);
    order %= function_mod;
    /* This should never be true */
    if (prva[order] != max_symbol)
    {
      fprintf(stderr,"Error: Got duplicate value for symbol '%s'\n",name);
      exit(1);
    }
    prva [order] = i;
  }

@@ -330,11 +339,11 @@ static struct option long_options[] =

static void usage(int version)
{
  printf("%s  Ver 3.2 Distrib %s, for %s (%s)\n",
  printf("%s  Ver 3.3 Distrib %s, for %s (%s)\n",
	 my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
  if (version)
    return;
  puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB, by Sinisa and Monty");
  puts("Copyright (C) 2001 MySQL AB, by Sinisa and Monty");
  puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
  puts("This program generates a perfect hashing function for the sql_lex.cc");
  printf("Usage: %s [OPTIONS]\n", my_progname);
@@ -521,7 +530,7 @@ int main(int argc,char **argv)
  function_mod=best_mod; function_plus=best_add;
  make_char_table(best_t1,best_t2,best_type);

  printf("/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB\n\
  printf("/* Copyright (C) 2001 MySQL AB\n\
   This program is free software; you can redistribute it and/or modify\n\
   it under the terms of the GNU General Public License as published by\n\
   the Free Software Foundation; either version 2 of the License, or\n\
+1 −1
Original line number Diff line number Diff line
@@ -1406,7 +1406,7 @@ void item_user_lock_release(ULL *ull)
    char buf[256];
    String tmp(buf,sizeof(buf));
    tmp.length(0);
    tmp.append("SELECT release_lock(\"");
    tmp.append("DO RELEASE_LOCK(\"");
    tmp.append(ull->key,ull->key_length);
    tmp.append("\")");
    save_errno=thd->net.last_errno;
+2 −1
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ static SYMBOL symbols[] = {
  { "DESCRIBE",		SYM(DESCRIBE),0,0},
  { "DISTINCT",		SYM(DISTINCT),0,0},
  { "DISTINCTROW",	SYM(DISTINCT),0,0},	/* Access likes this */
  { "DO",		SYM(DO_SYM),0,0},
  { "DOUBLE",		SYM(DOUBLE_SYM),0,0},
  { "DROP",		SYM(DROP),0,0},
  { "DUMPFILE",		SYM(DUMPFILE),0,0},
@@ -466,9 +467,9 @@ static SYMBOL sql_functions[] = {
  { "TO_DAYS",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)},
  { "TRIM",		SYM(TRIM),0,0},
  { "UCASE",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
  { "UPPER",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
  { "UNIQUE_USERS",	SYM(UNIQUE_USERS),0,0},
  { "UNIX_TIMESTAMP",	SYM(UNIX_TIMESTAMP),0,0},
  { "UPPER",		SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
  { "USER",		SYM(USER),0,0},
  { "VERSION",		SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
  { "WEEK",		SYM(WEEK_SYM),0,0},
Loading