1014
1058
keycache_list assign_to_keycache
1015
1059
select_item_list select_item values_list no_braces
1016
1060
opt_limit_clause delete_limit_clause fields opt_values values
1017
opt_precision opt_ignore opt_column
1018
set lock unlock string_list
1019
opt_binary table_lock_list table_lock
1061
opt_precision opt_ignore opt_column opt_restrict
1062
set lock unlock string_list field_options field_option
1063
field_opt_list opt_binary table_lock_list table_lock
1020
1064
ref_list opt_match_clause opt_on_update_delete use
1021
opt_delete_options opt_delete_option varchar
1065
opt_delete_options opt_delete_option varchar nchar nvarchar
1022
1066
opt_outer table_list table_name table_alias_ref_list table_alias_ref
1023
1067
opt_option opt_place
1024
1068
opt_attribute opt_attribute_list attribute
1035
1079
opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
1036
1080
binlog_base64_event
1037
1081
init_key_options key_options key_opts key_opt key_using_alg
1038
parse_vcol_expr vcol_opt_attribute vcol_opt_attribute_list
1042
1084
%type <index_hint> index_hint_type
1043
1085
%type <num> index_hint_clause
1044
%type <filetype> data_file
1086
%type <filetype> data_or_xml
1047
1089
'-' '+' '*' '/' '%' '(' ')'
1048
',' '!' '{' '}' AND_SYM OR_SYM BETWEEN_SYM CASE_SYM
1049
THEN_SYM WHEN_SYM DIV_SYM MOD_SYM DELETE_SYM
1090
',' '!' '{' '}' '&' '|' AND_SYM OR_SYM BETWEEN_SYM CASE_SYM
1091
THEN_SYM WHEN_SYM DIV_SYM MOD_SYM AND_AND_SYM DELETE_SYM
1179
1221
Lex->mi.heartbeat_period < 0.0)
1181
1223
char buf[sizeof(SLAVE_MAX_HEARTBEAT_PERIOD*4)];
1182
sprintf(buf, "%d seconds", SLAVE_MAX_HEARTBEAT_PERIOD);
1224
my_sprintf(buf, (buf, "%d seconds", SLAVE_MAX_HEARTBEAT_PERIOD));
1183
1225
my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1185
1227
" is negative or exceeds the maximum ",
1189
1231
if (Lex->mi.heartbeat_period > slave_net_timeout)
1191
push_warning_printf(YYTHD, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1233
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
1192
1234
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1193
1235
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
1194
1236
" exceeds the value of `slave_net_timeout' sec.",
1532
1570
Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
1533
1571
Lex->alter_info.flags|= ALTER_ROW_FORMAT;
1573
| UNION_SYM opt_equal '(' opt_table_list ')'
1575
/* Move the union list to the merge_list */
1577
TABLE_LIST *table_list= lex->select_lex.get_table_list();
1578
lex->create_info.merge_list= lex->select_lex.table_list;
1579
lex->create_info.merge_list.elements--;
1580
lex->create_info.merge_list.first=
1581
(uchar*) (table_list->next_local);
1582
lex->select_lex.table_list.elements=1;
1583
lex->select_lex.table_list.next=
1584
(uchar**) &(table_list->next_local);
1585
table_list->next_local= 0;
1586
lex->create_info.used_fields|= HA_CREATE_USED_UNION;
1535
1589
| default_collation
1536
1590
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
1554
1608
Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
1555
1609
Lex->create_info.key_block_size= $3;
1611
| TRANSACTIONAL_SYM opt_equal choice
1613
Lex->create_info.used_fields|= HA_CREATE_USED_TRANSACTIONAL;
1614
Lex->create_info.transactional= $3;
1619
opt_default charset opt_equal charset_name_or_default
1621
HA_CREATE_INFO *cinfo= &Lex->create_info;
1622
if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
1623
cinfo->default_table_charset && $4 &&
1624
!my_charset_same(cinfo->default_table_charset,$4))
1626
my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
1627
"CHARACTER SET ", cinfo->default_table_charset->csname,
1628
"CHARACTER SET ", $4->csname);
1631
Lex->create_info.default_table_charset= $4;
1632
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
1559
1636
default_collation:
1724
1800
lex->column_format,
1725
1801
lex->default_value, lex->on_update_value,
1727
lex->change,&lex->interval_list,lex->charset,
1733
type opt_attribute {}
1734
| VIRTUAL_SYM type AS '(' virtual_column_func ')' vcol_opt_attribute
1736
$$=DRIZZLE_TYPE_VIRTUAL;
1737
Lex->vcol_info->set_field_type((enum enum_field_types) $2);
1743
| vcol_opt_attribute_list {}
1746
vcol_opt_attribute_list:
1747
vcol_opt_attribute_list vcol_attribute {}
1755
lex->type|= UNIQUE_FLAG;
1756
lex->alter_info.flags|= ALTER_ADD_INDEX;
1758
| UNIQUE_SYM KEY_SYM
1761
lex->type|= UNIQUE_KEY_FLAG;
1762
lex->alter_info.flags|= ALTER_ADD_INDEX;
1764
| COMMENT_SYM TEXT_STRING_sys { Lex->comment= $2; }
1767
Lex->vcol_info->set_field_stored(true);
1772
PARSE_VCOL_EXPR_SYM '(' virtual_column_func ')'
1775
"PARSE_VCOL_EXPR" can only be used by the SQL server
1776
when reading a '*.frm' file.
1777
Prevent the end user from invoking this command.
1779
if (not Lex->parse_vcol_expr)
1781
my_message(ER_SYNTAX_ERROR, ER(ER_SYNTAX_ERROR), MYF(0));
1787
virtual_column_func:
1788
remember_name expr remember_end
1790
Lex->vcol_info= new virtual_column_info();
1791
if (not Lex->vcol_info)
1793
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(virtual_column_info));
1796
uint expr_len= (uint)($3 - $1) - 1;
1797
Lex->vcol_info->expr_str.str= (char* ) sql_memdup($1 + 1, expr_len);
1798
Lex->vcol_info->expr_str.length= expr_len;
1799
Lex->vcol_info->expr_item= $2;
1803
lex->change,&lex->interval_list,lex->charset))
1807
Lex->length=(char*) 0; /* use default length */
1809
| real_type opt_precision { $$=$1; }
1809
int_type opt_len field_options { $$=$1; }
1810
| real_type opt_precision field_options { $$=$1; }
1813
Lex->length= (char*) "1";
1818
Lex->length=(char*) "1";
1823
Lex->length=(char*) "1";
1810
1826
| char '(' NUM ')' opt_binary
1812
1828
Lex->length=$3.str;
1813
$$=DRIZZLE_TYPE_VARCHAR;
1829
$$=MYSQL_TYPE_STRING;
1815
1831
| char opt_binary
1817
1833
Lex->length=(char*) "1";
1818
$$=DRIZZLE_TYPE_VARCHAR;
1834
$$=MYSQL_TYPE_STRING;
1836
| nchar '(' NUM ')' opt_bin_mod
1839
$$=MYSQL_TYPE_STRING;
1840
Lex->charset=national_charset_info;
1844
Lex->length=(char*) "1";
1845
$$=MYSQL_TYPE_STRING;
1846
Lex->charset=national_charset_info;
1848
| BINARY '(' NUM ')'
1851
Lex->charset=&my_charset_bin;
1852
$$=MYSQL_TYPE_STRING;
1856
Lex->length= (char*) "1";
1857
Lex->charset=&my_charset_bin;
1858
$$=MYSQL_TYPE_STRING;
1820
1860
| varchar '(' NUM ')' opt_binary
1822
1862
Lex->length=$3.str;
1823
$$= DRIZZLE_TYPE_VARCHAR;
1863
$$= MYSQL_TYPE_VARCHAR;
1865
| nvarchar '(' NUM ')' opt_bin_mod
1868
$$= MYSQL_TYPE_VARCHAR;
1869
Lex->charset=national_charset_info;
1825
1871
| VARBINARY '(' NUM ')'
1827
1873
Lex->length=$3.str;
1828
1874
Lex->charset=&my_charset_bin;
1829
$$= DRIZZLE_TYPE_VARCHAR;
1875
$$= MYSQL_TYPE_VARCHAR;
1877
| YEAR_SYM opt_len field_options
1878
{ $$=MYSQL_TYPE_YEAR; }
1832
{ $$=DRIZZLE_TYPE_NEWDATE; }
1880
{ $$=MYSQL_TYPE_NEWDATE; }
1834
{ $$=DRIZZLE_TYPE_TIME; }
1882
{ $$=MYSQL_TYPE_TIME; }
1837
1885
/* Unlike other types TIMESTAMP fields are NOT NULL by default */
1838
1886
Lex->type|= NOT_NULL_FLAG;
1839
$$=DRIZZLE_TYPE_TIMESTAMP;
1887
$$=MYSQL_TYPE_TIMESTAMP;
1842
{ $$=DRIZZLE_TYPE_DATETIME; }
1890
{ $$=MYSQL_TYPE_DATETIME; }
1845
1893
Lex->charset=&my_charset_bin;
1846
$$=DRIZZLE_TYPE_BLOB;
1847
Lex->length=(char*) 0; /* use default length */
1849
| TEXT_SYM opt_binary
1851
$$=DRIZZLE_TYPE_BLOB;
1852
Lex->length=(char*) 0; /* use default length */
1854
| DECIMAL_SYM float_options
1855
{ $$=DRIZZLE_TYPE_NEWDECIMAL;}
1856
| NUMERIC_SYM float_options
1857
{ $$=DRIZZLE_TYPE_NEWDECIMAL;}
1858
| FIXED_SYM float_options
1859
{ $$=DRIZZLE_TYPE_NEWDECIMAL;}
1896
| TEXT_SYM opt_len opt_binary
1897
{ $$=MYSQL_TYPE_BLOB; }
1898
| DECIMAL_SYM float_options field_options
1899
{ $$=MYSQL_TYPE_NEWDECIMAL;}
1900
| NUMERIC_SYM float_options field_options
1901
{ $$=MYSQL_TYPE_NEWDECIMAL;}
1902
| FIXED_SYM float_options field_options
1903
{ $$=MYSQL_TYPE_NEWDECIMAL;}
1861
1905
{Lex->interval_list.empty();}
1862
1906
'(' string_list ')' opt_binary
1863
{ $$=DRIZZLE_TYPE_ENUM; }
1907
{ $$=MYSQL_TYPE_ENUM; }
1909
{ Lex->interval_list.empty();}
1910
'(' string_list ')' opt_binary
1911
{ $$=MYSQL_TYPE_SET; }
1866
$$=DRIZZLE_TYPE_LONGLONG;
1867
Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG);
1914
$$=MYSQL_TYPE_LONGLONG;
1915
Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
2085
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
2087
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
2091
| BINARY { $$= &my_charset_bin; }
2094
charset_name_or_default:
2095
charset_name { $$=$1; }
2096
| DEFAULT { $$=NULL; }
2099
opt_load_data_charset:
2100
/* Empty */ { $$= NULL; }
2101
| charset charset_name_or_default { $$= $2; }
2104
old_or_new_charset_name:
2107
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) &&
2108
!($$=get_old_charset_by_name($1.str)))
2110
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
2114
| BINARY { $$= &my_charset_bin; }
2117
old_or_new_charset_name_or_default:
2118
old_or_new_charset_name { $$=$1; }
2119
| DEFAULT { $$=NULL; }
2002
2122
collation_name:
2005
2125
if (!($$=get_charset_by_name($1.str,MYF(0))))
2007
2127
my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
2134
/* empty */ { $$=NULL; }
2135
| COLLATE_SYM collation_name_or_default { $$=$2; }
2013
2138
collation_name_or_default:
2014
2139
collation_name { $$=$1; }
2015
2140
| DEFAULT { $$=NULL; }
2024
2149
/* empty */ { Lex->charset=NULL; }
2150
| ASCII_SYM opt_bin_mod { Lex->charset=&my_charset_latin1; }
2025
2151
| BYTE_SYM { Lex->charset=&my_charset_bin; }
2152
| UNICODE_SYM opt_bin_mod
2154
if (!(Lex->charset=get_charset_by_csname("ucs2",
2155
MY_CS_PRIMARY,MYF(0))))
2157
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
2161
| charset charset_name opt_bin_mod { Lex->charset=$2; }
2162
| BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; }
2026
2167
| BINARY { Lex->type|= BINCMP_FLAG; }
2171
/* empty */ { Lex->charset= NULL; }
2172
| ASCII_SYM { Lex->charset=&my_charset_latin1; }
2175
if (!(Lex->charset=get_charset_by_csname("ucs2",
2176
MY_CS_PRIMARY,MYF(0))))
2178
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
2182
| charset charset_name { Lex->charset=$2; }
2030
2186
'(' real_ulong_num
2034
2190
my_parse_error(ER(ER_SYNTAX_ERROR));
2303
2459
lex->duplicates= DUP_ERROR;
2304
2460
if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
2305
2461
TL_OPTION_UPDATING))
2307
2463
lex->alter_info.reset();
2308
2464
lex->col_list.empty();
2309
2465
lex->select_lex.init_order();
2310
2466
lex->select_lex.db=
2311
((TableList*) lex->select_lex.table_list.first)->db;
2312
memset(&lex->create_info, 0, sizeof(lex->create_info));
2467
((TABLE_LIST*) lex->select_lex.table_list.first)->db;
2468
bzero((char*) &lex->create_info,sizeof(lex->create_info));
2313
2469
lex->create_info.db_type= 0;
2314
2470
lex->create_info.default_table_charset= NULL;
2315
2471
lex->create_info.row_type= ROW_TYPE_NOT_USED;
2316
2472
lex->alter_info.reset();
2473
lex->no_write_to_binlog= 0;
2317
2474
lex->alter_info.build_method= $2;
2475
2636
if (lex->select_lex.db == NULL &&
2476
2637
lex->copy_db_to(&lex->select_lex.db, &dummy))
2480
2641
if (check_table_name($3->table.str,$3->table.length) || ($3->db.str && check_db_name(&$3->db)))
2482
2643
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
2485
2646
lex->name= $3->table;
2486
2647
lex->alter_info.flags|= ALTER_RENAME;
2488
| CONVERT_SYM TO_SYM collation_name_or_default
2649
| CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
2492
2653
THD *thd= YYTHD;
2493
$3= thd->variables.collation_database;
2654
$4= thd->variables.collation_database;
2657
if (!my_charset_same($4,$5))
2659
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
2660
$5->name, $4->csname);
2496
2664
lex->create_info.table_charset=
2497
lex->create_info.default_table_charset= $3;
2665
lex->create_info.default_table_charset= $5;
2498
2666
lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
2499
2667
HA_CREATE_USED_DEFAULT_CHARSET);
2500
2668
lex->alter_info.flags|= ALTER_CONVERT;
3217
bit_expr '+' bit_expr %prec '+'
3400
bit_expr '|' bit_expr %prec '|'
3401
{ $$= new Item_func_bit_or($1,$3); }
3402
| bit_expr '&' bit_expr %prec '&'
3403
{ $$= new Item_func_bit_and($1,$3); }
3404
| bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT
3405
{ $$= new Item_func_shift_left($1,$3); }
3406
| bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT
3407
{ $$= new Item_func_shift_right($1,$3); }
3408
| bit_expr '+' bit_expr %prec '+'
3218
3409
{ $$= new Item_func_plus($1,$3); }
3219
3410
| bit_expr '-' bit_expr %prec '-'
3220
3411
{ $$= new Item_func_minus($1,$3); }
3674
3895
{ $$=new Item_sum_avg($3); }
3675
3896
| AVG_SYM '(' DISTINCT in_sum_expr ')'
3676
3897
{ $$=new Item_sum_avg_distinct($4); }
3898
| BIT_AND '(' in_sum_expr ')'
3899
{ $$=new Item_sum_and($3); }
3900
| BIT_OR '(' in_sum_expr ')'
3901
{ $$=new Item_sum_or($3); }
3902
| BIT_XOR '(' in_sum_expr ')'
3903
{ $$=new Item_sum_xor($3); }
3677
3904
| COUNT_SYM '(' opt_all '*' ')'
3678
{ $$=new Item_sum_count(new Item_int((int32_t) 0L,1)); }
3905
{ $$=new Item_sum_count(new Item_int((int32) 0L,1)); }
3679
3906
| COUNT_SYM '(' in_sum_expr ')'
3680
3907
{ $$=new Item_sum_count($3); }
3681
3908
| COUNT_SYM '(' DISTINCT
3913
4150
left-associative joins.
3915
4152
table_ref normal_join table_ref %prec TABLE_REF_PRIORITY
3916
{ DRIZZLE_YYABORT_UNLESS($1 && ($$=$3)); }
4153
{ MYSQL_YYABORT_UNLESS($1 && ($$=$3)); }
3917
4154
| table_ref STRAIGHT_JOIN table_factor
3918
{ DRIZZLE_YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
4155
{ MYSQL_YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
3919
4156
| table_ref normal_join table_ref
3922
DRIZZLE_YYABORT_UNLESS($1 && $3);
4159
MYSQL_YYABORT_UNLESS($1 && $3);
3923
4160
/* Change the current name resolution context to a local context. */
3924
4161
if (push_new_name_resolution_context(YYTHD, $1, $3))
3926
4163
Select->parsing_place= IN_ON;
4000
4237
| table_ref RIGHT opt_outer JOIN_SYM table_ref
4003
DRIZZLE_YYABORT_UNLESS($1 && $5);
4240
MYSQL_YYABORT_UNLESS($1 && $5);
4004
4241
/* Change the current name resolution context to a local context. */
4005
4242
if (push_new_name_resolution_context(YYTHD, $1, $5))
4007
4244
Select->parsing_place= IN_ON;
4012
4249
if (!($$= lex->current_select->convert_right_join()))
4014
4251
add_join_on($$, $8);
4015
4252
Lex->pop_context();
4016
4253
Select->parsing_place= NO_MATTER;
4018
4255
| table_ref RIGHT opt_outer JOIN_SYM table_factor
4020
DRIZZLE_YYABORT_UNLESS($1 && $5);
4257
MYSQL_YYABORT_UNLESS($1 && $5);
4022
4259
USING '(' using_list ')'
4025
4262
if (!($$= lex->current_select->convert_right_join()))
4027
4264
add_join_natural($$,$5,$9,Select);
4029
4266
| table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor
4031
DRIZZLE_YYABORT_UNLESS($1 && $6);
4268
MYSQL_YYABORT_UNLESS($1 && $6);
4032
4269
add_join_natural($6,$1,NULL,Select);
4034
4271
if (!($$= lex->current_select->convert_right_join()))
4491
4728
group_list ',' order_ident order_dir
4492
{ if (add_group_to_list(YYTHD, $3,(bool) $4)) DRIZZLE_YYABORT; }
4729
{ if (add_group_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
4493
4730
| order_ident order_dir
4494
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) DRIZZLE_YYABORT; }
4731
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
4739
'WITH CUBE' is reserved in the MySQL syntax, but not implemented,
4740
and cause LALR(2) conflicts.
4741
This syntax is not standard.
4742
MySQL syntax: GROUP BY col1, col2, col3 WITH CUBE
4743
SQL-2003: GROUP BY ... CUBE(col1, col2, col3)
4746
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
4748
my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
4749
"global union parameters");
4752
lex->current_select->olap= CUBE_TYPE;
4753
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
4499
4756
| WITH_ROLLUP_SYM
5181
5442
lex->lock_option= TL_READ;
5182
5443
mysql_init_select(lex);
5183
5444
lex->current_select->parsing_place= SELECT_LIST;
5184
memset(&lex->create_info, 0, sizeof(lex->create_info));
5445
bzero((char*) &lex->create_info,sizeof(lex->create_info));
5452
DATABASES wild_and_where
5194
5455
lex->sql_command= SQLCOM_SHOW_DATABASES;
5195
5456
if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
5198
| opt_full TABLES opt_db show_wild
5459
| opt_full TABLES opt_db wild_and_where
5201
5462
lex->sql_command= SQLCOM_SHOW_TABLES;
5202
5463
lex->select_lex.db= $3;
5203
5464
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES))
5206
| TABLE_SYM STATUS_SYM opt_db show_wild
5467
| TABLE_SYM STATUS_SYM opt_db wild_and_where
5209
5470
lex->sql_command= SQLCOM_SHOW_TABLE_STATUS;
5210
5471
lex->select_lex.db= $3;
5211
5472
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES))
5214
| OPEN_SYM TABLES opt_db show_wild
5475
| OPEN_SYM TABLES opt_db wild_and_where
5217
5478
lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
5218
5479
lex->select_lex.db= $3;
5219
5480
if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
5222
5483
| ENGINE_SYM known_storage_engines STATUS_SYM /* This should either go... well it should go */
5224
5485
Lex->create_info.db_type= $2;
5225
5486
Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS;
5227
| opt_full COLUMNS from_or_in table_ident opt_db show_wild
5488
| opt_full COLUMNS from_or_in table_ident opt_db wild_and_where
5230
5491
lex->sql_command= SQLCOM_SHOW_FIELDS;
5232
5493
$4->change_db($5);
5233
5494
if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
5236
5497
| master_or_binary LOGS_SYM
5238
5499
Lex->sql_command = SQLCOM_SHOW_BINLOGS;
5503
Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS;
5505
| BINLOG_SYM EVENTS_SYM binlog_in binlog_from
5508
lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
5509
} opt_limit_clause_init
5240
5510
| keys_or_index from_or_in table_ident opt_db where_clause
5254
5524
{ Lex->sql_command = SQLCOM_SHOW_WARNS;}
5255
5525
| ERRORS opt_limit_clause_init
5256
5526
{ Lex->sql_command = SQLCOM_SHOW_ERRORS;}
5257
| opt_var_type STATUS_SYM show_wild
5527
| opt_var_type STATUS_SYM wild_and_where
5260
5530
lex->sql_command= SQLCOM_SHOW_STATUS;
5261
5531
lex->option_type= $1;
5262
5532
if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS))
5265
5535
| opt_full PROCESSLIST_SYM
5266
5536
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
5267
| opt_var_type VARIABLES show_wild
5537
| opt_var_type VARIABLES wild_and_where
5270
5540
lex->sql_command= SQLCOM_SHOW_VARIABLES;
5271
5541
lex->option_type= $1;
5272
5542
if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
5545
| charset wild_and_where
5548
lex->sql_command= SQLCOM_SHOW_CHARSETS;
5549
if (prepare_schema_table(YYTHD, lex, 0, SCH_CHARSETS))
5552
| COLLATION_SYM wild_and_where
5555
lex->sql_command= SQLCOM_SHOW_COLLATIONS;
5556
if (prepare_schema_table(YYTHD, lex, 0, SCH_COLLATIONS))
5275
5559
| CREATE DATABASE opt_if_not_exists ident
5677
5990
$$= new Item_string(tmp.str, tmp.length, cs_con,
5678
5991
DERIVATION_COERCIBLE, repertoire);
5995
uint repertoire= Lex->text_string_is_7bit ?
5996
MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
5997
assert(my_charset_is_ascii_based(national_charset_info));
5998
$$= new Item_string($1.str, $1.length, national_charset_info,
5999
DERIVATION_COERCIBLE, repertoire);
5680
6001
| UNDERSCORE_CHARSET TEXT_STRING
5682
6003
Item_string *str= new Item_string($2.str, $2.length, $1);
5881
6223
SELECT_LEX *sel=Select;
5882
6224
$$= (sel->parsing_place != IN_HAVING ||
5883
6225
sel->get_in_sum_expr() > 0) ?
5884
(Item*) new Item_field(Lex->current_context(),
5885
(const char *)NULL, NULL, $1.str) :
5886
(Item*) new Item_ref(Lex->current_context(),
5887
(const char *)NULL, NULL, $1.str);
6226
(Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
6227
(Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
5890
6230
| simple_ident_q { $$= $1; }
5896
6236
SELECT_LEX *sel=Select;
5897
6237
$$= (sel->parsing_place != IN_HAVING ||
5898
6238
sel->get_in_sum_expr() > 0) ?
5899
(Item*) new Item_field(Lex->current_context(),
5900
(const char *)NULL, NULL, $1.str) :
5901
(Item*) new Item_ref(Lex->current_context(),
5902
(const char *)NULL, NULL, $1.str);
6239
(Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
6240
(Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
5904
6242
| simple_ident_q { $$= $1; }
5920
6258
$$= (sel->parsing_place != IN_HAVING ||
5921
6259
sel->get_in_sum_expr() > 0) ?
5922
(Item*) new Item_field(Lex->current_context(),
5923
(const char *)NULL, $1.str, $3.str) :
5924
(Item*) new Item_ref(Lex->current_context(),
5925
(const char *)NULL, $1.str, $3.str);
6260
(Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) :
6261
(Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str);
5928
6264
| '.' ident '.' ident
5938
6274
$$= (sel->parsing_place != IN_HAVING ||
5939
6275
sel->get_in_sum_expr() > 0) ?
5940
(Item*) new Item_field(Lex->current_context(), NULL, $2.str, $4.str) :
5941
(Item*) new Item_ref(Lex->current_context(),
5942
(const char *)NULL, $2.str, $4.str);
6276
(Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) :
6277
(Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str);
5944
6279
| ident '.' ident '.' ident
5968
6303
ident { $$=$1;}
5969
6304
| ident '.' ident '.' ident
5971
TableList *table= (TableList*) Select->table_list.first;
6306
TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
5972
6307
if (my_strcasecmp(table_alias_charset, $1.str, table->db))
5974
6309
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
5977
6312
if (my_strcasecmp(table_alias_charset, $3.str,
5978
6313
table->table_name))
5980
6315
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3.str);
5985
6320
| ident '.' ident
5987
TableList *table= (TableList*) Select->table_list.first;
6322
TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
5988
6323
if (my_strcasecmp(table_alias_charset, $1.str, table->alias))
5990
6325
my_error(ER_WRONG_TABLE_NAME, MYF(0), $1.str);
6443
6800
lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6));
6445
| NAMES_SYM COLLATE_SYM collation_name_or_default
6802
| charset old_or_new_charset_name_or_default
6806
$2= $2 ? $2: global_system_variables.character_set_client;
6807
lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2));
6809
| NAMES_SYM charset_name_or_default opt_collate
6448
$3= $3 ? $3 : global_system_variables.character_set_client;
6812
$2= $2 ? $2 : global_system_variables.character_set_client;
6814
if (!my_charset_same($2,$3))
6816
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
6817
$3->name, $2->csname);
6449
6820
lex->var_list.push_back(new set_var_collation_client($3,$3,$3));