1014
1059
keycache_list assign_to_keycache
1015
1060
select_item_list select_item values_list no_braces
1016
1061
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
1062
opt_precision opt_ignore opt_column opt_restrict
1063
set lock unlock string_list field_options field_option
1064
field_opt_list opt_binary table_lock_list table_lock
1020
1065
ref_list opt_match_clause opt_on_update_delete use
1021
opt_delete_options opt_delete_option varchar
1066
opt_delete_options opt_delete_option varchar nchar nvarchar
1022
1067
opt_outer table_list table_name table_alias_ref_list table_alias_ref
1023
1068
opt_option opt_place
1024
1069
opt_attribute opt_attribute_list attribute
1035
1080
opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
1036
1081
binlog_base64_event
1037
1082
init_key_options key_options key_opts key_opt key_using_alg
1038
parse_vcol_expr vcol_opt_attribute vcol_opt_attribute_list
1042
1085
%type <index_hint> index_hint_type
1043
1086
%type <num> index_hint_clause
1044
%type <filetype> data_file
1087
%type <filetype> data_or_xml
1047
1090
'-' '+' '*' '/' '%' '(' ')'
1048
',' '!' '{' '}' AND_SYM OR_SYM BETWEEN_SYM CASE_SYM
1049
THEN_SYM WHEN_SYM DIV_SYM MOD_SYM DELETE_SYM
1091
',' '!' '{' '}' '&' '|' AND_SYM OR_SYM BETWEEN_SYM CASE_SYM
1092
THEN_SYM WHEN_SYM DIV_SYM MOD_SYM AND_AND_SYM DELETE_SYM
1179
1222
Lex->mi.heartbeat_period < 0.0)
1181
1224
char buf[sizeof(SLAVE_MAX_HEARTBEAT_PERIOD*4)];
1182
sprintf(buf, "%d seconds", SLAVE_MAX_HEARTBEAT_PERIOD);
1225
my_sprintf(buf, (buf, "%d seconds", SLAVE_MAX_HEARTBEAT_PERIOD));
1183
1226
my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1185
1228
" is negative or exceeds the maximum ",
1189
1232
if (Lex->mi.heartbeat_period > slave_net_timeout)
1191
push_warning_printf(YYTHD, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1234
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
1192
1235
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1193
1236
ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
1194
1237
" exceeds the value of `slave_net_timeout' sec.",
1532
1571
Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
1533
1572
Lex->alter_info.flags|= ALTER_ROW_FORMAT;
1574
| UNION_SYM opt_equal '(' opt_table_list ')'
1576
/* Move the union list to the merge_list */
1578
TABLE_LIST *table_list= lex->select_lex.get_table_list();
1579
lex->create_info.merge_list= lex->select_lex.table_list;
1580
lex->create_info.merge_list.elements--;
1581
lex->create_info.merge_list.first=
1582
(uchar*) (table_list->next_local);
1583
lex->select_lex.table_list.elements=1;
1584
lex->select_lex.table_list.next=
1585
(uchar**) &(table_list->next_local);
1586
table_list->next_local= 0;
1587
lex->create_info.used_fields|= HA_CREATE_USED_UNION;
1535
1590
| default_collation
1536
1591
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
1554
1609
Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
1555
1610
Lex->create_info.key_block_size= $3;
1612
| TRANSACTIONAL_SYM opt_equal choice
1614
Lex->create_info.used_fields|= HA_CREATE_USED_TRANSACTIONAL;
1615
Lex->create_info.transactional= $3;
1620
opt_default charset opt_equal charset_name_or_default
1622
HA_CREATE_INFO *cinfo= &Lex->create_info;
1623
if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
1624
cinfo->default_table_charset && $4 &&
1625
!my_charset_same(cinfo->default_table_charset,$4))
1627
my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
1628
"CHARACTER SET ", cinfo->default_table_charset->csname,
1629
"CHARACTER SET ", $4->csname);
1632
Lex->create_info.default_table_charset= $4;
1633
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
1559
1637
default_collation:
1724
1801
lex->column_format,
1725
1802
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;
1804
lex->change,&lex->interval_list,lex->charset))
1807
Lex->length=(char*) 0; /* use default length */
1809
| real_type opt_precision { $$=$1; }
1810
int_type opt_len field_options { $$=$1; }
1811
| real_type opt_precision field_options { $$=$1; }
1812
| FLOAT_SYM float_options field_options { $$=MYSQL_TYPE_FLOAT; }
1815
Lex->length= (char*) "1";
1820
Lex->length=(char*) "1";
1825
Lex->length=(char*) "1";
1810
1828
| char '(' NUM ')' opt_binary
1812
1830
Lex->length=$3.str;
1813
$$=DRIZZLE_TYPE_VARCHAR;
1831
$$=MYSQL_TYPE_STRING;
1815
1833
| char opt_binary
1817
1835
Lex->length=(char*) "1";
1818
$$=DRIZZLE_TYPE_VARCHAR;
1836
$$=MYSQL_TYPE_STRING;
1838
| nchar '(' NUM ')' opt_bin_mod
1841
$$=MYSQL_TYPE_STRING;
1842
Lex->charset=national_charset_info;
1846
Lex->length=(char*) "1";
1847
$$=MYSQL_TYPE_STRING;
1848
Lex->charset=national_charset_info;
1850
| BINARY '(' NUM ')'
1853
Lex->charset=&my_charset_bin;
1854
$$=MYSQL_TYPE_STRING;
1858
Lex->length= (char*) "1";
1859
Lex->charset=&my_charset_bin;
1860
$$=MYSQL_TYPE_STRING;
1820
1862
| varchar '(' NUM ')' opt_binary
1822
1864
Lex->length=$3.str;
1823
$$= DRIZZLE_TYPE_VARCHAR;
1865
$$= MYSQL_TYPE_VARCHAR;
1867
| nvarchar '(' NUM ')' opt_bin_mod
1870
$$= MYSQL_TYPE_VARCHAR;
1871
Lex->charset=national_charset_info;
1825
1873
| VARBINARY '(' NUM ')'
1827
1875
Lex->length=$3.str;
1828
1876
Lex->charset=&my_charset_bin;
1829
$$= DRIZZLE_TYPE_VARCHAR;
1877
$$= MYSQL_TYPE_VARCHAR;
1879
| YEAR_SYM opt_len field_options
1880
{ $$=MYSQL_TYPE_YEAR; }
1832
{ $$=DRIZZLE_TYPE_NEWDATE; }
1882
{ $$=MYSQL_TYPE_NEWDATE; }
1834
{ $$=DRIZZLE_TYPE_TIME; }
1884
{ $$=MYSQL_TYPE_TIME; }
1837
1887
/* Unlike other types TIMESTAMP fields are NOT NULL by default */
1838
1888
Lex->type|= NOT_NULL_FLAG;
1839
$$=DRIZZLE_TYPE_TIMESTAMP;
1889
$$=MYSQL_TYPE_TIMESTAMP;
1842
{ $$=DRIZZLE_TYPE_DATETIME; }
1892
{ $$=MYSQL_TYPE_DATETIME; }
1845
1895
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;}
1898
| TEXT_SYM opt_len opt_binary
1899
{ $$=MYSQL_TYPE_BLOB; }
1900
| DECIMAL_SYM float_options field_options
1901
{ $$=MYSQL_TYPE_NEWDECIMAL;}
1902
| NUMERIC_SYM float_options field_options
1903
{ $$=MYSQL_TYPE_NEWDECIMAL;}
1904
| FIXED_SYM float_options field_options
1905
{ $$=MYSQL_TYPE_NEWDECIMAL;}
1861
1907
{Lex->interval_list.empty();}
1862
1908
'(' string_list ')' opt_binary
1863
{ $$=DRIZZLE_TYPE_ENUM; }
1909
{ $$=MYSQL_TYPE_ENUM; }
1911
{ Lex->interval_list.empty();}
1912
'(' string_list ')' opt_binary
1913
{ $$=MYSQL_TYPE_SET; }
1866
$$=DRIZZLE_TYPE_LONGLONG;
1867
Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG);
1916
$$=MYSQL_TYPE_LONGLONG;
1917
Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
2087
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
2089
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
2093
| BINARY { $$= &my_charset_bin; }
2096
charset_name_or_default:
2097
charset_name { $$=$1; }
2098
| DEFAULT { $$=NULL; }
2101
opt_load_data_charset:
2102
/* Empty */ { $$= NULL; }
2103
| charset charset_name_or_default { $$= $2; }
2106
old_or_new_charset_name:
2109
if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) &&
2110
!($$=get_old_charset_by_name($1.str)))
2112
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
2116
| BINARY { $$= &my_charset_bin; }
2119
old_or_new_charset_name_or_default:
2120
old_or_new_charset_name { $$=$1; }
2121
| DEFAULT { $$=NULL; }
2002
2124
collation_name:
2005
2127
if (!($$=get_charset_by_name($1.str,MYF(0))))
2007
2129
my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
2136
/* empty */ { $$=NULL; }
2137
| COLLATE_SYM collation_name_or_default { $$=$2; }
2013
2140
collation_name_or_default:
2014
2141
collation_name { $$=$1; }
2015
2142
| DEFAULT { $$=NULL; }
2024
2151
/* empty */ { Lex->charset=NULL; }
2152
| ASCII_SYM opt_bin_mod { Lex->charset=&my_charset_latin1; }
2025
2153
| BYTE_SYM { Lex->charset=&my_charset_bin; }
2154
| UNICODE_SYM opt_bin_mod
2156
if (!(Lex->charset=get_charset_by_csname("ucs2",
2157
MY_CS_PRIMARY,MYF(0))))
2159
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
2163
| charset charset_name opt_bin_mod { Lex->charset=$2; }
2164
| BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; }
2026
2169
| BINARY { Lex->type|= BINCMP_FLAG; }
2173
/* empty */ { Lex->charset= NULL; }
2174
| ASCII_SYM { Lex->charset=&my_charset_latin1; }
2177
if (!(Lex->charset=get_charset_by_csname("ucs2",
2178
MY_CS_PRIMARY,MYF(0))))
2180
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
2184
| charset charset_name { Lex->charset=$2; }
2030
2188
'(' real_ulong_num
2034
2192
my_parse_error(ER(ER_SYNTAX_ERROR));
2303
2461
lex->duplicates= DUP_ERROR;
2304
2462
if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
2305
2463
TL_OPTION_UPDATING))
2307
2465
lex->alter_info.reset();
2308
2466
lex->col_list.empty();
2309
2467
lex->select_lex.init_order();
2310
2468
lex->select_lex.db=
2311
((TableList*) lex->select_lex.table_list.first)->db;
2312
memset(&lex->create_info, 0, sizeof(lex->create_info));
2469
((TABLE_LIST*) lex->select_lex.table_list.first)->db;
2470
bzero((char*) &lex->create_info,sizeof(lex->create_info));
2313
2471
lex->create_info.db_type= 0;
2314
2472
lex->create_info.default_table_charset= NULL;
2315
2473
lex->create_info.row_type= ROW_TYPE_NOT_USED;
2316
2474
lex->alter_info.reset();
2475
lex->no_write_to_binlog= 0;
2317
2476
lex->alter_info.build_method= $2;
2475
2638
if (lex->select_lex.db == NULL &&
2476
2639
lex->copy_db_to(&lex->select_lex.db, &dummy))
2480
2643
if (check_table_name($3->table.str,$3->table.length) || ($3->db.str && check_db_name(&$3->db)))
2482
2645
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
2485
2648
lex->name= $3->table;
2486
2649
lex->alter_info.flags|= ALTER_RENAME;
2488
| CONVERT_SYM TO_SYM collation_name_or_default
2651
| CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
2492
2655
THD *thd= YYTHD;
2493
$3= thd->variables.collation_database;
2656
$4= thd->variables.collation_database;
2659
if (!my_charset_same($4,$5))
2661
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
2662
$5->name, $4->csname);
2496
2666
lex->create_info.table_charset=
2497
lex->create_info.default_table_charset= $3;
2667
lex->create_info.default_table_charset= $5;
2498
2668
lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
2499
2669
HA_CREATE_USED_DEFAULT_CHARSET);
2500
2670
lex->alter_info.flags|= ALTER_CONVERT;
3217
bit_expr '+' bit_expr %prec '+'
3402
bit_expr '|' bit_expr %prec '|'
3403
{ $$= new Item_func_bit_or($1,$3); }
3404
| bit_expr '&' bit_expr %prec '&'
3405
{ $$= new Item_func_bit_and($1,$3); }
3406
| bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT
3407
{ $$= new Item_func_shift_left($1,$3); }
3408
| bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT
3409
{ $$= new Item_func_shift_right($1,$3); }
3410
| bit_expr '+' bit_expr %prec '+'
3218
3411
{ $$= new Item_func_plus($1,$3); }
3219
3412
| bit_expr '-' bit_expr %prec '-'
3220
3413
{ $$= new Item_func_minus($1,$3); }
3674
3897
{ $$=new Item_sum_avg($3); }
3675
3898
| AVG_SYM '(' DISTINCT in_sum_expr ')'
3676
3899
{ $$=new Item_sum_avg_distinct($4); }
3900
| BIT_AND '(' in_sum_expr ')'
3901
{ $$=new Item_sum_and($3); }
3902
| BIT_OR '(' in_sum_expr ')'
3903
{ $$=new Item_sum_or($3); }
3904
| BIT_XOR '(' in_sum_expr ')'
3905
{ $$=new Item_sum_xor($3); }
3677
3906
| COUNT_SYM '(' opt_all '*' ')'
3678
{ $$=new Item_sum_count(new Item_int((int32_t) 0L,1)); }
3907
{ $$=new Item_sum_count(new Item_int((int32) 0L,1)); }
3679
3908
| COUNT_SYM '(' in_sum_expr ')'
3680
3909
{ $$=new Item_sum_count($3); }
3681
3910
| COUNT_SYM '(' DISTINCT
3913
4152
left-associative joins.
3915
4154
table_ref normal_join table_ref %prec TABLE_REF_PRIORITY
3916
{ DRIZZLE_YYABORT_UNLESS($1 && ($$=$3)); }
4155
{ MYSQL_YYABORT_UNLESS($1 && ($$=$3)); }
3917
4156
| table_ref STRAIGHT_JOIN table_factor
3918
{ DRIZZLE_YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
4157
{ MYSQL_YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
3919
4158
| table_ref normal_join table_ref
3922
DRIZZLE_YYABORT_UNLESS($1 && $3);
4161
MYSQL_YYABORT_UNLESS($1 && $3);
3923
4162
/* Change the current name resolution context to a local context. */
3924
4163
if (push_new_name_resolution_context(YYTHD, $1, $3))
3926
4165
Select->parsing_place= IN_ON;
4000
4239
| table_ref RIGHT opt_outer JOIN_SYM table_ref
4003
DRIZZLE_YYABORT_UNLESS($1 && $5);
4242
MYSQL_YYABORT_UNLESS($1 && $5);
4004
4243
/* Change the current name resolution context to a local context. */
4005
4244
if (push_new_name_resolution_context(YYTHD, $1, $5))
4007
4246
Select->parsing_place= IN_ON;
4012
4251
if (!($$= lex->current_select->convert_right_join()))
4014
4253
add_join_on($$, $8);
4015
4254
Lex->pop_context();
4016
4255
Select->parsing_place= NO_MATTER;
4018
4257
| table_ref RIGHT opt_outer JOIN_SYM table_factor
4020
DRIZZLE_YYABORT_UNLESS($1 && $5);
4259
MYSQL_YYABORT_UNLESS($1 && $5);
4022
4261
USING '(' using_list ')'
4025
4264
if (!($$= lex->current_select->convert_right_join()))
4027
4266
add_join_natural($$,$5,$9,Select);
4029
4268
| table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor
4031
DRIZZLE_YYABORT_UNLESS($1 && $6);
4270
MYSQL_YYABORT_UNLESS($1 && $6);
4032
4271
add_join_natural($6,$1,NULL,Select);
4034
4273
if (!($$= lex->current_select->convert_right_join()))
4491
4730
group_list ',' order_ident order_dir
4492
{ if (add_group_to_list(YYTHD, $3,(bool) $4)) DRIZZLE_YYABORT; }
4731
{ if (add_group_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
4493
4732
| order_ident order_dir
4494
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) DRIZZLE_YYABORT; }
4733
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
4741
'WITH CUBE' is reserved in the MySQL syntax, but not implemented,
4742
and cause LALR(2) conflicts.
4743
This syntax is not standard.
4744
MySQL syntax: GROUP BY col1, col2, col3 WITH CUBE
4745
SQL-2003: GROUP BY ... CUBE(col1, col2, col3)
4748
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
4750
my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
4751
"global union parameters");
4754
lex->current_select->olap= CUBE_TYPE;
4755
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
4499
4758
| WITH_ROLLUP_SYM
5181
5444
lex->lock_option= TL_READ;
5182
5445
mysql_init_select(lex);
5183
5446
lex->current_select->parsing_place= SELECT_LIST;
5184
memset(&lex->create_info, 0, sizeof(lex->create_info));
5447
bzero((char*) &lex->create_info,sizeof(lex->create_info));
5454
DATABASES wild_and_where
5194
5457
lex->sql_command= SQLCOM_SHOW_DATABASES;
5195
5458
if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
5198
| opt_full TABLES opt_db show_wild
5461
| opt_full TABLES opt_db wild_and_where
5201
5464
lex->sql_command= SQLCOM_SHOW_TABLES;
5202
5465
lex->select_lex.db= $3;
5203
5466
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES))
5206
| TABLE_SYM STATUS_SYM opt_db show_wild
5469
| TABLE_SYM STATUS_SYM opt_db wild_and_where
5209
5472
lex->sql_command= SQLCOM_SHOW_TABLE_STATUS;
5210
5473
lex->select_lex.db= $3;
5211
5474
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES))
5214
| OPEN_SYM TABLES opt_db show_wild
5477
| OPEN_SYM TABLES opt_db wild_and_where
5217
5480
lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
5218
5481
lex->select_lex.db= $3;
5219
5482
if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
5222
5485
| ENGINE_SYM known_storage_engines STATUS_SYM /* This should either go... well it should go */
5224
5487
Lex->create_info.db_type= $2;
5225
5488
Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS;
5227
| opt_full COLUMNS from_or_in table_ident opt_db show_wild
5490
| opt_full COLUMNS from_or_in table_ident opt_db wild_and_where
5230
5493
lex->sql_command= SQLCOM_SHOW_FIELDS;
5232
5495
$4->change_db($5);
5233
5496
if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
5236
5499
| master_or_binary LOGS_SYM
5238
5501
Lex->sql_command = SQLCOM_SHOW_BINLOGS;
5505
Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS;
5507
| BINLOG_SYM EVENTS_SYM binlog_in binlog_from
5510
lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
5511
} opt_limit_clause_init
5240
5512
| keys_or_index from_or_in table_ident opt_db where_clause
5254
5526
{ Lex->sql_command = SQLCOM_SHOW_WARNS;}
5255
5527
| ERRORS opt_limit_clause_init
5256
5528
{ Lex->sql_command = SQLCOM_SHOW_ERRORS;}
5257
| opt_var_type STATUS_SYM show_wild
5529
| opt_var_type STATUS_SYM wild_and_where
5260
5532
lex->sql_command= SQLCOM_SHOW_STATUS;
5261
5533
lex->option_type= $1;
5262
5534
if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS))
5265
5537
| opt_full PROCESSLIST_SYM
5266
5538
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
5267
| opt_var_type VARIABLES show_wild
5539
| opt_var_type VARIABLES wild_and_where
5270
5542
lex->sql_command= SQLCOM_SHOW_VARIABLES;
5271
5543
lex->option_type= $1;
5272
5544
if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
5547
| charset wild_and_where
5550
lex->sql_command= SQLCOM_SHOW_CHARSETS;
5551
if (prepare_schema_table(YYTHD, lex, 0, SCH_CHARSETS))
5554
| COLLATION_SYM wild_and_where
5557
lex->sql_command= SQLCOM_SHOW_COLLATIONS;
5558
if (prepare_schema_table(YYTHD, lex, 0, SCH_COLLATIONS))
5275
5561
| CREATE DATABASE opt_if_not_exists ident
5677
5992
$$= new Item_string(tmp.str, tmp.length, cs_con,
5678
5993
DERIVATION_COERCIBLE, repertoire);
5997
uint repertoire= Lex->text_string_is_7bit ?
5998
MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
5999
assert(my_charset_is_ascii_based(national_charset_info));
6000
$$= new Item_string($1.str, $1.length, national_charset_info,
6001
DERIVATION_COERCIBLE, repertoire);
5680
6003
| UNDERSCORE_CHARSET TEXT_STRING
5682
6005
Item_string *str= new Item_string($2.str, $2.length, $1);
5881
6225
SELECT_LEX *sel=Select;
5882
6226
$$= (sel->parsing_place != IN_HAVING ||
5883
6227
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);
6228
(Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
6229
(Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
5890
6232
| simple_ident_q { $$= $1; }
5896
6238
SELECT_LEX *sel=Select;
5897
6239
$$= (sel->parsing_place != IN_HAVING ||
5898
6240
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);
6241
(Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
6242
(Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
5904
6244
| simple_ident_q { $$= $1; }
5920
6260
$$= (sel->parsing_place != IN_HAVING ||
5921
6261
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);
6262
(Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) :
6263
(Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str);
5928
6266
| '.' ident '.' ident
5938
6276
$$= (sel->parsing_place != IN_HAVING ||
5939
6277
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);
6278
(Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) :
6279
(Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str);
5944
6281
| ident '.' ident '.' ident
5968
6305
ident { $$=$1;}
5969
6306
| ident '.' ident '.' ident
5971
TableList *table= (TableList*) Select->table_list.first;
6308
TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
5972
6309
if (my_strcasecmp(table_alias_charset, $1.str, table->db))
5974
6311
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
5977
6314
if (my_strcasecmp(table_alias_charset, $3.str,
5978
6315
table->table_name))
5980
6317
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3.str);
5985
6322
| ident '.' ident
5987
TableList *table= (TableList*) Select->table_list.first;
6324
TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
5988
6325
if (my_strcasecmp(table_alias_charset, $1.str, table->alias))
5990
6327
my_error(ER_WRONG_TABLE_NAME, MYF(0), $1.str);
6443
6802
lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6));
6445
| NAMES_SYM COLLATE_SYM collation_name_or_default
6804
| charset old_or_new_charset_name_or_default
6808
$2= $2 ? $2: global_system_variables.character_set_client;
6809
lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2));
6811
| NAMES_SYM charset_name_or_default opt_collate
6448
$3= $3 ? $3 : global_system_variables.character_set_client;
6814
$2= $2 ? $2 : global_system_variables.character_set_client;
6816
if (!my_charset_same($2,$3))
6818
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
6819
$3->name, $2->csname);
6449
6822
lex->var_list.push_back(new set_var_collation_client($3,$3,$3));