sql_yacc.cpp
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:979k
- case 774:
- #line 3172 "sql_yacc.yy"
- {
- if (yyvsp[-1].item_list != NULL)
- yyval.item = new Item_func_udf_float(yyvsp[-3].udf, *yyvsp[-1].item_list);
- else
- yyval.item = new Item_func_udf_float(yyvsp[-3].udf);
- }
- break;
- case 775:
- #line 3179 "sql_yacc.yy"
- {
- if (yyvsp[-1].item_list != NULL)
- yyval.item = new Item_func_udf_int(yyvsp[-3].udf, *yyvsp[-1].item_list);
- else
- yyval.item = new Item_func_udf_int(yyvsp[-3].udf);
- }
- break;
- case 776:
- #line 3186 "sql_yacc.yy"
- {
- yyval.item= new Item_func_unique_users(yyvsp[-7].item,atoi(yyvsp[-5].lex_str.str),atoi(yyvsp[-3].lex_str.str), * yyvsp[-1].item_list);
- }
- break;
- case 777:
- #line 3190 "sql_yacc.yy"
- {
- yyval.item= new Item_func_unix_timestamp();
- Lex->safe_to_cache_query=0;
- }
- break;
- case 778:
- #line 3195 "sql_yacc.yy"
- { yyval.item= new Item_func_unix_timestamp(yyvsp[-1].item); }
- break;
- case 779:
- #line 3197 "sql_yacc.yy"
- { yyval.item= new Item_func_user(); Lex->safe_to_cache_query=0; }
- break;
- case 780:
- #line 3199 "sql_yacc.yy"
- { yyval.item= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;}
- break;
- case 781:
- #line 3201 "sql_yacc.yy"
- { yyval.item= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;}
- break;
- case 782:
- #line 3203 "sql_yacc.yy"
- { yyval.item= new Item_func_now_utc(); Lex->safe_to_cache_query=0;}
- break;
- case 783:
- #line 3205 "sql_yacc.yy"
- {
- yyval.item= new Item_func_week(yyvsp[-1].item,new Item_int((char*) "0",
- YYTHD->variables.default_week_format,1));
- }
- break;
- case 784:
- #line 3210 "sql_yacc.yy"
- { yyval.item= new Item_func_week(yyvsp[-3].item,yyvsp[-1].item); }
- break;
- case 785:
- #line 3212 "sql_yacc.yy"
- { yyval.item= new Item_func_year(yyvsp[-1].item); }
- break;
- case 786:
- #line 3214 "sql_yacc.yy"
- { yyval.item= new Item_func_yearweek(yyvsp[-1].item,new Item_int((char*) "0",0,1)); }
- break;
- case 787:
- #line 3216 "sql_yacc.yy"
- { yyval.item= new Item_func_yearweek(yyvsp[-3].item, yyvsp[-1].item); }
- break;
- case 788:
- #line 3218 "sql_yacc.yy"
- {
- yyval.item=new Item_func_benchmark(yyvsp[-3].ulong_num,yyvsp[-1].item);
- Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- }
- break;
- case 789:
- #line 3223 "sql_yacc.yy"
- { yyval.item=new Item_extract( yyvsp[-3].interval, yyvsp[-1].item); }
- break;
- case 790:
- #line 3227 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 791:
- #line 3229 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 792:
- #line 3231 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_wkb(yyvsp[-1].item)); }
- break;
- case 793:
- #line 3233 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_wkb(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 794:
- #line 3235 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list,
- Geometry::wkb_geometrycollection,
- Geometry::wkb_point)); }
- break;
- case 795:
- #line 3239 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list,
- Geometry::wkb_linestring, Geometry::wkb_point)); }
- break;
- case 796:
- #line 3242 "sql_yacc.yy"
- { yyval.item= GEOM_NEW( Item_func_spatial_collection(* yyvsp[-1].item_list,
- Geometry::wkb_multilinestring, Geometry::wkb_linestring)); }
- break;
- case 797:
- #line 3245 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 798:
- #line 3247 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 799:
- #line 3249 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 800:
- #line 3251 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 801:
- #line 3253 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 802:
- #line 3255 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 803:
- #line 3257 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list,
- Geometry::wkb_multipoint, Geometry::wkb_point)); }
- break;
- case 804:
- #line 3260 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list,
- Geometry::wkb_multipolygon, Geometry::wkb_polygon)); }
- break;
- case 805:
- #line 3263 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_point(yyvsp[-3].item,yyvsp[-1].item)); }
- break;
- case 806:
- #line 3265 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 807:
- #line 3267 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 808:
- #line 3269 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 809:
- #line 3271 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 810:
- #line 3273 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_spatial_collection(* yyvsp[-1].item_list,
- Geometry::wkb_polygon, Geometry::wkb_linestring)); }
- break;
- case 811:
- #line 3276 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 812:
- #line 3278 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 813:
- #line 3280 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-1].item)); }
- break;
- case 814:
- #line 3282 "sql_yacc.yy"
- { yyval.item= GEOM_NEW(Item_func_geometry_from_text(yyvsp[-3].item, yyvsp[-1].item)); }
- break;
- case 815:
- #line 3286 "sql_yacc.yy"
- { yyval.num= FT_NL; }
- break;
- case 816:
- #line 3287 "sql_yacc.yy"
- { yyval.num= FT_NL | FT_EXPAND; }
- break;
- case 817:
- #line 3288 "sql_yacc.yy"
- { yyval.num= FT_BOOL; }
- break;
- case 818:
- #line 3292 "sql_yacc.yy"
- { yyval.item_list= NULL; }
- break;
- case 819:
- #line 3293 "sql_yacc.yy"
- { yyval.item_list= yyvsp[0].item_list;}
- break;
- case 820:
- #line 3296 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- if (lex->current_select->inc_in_sum_expr())
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- }
- break;
- case 821:
- #line 3305 "sql_yacc.yy"
- {
- Select->in_sum_expr--;
- yyval.item_list= yyvsp[0].item_list;
- }
- break;
- case 822:
- #line 3312 "sql_yacc.yy"
- { yyval.item=new Item_sum_avg(yyvsp[-1].item); }
- break;
- case 823:
- #line 3314 "sql_yacc.yy"
- { yyval.item=new Item_sum_and(yyvsp[-1].item); }
- break;
- case 824:
- #line 3316 "sql_yacc.yy"
- { yyval.item=new Item_sum_or(yyvsp[-1].item); }
- break;
- case 825:
- #line 3318 "sql_yacc.yy"
- { yyval.item=new Item_sum_xor(yyvsp[-1].item); }
- break;
- case 826:
- #line 3320 "sql_yacc.yy"
- { yyval.item=new Item_sum_count(new Item_int((int32) 0L,1)); }
- break;
- case 827:
- #line 3322 "sql_yacc.yy"
- { yyval.item=new Item_sum_count(yyvsp[-1].item); }
- break;
- case 828:
- #line 3324 "sql_yacc.yy"
- { Select->in_sum_expr++; }
- break;
- case 829:
- #line 3326 "sql_yacc.yy"
- { Select->in_sum_expr--; }
- break;
- case 830:
- #line 3328 "sql_yacc.yy"
- { yyval.item=new Item_sum_count_distinct(* yyvsp[-2].item_list); }
- break;
- case 831:
- #line 3330 "sql_yacc.yy"
- { yyval.item= new Item_sum_unique_users(yyvsp[-7].item,atoi(yyvsp[-5].lex_str.str),atoi(yyvsp[-3].lex_str.str),yyvsp[-1].item); }
- break;
- case 832:
- #line 3332 "sql_yacc.yy"
- { yyval.item=new Item_sum_min(yyvsp[-1].item); }
- break;
- case 833:
- #line 3334 "sql_yacc.yy"
- { yyval.item=new Item_sum_max(yyvsp[-1].item); }
- break;
- case 834:
- #line 3336 "sql_yacc.yy"
- { yyval.item=new Item_sum_std(yyvsp[-1].item); }
- break;
- case 835:
- #line 3338 "sql_yacc.yy"
- { yyval.item=new Item_sum_variance(yyvsp[-1].item); }
- break;
- case 836:
- #line 3340 "sql_yacc.yy"
- { yyval.item=new Item_sum_sum(yyvsp[-1].item); }
- break;
- case 837:
- #line 3342 "sql_yacc.yy"
- { Select->in_sum_expr++; }
- break;
- case 838:
- #line 3346 "sql_yacc.yy"
- {
- Select->in_sum_expr--;
- yyval.item=new Item_func_group_concat(yyvsp[-5].num,yyvsp[-3].item_list,Select->gorder_list,yyvsp[-1].string);
- yyvsp[-3].item_list->empty();
- }
- break;
- case 839:
- #line 3353 "sql_yacc.yy"
- { yyval.num = 0; }
- break;
- case 840:
- #line 3354 "sql_yacc.yy"
- { yyval.num = 1; }
- break;
- case 841:
- #line 3357 "sql_yacc.yy"
- { yyval.string = new (YYTHD->mem_root) String(",",1,default_charset_info); }
- break;
- case 842:
- #line 3358 "sql_yacc.yy"
- { yyval.string = yyvsp[0].string; }
- break;
- case 843:
- #line 3363 "sql_yacc.yy"
- {
- Select->gorder_list = NULL;
- }
- break;
- case 844:
- #line 3367 "sql_yacc.yy"
- {
- SELECT_LEX *select= Select;
- select->gorder_list=
- (SQL_LIST*) sql_memdup((char*) &select->order_list,
- sizeof(st_sql_list));
- select->order_list.empty();
- }
- break;
- case 845:
- #line 3378 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- if (lex->current_select->inc_in_sum_expr())
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- }
- break;
- case 846:
- #line 3387 "sql_yacc.yy"
- {
- Select->in_sum_expr--;
- yyval.item= yyvsp[0].item;
- }
- break;
- case 847:
- #line 3393 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; }
- break;
- case 848:
- #line 3394 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_CHAR; }
- break;
- case 849:
- #line 3395 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_CHAR; Lex->charset= national_charset_info; }
- break;
- case 850:
- #line 3396 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 851:
- #line 3397 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 852:
- #line 3398 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 853:
- #line 3399 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 854:
- #line 3400 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_DATE; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 855:
- #line 3401 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_TIME; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 856:
- #line 3402 "sql_yacc.yy"
- { yyval.cast_type=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->length= (char*)0; }
- break;
- case 857:
- #line 3406 "sql_yacc.yy"
- { Select->expr_list.push_front(new List<Item>); }
- break;
- case 858:
- #line 3408 "sql_yacc.yy"
- { yyval.item_list= Select->expr_list.pop(); }
- break;
- case 859:
- #line 3411 "sql_yacc.yy"
- { Select->expr_list.head()->push_back(yyvsp[0].item); }
- break;
- case 860:
- #line 3412 "sql_yacc.yy"
- { Select->expr_list.head()->push_back(yyvsp[0].item); }
- break;
- case 861:
- #line 3415 "sql_yacc.yy"
- { yyval.item_list= yyvsp[0].item_list; }
- break;
- case 862:
- #line 3416 "sql_yacc.yy"
- { yyval.item_list= yyvsp[-1].item_list; }
- break;
- case 863:
- #line 3419 "sql_yacc.yy"
- { Select->expr_list.push_front(new List<Item>); }
- break;
- case 864:
- #line 3421 "sql_yacc.yy"
- { yyval.item_list= Select->expr_list.pop(); }
- break;
- case 865:
- #line 3424 "sql_yacc.yy"
- { Select->expr_list.head()->push_back(yyvsp[0].item); }
- break;
- case 866:
- #line 3425 "sql_yacc.yy"
- { Select->expr_list.head()->push_back(yyvsp[0].item); }
- break;
- case 867:
- #line 3428 "sql_yacc.yy"
- { yyval.item= NULL; }
- break;
- case 868:
- #line 3429 "sql_yacc.yy"
- { yyval.item= yyvsp[0].item; }
- break;
- case 869:
- #line 3432 "sql_yacc.yy"
- { yyval.item= NULL; }
- break;
- case 870:
- #line 3433 "sql_yacc.yy"
- { yyval.item= yyvsp[0].item; }
- break;
- case 871:
- #line 3436 "sql_yacc.yy"
- { Select->when_list.push_front(new List<Item>); }
- break;
- case 872:
- #line 3438 "sql_yacc.yy"
- { yyval.item_list= Select->when_list.pop(); }
- break;
- case 873:
- #line 3442 "sql_yacc.yy"
- {
- SELECT_LEX *sel=Select;
- sel->when_list.head()->push_back(yyvsp[-2].item);
- sel->when_list.head()->push_back(yyvsp[0].item);
- }
- break;
- case 874:
- #line 3448 "sql_yacc.yy"
- {
- SELECT_LEX *sel=Select;
- sel->when_list.head()->push_back(yyvsp[-2].item);
- sel->when_list.head()->push_back(yyvsp[0].item);
- }
- break;
- case 875:
- #line 3455 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list; }
- break;
- case 876:
- #line 3456 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list; }
- break;
- case 877:
- #line 3457 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list; }
- break;
- case 878:
- #line 3459 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list ; yyvsp[-2].table_list->next->straight=1; }
- break;
- case 879:
- #line 3461 "sql_yacc.yy"
- { add_join_on(yyvsp[-2].table_list,yyvsp[0].item); yyval.table_list=yyvsp[-2].table_list; }
- break;
- case 880:
- #line 3464 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->db1=yyvsp[-3].table_list->db; sel->table1=yyvsp[-3].table_list->alias;
- sel->db2=yyvsp[-1].table_list->db; sel->table2=yyvsp[-1].table_list->alias;
- }
- break;
- case 881:
- #line 3470 "sql_yacc.yy"
- { add_join_on(yyvsp[-5].table_list,yyvsp[-1].item); yyval.table_list=yyvsp[-5].table_list; }
- break;
- case 882:
- #line 3473 "sql_yacc.yy"
- { add_join_on(yyvsp[-2].table_list,yyvsp[0].item); yyvsp[-2].table_list->outer_join|=JOIN_TYPE_LEFT; yyval.table_list=yyvsp[-2].table_list; }
- break;
- case 883:
- #line 3475 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->db1=yyvsp[-4].table_list->db; sel->table1=yyvsp[-4].table_list->alias;
- sel->db2=yyvsp[0].table_list->db; sel->table2=yyvsp[0].table_list->alias;
- }
- break;
- case 884:
- #line 3481 "sql_yacc.yy"
- { add_join_on(yyvsp[-5].table_list,yyvsp[-1].item); yyvsp[-5].table_list->outer_join|=JOIN_TYPE_LEFT; yyval.table_list=yyvsp[-5].table_list; }
- break;
- case 885:
- #line 3483 "sql_yacc.yy"
- {
- add_join_natural(yyvsp[-5].table_list,yyvsp[-5].table_list->next);
- yyvsp[-5].table_list->next->outer_join|=JOIN_TYPE_LEFT;
- yyval.table_list=yyvsp[0].table_list;
- }
- break;
- case 886:
- #line 3489 "sql_yacc.yy"
- { add_join_on(yyvsp[-6].table_list,yyvsp[0].item); yyvsp[-6].table_list->outer_join|=JOIN_TYPE_RIGHT; yyval.table_list=yyvsp[-2].table_list; }
- break;
- case 887:
- #line 3491 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->db1=yyvsp[-4].table_list->db; sel->table1=yyvsp[-4].table_list->alias;
- sel->db2=yyvsp[0].table_list->db; sel->table2=yyvsp[0].table_list->alias;
- }
- break;
- case 888:
- #line 3497 "sql_yacc.yy"
- { add_join_on(yyvsp[-9].table_list,yyvsp[-1].item); yyvsp[-9].table_list->outer_join|=JOIN_TYPE_RIGHT; yyval.table_list=yyvsp[-5].table_list; }
- break;
- case 889:
- #line 3499 "sql_yacc.yy"
- {
- add_join_natural(yyvsp[-5].table_list->next,yyvsp[-5].table_list);
- yyvsp[-5].table_list->outer_join|=JOIN_TYPE_RIGHT;
- yyval.table_list=yyvsp[0].table_list;
- }
- break;
- case 890:
- #line 3505 "sql_yacc.yy"
- { add_join_natural(yyvsp[-3].table_list,yyvsp[-3].table_list->next); yyval.table_list=yyvsp[0].table_list; }
- break;
- case 891:
- #line 3508 "sql_yacc.yy"
- {}
- break;
- case 892:
- #line 3509 "sql_yacc.yy"
- {}
- break;
- case 893:
- #line 3510 "sql_yacc.yy"
- {}
- break;
- case 894:
- #line 3514 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->use_index_ptr=sel->ignore_index_ptr=0;
- sel->table_join_options= 0;
- }
- break;
- case 895:
- #line 3520 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- SELECT_LEX *sel= lex->current_select;
- if (!(yyval.table_list= sel->add_table_to_list(lex->thd, yyvsp[-2].table, yyvsp[-1].lex_str_ptr,
- sel->get_table_join_options(),
- lex->lock_option,
- sel->get_use_index(),
- sel->get_ignore_index())))
- YYABORT;
- }
- break;
- case 896:
- #line 3531 "sql_yacc.yy"
- { add_join_on(yyvsp[-3].table_list,yyvsp[-1].item); yyvsp[-3].table_list->outer_join|=JOIN_TYPE_LEFT; yyval.table_list=yyvsp[-3].table_list; }
- break;
- case 897:
- #line 3533 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- SELECT_LEX_UNIT *unit= lex->current_select->master_unit();
- lex->current_select= unit->outer_select();
- if (!(yyval.table_list= lex->current_select->
- add_table_to_list(lex->thd, new Table_ident(unit), yyvsp[0].lex_str_ptr, 0,
- TL_READ,(List<String> *)0,
- (List<String> *)0)))
- YYABORT;
- }
- break;
- case 898:
- #line 3544 "sql_yacc.yy"
- { yyval.table_list=yyvsp[-1].table_list; }
- break;
- case 900:
- #line 3549 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- SELECT_LEX * sel= lex->current_select;
- if (sel->set_braces(1))
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- /* select in braces, can't contain global parameters */
- if (sel->master_unit()->fake_select_lex)
- sel->master_unit()->global_parameters=
- sel->master_unit()->fake_select_lex;
- }
- break;
- case 901:
- #line 3564 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->derived_tables= 1;
- if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
- lex->sql_command <= (int)SQLCOM_HA_READ) ||
- lex->sql_command == (int)SQLCOM_KILL)
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
- mysql_new_select(lex, 1))
- YYABORT;
- mysql_init_select(lex);
- lex->current_select->linkage= DERIVED_TABLE_TYPE;
- lex->current_select->parsing_place= SELECT_LIST;
- }
- break;
- case 902:
- #line 3582 "sql_yacc.yy"
- {
- Select->parsing_place= NO_MATTER;
- }
- break;
- case 904:
- #line 3589 "sql_yacc.yy"
- {}
- break;
- case 905:
- #line 3590 "sql_yacc.yy"
- {}
- break;
- case 906:
- #line 3593 "sql_yacc.yy"
- {}
- break;
- case 907:
- #line 3595 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->use_index= *yyvsp[0].string_list;
- sel->use_index_ptr= &sel->use_index;
- }
- break;
- case 908:
- #line 3601 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->use_index= *yyvsp[0].string_list;
- sel->use_index_ptr= &sel->use_index;
- sel->table_join_options|= TL_OPTION_FORCE_INDEX;
- }
- break;
- case 909:
- #line 3608 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->ignore_index= *yyvsp[0].string_list;
- sel->ignore_index_ptr= &sel->ignore_index;
- }
- break;
- case 910:
- #line 3615 "sql_yacc.yy"
- { Select->interval_list.empty(); }
- break;
- case 911:
- #line 3617 "sql_yacc.yy"
- { yyval.string_list= &Select->interval_list; }
- break;
- case 912:
- #line 3621 "sql_yacc.yy"
- {}
- break;
- case 913:
- #line 3622 "sql_yacc.yy"
- {}
- break;
- case 914:
- #line 3627 "sql_yacc.yy"
- { Select->
- interval_list.push_back(new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length,
- system_charset_info)); }
- break;
- case 915:
- #line 3631 "sql_yacc.yy"
- { Select->
- interval_list.push_back(new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str, yyvsp[0].lex_str.length,
- system_charset_info)); }
- break;
- case 916:
- #line 3635 "sql_yacc.yy"
- { Select->
- interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7,
- system_charset_info)); }
- break;
- case 917:
- #line 3641 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- if (!(yyval.item= new Item_func_eq(new Item_field(sel->db1, sel->table1,
- yyvsp[0].lex_str.str),
- new Item_field(sel->db2, sel->table2,
- yyvsp[0].lex_str.str))))
- YYABORT;
- }
- break;
- case 918:
- #line 3650 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- if (!(yyval.item= new Item_cond_and(new Item_func_eq(new Item_field(sel->db1,sel->table1,yyvsp[0].lex_str.str), new Item_field(sel->db2,sel->table2,yyvsp[0].lex_str.str)), yyvsp[-2].item)))
- YYABORT;
- }
- break;
- case 919:
- #line 3657 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_HOUR; }
- break;
- case 920:
- #line 3658 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_MICROSECOND; }
- break;
- case 921:
- #line 3659 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_MINUTE; }
- break;
- case 922:
- #line 3660 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_SECOND; }
- break;
- case 923:
- #line 3661 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY; }
- break;
- case 924:
- #line 3662 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR_MICROSECOND; }
- break;
- case 925:
- #line 3663 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR_MINUTE; }
- break;
- case 926:
- #line 3664 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR_SECOND; }
- break;
- case 927:
- #line 3665 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR; }
- break;
- case 928:
- #line 3666 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MICROSECOND; }
- break;
- case 929:
- #line 3667 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MINUTE_MICROSECOND; }
- break;
- case 930:
- #line 3668 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MINUTE_SECOND; }
- break;
- case 931:
- #line 3669 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MINUTE; }
- break;
- case 932:
- #line 3670 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MONTH; }
- break;
- case 933:
- #line 3671 "sql_yacc.yy"
- { yyval.interval=INTERVAL_SECOND_MICROSECOND; }
- break;
- case 934:
- #line 3672 "sql_yacc.yy"
- { yyval.interval=INTERVAL_SECOND; }
- break;
- case 935:
- #line 3673 "sql_yacc.yy"
- { yyval.interval=INTERVAL_YEAR_MONTH; }
- break;
- case 936:
- #line 3674 "sql_yacc.yy"
- { yyval.interval=INTERVAL_YEAR; }
- break;
- case 937:
- #line 3678 "sql_yacc.yy"
- {yyval.date_time_type=MYSQL_TIMESTAMP_DATE;}
- break;
- case 938:
- #line 3679 "sql_yacc.yy"
- {yyval.date_time_type=MYSQL_TIMESTAMP_TIME;}
- break;
- case 939:
- #line 3680 "sql_yacc.yy"
- {yyval.date_time_type=MYSQL_TIMESTAMP_DATETIME;}
- break;
- case 940:
- #line 3681 "sql_yacc.yy"
- {yyval.date_time_type=MYSQL_TIMESTAMP_DATETIME;}
- break;
- case 944:
- #line 3690 "sql_yacc.yy"
- { yyval.lex_str_ptr=0; }
- break;
- case 945:
- #line 3692 "sql_yacc.yy"
- { yyval.lex_str_ptr= (LEX_STRING*) sql_memdup(&yyvsp[0].lex_str,sizeof(LEX_STRING)); }
- break;
- case 948:
- #line 3700 "sql_yacc.yy"
- { Select->where= 0; }
- break;
- case 949:
- #line 3702 "sql_yacc.yy"
- {
- Select->parsing_place= IN_WHERE;
- }
- break;
- case 950:
- #line 3706 "sql_yacc.yy"
- {
- SELECT_LEX *select= Select;
- select->where= yyvsp[0].item;
- select->parsing_place= NO_MATTER;
- if (yyvsp[0].item)
- yyvsp[0].item->top_level_item();
- }
- break;
- case 952:
- #line 3718 "sql_yacc.yy"
- {
- Select->parsing_place= IN_HAVING;
- }
- break;
- case 953:
- #line 3722 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->having= yyvsp[0].item;
- sel->parsing_place= NO_MATTER;
- if (yyvsp[0].item)
- yyvsp[0].item->top_level_item();
- }
- break;
- case 954:
- #line 3732 "sql_yacc.yy"
- { yyval.item= yyvsp[0].item; }
- break;
- case 955:
- #line 3734 "sql_yacc.yy"
- {
- yyval.item= new Item_string("\", 1, &my_charset_latin1);
- }
- break;
- case 958:
- #line 3750 "sql_yacc.yy"
- { if (add_group_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) YYABORT; }
- break;
- case 959:
- #line 3752 "sql_yacc.yy"
- { if (add_group_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) YYABORT; }
- break;
- case 960:
- #line 3755 "sql_yacc.yy"
- {}
- break;
- case 961:
- #line 3757 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
- {
- net_printf(lex->thd, ER_WRONG_USAGE, "WITH CUBE",
- "global union parameters");
- YYABORT;
- }
- lex->current_select->olap= CUBE_TYPE;
- net_printf(lex->thd, ER_NOT_SUPPORTED_YET, "CUBE");
- YYABORT; /* To be deleted in 5.1 */
- }
- break;
- case 962:
- #line 3770 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
- {
- net_printf(lex->thd, ER_WRONG_USAGE, "WITH ROLLUP",
- "global union parameters");
- YYABORT;
- }
- lex->current_select->olap= ROLLUP_TYPE;
- }
- break;
- case 965:
- #line 3792 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->current_select->linkage != GLOBAL_OPTIONS_TYPE &&
- lex->current_select->olap !=
- UNSPECIFIED_OLAP_TYPE)
- {
- net_printf(lex->thd, ER_WRONG_USAGE,
- "CUBE/ROLLUP",
- "ORDER BY");
- YYABORT;
- }
- }
- break;
- case 967:
- #line 3807 "sql_yacc.yy"
- { if (add_order_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) YYABORT; }
- break;
- case 968:
- #line 3809 "sql_yacc.yy"
- { if (add_order_to_list(YYTHD, yyvsp[-1].item,(bool) yyvsp[0].num)) YYABORT; }
- break;
- case 969:
- #line 3812 "sql_yacc.yy"
- { yyval.num = 1; }
- break;
- case 970:
- #line 3813 "sql_yacc.yy"
- { yyval.num =1; }
- break;
- case 971:
- #line 3814 "sql_yacc.yy"
- { yyval.num =0; }
- break;
- case 972:
- #line 3819 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- SELECT_LEX *sel= lex->current_select;
- sel->offset_limit= 0L;
- sel->select_limit= HA_POS_ERROR;
- }
- break;
- case 973:
- #line 3825 "sql_yacc.yy"
- {}
- break;
- case 974:
- #line 3829 "sql_yacc.yy"
- {}
- break;
- case 975:
- #line 3830 "sql_yacc.yy"
- {}
- break;
- case 976:
- #line 3834 "sql_yacc.yy"
- {}
- break;
- case 977:
- #line 3839 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= yyvsp[0].ulong_num;
- sel->offset_limit= 0L;
- sel->explicit_limit= 1;
- }
- break;
- case 978:
- #line 3846 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= yyvsp[0].ulong_num;
- sel->offset_limit= yyvsp[-2].ulong_num;
- sel->explicit_limit= 1;
- }
- break;
- case 979:
- #line 3853 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= yyvsp[-2].ulong_num;
- sel->offset_limit= yyvsp[0].ulong_num;
- sel->explicit_limit= 1;
- }
- break;
- case 980:
- #line 3864 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->current_select->select_limit= HA_POS_ERROR;
- }
- break;
- case 981:
- #line 3869 "sql_yacc.yy"
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= (ha_rows) yyvsp[0].ulonglong_number;
- sel->explicit_limit= 1;
- }
- break;
- case 982:
- #line 3876 "sql_yacc.yy"
- { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 983:
- #line 3877 "sql_yacc.yy"
- { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 984:
- #line 3878 "sql_yacc.yy"
- { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 985:
- #line 3879 "sql_yacc.yy"
- { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 986:
- #line 3880 "sql_yacc.yy"
- { int error; yyval.ulong_num= (ulong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 987:
- #line 3884 "sql_yacc.yy"
- { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 988:
- #line 3885 "sql_yacc.yy"
- { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 989:
- #line 3886 "sql_yacc.yy"
- { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 990:
- #line 3887 "sql_yacc.yy"
- { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 991:
- #line 3888 "sql_yacc.yy"
- { int error; yyval.ulonglong_number= (ulonglong) my_strtoll10(yyvsp[0].lex_str.str, (char**) 0, &error); }
- break;
- case 993:
- #line 3894 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (&lex->select_lex != lex->current_select)
- {
- net_printf(lex->thd, ER_WRONG_USAGE,
- "PROCEDURE",
- "subquery");
- YYABORT;
- }
- lex->proc_list.elements=0;
- lex->proc_list.first=0;
- lex->proc_list.next= (byte**) &lex->proc_list.first;
- if (add_proc_to_list(lex->thd, new Item_field(NULL,NULL,yyvsp[0].lex_str.str)))
- YYABORT;
- Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- }
- break;
- case 995:
- #line 3914 "sql_yacc.yy"
- {}
- break;
- case 996:
- #line 3915 "sql_yacc.yy"
- {}
- break;
- case 999:
- #line 3923 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- if (add_proc_to_list(lex->thd, yyvsp[0].item))
- YYABORT;
- if (!yyvsp[0].item->name)
- yyvsp[0].item->set_name(yyvsp[-1].simple_string,(uint) ((char*) lex->tok_end - yyvsp[-1].simple_string), YYTHD->charset());
- }
- break;
- case 1000:
- #line 3934 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (!lex->describe && (!(lex->result= new select_dumpvar())))
- YYABORT;
- }
- break;
- case 1001:
- #line 3940 "sql_yacc.yy"
- {}
- break;
- case 1003:
- #line 3945 "sql_yacc.yy"
- {}
- break;
- case 1004:
- #line 3949 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->result && ((select_dumpvar *)lex->result)->var_list.push_back((LEX_STRING*) sql_memdup(&yyvsp[0].lex_str,sizeof(LEX_STRING))))
- YYABORT;
- }
- break;
- case 1005:
- #line 3958 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str, 0)) ||
- !(lex->result= new select_export(lex->exchange)))
- YYABORT;
- }
- break;
- case 1007:
- #line 3967 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (!lex->describe)
- {
- lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,1)))
- YYABORT;
- if (!(lex->result= new select_dump(lex->exchange)))
- YYABORT;
- }
- }
- break;
- case 1008:
- #line 3979 "sql_yacc.yy"
- {
- Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- }
- break;
- case 1009:
- #line 3989 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_DO;
- mysql_init_select(lex);
- }
- break;
- case 1010:
- #line 3995 "sql_yacc.yy"
- {
- Lex->insert_list= yyvsp[0].item_list;
- }
- break;
- case 1011:
- #line 4006 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_DROP_TABLE;
- lex->drop_temporary= yyvsp[-4].num;
- lex->drop_if_exists= yyvsp[-2].num;
- }
- break;
- case 1012:
- #line 4012 "sql_yacc.yy"
- {}
- break;
- case 1013:
- #line 4013 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_DROP_INDEX;
- lex->alter_info.drop_list.empty();
- lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- yyvsp[-3].lex_str.str));
- if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, NULL,
- TL_OPTION_UPDATING))
- YYABORT;
- }
- break;
- case 1014:
- #line 4024 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_DROP_DB;
- lex->drop_if_exists=yyvsp[-1].num;
- lex->name=yyvsp[0].lex_str.str;
- }
- break;
- case 1015:
- #line 4031 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_DROP_FUNCTION;
- lex->udf.name = yyvsp[0].lex_str;
- }
- break;
- case 1016:
- #line 4037 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_DROP_USER;
- lex->users_list.empty();
- }
- break;
- case 1017:
- #line 4043 "sql_yacc.yy"
- {}
- break;
- case 1020:
- #line 4053 "sql_yacc.yy"
- {
- if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING))
- YYABORT;
- }
- break;
- case 1021:
- #line 4060 "sql_yacc.yy"
- { yyval.num= 0; }
- break;
- case 1022:
- #line 4061 "sql_yacc.yy"
- { yyval.num= 1; }
- break;
- case 1023:
- #line 4065 "sql_yacc.yy"
- { yyval.num= 0; }
- break;
- case 1024:
- #line 4066 "sql_yacc.yy"
- { yyval.num= 1; }
- break;
- case 1025:
- #line 4074 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_INSERT;
- lex->duplicates= DUP_ERROR;
- mysql_init_select(lex);
- /* for subselects */
- lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
- lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
- }
- break;
- case 1026:
- #line 4084 "sql_yacc.yy"
- {
- Select->set_lock_for_tables(yyvsp[-2].lock_type);
- Lex->current_select= &Lex->select_lex;
- }
- break;
- case 1027:
- #line 4089 "sql_yacc.yy"
- {}
- break;
- case 1028:
- #line 4094 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_REPLACE;
- lex->duplicates= DUP_REPLACE;
- mysql_init_select(lex);
- lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
- }
- break;
- case 1029:
- #line 4102 "sql_yacc.yy"
- {
- Select->set_lock_for_tables(yyvsp[-1].lock_type);
- Lex->current_select= &Lex->select_lex;
- }
- break;
- case 1030:
- #line 4107 "sql_yacc.yy"
- {}
- break;
- case 1031:
- #line 4111 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_CONCURRENT_INSERT; }
- break;
- case 1032:
- #line 4112 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_LOW_PRIORITY; }
- break;
- case 1033:
- #line 4113 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_DELAYED; }
- break;
- case 1034:
- #line 4114 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE; }
- break;
- case 1035:
- #line 4118 "sql_yacc.yy"
- { yyval.lock_type= yyvsp[0].lock_type; }
- break;
- case 1036:
- #line 4119 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_DELAYED; }
- break;
- case 1037:
- #line 4122 "sql_yacc.yy"
- {}
- break;
- case 1038:
- #line 4123 "sql_yacc.yy"
- {}
- break;
- case 1039:
- #line 4127 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->field_list.empty();
- lex->many_values.empty();
- lex->insert_list=0;
- }
- break;
- case 1040:
- #line 4135 "sql_yacc.yy"
- {}
- break;
- case 1041:
- #line 4136 "sql_yacc.yy"
- {}
- break;
- case 1042:
- #line 4137 "sql_yacc.yy"
- {}
- break;
- case 1043:
- #line 4139 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (!(lex->insert_list = new List_item) ||
- lex->many_values.push_back(lex->insert_list))
- YYABORT;
- }
- break;
- case 1045:
- #line 4148 "sql_yacc.yy"
- { }
- break;
- case 1046:
- #line 4149 "sql_yacc.yy"
- { }
- break;
- case 1047:
- #line 4150 "sql_yacc.yy"
- { }
- break;
- case 1048:
- #line 4153 "sql_yacc.yy"
- { Lex->field_list.push_back(yyvsp[0].item); }
- break;
- case 1049:
- #line 4154 "sql_yacc.yy"
- { Lex->field_list.push_back(yyvsp[0].item); }
- break;
- case 1050:
- #line 4157 "sql_yacc.yy"
- {}
- break;
- case 1051:
- #line 4158 "sql_yacc.yy"
- {}
- break;
- case 1052:
- #line 4159 "sql_yacc.yy"
- { Select->set_braces(0);}
- break;
- case 1053:
- #line 4159 "sql_yacc.yy"
- {}
- break;
- case 1054:
- #line 4160 "sql_yacc.yy"
- { Select->set_braces(1);}
- break;
- case 1055:
- #line 4160 "sql_yacc.yy"
- {}
- break;
- case 1060:
- #line 4174 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->field_list.push_back(yyvsp[-2].item) ||
- lex->insert_list->push_back(yyvsp[0].item))
- YYABORT;
- }
- break;
- case 1061:
- #line 4181 "sql_yacc.yy"
- {}
- break;
- case 1062:
- #line 4182 "sql_yacc.yy"
- {}
- break;
- case 1063:
- #line 4186 "sql_yacc.yy"
- {}
- break;
- case 1064:
- #line 4187 "sql_yacc.yy"
- {}
- break;
- case 1065:
- #line 4192 "sql_yacc.yy"
- {
- if (!(Lex->insert_list = new List_item))
- YYABORT;
- }
- break;
- case 1066:
- #line 4197 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->many_values.push_back(lex->insert_list))
- YYABORT;
- }
- break;
- case 1067:
- #line 4204 "sql_yacc.yy"
- {}
- break;
- case 1069:
- #line 4209 "sql_yacc.yy"
- {
- if (Lex->insert_list->push_back(yyvsp[0].item))
- YYABORT;
- }
- break;
- case 1070:
- #line 4214 "sql_yacc.yy"
- {
- if (Lex->insert_list->push_back(yyvsp[0].item))
- YYABORT;
- }
- break;
- case 1071:
- #line 4221 "sql_yacc.yy"
- { yyval.item= yyvsp[0].item;}
- break;
- case 1072:
- #line 4222 "sql_yacc.yy"
- {yyval.item= new Item_default_value(); }
- break;
- case 1074:
- #line 4227 "sql_yacc.yy"
- { Lex->duplicates= DUP_UPDATE; }
- break;
- case 1076:
- #line 4235 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- mysql_init_select(lex);
- lex->sql_command= SQLCOM_UPDATE;
- lex->lock_option= TL_UNLOCK; /* Will be set later */
- lex->duplicates= DUP_ERROR;
- }
- break;
- case 1077:
- #line 4244 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- if (lex->select_lex.table_list.elements > 1)
- {
- lex->sql_command= SQLCOM_UPDATE_MULTI;
- lex->multi_lock_option= yyvsp[-4].lock_type;
- }
- else if (lex->select_lex.get_table_list()->derived)
- {
- /* it is single table update and it is update of derived table */
- net_printf(lex->thd, ER_NON_UPDATABLE_TABLE,
- lex->select_lex.get_table_list()->alias, "UPDATE");
- YYABORT;
- }
- else
- Select->set_lock_for_tables(yyvsp[-4].lock_type);
- }
- break;
- case 1078:
- #line 4261 "sql_yacc.yy"
- {}
- break;
- case 1081:
- #line 4270 "sql_yacc.yy"
- {
- if (add_item_to_list(YYTHD, yyvsp[-2].item) || add_value_to_list(YYTHD, yyvsp[0].item))
- YYABORT;
- }
- break;
- case 1084:
- #line 4281 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- if (lex->update_list.push_back(yyvsp[-2].item) ||
- lex->value_list.push_back(yyvsp[0].item))
- YYABORT;
- }
- break;
- case 1085:
- #line 4289 "sql_yacc.yy"
- { yyval.lock_type= YYTHD->update_lock_default; }
- break;
- case 1086:
- #line 4290 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_LOW_PRIORITY; }
- break;
- case 1087:
- #line 4296 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_DELETE;
- mysql_init_select(lex);
- lex->lock_option= lex->thd->update_lock_default;
- lex->ignore= 0;
- lex->select_lex.init_order();
- }
- break;
- case 1088:
- #line 4304 "sql_yacc.yy"
- {}
- break;
- case 1089:
- #line 4309 "sql_yacc.yy"
- {
- if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL, TL_OPTION_UPDATING,
- Lex->lock_option))
- YYABORT;
- }
- break;
- case 1090:
- #line 4315 "sql_yacc.yy"
- {}
- break;
- case 1091:
- #line 4316 "sql_yacc.yy"
- {mysql_init_multi_delete(Lex);}
- break;
- case 1092:
- #line 4317 "sql_yacc.yy"
- {fix_multi_delete_lex(Lex);}
- break;
- case 1094:
- #line 4318 "sql_yacc.yy"
- { mysql_init_multi_delete(Lex);}
- break;
- case 1095:
- #line 4319 "sql_yacc.yy"
- {fix_multi_delete_lex(Lex);}
- break;
- case 1096:
- #line 4320 "sql_yacc.yy"
- {}
- break;
- case 1097:
- #line 4324 "sql_yacc.yy"
- {}
- break;
- case 1098:
- #line 4325 "sql_yacc.yy"
- {}
- break;
- case 1099:
- #line 4329 "sql_yacc.yy"
- {
- if (!Select->add_table_to_list(YYTHD, new Table_ident(yyvsp[-2].lex_str), yyvsp[0].lex_str_ptr,
- TL_OPTION_UPDATING, Lex->lock_option))
- YYABORT;
- }
- break;
- case 1100:
- #line 4335 "sql_yacc.yy"
- {
- if (!Select->add_table_to_list(YYTHD,
- new Table_ident(YYTHD, yyvsp[-4].lex_str, yyvsp[-2].lex_str, 0),
- yyvsp[0].lex_str_ptr, TL_OPTION_UPDATING,
- Lex->lock_option))
- YYABORT;
- }
- break;
- case 1101:
- #line 4345 "sql_yacc.yy"
- {}
- break;
- case 1102:
- #line 4346 "sql_yacc.yy"
- {}
- break;
- case 1103:
- #line 4350 "sql_yacc.yy"
- {}
- break;
- case 1104:
- #line 4351 "sql_yacc.yy"
- {}
- break;
- case 1105:
- #line 4354 "sql_yacc.yy"
- { Select->options|= OPTION_QUICK; }
- break;
- case 1106:
- #line 4355 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
- break;
- case 1107:
- #line 4356 "sql_yacc.yy"
- { Lex->ignore= 1; }
- break;
- case 1108:
- #line 4360 "sql_yacc.yy"
- {
- LEX* lex= Lex;
- lex->sql_command= SQLCOM_TRUNCATE;
- lex->select_lex.options= 0;
- lex->select_lex.init_order();
- }
- break;
- case 1111:
- #line 4375 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->wild=0;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
- }
- break;
- case 1112:
- #line 4381 "sql_yacc.yy"
- {}
- break;
- case 1113:
- #line 4386 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_DATABASES; }
- break;
- case 1114:
- #line 4388 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_TABLES;
- lex->select_lex.db= yyvsp[-1].simple_string;
- }
- break;
- case 1115:
- #line 4394 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_TABLES;
- lex->describe= DESCRIBE_EXTENDED;
- lex->select_lex.db= yyvsp[-1].simple_string;
- }
- break;
- case 1116:
- #line 4401 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
- lex->select_lex.db= yyvsp[-1].simple_string;
- }
- break;
- case 1117:
- #line 4407 "sql_yacc.yy"
- { Lex->create_info.db_type= yyvsp[0].db_type; }
- break;
- case 1119:
- #line 4410 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_SHOW_FIELDS;
- if (yyvsp[-1].simple_string)
- yyvsp[-2].table->change_db(yyvsp[-1].simple_string);
- if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, NULL, 0))
- YYABORT;
- }
- break;
- case 1120:
- #line 4421 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_NEW_MASTER;
- Lex->mi.log_file_name = yyvsp[-8].lex_str.str;
- Lex->mi.pos = yyvsp[-4].ulonglong_number;
- Lex->mi.server_id = yyvsp[0].ulong_num;
- }
- break;
- case 1121:
- #line 4428 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_BINLOGS;
- }
- break;
- case 1122:
- #line 4432 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS;
- }
- break;
- case 1123:
- #line 4436 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
- }
- break;
- case 1125:
- #line 4441 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_SHOW_KEYS;
- if (yyvsp[0].simple_string)
- yyvsp[-1].table->change_db(yyvsp[0].simple_string);
- if (!Select->add_table_to_list(YYTHD, yyvsp[-1].table, NULL, 0))
- YYABORT;
- }
- break;
- case 1126:
- #line 4449 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES;
- }
- break;
- case 1127:
- #line 4454 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
- WARN_DEPRECATED("SHOW TABLE TYPES", "SHOW [STORAGE] ENGINES");
- }
- break;
- case 1128:
- #line 4460 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
- }
- break;
- case 1129:
- #line 4465 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_PRIVILEGES;
- }
- break;
- case 1130:
- #line 4470 "sql_yacc.yy"
- { (void) create_select_for_variable("warning_count"); }
- break;
- case 1131:
- #line 4472 "sql_yacc.yy"
- { (void) create_select_for_variable("error_count"); }
- break;
- case 1132:
- #line 4474 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_SHOW_WARNS;}
- break;
- case 1133:
- #line 4476 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_SHOW_ERRORS;}
- break;
- case 1134:
- #line 4478 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_STATUS; }
- break;
- case 1135:
- #line 4480 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); }
- break;
- case 1136:
- #line 4482 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
- break;
- case 1137:
- #line 4484 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- thd->lex->sql_command= SQLCOM_SHOW_VARIABLES;
- thd->lex->option_type= (enum_var_type) yyvsp[-2].num;
- }
- break;
- case 1138:
- #line 4490 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
- break;
- case 1139:
- #line 4492 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_COLLATIONS; }
- break;
- case 1140:
- #line 4494 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); }
- break;
- case 1141:
- #line 4496 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW LOGS", "SHOW ENGINE BDB LOGS"); }
- break;
- case 1142:
- #line 4498 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_GRANTS;
- THD *thd= lex->thd;
- LEX_USER *curr_user;
- if (!(curr_user= (LEX_USER*) thd->alloc(sizeof(st_lex_user))))
- YYABORT;
- curr_user->user.str= thd->priv_user;
- curr_user->user.length= strlen(thd->priv_user);
- if (*thd->priv_host != 0)
- {
- curr_user->host.str= thd->priv_host;
- curr_user->host.length= strlen(thd->priv_host);
- }
- else
- {
- curr_user->host.str= (char *) "%";
- curr_user->host.length= 1;
- }
- curr_user->password.str=NullS;
- lex->grant_user= curr_user;
- }
- break;
- case 1143:
- #line 4521 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_GRANTS;
- lex->grant_user=yyvsp[0].lex_user;
- lex->grant_user->password.str=NullS;
- }
- break;
- case 1144:
- #line 4528 "sql_yacc.yy"
- {
- Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
- Lex->create_info.options=yyvsp[-1].num;
- Lex->name=yyvsp[0].lex_str.str;
- }
- break;
- case 1145:
- #line 4534 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_CREATE;
- if (!Select->add_table_to_list(YYTHD, yyvsp[0].table, NULL,0))
- YYABORT;
- }
- break;
- case 1146:
- #line 4540 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
- }
- break;
- case 1147:
- #line 4544 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
- }
- break;
- case 1148:
- #line 4550 "sql_yacc.yy"
- {
- switch (Lex->create_info.db_type) {
- case DB_TYPE_NDBCLUSTER:
- Lex->sql_command = SQLCOM_SHOW_NDBCLUSTER_STATUS;
- break;
- case DB_TYPE_INNODB:
- Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;
- break;
- default:
- net_printf(YYTHD, ER_NOT_SUPPORTED_YET, "STATUS");
- YYABORT;
- }
- }
- break;
- case 1149:
- #line 4564 "sql_yacc.yy"
- {
- switch (Lex->create_info.db_type) {
- case DB_TYPE_BERKELEY_DB:
- Lex->sql_command = SQLCOM_SHOW_LOGS;
- break;
- default:
- net_printf(YYTHD, ER_NOT_SUPPORTED_YET, "LOGS");
- YYABORT;
- }
- }
- break;
- case 1154:
- #line 4584 "sql_yacc.yy"
- { yyval.simple_string= 0; }
- break;
- case 1155:
- #line 4585 "sql_yacc.yy"
- { yyval.simple_string= yyvsp[0].lex_str.str; }
- break;
- case 1157:
- #line 4590 "sql_yacc.yy"
- { Lex->wild= new (YYTHD->mem_root) String(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length,
- system_charset_info); }
- break;
- case 1158:
- #line 4594 "sql_yacc.yy"
- { Lex->verbose=0; }
- break;
- case 1159:
- #line 4595 "sql_yacc.yy"
- { Lex->verbose=1; }
- break;
- case 1162:
- #line 4602 "sql_yacc.yy"
- { Lex->mi.log_file_name = 0; }
- break;
- case 1163:
- #line 4603 "sql_yacc.yy"
- { Lex->mi.log_file_name = yyvsp[0].lex_str.str; }
- break;
- case 1164:
- #line 4606 "sql_yacc.yy"
- { Lex->mi.pos = 4; /* skip magic number */ }
- break;
- case 1165:
- #line 4607 "sql_yacc.yy"
- { Lex->mi.pos = yyvsp[0].ulonglong_number; }
- break;
- case 1166:
- #line 4613 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->wild=0;
- lex->verbose=0;
- lex->sql_command=SQLCOM_SHOW_FIELDS;
- if (!Select->add_table_to_list(lex->thd, yyvsp[0].table, NULL,0))
- YYABORT;
- }
- break;
- case 1167:
- #line 4621 "sql_yacc.yy"
- {}
- break;
- case 1168:
- #line 4623 "sql_yacc.yy"
- { Lex->describe|= DESCRIBE_NORMAL; }
- break;
- case 1169:
- #line 4625 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->select_lex.options|= SELECT_DESCRIBE;
- }
- break;
- case 1172:
- #line 4636 "sql_yacc.yy"
- {}
- break;
- case 1173:
- #line 4637 "sql_yacc.yy"
- { Lex->describe|= DESCRIBE_EXTENDED; }
- break;
- case 1174:
- #line 4641 "sql_yacc.yy"
- {}
- break;
- case 1175:
- #line 4642 "sql_yacc.yy"
- { Lex->wild= yyvsp[0].string; }
- break;
- case 1176:
- #line 4644 "sql_yacc.yy"
- { Lex->wild= new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,system_charset_info); }
- break;
- case 1177:
- #line 4651 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_FLUSH; lex->type=0;
- lex->no_write_to_binlog= yyvsp[0].num;
- }
- break;
- case 1178:
- #line 4657 "sql_yacc.yy"
- {}
- break;
- case 1181:
- #line 4665 "sql_yacc.yy"
- { Lex->type|= REFRESH_TABLES; }
- break;
- case 1182:
- #line 4665 "sql_yacc.yy"
- {}
- break;
- case 1183:
- #line 4666 "sql_yacc.yy"
- { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
- break;
- case 1184:
- #line 4667 "sql_yacc.yy"
- { Lex->type|= REFRESH_QUERY_CACHE_FREE; }
- break;
- case 1185:
- #line 4668 "sql_yacc.yy"
- { Lex->type|= REFRESH_HOSTS; }
- break;
- case 1186:
- #line 4669 "sql_yacc.yy"
- { Lex->type|= REFRESH_GRANT; }
- break;
- case 1187:
- #line 4670 "sql_yacc.yy"
- { Lex->type|= REFRESH_LOG; }
- break;
- case 1188:
- #line 4671 "sql_yacc.yy"
- { Lex->type|= REFRESH_STATUS; }
- break;
- case 1189:
- #line 4672 "sql_yacc.yy"
- { Lex->type|= REFRESH_SLAVE; }
- break;
- case 1190:
- #line 4673 "sql_yacc.yy"
- { Lex->type|= REFRESH_MASTER; }
- break;
- case 1191:
- #line 4674 "sql_yacc.yy"
- { Lex->type|= REFRESH_DES_KEY_FILE; }
- break;
- case 1192:
- #line 4675 "sql_yacc.yy"
- { Lex->type|= REFRESH_USER_RESOURCES; }
- break;
- case 1193:
- #line 4678 "sql_yacc.yy"
- {;}
- break;
- case 1194:
- #line 4679 "sql_yacc.yy"
- {;}
- break;
- case 1195:
- #line 4683 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_RESET; lex->type=0;
- }
- break;
- case 1196:
- #line 4687 "sql_yacc.yy"
- {}
- break;
- case 1199:
- #line 4695 "sql_yacc.yy"
- { Lex->type|= REFRESH_SLAVE; }
- break;
- case 1200:
- #line 4696 "sql_yacc.yy"
- { Lex->type|= REFRESH_MASTER; }
- break;
- case 1201:
- #line 4697 "sql_yacc.yy"
- { Lex->type|= REFRESH_QUERY_CACHE;}
- break;
- case 1202:
- #line 4701 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->type=0;
- }
- break;
- case 1203:
- #line 4705 "sql_yacc.yy"
- {}
- break;
- case 1205:
- #line 4714 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_PURGE;
- Lex->to_log = yyvsp[0].lex_str.str;
- }
- break;
- case 1206:
- #line 4719 "sql_yacc.yy"
- {
- if (!yyvsp[0].item)
- /* Can only be an out of memory situation, no need for a message */
- YYABORT;
- if (yyvsp[0].item->fix_fields(Lex->thd, 0, &yyvsp[0].item) || yyvsp[0].item->check_cols(1))
- {
- net_printf(Lex->thd, ER_WRONG_ARGUMENTS, "PURGE LOGS BEFORE");
- YYABORT;
- }
- Item *tmp= new Item_func_unix_timestamp(yyvsp[0].item);
- /*
- it is OK only emulate fix_fieds, because we need only
- value of constant
- */
- tmp->quick_fix_field();
- Lex->sql_command = SQLCOM_PURGE_BEFORE;
- Lex->purge_time= (ulong) tmp->val_int();
- }
- break;
- case 1207:
- #line 4743 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (yyvsp[0].item->fix_fields(lex->thd, 0, &yyvsp[0].item) || yyvsp[0].item->check_cols(1))
- {
- send_error(lex->thd, ER_SET_CONSTANTS_ONLY);
- YYABORT;
- }
- lex->sql_command=SQLCOM_KILL;
- lex->thread_id= (ulong) yyvsp[0].item->val_int();
- }
- break;
- case 1208:
- #line 4757 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command=SQLCOM_CHANGE_DB;
- lex->select_lex.db= yyvsp[0].lex_str.str;
- }
- break;
- case 1209:
- #line 4766 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_LOAD;
- lex->lock_option= yyvsp[-3].lock_type;
- lex->local_file= yyvsp[-2].num;
- lex->duplicates= DUP_ERROR;
- lex->ignore= 0;
- if (!(lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,0)))
- YYABORT;
- lex->field_list.empty();
- }
- break;
- case 1210:
- #line 4779 "sql_yacc.yy"
- {
- if (!Select->add_table_to_list(YYTHD, yyvsp[-4].table, NULL, TL_OPTION_UPDATING))
- YYABORT;
- }
- break;
- case 1211:
- #line 4785 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
- if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, NULL, TL_OPTION_UPDATING))
- YYABORT;
- }
- break;
- case 1212:
- #line 4793 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
- }
- break;
- case 1213:
- #line 4798 "sql_yacc.yy"
- { yyval.num=0;}
- break;
- case 1214:
- #line 4799 "sql_yacc.yy"
- { yyval.num=1;}
- break;
- case 1215:
- #line 4802 "sql_yacc.yy"
- { yyval.lock_type= YYTHD->update_lock_default; }
- break;
- case 1216:
- #line 4803 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_CONCURRENT_INSERT ; }
- break;
- case 1217:
- #line 4804 "sql_yacc.yy"
- { yyval.lock_type= TL_WRITE_LOW_PRIORITY; }
- break;
- case 1218:
- #line 4808 "sql_yacc.yy"
- { Lex->duplicates=DUP_ERROR; }
- break;
- case 1219:
- #line 4809 "sql_yacc.yy"
- { Lex->duplicates=DUP_REPLACE; }
- break;
- case 1220:
- #line 4810 "sql_yacc.yy"
- { Lex->ignore= 1; }
- break;
- case 1225:
- #line 4822 "sql_yacc.yy"
- {
- DBUG_ASSERT(Lex->exchange);
- Lex->exchange->field_term= yyvsp[0].string;
- }
- break;
- case 1226:
- #line 4827 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- DBUG_ASSERT(lex->exchange);
- lex->exchange->enclosed= yyvsp[0].string;
- lex->exchange->opt_enclosed= 1;
- }
- break;
- case 1227:
- #line 4834 "sql_yacc.yy"
- {
- DBUG_ASSERT(Lex->exchange);
- Lex->exchange->enclosed= yyvsp[0].string;
- }
- break;
- case 1228:
- #line 4839 "sql_yacc.yy"
- {
- DBUG_ASSERT(Lex->exchange);
- Lex->exchange->escaped= yyvsp[0].string;
- }
- break;
- case 1233:
- #line 4854 "sql_yacc.yy"
- {
- DBUG_ASSERT(Lex->exchange);
- Lex->exchange->line_term= yyvsp[0].string;
- }
- break;
- case 1234:
- #line 4859 "sql_yacc.yy"
- {
- DBUG_ASSERT(Lex->exchange);
- Lex->exchange->line_start= yyvsp[0].string;
- }
- break;
- case 1236:
- #line 4867 "sql_yacc.yy"
- {
- DBUG_ASSERT(Lex->exchange);
- Lex->exchange->skip_lines= atol(yyvsp[-1].lex_str.str);
- }
- break;
- case 1237:
- #line 4876 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,thd->variables.collation_connection);
- }
- break;
- case 1238:
- #line 4881 "sql_yacc.yy"
- { yyval.item= new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,national_charset_info); }
- break;
- case 1239:
- #line 4883 "sql_yacc.yy"
- { yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,Lex->charset); }
- break;
- case 1240:
- #line 4885 "sql_yacc.yy"
- { ((Item_string*) yyvsp[-1].item)->append(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); }
- break;
- case 1241:
- #line 4890 "sql_yacc.yy"
- { yyval.string= new (YYTHD->mem_root) String(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,YYTHD->variables.collation_connection); }
- break;
- case 1242:
- #line 4892 "sql_yacc.yy"
- {
- Item *tmp = new Item_varbinary(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length);
- /*
- it is OK only emulate fix_fieds, because we need only
- value of constant
- */
- yyval.string= tmp ?
- tmp->quick_fix_field(), tmp->val_str((String*) 0) :
- (String*) 0;
- }
- break;
- case 1243:
- #line 4906 "sql_yacc.yy"
- {
- THD *thd=YYTHD;
- LEX *lex= thd->lex;
- Item_param *item= new Item_param((uint) (lex->tok_start -
- (uchar *) thd->query));
- if (!(yyval.item= item) || lex->param_list.push_back(item))
- {
- send_error(thd, ER_OUT_OF_RESOURCES);
- YYABORT;
- }
- }
- break;
- case 1244:
- #line 4920 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; }
- break;
- case 1245:
- #line 4921 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item_num; }
- break;
- case 1246:
- #line 4923 "sql_yacc.yy"
- {
- yyvsp[0].item_num->max_length++;
- yyval.item= yyvsp[0].item_num->neg();
- }
- break;
- case 1247:
- #line 4931 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; }
- break;
- case 1248:
- #line 4932 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item_num; }
- break;
- case 1249:
- #line 4933 "sql_yacc.yy"
- { yyval.item = new Item_null();
- Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
- break;
- case 1250:
- #line 4935 "sql_yacc.yy"
- { yyval.item= new Item_int((char*) "FALSE",0,1); }
- break;
- case 1251:
- #line 4936 "sql_yacc.yy"
- { yyval.item= new Item_int((char*) "TRUE",1,1); }
- break;
- case 1252: