summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2003-06-17 16:24:31 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2003-06-17 16:24:31 +0300
commitcc7693e19f009a83e25b24568d64b390ed1106e3 (patch)
treec7ca1c850a0c582a1a071ffcc33f4402a6865992 /sql/sql_yacc.yy
parent231b0ff8dd13dc39a1ab94ed7c24b4a2d40e9c1c (diff)
parentad5c763e74821465cc8237aa39e2391239a17206 (diff)
downloadmariadb-git-cc7693e19f009a83e25b24568d64b390ed1106e3.tar.gz
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0 include/my_global.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy37
1 files changed, 34 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c011c058dc8..af0921825fc 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -135,6 +135,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token RESET_SYM
%token ROLLBACK_SYM
%token ROLLUP_SYM
+%token SAVEPOINT_SYM
%token SELECT_SYM
%token SHOW
%token SLAVE
@@ -573,7 +574,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
query verb_clause create change select do drop insert replace insert2
insert_values update delete truncate rename
show describe load alter optimize flush
- reset purge begin commit rollback slave master_def master_defs
+ reset purge begin commit rollback savepoint
+ slave master_def master_defs
repair restore backup analyze check start
field_list field_list_item field_spec kill column_def key_def
select_item_list select_item values_list no_braces
@@ -649,6 +651,7 @@ verb_clause:
| restore
| revoke
| rollback
+ | savepoint
| select
| set
| slave
@@ -706,6 +709,18 @@ master_def:
MASTER_LOG_POS_SYM EQ ulonglong_num
{
Lex->mi.pos = $3;
+ /*
+ If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it
+ instead of causing subsequent errors.
+ We need to do it in this file, because only there we know that
+ MASTER_LOG_POS has been explicitely specified. On the contrary
+ in change_master() (sql_repl.cc) we cannot distinguish between 0
+ (MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified),
+ whereas we want to distinguish (specified 0 means "read the binlog
+ from 0" (4 in fact), unspecified means "don't change the position
+ (keep the preceding value)").
+ */
+ Lex->mi.pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.pos);
}
|
MASTER_CONNECT_RETRY_SYM EQ ULONG_NUM
@@ -721,6 +736,8 @@ master_def:
RELAY_LOG_POS_SYM EQ ULONG_NUM
{
Lex->mi.relay_log_pos = $3;
+ /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */
+ Lex->mi.relay_log_pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos);
};
@@ -3398,6 +3415,7 @@ keyword:
| ROWS_SYM {}
| ROW_FORMAT_SYM {}
| ROW_SYM {}
+ | SAVEPOINT_SYM {}
| SECOND_SYM {}
| SERIALIZABLE_SYM {}
| SESSION_SYM {}
@@ -3931,8 +3949,21 @@ commit:
COMMIT_SYM { Lex->sql_command = SQLCOM_COMMIT;};
rollback:
- ROLLBACK_SYM { Lex->sql_command = SQLCOM_ROLLBACK;};
-
+ ROLLBACK_SYM
+ {
+ Lex->sql_command = SQLCOM_ROLLBACK;
+ }
+ | ROLLBACK_SYM TO_SYM SAVEPOINT_SYM ident
+ {
+ Lex->sql_command = SQLCOM_ROLLBACK_TO_SAVEPOINT;
+ Lex->savepoint_name = $4.str;
+ };
+savepoint:
+ SAVEPOINT_SYM ident
+ {
+ Lex->sql_command = SQLCOM_SAVEPOINT;
+ Lex->savepoint_name = $2.str;
+ };
/*
** UNIONS : glue selects together