summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xDocs/Support/colspec-fix.pl42
-rw-r--r--Docs/Support/trivial-makeinfo-4.0c.patch11
-rw-r--r--Docs/manual.texi49
-rw-r--r--client/mysql.cc30
-rw-r--r--client/mysqldump.c7
-rw-r--r--configure.in2
-rw-r--r--include/my_global.h8
-rw-r--r--myisam/myisamchk.c12
-rw-r--r--mysql-test/r/rpl000014.result2
-rw-r--r--mysql-test/r/rpl_log.result2
-rw-r--r--mysql-test/t/innodb_cache.test1
-rw-r--r--sql/mysqld.cc16
-rw-r--r--sql/slave.cc32
-rw-r--r--sql/slave.h2
-rw-r--r--sql/sql_yacc.yy553
15 files changed, 422 insertions, 347 deletions
diff --git a/Docs/Support/colspec-fix.pl b/Docs/Support/colspec-fix.pl
index 64269fdbe3a..bba0d27858f 100755
--- a/Docs/Support/colspec-fix.pl
+++ b/Docs/Support/colspec-fix.pl
@@ -9,7 +9,7 @@
use strict;
my $table_width = 12.75; # cm
-my $gutter_width = 0.09; # cm
+my $gutter_width = 0.55; # 2 mm
my $str = join '', <>;
@@ -28,12 +28,17 @@ sub msg {
}
sub rel2abs {
- my $str = shift;
- my $colnum = 1;
+ my $str = shift;
+ my $colnum = 1;
- my @widths = ();
- my $total = 0;
- my $output = '';
+ my @widths = ();
+ my $total = 0;
+ my $output = '';
+
+ my $gutters;
+ my $content_width;
+ my $total_width;
+ my @num_cache;
$str =~ /^(\s+)/;
my $ws = $1;
@@ -43,12 +48,31 @@ sub rel2abs {
push @widths, $1;
}
- my $unit = ($table_width - ($#widths * $gutter_width)) / ($total);
+ msg("!!! WARNING: Total Percent > 100%: $total%") if $total > 100;
+
+ if (! $total) {
+ die 'Something bad has happened - the script believes that there are no columns';
+ }
+
+ $gutters = $#widths * $gutter_width;
+ $content_width = $table_width - $gutters;
+ # Don't forget that $#... is the last offset not the count
foreach (@widths) {
- $output .= $ws . '<colspec colnum="'. $colnum .'" colwidth="'. sprintf ("%0.2f", $_ * $unit) .'cm" />' . "\n";
+ my $temp = sprintf ("%0.2f", $_/100 * $content_width);
+ $total_width += $temp;
+
+ if ($total_width > $content_width) {
+ $temp -= $total_width - $content_width;
+ msg("!!! WARNING: Column width reduced from " .
+ ($temp + ($total_width - $content_width)) . " to $temp !!!");
+ $total_width -= $total_width - $content_width;
+ }
+
+ $output .= $ws . '<colspec colnum="'. $colnum .'" colwidth="'. $temp .'cm" />' . "\n";
++$colnum;
+ push @num_cache, $temp;
}
-
+
return $output . "\n$ws";
}
diff --git a/Docs/Support/trivial-makeinfo-4.0c.patch b/Docs/Support/trivial-makeinfo-4.0c.patch
new file mode 100644
index 00000000000..b2446c0e8bb
--- /dev/null
+++ b/Docs/Support/trivial-makeinfo-4.0c.patch
@@ -0,0 +1,11 @@
+--- alt-multi.c Sun Apr 14 10:03:19 2002
++++ multi.c Tue May 22 20:52:33 2001
+@@ -287,7 +287,7 @@
+ && *params != '\n' && *params != '@')
+ params++;
+ setup_output_environment (i,
+- (int) ((columnfrac * 100.00) + 0.49));
++ (int) (columnfrac * (fill_column - current_indent) + .5));
+ }
+ }
+
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 04289f7098a..110df971115 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -14205,9 +14205,10 @@ system supports the @code{mlockall()} system call (like Solaris). This
may help if you have a problem where the operating system is causing
@code{mysqld} to swap on disk.
-@item --myisam-recover [=option[,option...]]] where option is any combination
+@item --myisam-recover [=option[,option...]]]
+Option is any combination
of @code{DEFAULT}, @code{BACKUP}, @code{FORCE} or @code{QUICK}. You can
-also set this explicitely to @code{""} if you want to disable this
+also set this explicitly to @code{""} if you want to disable this
option. If this option is used, @code{mysqld} will on open check if the
table is marked as crashed or if if the table wasn't closed properly.
(The last option only works if you are running with
@@ -14339,7 +14340,7 @@ Option can be any combination of: @code{REAL_AS_FLOAT},
By specifying all of the above options is same as using --ansi.
With this option one can turn on only needed SQL modes. @xref{ANSI mode}.
-@item transaction-isolation= @{ READ-UNCOMMITTED | READ-COMMITTED | REPEATABLE-READ | SERIALIZABLE @}
+@item --transaction-isolation= @{ READ-UNCOMMITTED | READ-COMMITTED | REPEATABLE-READ | SERIALIZABLE @}
Sets the default transaction isolation level. @xref{SET TRANSACTION}.
@item -t, --tmpdir=path
@@ -17661,7 +17662,7 @@ Some things reported by check table, can't be corrected automatically:
This means that you have in the table a row where the
@code{auto_increment} index column contains the value 0.
(It's possible to create a row where the auto_increment column is 0 by
-explicitely setting the column to 0 with an @code{UPDATE} statement)
+explicitly setting the column to 0 with an @code{UPDATE} statement)
This isn't an error in itself, but could cause trouble if you decide to
dump the table and restore it or do an @code{ALTER TABLE} on the
@@ -18022,7 +18023,7 @@ temporary files should be very big.
Directory where character sets are stored.
@item --set-character-set=name
Change the character set used by the index
-@item .t or --tmpdir=path
+@item -t or --tmpdir=path
Path for storing temporary files. If this is not set, @code{myisamchk} will
use the environment variable @code{TMPDIR} for this.
@item -q or --quick
@@ -18434,9 +18435,9 @@ and the server, because the server does all the work when you use
the performance of a table:
@itemize
-@item -S, --sort-index
-@item -R index_num, --sort-records=index_num
-@item -a, --analyze
+@item @code{-S}, @code{--sort-index}
+@item @code{-R index_num}, @code{--sort-records=index_num}
+@item @code{-a}, @code{--analyze}
@end itemize
For a full description of the option. @xref{myisamchk syntax}.
@@ -20267,7 +20268,7 @@ old @code{mysql_escape_string()} function, except that it takes the @code{MYSQL}
connection handle as the first parameter.
If the client is compiled with different paths than where the server is
-installed and the user who configured MySQL didn't included all
+installed and the user who configured MySQL didn't include all
character sets in the MySQL binary, one must specify for
the client where it can find the additional character sets it will need
if the server runs with a different character set than the client.
@@ -20279,8 +20280,8 @@ One can specify this by putting in a MySQL option file:
character-sets-dir=/usr/local/mysql/share/mysql/charsets
@end example
-where the path points to where the dynamic MySQL character sets
-are stored.
+where the path points to the directory in which the dynamic MySQL character
+sets are stored.
One can force the client to use specific character set by specifying:
@@ -20784,7 +20785,7 @@ Most of the options to @code{safe_mysqld} are the same as the options to
@code{safe_mysqld} supports the following options:
-@itemize
+@table @code
@item --basedir=path
@item --core-file-size=#
Size of the core file @code{mysqld} should be able to create. Passed to @code{ulimit -c}.
@@ -20811,7 +20812,7 @@ Number of files @code{mysqld} should be able to open. Passed to @code{ulimit -n}
@item --timezone=#
Set the timezone (the @code{TZ}) variable to the value of this parameter.
@item --user=#
-@end itemize
+@end table
The @code{safe_mysqld} script is written so that it normally is able to start
a server that was installed from either a source or a binary version of
@@ -20891,7 +20892,7 @@ list. Anything after a white space is ignored.
@code{mysqld_multi} supports the following options:
-@itemize
+@table @code
@cindex config-file option
@item --config-file=...
Alternative config file. Note: This will not affect this program's own
@@ -20936,7 +20937,7 @@ MySQL user for @code{mysqladmin}.
@cindex version option
@item --version
Print the version number and exit.
-@end itemize
+@end table
Some notes about @code{mysqld_multi}:
@@ -21109,7 +21110,7 @@ file. It is permissible to omit the @file{.MYI} extension.
@code{myisampack} supports the following options:
-@itemize @bullet
+@table @code
@item -b, --backup
Make a backup of the table as @code{tbl_name.OLD}.
@@ -21163,7 +21164,7 @@ Wait and retry if table is in use. If the @code{mysqld} server was
invoked with the @code{--skip-locking} option, it is not a good idea to
invoke @code{myisampack} if the table might be updated during the
packing process.
-@end itemize
+@end table
@cindex examples, compressed tables
The sequence of commands shown below illustrates a typical table compression
@@ -34921,7 +34922,7 @@ column in a table, the default value is the current date and time.
@item
For string types other than @code{ENUM}, the default value is the empty
string. For @code{ENUM}, the default is the first enumeration value (if
-you haven't explicitely specified another default value with the
+you haven't explicitly specified another default value with the
@code{DEFAULT} directive).
@end itemize
@@ -36328,6 +36329,8 @@ Following are some performance data for the query cache
@item
If you want to disable the query cache code set @code{query_cache_size=0}.
By disabling the query cache code there is no noticeable overhead.
+(query cache can be excluded from code with help of configure option
+@code{--without-query-cache})
@item
If all of the queries you're preforming are simple (such as selecting a
row from a table with one row); but still differ so that the queries can
@@ -36735,7 +36738,7 @@ The following options to @code{mysqld} can be used to change the behavior of
@multitable @columnfractions .40 .60
@item @strong{Option} @tab @strong{Description}
-@item @code{--myisam-recover=#} @tab Automatic recover of crashed tables.
+@item @code{--myisam-recover=#} @tab Automatic recovery of crashed tables.
@item @code{-O myisam_sort_buffer_size=#} @tab Buffer used when recovering tables.
@item @code{--delay-key-write-for-all-tables} @tab Don't flush key buffers between writes for any MyISAM table
@item @code{-O myisam_max_extra_sort_file_size=#} @tab Used to help MySQL to decide when to use the slow but safe key cache index create method. @strong{Note} that this parameter is given in megabytes!
@@ -47526,8 +47529,8 @@ The following are a list of the limitations with @code{TEMPORARY TABLES}.
@itemize @bullet
@item
-A temporary table can only be of type @code{HEAP}, @code{ISAM} or
-@code{MyISAM}.
+A temporary table can only be of type @code{HEAP}, @code{ISAM},
+@code{MyISAM} or @code{InnoDB}.
@item
You can't use temporary tables more than once in the same query.
For example, the following doesn't work.
@@ -48921,7 +48924,9 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
-Strategy of memory allocation of 'root memory' is changed. Block size grow
+New configure option --without-query-cache.
+@item
+Memory allocation strategy for 'root memory' changed. Block size now grows
with number of allocated blocks.
@item
@code{INET_NTOA()} now returns @code{NULL} if you give it a too big argument.
diff --git a/client/mysql.cc b/client/mysql.cc
index 2a09abc13b8..78d071888be 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -41,7 +41,7 @@
#include <signal.h>
#include <violite.h>
-const char *VER= "12.1";
+const char *VER= "12.2";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
@@ -120,7 +120,7 @@ typedef enum enum_info_type INFO_TYPE;
static MYSQL mysql; /* The connection */
static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
- no_rehash=0,skip_updates=0,safe_updates=0,one_database=0,
+ rehash=1,skip_updates=0,safe_updates=0,one_database=0,
opt_compress=0, using_opt_local_infile=0,
vertical=0, line_numbers=1, column_names=1,opt_html=0,
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
@@ -439,8 +439,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0},
{"auto-rehash", OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
- (gptr*) &no_rehash, (gptr*) &no_rehash, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
- 0},
+ (gptr*) &rehash, (gptr*) &rehash, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-auto-rehash", 'A',
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options depricated; use --disable-auto-rehash instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -647,6 +646,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
current_prompt=my_strdup(optarg,MYF(MY_FAE));
break;
+ case 'A':
+ rehash= 0;
+ break;
case 'b':
opt_nobeep = 1;
break;
@@ -1165,7 +1167,7 @@ static char *new_command_generator(char *text,int state)
/* Build up the completion hash */
-static void build_completion_hash(bool skip_rehash,bool write_info)
+static void build_completion_hash(bool rehash, bool write_info)
{
COMMANDS *cmd=commands;
MYSQL_RES *databases=0,*tables=0;
@@ -1191,7 +1193,7 @@ static void build_completion_hash(bool skip_rehash,bool write_info)
add_word(&ht,(char*) cmd->name);
cmd++;
}
- if (skip_rehash)
+ if (!rehash)
DBUG_VOID_RETURN;
/* Free old used memory */
@@ -1330,7 +1332,7 @@ static int reconnect(void)
{
put_info("No connection. Trying to reconnect...",INFO_INFO);
(void) com_connect((String *) 0, 0);
- if(!no_rehash) com_rehash(NULL, NULL);
+ if(rehash) com_rehash(NULL, NULL);
}
if (!connected)
return put_info("Can't connect to the server\n",INFO_ERROR);
@@ -2013,7 +2015,7 @@ com_rehash(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
#ifdef HAVE_READLINE
- build_completion_hash(0,0);
+ build_completion_hash(1, 0);
#endif
return 0;
}
@@ -2057,7 +2059,7 @@ static int
com_connect(String *buffer, char *line)
{
char *tmp,buff[256];
- bool save_rehash=no_rehash;
+ bool save_rehash= rehash;
int error;
if (buffer)
@@ -2079,13 +2081,13 @@ com_connect(String *buffer, char *line)
}
}
else
- no_rehash=1; // Quick re-connect
+ rehash= 0; // Quick re-connect
buffer->length(0); // command used
}
else
- no_rehash=1;
+ rehash= 0;
error=sql_connect(current_host,current_db,current_user,opt_password,0);
- no_rehash=save_rehash;
+ rehash= save_rehash;
if (connected)
{
@@ -2193,7 +2195,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
current_db=my_strdup(tmp,MYF(MY_WME));
#ifdef HAVE_READLINE
- build_completion_hash(no_rehash,1);
+ build_completion_hash(rehash, 1);
#endif
}
}
@@ -2251,7 +2253,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
connected=1;
mysql.reconnect=info_flag ? 1 : 0; // We want to know if this happens
#ifdef HAVE_READLINE
- build_completion_hash(no_rehash,1);
+ build_completion_hash(rehash, 1);
#endif
return 0;
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index b1c4707e211..447499c64e9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -35,7 +35,7 @@
** and adapted to mysqldump 05/11/01 by Jani Tolonen
*/
-#define DUMP_VERSION "9.00"
+#define DUMP_VERSION "9.01"
#include <my_global.h>
#include <my_sys.h>
@@ -257,7 +257,6 @@ static void print_version(void)
static void usage(void)
{
- uint i;
print_version();
puts("By Igor Romanenko, Monty, Jani & Sinisa");
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");
@@ -1421,8 +1420,8 @@ int main(int argc, char **argv)
return(first_error);
}
}
- if(mysql_query(sock, "set sql_query_cache_type=off") && verbose)
- fprintf(stderr, "-- can't take off query cache (not supported).\n");
+ if(mysql_query(sock, "SET SQL_QUERY_CACHE_TYPE=OFF") && verbose)
+ fprintf(stderr, "-- Can't disable query cache (not supported).\n");
if (opt_alldbs)
dump_all_databases();
/* Only one database and selected table(s) */
diff --git a/configure.in b/configure.in
index 9649160393a..77a53a3c099 100644
--- a/configure.in
+++ b/configure.in
@@ -1823,7 +1823,7 @@ AC_ARG_WITH(embedded-server,
)
AC_ARG_WITH(query_cache,
- [ --without-query-cache Don not build query cache in embedded server.],
+ [ --without-query-cache Do not build query cache.],
[with_query_cache=$withval],
[with_query_cache=yes]
)
diff --git a/include/my_global.h b/include/my_global.h
index 2b5c6915ad9..01910eb1342 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1023,12 +1023,4 @@ typedef union {
#define C_MODE_END
#endif
-/*
- Now if query is taken off then tests with query cache fails
- SANJA TODO: remove this when problem with mysql-test will be solved
-*/
-#if defined(MYSQL_SERVER) && !defined(HAVE_QUERY_CACHE)
-#define HAVE_QUERY_CACHE
-#endif
-
#endif /* _global_h */
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index 10bd29e25e3..cbeb4e2c5e5 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -165,7 +165,7 @@ static struct my_option my_long_options[] =
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{"check-only-changed", 'C',
- "Check only tables that has changed since last check.", 0, 0, 0, GET_NO_ARG,
+ "Check only tables that have changed since last check.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"correct-checksum", OPT_CORRECT_CHECKSUM,
"Correct checksum information for table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
@@ -183,7 +183,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0},
{"extend-check", 'e',
"Try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option if you are not totally desperate.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"fast", 'F', "Check only tables that hasn't been closed properly.", 0, 0, 0,
+ {"fast", 'F', "Check only tables that haven't been closed properly.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
"Restart with -r if there are any errors in the table. States will be updated as with --update-state.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0,
@@ -220,7 +220,7 @@ static struct my_option my_long_options[] =
"Change the character set used by the index", 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
- "Change the value of a variable. Please note that this option is depricated; you can set variables directly with --variable-name=value.",
+ "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's',
"Only print errors. One can use two -s to make myisamchk very silent.", 0,
@@ -322,9 +322,9 @@ static void usage(void)
-e, --extend-check Check the table VERY throughly. Only use this in\n\
extreme cases as myisamchk should normally be able to\n\
find out if the table is ok even without this switch\n\
- -F, --fast Check only tables that hasn't been closed properly\n\
+ -F, --fast Check only tables that haven't been closed properly\n\
-C, --check-only-changed\n\
- Check only tables that has changed since last check\n\
+ Check only tables that have changed since last check\n\
-f, --force Restart with -r if there are any errors in the table.\n\
States will be updated as with --update-state\n\
-i, --information Print statistics information about table that is checked\n\
@@ -733,7 +733,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
raid_chunks=share->base.raid_chunks;
/*
- Skipp the checking of the file if:
+ Skip the checking of the file if:
We are using --fast and the table is closed properly
We are using --check-only-changed-tables and the table hasn't changed
*/
diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl000014.result
index ded11a9bb95..c9926c92a4f 100644
--- a/mysql-test/r/rpl000014.result
+++ b/mysql-test/r/rpl000014.result
@@ -8,7 +8,7 @@ File Position Binlog_do_db Binlog_ignore_db
master-bin.001 79
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124
+127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 128
change master to master_log_pos=73;
slave stop;
change master to master_log_pos=73;
diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
index 70fbe32845d..f5885085dee 100644
--- a/mysql-test/r/rpl_log.result
+++ b/mysql-test/r/rpl_log.result
@@ -75,7 +75,7 @@ slave-bin.002 115 Query 1 62 use test; insert into t1 values (1)
slave-bin.002 175 Query 1 122 use test; drop table t1
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 920
+127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 924
show new master for slave with master_log_file='master-bin.001' and
master_log_pos=4 and master_server_id=1;
Log_name Log_pos
diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test
index 065671476a0..21d30420eaf 100644
--- a/mysql-test/t/innodb_cache.test
+++ b/mysql-test/t/innodb_cache.test
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
+-- source include/have_query_cache.inc
#
# Without auto_commit.
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 99f0a463a42..3f57d12559d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -227,6 +227,11 @@ SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
#endif
bool opt_skip_slave_start = 0; // If set, slave is not autostarted
+
+/* if set, some standard measures to enforce
+ slave data intergity will not be performed
+ */
+bool opt_reckless_slave = 0;
static bool opt_do_pstack = 0;
static ulong opt_specialflag=SPECIAL_ENGLISH;
static ulong back_log,connect_timeout,concurrency;
@@ -291,8 +296,9 @@ ulong keybuff_size,sortbuff_size,max_item_sort_length,table_cache_size,
ulong com_stat[(uint) SQLCOM_END], com_other;
ulong slave_net_timeout;
ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0;
+ulong query_cache_size=0;
#ifdef HAVE_QUERY_CACHE
-ulong query_cache_size=0, query_cache_limit=0, query_cache_startup_type=1;
+ulong query_cache_limit=0, query_cache_startup_type=1;
Query_cache query_cache;
#endif
@@ -2740,6 +2746,7 @@ enum options {
OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE,
+ OPT_RECKLESS_SLAVE,
OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA,
OPT_SSL_CAPATH, OPT_SSL_CIPHER
};
@@ -2850,6 +2857,7 @@ static struct option long_options[] = {
#endif
{"pid-file", required_argument, 0, (int) OPT_PID_FILE},
{"port", required_argument, 0, 'P'},
+ {"reckless-slave", no_argument, 0, (int) OPT_RECKLESS_SLAVE},
{"replicate-do-db", required_argument, 0, (int) OPT_REPLICATE_DO_DB},
{"replicate-do-table", required_argument, 0,
(int) OPT_REPLICATE_DO_TABLE},
@@ -3048,8 +3056,10 @@ CHANGEABLE_VAR changeable_vars[] = {
#ifdef HAVE_QUERY_CACHE
{ "query_cache_limit", (long*) &query_cache_limit,
1024*1024L, 0, ULONG_MAX, 0, 1},
+#endif /*HAVE_QUERY_CACHE*/
{ "query_cache_size", (long*) &query_cache_size,
0, 0, ULONG_MAX, 0, 1},
+#ifdef HAVE_QUERY_CACHE
{ "query_cache_startup_type",(long*) &query_cache_startup_type,
1, 0, 2, 0, 1},
#endif /*HAVE_QUERY_CACHE*/
@@ -3938,6 +3948,10 @@ static void get_options(int argc,char **argv)
opt_slow_log=1;
opt_slow_logname=optarg;
break;
+ case (int)OPT_RECKLESS_SLAVE:
+ opt_reckless_slave = 1;
+ init_slave_skip_errors("all");
+ break;
case (int)OPT_SKIP_SLAVE_START:
opt_skip_slave_start = 1;
break;
diff --git a/sql/slave.cc b/sql/slave.cc
index 25b29732000..045ba57d8c7 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -191,11 +191,22 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,
pos = rli->relay_log_pos; // already inited
else
rli->relay_log_pos = pos;
- if (rli->relay_log.find_first_log(&rli->linfo,log))
+
+ // test to see if the previous run was with the skip of purging
+ // if yes, we do not purge when we restart
+ if (rli->relay_log.find_first_log(&rli->linfo,""))
{
*errmsg="Could not find first log during relay log initialization";
goto err;
}
+ if (strcmp(log,rli->linfo.log_file_name))
+ rli->skip_log_purge=1;
+
+ if (rli->relay_log.find_first_log(&rli->linfo,log))
+ {
+ *errmsg="Could not find target log during relay log initialization";
+ goto err;
+ }
strnmov(rli->relay_log_name,rli->linfo.log_file_name,
sizeof(rli->relay_log_name));
// to make end_io_cache(&rli->cache_buf) safe in all cases
@@ -2497,6 +2508,15 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
return ev;
}
DBUG_ASSERT(thd==rli->sql_thd);
+ if (opt_reckless_slave)
+ cur_log->error = 0;
+ if ( cur_log->error < 0)
+ {
+ errmsg = "slave SQL thread aborted because of I/O error";
+ goto err;
+ }
+
+
if (!cur_log->error) /* EOF */
{
/*
@@ -2605,12 +2625,12 @@ event(errno=%d,cur_log->error=%d)",
my_errno,cur_log->error);
// set read position to the beginning of the event
my_b_seek(cur_log,rli->relay_log_pos+rli->pending);
- // no need to hog the mutex while we sleep
- pthread_mutex_unlock(&rli->data_lock);
- safe_sleep(rli->sql_thd,1,(CHECK_KILLED_FUNC)sql_slave_killed,
- (void*)rli);
- pthread_mutex_lock(&rli->data_lock);
+ /* otherwise, we have had a partial read */
+ /* TODO; see if there is a way to do this without this goto */
+ errmsg = "Aborting slave SQL thread because of partial event read";
+ goto err;
}
+
}
if (!errmsg && was_killed)
errmsg = "slave SQL thread was killed";
diff --git a/sql/slave.h b/sql/slave.h
index 354fc46e99d..b70ca6f6d00 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -30,7 +30,7 @@ extern bool use_slave_mask;
extern char* slave_load_tmpdir;
extern my_string master_info_file,relay_log_info_file;
extern my_string opt_relay_logname, opt_relaylog_index_name;
-extern bool opt_skip_slave_start;
+extern bool opt_skip_slave_start, opt_reckless_slave;
extern ulong relay_log_space_limit;
struct st_master_info;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 8012768e508..63bfb217b52 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -613,7 +613,7 @@ query:
thd->lex.sql_command = SQLCOM_EMPTY_QUERY;
}
}
- | verb_clause END_OF_INPUT {}
+ | verb_clause END_OF_INPUT {};
verb_clause:
alter
@@ -651,7 +651,7 @@ verb_clause:
| handler
| unlock
| update
- | use
+ | use;
/* change master */
@@ -661,12 +661,12 @@ change:
LEX *lex = Lex;
lex->sql_command = SQLCOM_CHANGE_MASTER;
memset(&lex->mi, 0, sizeof(lex->mi));
- } master_defs
+ } master_defs;
master_defs:
master_def
|
- master_defs ',' master_def
+ master_defs ',' master_def;
master_def:
MASTER_HOST_SYM EQ TEXT_STRING
@@ -712,7 +712,7 @@ master_def:
RELAY_LOG_POS_SYM EQ ULONG_NUM
{
Lex->mi.relay_log_pos = $3;
- }
+ };
/* create a table */
@@ -773,11 +773,11 @@ create:
LEX *lex=Lex;
lex->udf.returns=(Item_result) $7;
lex->udf.dl=$9.str;
- }
+ };
create2:
'(' field_list ')' opt_create_table_options create3 {}
- | opt_create_table_options create3 {}
+ | opt_create_table_options create3 {};
create3:
/* empty */ {}
@@ -787,34 +787,34 @@ create3:
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
mysql_init_select(lex);
}
- select_options select_item_list opt_select_from union {}
+ select_options select_item_list opt_select_from union {};
opt_as:
/* empty */ {}
- | AS {}
+ | AS {};
opt_table_options:
/* empty */ { $$= 0; }
- | table_options { $$= $1;}
+ | table_options { $$= $1;};
table_options:
table_option { $$=$1; }
- | table_option table_options { $$= $1 | $2; }
+ | table_option table_options { $$= $1 | $2; };
table_option:
- TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; }
+ TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; };
opt_if_not_exists:
/* empty */ { $$= 0; }
- | IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }
+ | IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; };
opt_create_table_options:
/* empty */
- | create_table_options
+ | create_table_options;
create_table_options:
create_table_option
- | create_table_option create_table_options
+ | create_table_option create_table_options;
create_table_option:
TYPE_SYM EQ table_types { Lex->create_info.db_type= $3; }
@@ -847,7 +847,7 @@ create_table_option:
}
| INSERT_METHOD EQ merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM EQ TEXT_STRING { Lex->create_info.data_file_name= $4.str; }
- | INDEX DIRECTORY_SYM EQ TEXT_STRING { Lex->create_info.index_file_name= $4.str; }
+ | INDEX DIRECTORY_SYM EQ TEXT_STRING { Lex->create_info.index_file_name= $4.str; };
table_types:
ISAM_SYM { $$= DB_TYPE_ISAM; }
@@ -855,40 +855,40 @@ table_types:
| MERGE_SYM { $$= DB_TYPE_MRG_MYISAM; }
| HEAP_SYM { $$= DB_TYPE_HEAP; }
| BERKELEY_DB_SYM { $$= DB_TYPE_BERKELEY_DB; }
- | INNOBASE_SYM { $$= DB_TYPE_INNODB; }
+ | INNOBASE_SYM { $$= DB_TYPE_INNODB; };
row_types:
DEFAULT { $$= ROW_TYPE_DEFAULT; }
| FIXED_SYM { $$= ROW_TYPE_FIXED; }
| DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
- | COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
+ | COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; };
raid_types:
RAID_STRIPED_SYM { $$= RAID_TYPE_0; }
| RAID_0_SYM { $$= RAID_TYPE_0; }
- | ULONG_NUM { $$=$1;}
+ | ULONG_NUM { $$=$1;};
merge_insert_types:
NO_SYM { $$= MERGE_INSERT_DISABLED; }
| FIRST_SYM { $$= MERGE_INSERT_TO_FIRST; }
- | LAST_SYM { $$= MERGE_INSERT_TO_LAST; }
+ | LAST_SYM { $$= MERGE_INSERT_TO_LAST; };
opt_select_from:
/* empty */
- | select_from select_lock_type
+ | select_from select_lock_type;
udf_func_type:
/* empty */ { $$ = UDFTYPE_FUNCTION; }
- | AGGREGATE_SYM { $$ = UDFTYPE_AGGREGATE; }
+ | AGGREGATE_SYM { $$ = UDFTYPE_AGGREGATE; };
udf_type:
STRING_SYM {$$ = (int) STRING_RESULT; }
| REAL {$$ = (int) REAL_RESULT; }
- | INT_SYM {$$ = (int) INT_RESULT; }
+ | INT_SYM {$$ = (int) INT_RESULT; };
field_list:
field_list_item
- | field_list ',' field_list_item
+ | field_list ',' field_list_item;
field_list_item:
@@ -910,11 +910,11 @@ field_list_item:
| opt_constraint CHECK_SYM '(' expr ')'
{
Lex->col_list.empty(); /* Alloced by sql_alloc */
- }
+ };
opt_constraint:
/* empty */
- | CONSTRAINT opt_ident
+ | CONSTRAINT opt_ident;
field_spec:
field_ident
@@ -932,7 +932,7 @@ field_spec:
lex->default_value,lex->change,
lex->interval))
YYABORT;
- }
+ };
type:
int_type opt_len field_options { Lex->length=$2; $$=$1; }
@@ -991,73 +991,73 @@ type:
LEX *lex=Lex;
lex->interval=typelib(lex->interval_list);
$$=FIELD_TYPE_SET;
- }
+ };
char:
CHAR_SYM {}
| NCHAR_SYM {}
- | NATIONAL_SYM CHAR_SYM {}
+ | NATIONAL_SYM CHAR_SYM {};
varchar:
char VARYING {}
| VARCHAR {}
| NATIONAL_SYM VARCHAR {}
- | NCHAR_SYM VARCHAR {}
+ | NCHAR_SYM VARCHAR {};
int_type:
INT_SYM { $$=FIELD_TYPE_LONG; }
| TINYINT { $$=FIELD_TYPE_TINY; }
| SMALLINT { $$=FIELD_TYPE_SHORT; }
| MEDIUMINT { $$=FIELD_TYPE_INT24; }
- | BIGINT { $$=FIELD_TYPE_LONGLONG; }
+ | BIGINT { $$=FIELD_TYPE_LONGLONG; };
real_type:
REAL { $$= current_thd->sql_mode & MODE_REAL_AS_FLOAT ?
FIELD_TYPE_FLOAT : FIELD_TYPE_DOUBLE; }
| DOUBLE_SYM { $$=FIELD_TYPE_DOUBLE; }
- | DOUBLE_SYM PRECISION { $$=FIELD_TYPE_DOUBLE; }
+ | DOUBLE_SYM PRECISION { $$=FIELD_TYPE_DOUBLE; };
float_options:
/* empty */ {}
| '(' NUM ')' { Lex->length=$2.str; }
- | precision {}
+ | precision {};
precision:
'(' NUM ',' NUM ')'
{
LEX *lex=Lex;
lex->length=$2.str; lex->dec=$4.str;
- }
+ };
field_options:
/* empty */ {}
- | field_opt_list {}
+ | field_opt_list {};
field_opt_list:
field_opt_list field_option {}
- | field_option {}
+ | field_option {};
field_option:
SIGNED_SYM {}
| UNSIGNED { Lex->type|= UNSIGNED_FLAG;}
- | ZEROFILL { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; }
+ | ZEROFILL { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; };
opt_len:
/* empty */ { $$=(char*) 0; } /* use default length */
- | '(' NUM ')' { $$=$2.str; }
+ | '(' NUM ')' { $$=$2.str; };
opt_precision:
/* empty */ {}
- | precision {}
+ | precision {};
opt_attribute:
/* empty */ {}
- | opt_attribute_list {}
+ | opt_attribute_list {};
opt_attribute_list:
opt_attribute_list attribute {}
- | attribute
+ | attribute;
attribute:
NULL_SYM { Lex->type&= ~ NOT_NULL_FLAG; }
@@ -1066,40 +1066,40 @@ attribute:
| AUTO_INC { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; }
| PRIMARY_SYM KEY_SYM { Lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG; }
| UNIQUE_SYM { Lex->type|= UNIQUE_FLAG; }
- | UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; }
+ | UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; };
opt_binary:
/* empty */ {}
- | BINARY { Lex->type|=BINARY_FLAG; }
+ | BINARY { Lex->type|=BINARY_FLAG; };
references:
REFERENCES table_ident opt_on_delete {}
| REFERENCES table_ident '(' key_list ')' opt_on_delete
{
Lex->col_list.empty(); /* Alloced by sql_alloc */
- }
+ };
opt_on_delete:
/* empty */ {}
- | opt_on_delete_list {}
+ | opt_on_delete_list {};
opt_on_delete_list:
opt_on_delete_list opt_on_delete_item {}
- | opt_on_delete_item {}
+ | opt_on_delete_item {};
opt_on_delete_item:
ON DELETE_SYM delete_option {}
| ON UPDATE_SYM delete_option {}
| MATCH FULL {}
- | MATCH PARTIAL {}
+ | MATCH PARTIAL {};
delete_option:
RESTRICT {}
| CASCADE {}
| SET NULL_SYM {}
| NO_SYM ACTION {}
- | SET DEFAULT {}
+ | SET DEFAULT {};
key_type:
opt_constraint PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
@@ -1107,37 +1107,37 @@ key_type:
| FULLTEXT_SYM { $$= Key::FULLTEXT; }
| FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; }
| opt_constraint UNIQUE_SYM { $$= Key::UNIQUE; }
- | opt_constraint UNIQUE_SYM key_or_index { $$= Key::UNIQUE; }
+ | opt_constraint UNIQUE_SYM key_or_index { $$= Key::UNIQUE; };
key_or_index:
KEY_SYM {}
- | INDEX {}
+ | INDEX {};
keys_or_index:
KEYS {}
| INDEX {}
- | INDEXES {}
+ | INDEXES {};
opt_unique_or_fulltext:
/* empty */ { $$= Key::MULTIPLE; }
| UNIQUE_SYM { $$= Key::UNIQUE; }
- | FULLTEXT_SYM { $$= Key::FULLTEXT; }
+ | FULLTEXT_SYM { $$= Key::FULLTEXT; };
key_list:
key_list ',' key_part order_dir { Lex->col_list.push_back($3); }
- | key_part order_dir { Lex->col_list.push_back($1); }
+ | key_part order_dir { Lex->col_list.push_back($1); };
key_part:
ident { $$=new key_part_spec($1.str); }
- | ident '(' NUM ')' { $$=new key_part_spec($1.str,(uint) atoi($3.str)); }
+ | ident '(' NUM ')' { $$=new key_part_spec($1.str,(uint) atoi($3.str)); };
opt_ident:
/* empty */ { $$=(char*) 0; } /* Defaultlength */
- | field_ident { $$=$1.str; }
+ | field_ident { $$=$1.str; };
string_list:
text_string { Lex->interval_list.push_back($1); }
- | string_list ',' text_string { Lex->interval_list.push_back($3); }
+ | string_list ',' text_string { Lex->interval_list.push_back($3); };
/*
** Alter table
@@ -1167,14 +1167,14 @@ alter:
lex->alter_keys_onoff=LEAVE_AS_IS;
lex->simple_alter=1;
}
- alter_list
+ alter_list;
alter_list:
| alter_list_item
- | alter_list ',' alter_list_item
+ | alter_list ',' alter_list_item;
add_column:
- ADD opt_column { Lex->change=0; }
+ ADD opt_column { Lex->change=0; };
alter_list_item:
add_column field_list_item opt_place { Lex->simple_alter=0; }
@@ -1245,30 +1245,30 @@ alter_list_item:
lex->simple_alter=0;
}
| create_table_options { Lex->simple_alter=0; }
- | order_clause { Lex->simple_alter=0; }
+ | order_clause { Lex->simple_alter=0; };
opt_column:
/* empty */ {}
- | COLUMN_SYM {}
+ | COLUMN_SYM {};
opt_ignore:
/* empty */ { Lex->duplicates=DUP_ERROR; }
- | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; }
+ | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; };
opt_restrict:
/* empty */ {}
| RESTRICT {}
- | CASCADE {}
+ | CASCADE {};
opt_place:
/* empty */ {}
| AFTER_SYM ident { store_position_for_column($2.str); }
- | FIRST_SYM { store_position_for_column(first_keyword); }
+ | FIRST_SYM { store_position_for_column(first_keyword); };
opt_to:
/* empty */ {}
| TO_SYM {}
- | AS {}
+ | AS {};
slave:
SLAVE START_SYM slave_thread_opts
@@ -1286,7 +1286,7 @@ slave:
};
slave_thread_opts: slave_thread_opt
- | slave_thread_opts ',' slave_thread_opt
+ | slave_thread_opts ',' slave_thread_opt;
slave_thread_opt:
/*empty*/ {}
@@ -1297,7 +1297,7 @@ slave_thread_opt:
| IO_THREAD
{
Lex->slave_thd_opt|=SLAVE_IO;
- }
+ };
restore:
RESTORE_SYM table_or_tables
@@ -1307,7 +1307,7 @@ restore:
table_list FROM TEXT_STRING
{
Lex->backup_dir = $6.str;
- }
+ };
backup:
BACKUP_SYM table_or_tables
{
@@ -1316,7 +1316,7 @@ backup:
table_list TO_SYM TEXT_STRING
{
Lex->backup_dir = $6.str;
- }
+ };
repair:
REPAIR table_or_tables
@@ -1325,20 +1325,20 @@ repair:
lex->sql_command = SQLCOM_REPAIR;
lex->check_opt.init();
}
- table_list opt_mi_repair_type
+ table_list opt_mi_repair_type;
opt_mi_repair_type:
/* empty */ { Lex->check_opt.flags = T_MEDIUM; }
- | mi_repair_types {}
+ | mi_repair_types {};
mi_repair_types:
mi_repair_type {}
- | mi_repair_type mi_repair_types {}
+ | mi_repair_type mi_repair_types {};
mi_repair_type:
QUICK { Lex->check_opt.flags|= T_QUICK; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
- | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; }
+ | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; };
analyze:
ANALYZE_SYM table_or_tables
@@ -1347,7 +1347,7 @@ analyze:
lex->sql_command = SQLCOM_ANALYZE;
lex->check_opt.init();
}
- table_list opt_mi_check_type
+ table_list opt_mi_check_type;
check:
CHECK_SYM table_or_tables
@@ -1356,22 +1356,22 @@ check:
lex->sql_command = SQLCOM_CHECK;
lex->check_opt.init();
}
- table_list opt_mi_check_type
+ table_list opt_mi_check_type;
opt_mi_check_type:
/* empty */ { Lex->check_opt.flags = T_MEDIUM; }
- | mi_check_types {}
+ | mi_check_types {};
mi_check_types:
mi_check_type {}
- | mi_check_type mi_check_types {}
+ | mi_check_type mi_check_types {};
mi_check_type:
QUICK { Lex->check_opt.flags|= T_QUICK; }
| FAST_SYM { Lex->check_opt.flags|= T_FAST; }
| MEDIUM_SYM { Lex->check_opt.flags|= T_MEDIUM; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
- | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
+ | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; };
optimize:
OPTIMIZE table_or_tables
@@ -1380,25 +1380,25 @@ optimize:
lex->sql_command = SQLCOM_OPTIMIZE;
lex->check_opt.init();
}
- table_list opt_mi_check_type
+ table_list opt_mi_check_type;
rename:
RENAME table_or_tables
{
Lex->sql_command=SQLCOM_RENAME_TABLE;
}
- table_to_table_list
+ table_to_table_list;
table_to_table_list:
table_to_table
- | table_to_table_list ',' table_to_table
+ | table_to_table_list ',' table_to_table;
table_to_table:
table_ident TO_SYM table_ident
{ if (!add_table_to_list($1,NULL,1,TL_IGNORE) ||
!add_table_to_list($3,NULL,1,TL_IGNORE))
YYABORT;
- }
+ };
/*
Select : retrieve data from table
@@ -1406,12 +1406,12 @@ table_to_table:
select:
- select_init { Lex->sql_command=SQLCOM_SELECT; }
+ select_init { Lex->sql_command=SQLCOM_SELECT; };
select_init:
SELECT_SYM select_part2 { Select->braces=false; } union
|
- '(' SELECT_SYM select_part2 ')' { Select->braces=true;} union_opt
+ '(' SELECT_SYM select_part2 ')' { Select->braces=true;} union_opt;
select_part2:
@@ -1420,25 +1420,25 @@ select_part2:
lex->lock_option=TL_READ;
mysql_init_select(lex);
}
- select_options select_item_list select_into select_lock_type
+ select_options select_item_list select_into select_lock_type;
select_into:
limit_clause {}
| select_from
| opt_into select_from
- | select_from opt_into
+ | select_from opt_into;
select_from:
- FROM join_table_list where_clause group_clause having_clause opt_order_clause limit_clause procedure_clause
+ FROM join_table_list where_clause group_clause having_clause opt_order_clause limit_clause procedure_clause;
select_options:
/* empty*/
- | select_option_list
+ | select_option_list;
select_option_list:
select_option_list select_option
- | select_option
+ | select_option;
select_option:
STRAIGHT_JOIN { Select->options|= SELECT_STRAIGHT_JOIN; }
@@ -1450,14 +1450,14 @@ select_option:
| SQL_CALC_FOUND_ROWS { if (Select != &Lex->select_lex) YYABORT; Select->options|= OPTION_FOUND_ROWS; }
| SQL_NO_CACHE_SYM { if (Select != &Lex->select_lex) YYABORT; current_thd->safe_to_cache_query=0; }
| SQL_CACHE_SYM { if (Select != &Lex->select_lex) YYABORT; Select->options |= OPTION_TO_QUERY_CACHE; }
- | ALL {}
+ | ALL {};
select_lock_type:
/* empty */
| FOR_SYM UPDATE_SYM
{ if (Select != &Lex->select_lex) YYABORT; Lex->lock_option= TL_WRITE; current_thd->safe_to_cache_query=0; }
| LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
- { if (Select != &Lex->select_lex) YYABORT; Lex->lock_option= TL_READ_WITH_SHARED_LOCKS; current_thd->safe_to_cache_query=0; }
+ { if (Select != &Lex->select_lex) YYABORT; Lex->lock_option= TL_READ_WITH_SHARED_LOCKS; current_thd->safe_to_cache_query=0; };
select_item_list:
select_item_list ',' select_item
@@ -1466,7 +1466,7 @@ select_item_list:
{
if (add_item_to_list(new Item_field(NULL,NULL,"*")))
YYABORT;
- }
+ };
select_item:
@@ -1478,32 +1478,32 @@ select_item:
$2->set_name($4.str);
else if (!$2->name)
$2->set_name($1,(uint) ($3 - $1));
- }
+ };
remember_name:
- { $$=(char*) Lex->tok_start; }
+ { $$=(char*) Lex->tok_start; };
remember_end:
- { $$=(char*) Lex->tok_end; }
+ { $$=(char*) Lex->tok_end; };
select_item2:
table_wild { $$=$1; } /* table.* */
- | expr { $$=$1; }
+ | expr { $$=$1; };
select_alias:
{ $$.str=0;}
| AS ident { $$=$2; }
| AS TEXT_STRING { $$=$2; }
| ident { $$=$1; }
- | TEXT_STRING { $$=$1; }
+ | TEXT_STRING { $$=$1; };
optional_braces:
/* empty */ {}
- | '(' ')' {}
+ | '(' ')' {};
/* all possible expressions */
expr: expr_expr {$$ = $1; }
- | simple_expr {$$ = $1; }
+ | simple_expr {$$ = $1; };
/* expressions that begin with 'expr' */
expr_expr:
@@ -1543,7 +1543,7 @@ expr_expr:
| expr '+' INTERVAL_SYM expr interval
{ $$= new Item_date_add_interval($1,$4,$5,0); }
| expr '-' INTERVAL_SYM expr interval
- { $$= new Item_date_add_interval($1,$4,$5,1); }
+ { $$= new Item_date_add_interval($1,$4,$5,1); };
/* expressions that begin with 'expr' that do NOT follow IN_SYM */
no_in_expr:
@@ -1580,7 +1580,7 @@ no_in_expr:
{ $$= new Item_date_add_interval($1,$4,$5,0); }
| no_in_expr '-' INTERVAL_SYM expr interval
{ $$= new Item_date_add_interval($1,$4,$5,1); }
- | simple_expr
+ | simple_expr;
/* expressions that begin with 'expr' that does NOT follow AND */
no_and_expr:
@@ -1620,7 +1620,7 @@ no_and_expr:
{ $$= new Item_date_add_interval($1,$4,$5,0); }
| no_and_expr '-' INTERVAL_SYM expr interval
{ $$= new Item_date_add_interval($1,$4,$5,1); }
- | simple_expr
+ | simple_expr;
simple_expr:
simple_ident
@@ -1888,11 +1888,11 @@ simple_expr:
current_thd->safe_to_cache_query=0;
}
| EXTRACT_SYM '(' interval FROM expr ')'
- { $$=new Item_extract( $3, $5); }
+ { $$=new Item_extract( $3, $5); };
udf_expr_list:
/* empty */ { $$= NULL; }
- | expr_list { $$= $1;}
+ | expr_list { $$= $1;};
sum_expr:
AVG_SYM '(' in_sum_expr ')'
@@ -1916,7 +1916,7 @@ sum_expr:
| STD_SYM '(' in_sum_expr ')'
{ $$=new Item_sum_std($3); }
| SUM_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_sum($3); }
+ { $$=new Item_sum_sum($3); };
in_sum_expr:
{ Select->in_sum_expr++; }
@@ -1924,7 +1924,7 @@ in_sum_expr:
{
Select->in_sum_expr--;
$$=$2;
- }
+ };
cast_type:
BINARY { $$=ITEM_CAST_BINARY; }
@@ -1934,42 +1934,42 @@ cast_type:
| UNSIGNED INT_SYM { $$=ITEM_CAST_UNSIGNED_INT; }
| DATE_SYM { $$=ITEM_CAST_DATE; }
| TIME_SYM { $$=ITEM_CAST_TIME; }
- | DATETIME { $$=ITEM_CAST_DATETIME; }
+ | DATETIME { $$=ITEM_CAST_DATETIME; };
expr_list:
{ Select->expr_list.push_front(new List<Item>); }
expr_list2
- { $$= Select->expr_list.pop(); }
+ { $$= Select->expr_list.pop(); };
expr_list2:
expr { Select->expr_list.head()->push_back($1); }
- | expr_list2 ',' expr { Select->expr_list.head()->push_back($3); }
+ | expr_list2 ',' expr { Select->expr_list.head()->push_back($3); };
ident_list_arg:
ident_list { $$= $1; }
- | '(' ident_list ')' { $$= $2; }
+ | '(' ident_list ')' { $$= $2; };
ident_list:
{ Select->expr_list.push_front(new List<Item>); }
ident_list2
- { $$= Select->expr_list.pop(); }
+ { $$= Select->expr_list.pop(); };
ident_list2:
simple_ident { Select->expr_list.head()->push_back($1); }
- | ident_list2 ',' simple_ident { Select->expr_list.head()->push_back($3); }
+ | ident_list2 ',' simple_ident { Select->expr_list.head()->push_back($3); };
opt_expr:
/* empty */ { $$= NULL; }
- | expr { $$= $1; }
+ | expr { $$= $1; };
opt_else:
/* empty */ { $$= NULL; }
- | ELSE expr { $$= $2; }
+ | ELSE expr { $$= $2; };
when_list:
{ Select->when_list.push_front(new List<Item>); }
when_list2
- { $$= Select->when_list.pop(); }
+ { $$= Select->when_list.pop(); };
when_list2:
expr THEN_SYM expr
@@ -1983,11 +1983,11 @@ when_list2:
SELECT_LEX *sel=Select;
sel->when_list.head()->push_back($3);
sel->when_list.head()->push_back($5);
- }
+ };
opt_pad:
/* empty */ { $$=new Item_string(" ",1); }
- | expr { $$=$1; }
+ | expr { $$=$1; };
join_table_list:
'(' join_table_list ')' { $$=$2; }
@@ -2029,12 +2029,12 @@ join_table_list:
| join_table_list NATURAL RIGHT opt_outer JOIN_SYM join_table
{ add_join_natural($6,$1); $1->outer_join|=JOIN_TYPE_RIGHT; $$=$1; }
| join_table_list NATURAL JOIN_SYM join_table
- { add_join_natural($1,$4); $$=$4; }
+ { add_join_natural($1,$4); $$=$4; };
normal_join:
',' {}
| JOIN_SYM {}
- | CROSS JOIN_SYM {}
+ | CROSS JOIN_SYM {};
join_table:
{
@@ -2048,11 +2048,11 @@ join_table:
sel->ignore_index_ptr))) YYABORT;
}
| '{' ident join_table LEFT OUTER JOIN_SYM join_table ON expr '}'
- { add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; }
+ { add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; };
opt_outer:
/* empty */ {}
- | OUTER {}
+ | OUTER {};
opt_key_definition:
/* empty */ {}
@@ -2067,11 +2067,11 @@ opt_key_definition:
SELECT_LEX *sel=Select;
sel->ignore_index= *$2;
sel->ignore_index_ptr= &sel->ignore_index;
- }
+ };
key_usage_list:
key_or_index { Select->interval_list.empty(); } '(' key_usage_list2 ')'
- { $$= &Select->interval_list; }
+ { $$= &Select->interval_list; };
key_usage_list2:
key_usage_list2 ',' ident
@@ -2079,7 +2079,7 @@ key_usage_list2:
| ident
{ Select->interval_list.push_back(new String((const char*) $1.str,$1.length)); }
| PRIMARY_SYM
- { Select->interval_list.push_back(new String("PRIMARY",7)); }
+ { Select->interval_list.push_back(new String("PRIMARY",7)); };
using_list:
ident
@@ -2093,7 +2093,7 @@ using_list:
SELECT_LEX *sel=Select;
if (!($$= new Item_cond_and(new Item_func_eq(new Item_field(sel->db1,sel->table1,$3.str), new Item_field(sel->db2,sel->table2,$3.str)), $1)))
YYABORT;
- }
+ };
interval:
DAY_HOUR_SYM { $$=INTERVAL_DAY_HOUR; }
@@ -2108,22 +2108,22 @@ interval:
| MONTH_SYM { $$=INTERVAL_MONTH; }
| SECOND_SYM { $$=INTERVAL_SECOND; }
| YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; }
- | YEAR_SYM { $$=INTERVAL_YEAR; }
+ | YEAR_SYM { $$=INTERVAL_YEAR; };
table_alias:
/* empty */
| AS
- | EQ
+ | EQ;
opt_table_alias:
/* empty */ { $$=0; }
| table_alias ident
- { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); }
+ { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); };
where_clause:
/* empty */ { Select->where= 0; }
- | WHERE expr { Select->where= $2; }
+ | WHERE expr { Select->where= $2; };
having_clause:
/* empty */
@@ -2131,11 +2131,11 @@ having_clause:
{
SELECT_LEX *sel=Select;
sel->having= $3; sel->create_refs=0;
- }
+ };
opt_escape:
ESCAPE_SYM TEXT_STRING { $$= $2.str; }
- | /* empty */ { $$= (char*) "\\"; }
+ | /* empty */ { $$= (char*) "\\"; };
/*
@@ -2144,13 +2144,13 @@ opt_escape:
group_clause:
/* empty */
- | GROUP BY group_list
+ | GROUP BY group_list;
group_list:
group_list ',' order_ident order_dir
{ if (add_group_to_list($3,(bool) $4)) YYABORT; }
| order_ident order_dir
- { if (add_group_to_list($1,(bool) $2)) YYABORT; }
+ { if (add_group_to_list($1,(bool) $2)) YYABORT; };
/*
Order by statement in select
@@ -2158,7 +2158,7 @@ group_list:
opt_order_clause:
/* empty */
- | order_clause
+ | order_clause;
order_clause:
ORDER_SYM BY
@@ -2167,18 +2167,18 @@ order_clause:
if (lex->sql_command == SQLCOM_MULTI_UPDATE)
YYABORT;
lex->select->sort_default=1;
- } order_list
+ } order_list;
order_list:
order_list ',' order_ident order_dir
{ if (add_order_to_list($3,(bool) $4)) YYABORT; }
| order_ident order_dir
- { if (add_order_to_list($1,(bool) $2)) YYABORT; }
+ { if (add_order_to_list($1,(bool) $2)) YYABORT; };
order_dir:
/* empty */ { $$ = 1; }
| ASC { $$ =1; }
- | DESC { $$ =0; }
+ | DESC { $$ =0; };
limit_clause:
@@ -2193,7 +2193,7 @@ limit_clause:
{
SELECT_LEX *sel=Select;
sel->select_limit= $4; sel->offset_limit=$2;
- }
+ };
delete_limit_clause:
/* empty */
@@ -2204,20 +2204,20 @@ delete_limit_clause:
lex->select->select_limit= HA_POS_ERROR;
}
| LIMIT ulonglong_num
- { Select->select_limit= (ha_rows) $2; }
+ { Select->select_limit= (ha_rows) $2; };
ULONG_NUM:
NUM { $$= strtoul($1.str,NULL,10); }
| ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); }
| REAL_NUM { $$= strtoul($1.str,NULL,10); }
- | FLOAT_NUM { $$= strtoul($1.str,NULL,10); }
+ | FLOAT_NUM { $$= strtoul($1.str,NULL,10); };
ulonglong_num:
NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
| ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); }
| LONG_NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
| REAL_NUM { $$= strtoull($1.str,NULL,10); }
- | FLOAT_NUM { $$= strtoull($1.str,NULL,10); }
+ | FLOAT_NUM { $$= strtoull($1.str,NULL,10); };
procedure_clause:
/* empty */
@@ -2231,16 +2231,16 @@ procedure_clause:
YYABORT;
current_thd->safe_to_cache_query=0;
}
- '(' procedure_list ')'
+ '(' procedure_list ')';
procedure_list:
/* empty */ {}
- | procedure_list2 {}
+ | procedure_list2 {};
procedure_list2:
procedure_list2 ',' procedure_item
- | procedure_item
+ | procedure_item;
procedure_item:
remember_name expr
@@ -2249,7 +2249,7 @@ procedure_item:
YYABORT;
if (!$2->name)
$2->set_name($1,(uint) ((char*) Lex->tok_end - $1));
- }
+ };
opt_into:
INTO OUTFILE TEXT_STRING
@@ -2262,7 +2262,7 @@ opt_into:
{
if (!(Lex->exchange= new sql_exchange($3.str,1)))
YYABORT;
- }
+ };
/*
DO statement
@@ -2275,7 +2275,7 @@ do: DO_SYM
if (!(lex->insert_list = new List_item))
YYABORT;
}
- values
+ values;
/*
Drop : delete tables or index
*/
@@ -2309,27 +2309,27 @@ drop:
LEX *lex=Lex;
lex->sql_command = SQLCOM_DROP_FUNCTION;
lex->udf.name=$3.str;
- }
+ };
table_list:
table_name
- | table_list ',' table_name
+ | table_list ',' table_name;
table_name:
table_ident
- { if (!add_table_to_list($1,NULL,1)) YYABORT; }
+ { if (!add_table_to_list($1,NULL,1)) YYABORT; };
if_exists:
/* empty */ { $$=0; }
- | IF EXISTS { $$= 1; }
+ | IF EXISTS { $$= 1; };
/*
** Insert : add new data to table
*/
insert:
- INSERT { Lex->sql_command = SQLCOM_INSERT; } insert_lock_option opt_ignore insert2 insert_field_spec
+ INSERT { Lex->sql_command = SQLCOM_INSERT; } insert_lock_option opt_ignore insert2 insert_field_spec;
replace:
REPLACE
@@ -2338,21 +2338,21 @@ replace:
lex->sql_command = SQLCOM_REPLACE;
lex->duplicates= DUP_REPLACE;
}
- replace_lock_option insert2 insert_field_spec
+ replace_lock_option insert2 insert_field_spec;
insert_lock_option:
/* empty */ { Lex->lock_option= TL_WRITE_CONCURRENT_INSERT; }
| LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
| DELAYED_SYM { Lex->lock_option= TL_WRITE_DELAYED; }
- | HIGH_PRIORITY { Lex->lock_option= TL_WRITE; }
+ | HIGH_PRIORITY { Lex->lock_option= TL_WRITE; };
replace_lock_option:
opt_low_priority {}
- | DELAYED_SYM { Lex->lock_option= TL_WRITE_DELAYED; }
+ | DELAYED_SYM { Lex->lock_option= TL_WRITE_DELAYED; };
insert2:
INTO insert_table {}
- | insert_table {}
+ | insert_table {};
insert_table:
table_name
@@ -2361,7 +2361,7 @@ insert_table:
lex->field_list.empty();
lex->many_values.empty();
lex->insert_list=0;
- }
+ };
insert_field_spec:
opt_field_spec insert_values {}
@@ -2372,16 +2372,16 @@ insert_field_spec:
lex->many_values.push_back(lex->insert_list))
YYABORT;
}
- ident_eq_list
+ ident_eq_list;
opt_field_spec:
/* empty */ { }
| '(' fields ')' { }
- | '(' ')' { }
+ | '(' ')' { };
fields:
fields ',' insert_ident { Lex->field_list.push_back($3); }
- | insert_ident { Lex->field_list.push_back($1); }
+ | insert_ident { Lex->field_list.push_back($1); };
insert_values:
VALUES values_list {}
@@ -2393,16 +2393,17 @@ insert_values:
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
mysql_init_select(lex);
}
- select_options select_item_list select_from select_lock_type union {}
+ select_options select_item_list select_from select_lock_type
+ union {};
values_list:
values_list ',' no_braces
- | no_braces
+ | no_braces;
ident_eq_list:
ident_eq_list ',' ident_eq_value
|
- ident_eq_value
+ ident_eq_value;
ident_eq_value:
simple_ident equal expr
@@ -2411,10 +2412,10 @@ ident_eq_value:
if (lex->field_list.push_back($1) ||
lex->insert_list->push_back($3))
YYABORT;
- }
+ };
equal: EQ {}
- | SET_VAR {}
+ | SET_VAR {};
no_braces:
'('
@@ -2427,11 +2428,11 @@ no_braces:
LEX *lex=Lex;
if (lex->many_values.push_back(lex->insert_list))
YYABORT;
- }
+ };
opt_values:
/* empty */ {}
- | values
+ | values;
values:
values ',' expr
@@ -2443,7 +2444,7 @@ values:
{
if (Lex->insert_list->push_back($1))
YYABORT;
- }
+ };
/* Update rows in a table */
@@ -2456,7 +2457,7 @@ update:
lex->select->order_list.first=0;
lex->select->order_list.next= (byte**) &lex->select->order_list.first;
}
- opt_low_priority opt_ignore join_table_list SET update_list where_clause opt_order_clause delete_limit_clause
+ opt_low_priority opt_ignore join_table_list SET update_list where_clause opt_order_clause delete_limit_clause;
update_list:
update_list ',' simple_ident equal expr
@@ -2468,11 +2469,11 @@ update_list:
{
if (add_item_to_list($1) || add_value_to_list($3))
YYABORT;
- }
+ };
opt_low_priority:
/* empty */ { Lex->lock_option= current_thd->update_lock_default; }
- | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
+ | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; };
/* Delete rows from a table */
@@ -2486,7 +2487,7 @@ delete:
lex->select->order_list.first=0;
lex->select->order_list.next= (byte**) &lex->select->order_list.first;
}
- opt_delete_options single_multi {}
+ opt_delete_options single_multi {};
single_multi:
FROM table_name where_clause opt_order_clause delete_limit_clause {}
@@ -2495,11 +2496,11 @@ single_multi:
FROM join_table_list where_clause
| FROM table_wild_list
{ mysql_init_multi_delete(Lex); }
- USING join_table_list where_clause
+ USING join_table_list where_clause;
table_wild_list:
table_wild_one {}
- | table_wild_list ',' table_wild_one {}
+ | table_wild_list ',' table_wild_one {};
table_wild_one:
ident opt_wild
@@ -2511,20 +2512,20 @@ table_wild_one:
{
if (!add_table_to_list(new Table_ident($1,$3,0),NULL,1,TL_WRITE))
YYABORT;
- }
+ };
opt_wild:
/* empty */ {}
- | '.' '*' {}
+ | '.' '*' {};
opt_delete_options:
/* empty */ {}
- | opt_delete_option opt_delete_options {}
+ | opt_delete_option opt_delete_options {};
opt_delete_option:
QUICK { Select->options|= OPTION_QUICK; }
- | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
+ | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; };
truncate:
TRUNCATE_SYM opt_table_sym table_name
@@ -2535,15 +2536,15 @@ truncate:
lex->select->order_list.elements=0;
lex->select->order_list.first=0;
lex->select->order_list.next= (byte**) &lex->select->order_list.first;
- lex->lock_option= current_thd->update_lock_default; }
+ lex->lock_option= current_thd->update_lock_default; };
opt_table_sym:
/* empty */
- | TABLE_SYM
+ | TABLE_SYM;
/* Show things */
-show: SHOW { Lex->wild=0;} show_param
+show: SHOW { Lex->wild=0;} show_param;
show_param:
DATABASES wild
@@ -2637,31 +2638,31 @@ show_param:
| SLAVE STATUS_SYM
{
Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
- }
+ };
opt_db:
/* empty */ { $$= 0; }
- | from_or_in ident { $$= $2.str; }
+ | from_or_in ident { $$= $2.str; };
wild:
/* empty */
- | LIKE text_string { Lex->wild= $2; }
+ | LIKE text_string { Lex->wild= $2; };
opt_full:
/* empty */ { Lex->verbose=0; }
- | FULL { Lex->verbose=1; }
+ | FULL { Lex->verbose=1; };
from_or_in:
FROM
- | IN_SYM
+ | IN_SYM;
binlog_in:
/* empty */ { Lex->mi.log_file_name = 0; }
- | IN_SYM TEXT_STRING { Lex->mi.log_file_name = $2.str; }
+ | IN_SYM TEXT_STRING { Lex->mi.log_file_name = $2.str; };
binlog_from:
/* empty */ { Lex->mi.pos = 4; /* skip magic number */ }
- | FROM ulonglong_num { Lex->mi.pos = $2; }
+ | FROM ulonglong_num { Lex->mi.pos = $2; };
/* A Oracle compatible synonym for show */
@@ -2676,17 +2677,19 @@ describe:
YYABORT;
}
opt_describe_column
- | describe_command select { Lex->select_lex.options|= SELECT_DESCRIBE; }
+ | describe_command select
+ { Lex->select_lex.options|= SELECT_DESCRIBE; };
describe_command:
DESC
- | DESCRIBE
+ | DESCRIBE;
opt_describe_column:
/* empty */ {}
| text_string { Lex->wild= $1; }
- | ident { Lex->wild= new String((const char*) $1.str,$1.length); }
+ | ident
+ { Lex->wild= new String((const char*) $1.str,$1.length); };
/* flush things */
@@ -2697,11 +2700,11 @@ flush:
LEX *lex=Lex;
lex->sql_command= SQLCOM_FLUSH; lex->type=0;
}
- flush_options
+ flush_options;
flush_options:
flush_options ',' flush_option
- | flush_option
+ | flush_option;
flush_option:
table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list
@@ -2713,26 +2716,26 @@ flush_option:
| STATUS_SYM { Lex->type|= REFRESH_STATUS; }
| SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
- | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
+ | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; };
opt_table_list:
/* empty */ {}
- | table_list {}
+ | table_list {};
reset:
RESET_SYM
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_RESET; lex->type=0;
- } reset_options
+ } reset_options;
reset_options:
reset_options ',' reset_option
- | reset_option
+ | reset_option;
reset_option:
SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
- | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;}
+ | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;};
purge:
PURGE
@@ -2744,7 +2747,7 @@ purge:
MASTER_SYM LOGS_SYM TO_SYM TEXT_STRING
{
Lex->to_log = $6.str;
- }
+ } ;
/* kill threads */
@@ -2759,7 +2762,7 @@ kill:
}
lex->sql_command=SQLCOM_KILL;
lex->thread_id= (ulong) $2->val_int();
- }
+ };
/* change database */
@@ -2767,7 +2770,7 @@ use: USE_SYM ident
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_CHANGE_DB; lex->select->db= $2.str;
- }
+ };
/* import, export of files */
@@ -2798,30 +2801,30 @@ load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING
LOAD DATA_SYM FROM MASTER_SYM
{
Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
- }
+ };
opt_local:
/* empty */ { $$=0;}
- | LOCAL_SYM { $$=1;}
+ | LOCAL_SYM { $$=1;};
load_data_lock:
/* empty */ { Lex->lock_option= current_thd->update_lock_default; }
| CONCURRENT { Lex->lock_option= TL_WRITE_CONCURRENT_INSERT ; }
- | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
+ | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; };
opt_duplicate:
/* empty */ { Lex->duplicates=DUP_ERROR; }
| REPLACE { Lex->duplicates=DUP_REPLACE; }
- | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; }
+ | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; };
opt_field_term:
/* empty */
- | COLUMNS field_term_list
+ | COLUMNS field_term_list;
field_term_list:
field_term_list field_term
- | field_term
+ | field_term;
field_term:
TERMINATED BY text_string { Lex->exchange->field_term= $3;}
@@ -2832,31 +2835,31 @@ field_term:
lex->exchange->opt_enclosed=1;
}
| ENCLOSED BY text_string { Lex->exchange->enclosed= $3;}
- | ESCAPED BY text_string { Lex->exchange->escaped= $3;}
+ | ESCAPED BY text_string { Lex->exchange->escaped= $3;};
opt_line_term:
/* empty */
- | LINES line_term_list
+ | LINES line_term_list;
line_term_list:
line_term_list line_term
- | line_term
+ | line_term;
line_term:
TERMINATED BY text_string { Lex->exchange->line_term= $3;}
- | STARTING BY text_string { Lex->exchange->line_start= $3;}
+ | STARTING BY text_string { Lex->exchange->line_start= $3;};
opt_ignore_lines:
/* empty */
| IGNORE_SYM NUM LINES
- { Lex->exchange->skip_lines=atol($2.str); }
+ { Lex->exchange->skip_lines=atol($2.str); };
/* Common definitions */
text_literal:
TEXT_STRING { $$ = new Item_string($1.str,$1.length); }
| text_literal TEXT_STRING
- { ((Item_string*) $1)->append($2.str,$2.length); }
+ { ((Item_string*) $1)->append($2.str,$2.length); };
text_string:
TEXT_STRING { $$= new String($1.str,$1.length); }
@@ -2864,7 +2867,7 @@ text_string:
{
Item *tmp = new Item_varbinary($1.str,$1.length);
$$= tmp ? tmp->val_str((String*) 0) : (String*) 0;
- }
+ };
literal:
text_literal { $$ = $1; }
@@ -2878,7 +2881,7 @@ literal:
| HEX_NUM { $$ = new Item_varbinary($1.str,$1.length);}
| DATE_SYM text_literal { $$ = $2; }
| TIME_SYM text_literal { $$ = $2; }
- | TIMESTAMP text_literal { $$ = $2; }
+ | TIMESTAMP text_literal { $$ = $2; };
/**********************************************************************
** Createing different items.
@@ -2886,15 +2889,16 @@ literal:
insert_ident:
simple_ident { $$=$1; }
- | table_wild { $$=$1; }
+ | table_wild { $$=$1; };
table_wild:
ident '.' '*' { $$ = new Item_field(NullS,$1.str,"*"); }
| ident '.' ident '.' '*'
- { $$ = new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS : $1.str),$3.str,"*"); }
+ { $$ = new Item_field((current_thd->client_capabilities &
+ CLIENT_NO_SCHEMA ? NullS : $1.str),$3.str,"*"); };
order_ident:
- expr { $$=$1; }
+ expr { $$=$1; };
simple_ident:
ident
@@ -2916,18 +2920,19 @@ simple_ident:
{
SELECT_LEX *sel=Select;
$$ = !sel->create_refs || sel->in_sum_expr > 0 ? (Item*) new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS :$1.str),$3.str,$5.str) : (Item*) new Item_ref((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS :$1.str),$3.str,$5.str);
- }
+ };
field_ident:
ident { $$=$1;}
| ident '.' ident { $$=$3;} /* Skipp schema name in create*/
- | '.' ident { $$=$2;} /* For Delphi */
+ | '.' ident { $$=$2;} /* For Delphi */;
table_ident:
ident { $$=new Table_ident($1); }
| ident '.' ident { $$=new Table_ident($1,$3,0);}
- | '.' ident { $$=new Table_ident($2);} /* For Delphi */
+ | '.' ident { $$=new Table_ident($2);}
+ /* For Delphi */;
ident:
IDENT { $$=$1; }
@@ -2938,12 +2943,12 @@ ident:
$$.length=$1.length;
if ((lex=Lex)->next_state != STATE_END)
lex->next_state=STATE_OPERATOR_OR_IDENT;
- }
+ };
ident_or_text:
ident { $$=$1;}
| TEXT_STRING { $$=$1;}
- | LEX_HOSTNAME { $$=$1;}
+ | LEX_HOSTNAME { $$=$1;};
user:
ident_or_text
@@ -2957,7 +2962,7 @@ user:
if (!($$=(LEX_USER*) sql_alloc(sizeof(st_lex_user))))
YYABORT;
$$->user = $1; $$->host=$3;
- }
+ };
/* Keyword that we allow for identifiers */
@@ -3107,7 +3112,7 @@ keyword:
| USE_FRM {}
| VARIABLES {}
| WORK_SYM {}
- | YEAR_SYM {}
+ | YEAR_SYM {};
/* Option functions */
@@ -3122,17 +3127,17 @@ set:
lex->option_type=0;
lex->option_list.empty();
}
- option_value_list
+ option_value_list;
opt_option:
/* empty */ {}
- | OPTION {}
+ | OPTION {};
option_value_list:
option_value
| GLOBAL_SYM { Lex->option_type=1; } option_value
| LOCAL_SYM { Lex->option_type=0; } option_value
- | option_value_list ',' option_value
+ | option_value_list ',' option_value;
option_value:
set_option equal NUM
@@ -3258,13 +3263,13 @@ option_value:
push_back(new Set_option(thd->lex.option_type,
$1.str,$1.length,
item));
- }
+ };
query_cache_type:
NUM { current_thd->query_cache_type = set_zone(atoi($1.str),0,3); }
| OFF { current_thd->query_cache_type = 0; }
| ON { current_thd->query_cache_type = 1; }
- | DEMAND_SYM { current_thd->query_cache_type = 2; }
+ | DEMAND_SYM { current_thd->query_cache_type = 2; };
text_or_password:
TEXT_STRING { $$=$1.str;}
@@ -3278,7 +3283,7 @@ text_or_password:
make_scrambled_password(buff,$3.str);
$$=buff;
}
- }
+ };
set_option:
SQL_BIG_TABLES { $$= OPTION_BIG_TABLES; }
@@ -3301,7 +3306,7 @@ set_option:
| SQL_AUTO_IS_NULL { $$= OPTION_AUTO_IS_NULL; }
| SQL_SAFE_UPDATES { $$= OPTION_SAFE_UPDATES; }
| SQL_BUFFER_RESULT { $$= OPTION_BUFFER_RESULT; }
- | SQL_QUOTE_SHOW_CREATE { $$= OPTION_QUOTE_SHOW_CREATE; }
+ | SQL_QUOTE_SHOW_CREATE { $$= OPTION_QUOTE_SHOW_CREATE; };
set_isolation:
@@ -3318,16 +3323,16 @@ set_isolation:
lex->thd->session_tx_isolation= lex->tx_isolation= $2;
}
| tx_isolation
- { Lex->tx_isolation= $1; }
+ { Lex->tx_isolation= $1; };
tx_isolation:
- TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types { $$=$4; }
+ TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types { $$=$4; };
isolation_types:
READ_SYM UNCOMMITTED_SYM { $$= ISO_READ_UNCOMMITTED; }
| READ_SYM COMMITTED_SYM { $$= ISO_READ_COMMITTED; }
| REPEATABLE_SYM READ_SYM { $$= ISO_REPEATABLE_READ; }
- | SERIALIZABLE_SYM { $$= ISO_SERIALIZABLE; }
+ | SERIALIZABLE_SYM { $$= ISO_SERIALIZABLE; };
/* Lock function */
@@ -3336,28 +3341,28 @@ lock:
{
Lex->sql_command=SQLCOM_LOCK_TABLES;
}
- table_lock_list
+ table_lock_list;
table_or_tables:
TABLE_SYM
- | TABLES
+ | TABLES;
table_lock_list:
table_lock
- | table_lock_list ',' table_lock
+ | table_lock_list ',' table_lock;
table_lock:
table_ident opt_table_alias lock_option
- { if (!add_table_to_list($1,$2,0,(thr_lock_type) $3)) YYABORT; }
+ { if (!add_table_to_list($1,$2,0,(thr_lock_type) $3)) YYABORT; };
lock_option:
READ_SYM { $$=TL_READ_NO_INSERT; }
| WRITE_SYM { $$=current_thd->update_lock_default; }
| LOW_PRIORITY WRITE_SYM { $$=TL_WRITE_LOW_PRIORITY; }
- | READ_SYM LOCAL_SYM { $$= TL_READ; }
+ | READ_SYM LOCAL_SYM { $$= TL_READ; };
unlock:
- UNLOCK_SYM table_or_tables { Lex->sql_command=SQLCOM_UNLOCK_TABLES; }
+ UNLOCK_SYM table_or_tables { Lex->sql_command=SQLCOM_UNLOCK_TABLES; };
/*
@@ -3387,15 +3392,15 @@ handler:
if (!add_table_to_list($2,0,0))
YYABORT;
}
- handler_read_or_scan where_clause limit_clause { }
+ handler_read_or_scan where_clause limit_clause { };
handler_read_or_scan:
handler_scan_function { Lex->backup_dir= 0; }
- | ident handler_rkey_function { Lex->backup_dir= $1.str; }
+ | ident handler_rkey_function { Lex->backup_dir= $1.str; };
handler_scan_function:
FIRST_SYM { Lex->ha_read_mode = RFIRST; }
- | NEXT_SYM { Lex->ha_read_mode = RNEXT; }
+ | NEXT_SYM { Lex->ha_read_mode = RNEXT; };
handler_rkey_function:
FIRST_SYM { Lex->ha_read_mode = RFIRST; }
@@ -3409,14 +3414,14 @@ handler_rkey_function:
lex->ha_rkey_mode=$1;
if (!(lex->insert_list = new List_item))
YYABORT;
- } '(' values ')' { }
+ } '(' values ')' { };
handler_rkey_mode:
EQ { $$=HA_READ_KEY_EXACT; }
| GE { $$=HA_READ_KEY_OR_NEXT; }
| LE { $$=HA_READ_KEY_OR_PREV; }
| GT_SYM { $$=HA_READ_AFTER_KEY; }
- | LT { $$=HA_READ_BEFORE_KEY; }
+ | LT { $$=HA_READ_BEFORE_KEY; };
/* GRANT / REVOKE */
@@ -3430,7 +3435,7 @@ revoke:
lex->grant= lex->grant_tot_col=0;
lex->select->db=0;
}
- grant_privileges ON opt_table FROM user_list
+ grant_privileges ON opt_table FROM user_list;
grant:
GRANT
@@ -3446,16 +3451,16 @@ grant:
lex->mqh=0;
}
grant_privileges ON opt_table TO_SYM user_list
- require_clause grant_options
+ require_clause grant_options;
grant_privileges:
grant_privilege_list {}
| ALL PRIVILEGES { Lex->grant = UINT_MAX;}
- | ALL { Lex->grant = UINT_MAX;}
+ | ALL { Lex->grant = UINT_MAX;};
grant_privilege_list:
grant_privilege
- | grant_privilege_list ',' grant_privilege
+ | grant_privilege_list ',' grant_privilege;
grant_privilege:
SELECT_SYM
@@ -3478,10 +3483,10 @@ grant_privilege:
| SHUTDOWN { Lex->grant |= SHUTDOWN_ACL;}
| PROCESS { Lex->grant |= PROCESS_ACL;}
| FILE_SYM { Lex->grant |= FILE_ACL;}
- | GRANT OPTION { Lex->grant |= GRANT_ACL;}
+ | GRANT OPTION { Lex->grant |= GRANT_ACL;};
require_list: require_list_element AND require_list
-| require_list_element
+| require_list_element ;
require_list_element: SUBJECT_SYM TEXT_STRING
{
@@ -3512,7 +3517,7 @@ require_list_element: SUBJECT_SYM TEXT_STRING
YYABORT;
}
lex->ssl_cipher=$2.str;
- }
+ };
opt_table:
'*'
@@ -3558,12 +3563,12 @@ opt_table:
YYABORT;
if (lex->grant == UINT_MAX)
lex->grant = TABLE_ACLS & ~GRANT_ACL;
- }
+ };
user_list:
grant_user { if (Lex->users_list.push_back($1)) YYABORT;}
- | user_list ',' grant_user { if (Lex->users_list.push_back($3)) YYABORT;}
+ | user_list ',' grant_user { if (Lex->users_list.push_back($3)) YYABORT;};
grant_user:
@@ -3584,7 +3589,7 @@ grant_user:
| user IDENTIFIED_SYM BY PASSWORD TEXT_STRING
{ $$=$1; $1->password=$5 ; }
| user
- { $$=$1; $1->password.str=NullS; }
+ { $$=$1; $1->password.str=NullS; };
opt_column_list:
@@ -3593,11 +3598,11 @@ opt_column_list:
LEX *lex=Lex;
lex->grant |= lex->which_columns;
}
- | '(' column_list ')'
+ | '(' column_list ')';
column_list:
column_list ',' column_list_id
- | column_list_id
+ | column_list_id;
column_list_id:
ident
@@ -3616,7 +3621,7 @@ column_list_id:
point->rights |= lex->which_columns;
else
lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns));
- }
+ };
require_clause: /* empty */
@@ -3631,35 +3636,35 @@ require_clause: /* empty */
| REQUIRE_SYM X509_SYM
{
Lex->ssl_type=SSL_TYPE_X509;
- }
+ };
grant_options:
/* empty */ {}
- | WITH grant_option_list
+ | WITH grant_option_list;
grant_option_list:
grant_option_list grant_option {}
- | grant_option {}
+ | grant_option {};
grant_option:
GRANT OPTION { Lex->grant |= GRANT_ACL;}
| MAX_QUERIES_PER_HOUR EQ NUM
{
Lex->mqh=atoi($3.str);
- }
+ };
begin:
- BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work
+ BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work;
opt_work:
/* empty */ {}
- | WORK_SYM {}
+ | WORK_SYM {};
commit:
- COMMIT_SYM { Lex->sql_command = SQLCOM_COMMIT;}
+ COMMIT_SYM { Lex->sql_command = SQLCOM_COMMIT;};
rollback:
- ROLLBACK_SYM { Lex->sql_command = SQLCOM_ROLLBACK;}
+ ROLLBACK_SYM { Lex->sql_command = SQLCOM_ROLLBACK;};
/*
@@ -3669,7 +3674,7 @@ rollback:
union:
/* empty */ {}
- | union_list
+ | union_list;
union_list:
UNION_SYM union_option
@@ -3685,14 +3690,14 @@ union_list:
YYABORT;
lex->select->linkage=UNION_TYPE;
}
- select_init
+ select_init;
union_opt:
union {}
- | optional_order_or_limit {}
+ | optional_order_or_limit {};
optional_order_or_limit:
- /* emty */ {}
+ /* empty */ {}
|
{
LEX *lex=Lex;
@@ -3702,8 +3707,10 @@ optional_order_or_limit:
lex->select->linkage=NOT_A_SELECT;
lex->select->select_limit=lex->thd->default_select_limit;
}
- opt_order_clause limit_clause
+ opt_order_clause limit_clause;
union_option:
/* empty */ {}
- | ALL {Lex->union_option=1;}
+ | ALL {Lex->union_option=1;};
+
+