1053
1047
%type <build_method> build_method
1056
query verb_clause create change select drop insert replace insert2
1050
query verb_clause create select drop insert replace insert2
1057
1051
insert_values update delete truncate rename
1058
1052
show describe load alter optimize keycache flush
1059
reset purge begin commit rollback savepoint release
1060
slave master_def master_defs master_file_def slave_until_opts
1053
begin commit rollback savepoint release
1061
1054
repair analyze check start checksum
1062
1055
field_list field_list_item field_spec kill column_def key_def
1063
1056
keycache_list assign_to_keycache
1188
CHANGE MASTER_SYM TO_SYM
1191
lex->sql_command = SQLCOM_CHANGE_MASTER;
1192
memset(&lex->mi, 0, sizeof(lex->mi));
1200
| master_defs ',' master_def
1204
MASTER_HOST_SYM EQ TEXT_STRING_sys
1206
Lex->mi.host = $3.str;
1208
| MASTER_USER_SYM EQ TEXT_STRING_sys
1210
Lex->mi.user = $3.str;
1212
| MASTER_PASSWORD_SYM EQ TEXT_STRING_sys
1214
Lex->mi.password = $3.str;
1216
| MASTER_PORT_SYM EQ ulong_num
1220
| MASTER_CONNECT_RETRY_SYM EQ ulong_num
1222
Lex->mi.connect_retry = $3;
1224
| MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal
1226
Lex->mi.heartbeat_period= (float) $3->val_real();
1227
if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
1228
Lex->mi.heartbeat_period < 0.0)
1230
char buf[sizeof(SLAVE_MAX_HEARTBEAT_PERIOD*4)];
1231
sprintf(buf, "%d seconds", SLAVE_MAX_HEARTBEAT_PERIOD);
1232
my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1234
" is negative or exceeds the maximum ",
1238
if (Lex->mi.heartbeat_period > slave_net_timeout)
1240
push_warning_printf(YYSession, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1241
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1242
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
1243
" exceeds the value of `slave_net_timeout' sec.",
1244
" A sensible value for the period should be"
1245
" less than the timeout.");
1247
if (Lex->mi.heartbeat_period < 0.001)
1249
if (Lex->mi.heartbeat_period != 0.0)
1251
push_warning_printf(YYSession, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1252
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1253
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
1254
" is less than 1 msec.",
1255
" The period is reset to zero which means"
1256
" no heartbeats will be sending");
1257
Lex->mi.heartbeat_period= 0.0;
1259
Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_DISABLE;
1261
Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_ENABLE;
1268
MASTER_LOG_FILE_SYM EQ TEXT_STRING_sys
1270
Lex->mi.log_file_name = $3.str;
1272
| MASTER_LOG_POS_SYM EQ ulonglong_num
1276
If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it
1277
instead of causing subsequent errors.
1278
We need to do it in this file, because only there we know that
1279
MASTER_LOG_POS has been explicitely specified. On the contrary
1280
in change_master() (sql_repl.cc) we cannot distinguish between 0
1281
(MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified),
1282
whereas we want to distinguish (specified 0 means "read the binlog
1283
from 0" (4 in fact), unspecified means "don't change the position
1284
(keep the preceding value)").
1286
Lex->mi.pos = cmax((uint64_t)BIN_LOG_HEADER_SIZE, Lex->mi.pos);
1288
| RELAY_LOG_FILE_SYM EQ TEXT_STRING_sys
1290
Lex->mi.relay_log_name = $3.str;
1292
| RELAY_LOG_POS_SYM EQ ulong_num
1294
Lex->mi.relay_log_pos = $3;
1295
/* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */
1296
Lex->mi.relay_log_pos = cmax((uint32_t)BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos);
1300
1171
/* create a table */
2594
SLAVE START and SLAVE STOP are deprecated. We keep them for compatibility.
2598
START_SYM SLAVE slave_thread_opts
2601
lex->sql_command = SQLCOM_SLAVE_START;
2603
/* We'll use mi structure for UNTIL options */
2604
memset(&lex->mi, 0, sizeof(lex->mi));
2605
/* If you change this code don't forget to update SLAVE START too */
2609
| STOP_SYM SLAVE slave_thread_opts
2612
lex->sql_command = SQLCOM_SLAVE_STOP;
2614
/* If you change this code don't forget to update SLAVE STOP too */
2616
| SLAVE START_SYM slave_thread_opts
2619
lex->sql_command = SQLCOM_SLAVE_START;
2621
/* We'll use mi structure for UNTIL options */
2622
memset(&lex->mi, 0, sizeof(lex->mi));
2626
| SLAVE STOP_SYM slave_thread_opts
2629
lex->sql_command = SQLCOM_SLAVE_STOP;
2635
2465
START_SYM TRANSACTION_SYM start_transaction_opts
2652
{ Lex->slave_session_opt= 0; }
2653
slave_thread_opt_list
2657
slave_thread_opt_list:
2659
| slave_thread_opt_list ',' slave_thread_opt
2664
| SQL_THREAD { Lex->slave_session_opt|=SLAVE_SQL; }
2665
| RELAY_THREAD { Lex->slave_session_opt|=SLAVE_IO; }
2670
| UNTIL_SYM slave_until_opts
2673
if (((lex->mi.log_file_name || lex->mi.pos) && (lex->mi.relay_log_name || lex->mi.relay_log_pos)) ||
2674
!((lex->mi.log_file_name && lex->mi.pos) ||
2675
(lex->mi.relay_log_name && lex->mi.relay_log_pos)))
2677
my_message(ER_BAD_SLAVE_UNTIL_COND,
2678
ER(ER_BAD_SLAVE_UNTIL_COND), MYF(0));
2686
| slave_until_opts ',' master_file_def
2690
2483
CHECKSUM_SYM table_or_tables