sql_yacc.cc
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:460k
- break;}
- case 459:
- #line 1484 "sql_yacc.yy"
- { yyval.item= new Item_func_format(yyvsp[-3].item,atoi(yyvsp[-1].lex_str.str)); ;
- break;}
- case 460:
- #line 1486 "sql_yacc.yy"
- { yyval.item= new Item_func_from_unixtime(yyvsp[-1].item); ;
- break;}
- case 461:
- #line 1488 "sql_yacc.yy"
- {
- yyval.item= new Item_func_date_format(new Item_func_from_unixtime(yyvsp[-3].item),yyvsp[-1].item,0);
- ;
- break;}
- case 462:
- #line 1492 "sql_yacc.yy"
- { yyval.item= new Item_func_field(yyvsp[-3].item, *yyvsp[-1].item_list); ;
- break;}
- case 463:
- #line 1494 "sql_yacc.yy"
- { yyval.item= new Item_func_hour(yyvsp[-1].item); ;
- break;}
- case 464:
- #line 1496 "sql_yacc.yy"
- { yyval.item= new Item_func_if(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 465:
- #line 1498 "sql_yacc.yy"
- { yyval.item= new Item_func_insert(yyvsp[-7].item,yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 466:
- #line 1501 "sql_yacc.yy"
- { yyval.item= new Item_date_add_interval(yyvsp[0].item,yyvsp[-3].item,yyvsp[-2].interval,0); ;
- break;}
- case 467:
- #line 1503 "sql_yacc.yy"
- { yyval.item= new Item_func_interval(yyvsp[-3].item,* yyvsp[-1].item_list); ;
- break;}
- case 468:
- #line 1505 "sql_yacc.yy"
- {
- yyval.item= new Item_int((char*) "last_insert_id()",
- current_thd->insert_id(),21);
- ;
- break;}
- case 469:
- #line 1510 "sql_yacc.yy"
- {
- yyval.item= new Item_func_set_last_insert_id(yyvsp[-1].item);
- ;
- break;}
- case 470:
- #line 1514 "sql_yacc.yy"
- { yyval.item= new Item_func_left(yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 471:
- #line 1516 "sql_yacc.yy"
- { yyval.item= new Item_func_locate(yyvsp[-1].item,yyvsp[-3].item); ;
- break;}
- case 472:
- #line 1518 "sql_yacc.yy"
- { yyval.item= new Item_func_locate(yyvsp[-3].item,yyvsp[-5].item,yyvsp[-1].item); ;
- break;}
- case 473:
- #line 1520 "sql_yacc.yy"
- { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_max(*yyvsp[-1].item_list); ;
- break;}
- case 474:
- #line 1522 "sql_yacc.yy"
- { yyvsp[-1].item_list->push_front(yyvsp[-3].item); yyval.item= new Item_func_min(*yyvsp[-1].item_list); ;
- break;}
- case 475:
- #line 1524 "sql_yacc.yy"
- { yyval.item= new Item_func_minute(yyvsp[-1].item); ;
- break;}
- case 476:
- #line 1526 "sql_yacc.yy"
- { yyval.item= new Item_func_month(yyvsp[-1].item); ;
- break;}
- case 477:
- #line 1528 "sql_yacc.yy"
- { yyval.item= new Item_func_now(); ;
- break;}
- case 478:
- #line 1530 "sql_yacc.yy"
- { yyval.item= new Item_func_now(yyvsp[-1].item); ;
- break;}
- case 479:
- #line 1531 "sql_yacc.yy"
- { yyval.item= new Item_func_password(yyvsp[-1].item); ;
- break;}
- case 480:
- #line 1533 "sql_yacc.yy"
- { yyval.item = new Item_func_locate(yyvsp[-1].item,yyvsp[-3].item); ;
- break;}
- case 481:
- #line 1534 "sql_yacc.yy"
- { yyval.item= new Item_func_rand(yyvsp[-1].item); ;
- break;}
- case 482:
- #line 1535 "sql_yacc.yy"
- { yyval.item= new Item_func_rand(); ;
- break;}
- case 483:
- #line 1537 "sql_yacc.yy"
- { yyval.item= new Item_func_replace(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 484:
- #line 1539 "sql_yacc.yy"
- { yyval.item= new Item_func_right(yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 485:
- #line 1541 "sql_yacc.yy"
- { yyval.item= new Item_func_round(yyvsp[-1].item, new Item_int((char*)"0",0,1),0); ;
- break;}
- case 486:
- #line 1542 "sql_yacc.yy"
- { yyval.item= new Item_func_round(yyvsp[-3].item,yyvsp[-1].item,0); ;
- break;}
- case 487:
- #line 1544 "sql_yacc.yy"
- { yyval.item= new Item_func_second(yyvsp[-1].item); ;
- break;}
- case 488:
- #line 1546 "sql_yacc.yy"
- { yyval.item= new Item_func_substr(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 489:
- #line 1548 "sql_yacc.yy"
- { yyval.item= new Item_func_substr(yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 490:
- #line 1550 "sql_yacc.yy"
- { yyval.item= new Item_func_substr(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 491:
- #line 1552 "sql_yacc.yy"
- { yyval.item= new Item_func_substr(yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 492:
- #line 1554 "sql_yacc.yy"
- { yyval.item= new Item_func_substr_index(yyvsp[-5].item,yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 493:
- #line 1556 "sql_yacc.yy"
- { yyval.item= new Item_func_trim(yyvsp[-1].item,new Item_string(" ",1)); ;
- break;}
- case 494:
- #line 1558 "sql_yacc.yy"
- { yyval.item= new Item_func_ltrim(yyvsp[-1].item,yyvsp[-3].item); ;
- break;}
- case 495:
- #line 1560 "sql_yacc.yy"
- { yyval.item= new Item_func_rtrim(yyvsp[-1].item,yyvsp[-3].item); ;
- break;}
- case 496:
- #line 1562 "sql_yacc.yy"
- { yyval.item= new Item_func_trim(yyvsp[-1].item,yyvsp[-3].item); ;
- break;}
- case 497:
- #line 1564 "sql_yacc.yy"
- { yyval.item= new Item_func_trim(yyvsp[-1].item,yyvsp[-3].item); ;
- break;}
- case 498:
- #line 1566 "sql_yacc.yy"
- { yyval.item= new Item_func_round(yyvsp[-3].item,yyvsp[-1].item,1); ;
- break;}
- case 499:
- #line 1568 "sql_yacc.yy"
- {
- if (yyvsp[-1].item_list != NULL)
- yyval.item = new Item_sum_udf_str(yyvsp[-3].udf, *yyvsp[-1].item_list);
- else
- yyval.item = new Item_sum_udf_str(yyvsp[-3].udf);
- ;
- break;}
- case 500:
- #line 1575 "sql_yacc.yy"
- {
- if (yyvsp[-1].item_list != NULL)
- yyval.item = new Item_sum_udf_float(yyvsp[-3].udf, *yyvsp[-1].item_list);
- else
- yyval.item = new Item_sum_udf_float(yyvsp[-3].udf);
- ;
- break;}
- case 501:
- #line 1582 "sql_yacc.yy"
- {
- if (yyvsp[-1].item_list != NULL)
- yyval.item = new Item_sum_udf_int(yyvsp[-3].udf, *yyvsp[-1].item_list);
- else
- yyval.item = new Item_sum_udf_int(yyvsp[-3].udf);
- ;
- break;}
- case 502:
- #line 1589 "sql_yacc.yy"
- {
- if (yyvsp[-1].item_list != NULL)
- yyval.item = new Item_func_udf_str(yyvsp[-3].udf, *yyvsp[-1].item_list);
- else
- yyval.item = new Item_func_udf_str(yyvsp[-3].udf);
- ;
- break;}
- case 503:
- #line 1596 "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 504:
- #line 1603 "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 505:
- #line 1610 "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 506:
- #line 1612 "sql_yacc.yy"
- { yyval.item= new Item_func_unix_timestamp(); ;
- break;}
- case 507:
- #line 1614 "sql_yacc.yy"
- { yyval.item= new Item_func_unix_timestamp(yyvsp[-1].item); ;
- break;}
- case 508:
- #line 1616 "sql_yacc.yy"
- { yyval.item= new Item_func_user(); ;
- break;}
- case 509:
- #line 1618 "sql_yacc.yy"
- { yyval.item= new Item_func_week(yyvsp[-1].item,new Item_int((char*) "0",0,1)); ;
- break;}
- case 510:
- #line 1620 "sql_yacc.yy"
- { yyval.item= new Item_func_week(yyvsp[-3].item,yyvsp[-1].item); ;
- break;}
- case 511:
- #line 1622 "sql_yacc.yy"
- { yyval.item= new Item_func_year(yyvsp[-1].item); ;
- break;}
- case 512:
- #line 1624 "sql_yacc.yy"
- { yyval.item= new Item_func_yearweek(yyvsp[-1].item,new Item_int((char*) "0",0,1)); ;
- break;}
- case 513:
- #line 1626 "sql_yacc.yy"
- { yyval.item= new Item_func_yearweek(yyvsp[-3].item, yyvsp[-1].item); ;
- break;}
- case 514:
- #line 1628 "sql_yacc.yy"
- { yyval.item=new Item_func_benchmark(yyvsp[-3].ulong_num,yyvsp[-1].item); ;
- break;}
- case 515:
- #line 1630 "sql_yacc.yy"
- { yyval.item=new Item_extract( yyvsp[-3].interval, yyvsp[-1].item); ;
- break;}
- case 516:
- #line 1633 "sql_yacc.yy"
- { yyval.item_list= NULL; ;
- break;}
- case 517:
- #line 1634 "sql_yacc.yy"
- { yyval.item_list= yyvsp[0].item_list;;
- break;}
- case 518:
- #line 1638 "sql_yacc.yy"
- { yyval.item=new Item_sum_avg(yyvsp[-1].item); ;
- break;}
- case 519:
- #line 1640 "sql_yacc.yy"
- { yyval.item=new Item_sum_and(yyvsp[-1].item); ;
- break;}
- case 520:
- #line 1642 "sql_yacc.yy"
- { yyval.item=new Item_sum_or(yyvsp[-1].item); ;
- break;}
- case 521:
- #line 1644 "sql_yacc.yy"
- { yyval.item=new Item_sum_count(new Item_int((int32) 0L,1)); ;
- break;}
- case 522:
- #line 1646 "sql_yacc.yy"
- { yyval.item=new Item_sum_count(yyvsp[-1].item); ;
- break;}
- case 523:
- #line 1648 "sql_yacc.yy"
- { yyval.item=new Item_sum_count_distinct(* yyvsp[-1].item_list); ;
- break;}
- case 524:
- #line 1650 "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 525:
- #line 1652 "sql_yacc.yy"
- { yyval.item=new Item_sum_min(yyvsp[-1].item); ;
- break;}
- case 526:
- #line 1654 "sql_yacc.yy"
- { yyval.item=new Item_sum_max(yyvsp[-1].item); ;
- break;}
- case 527:
- #line 1656 "sql_yacc.yy"
- { yyval.item=new Item_sum_std(yyvsp[-1].item); ;
- break;}
- case 528:
- #line 1658 "sql_yacc.yy"
- { yyval.item=new Item_sum_sum(yyvsp[-1].item); ;
- break;}
- case 529:
- #line 1661 "sql_yacc.yy"
- { Lex->in_sum_expr++ ;
- break;}
- case 530:
- #line 1663 "sql_yacc.yy"
- {
- Lex->in_sum_expr--;
- yyval.item=yyvsp[0].item;
- ;
- break;}
- case 531:
- #line 1669 "sql_yacc.yy"
- { Lex->expr_list.push_front(new List<Item>); ;
- break;}
- case 532:
- #line 1671 "sql_yacc.yy"
- { yyval.item_list= Lex->expr_list.pop(); ;
- break;}
- case 533:
- #line 1674 "sql_yacc.yy"
- { Lex->expr_list.head()->push_back(yyvsp[0].item); ;
- break;}
- case 534:
- #line 1675 "sql_yacc.yy"
- { Lex->expr_list.head()->push_back(yyvsp[0].item); ;
- break;}
- case 535:
- #line 1678 "sql_yacc.yy"
- { Lex->expr_list.push_front(new List<Item>); ;
- break;}
- case 536:
- #line 1680 "sql_yacc.yy"
- { yyval.item_list= Lex->expr_list.pop(); ;
- break;}
- case 537:
- #line 1683 "sql_yacc.yy"
- { Lex->expr_list.head()->push_back(yyvsp[0].item); ;
- break;}
- case 538:
- #line 1684 "sql_yacc.yy"
- { Lex->expr_list.head()->push_back(yyvsp[0].item); ;
- break;}
- case 539:
- #line 1687 "sql_yacc.yy"
- { yyval.item= NULL; ;
- break;}
- case 540:
- #line 1688 "sql_yacc.yy"
- { yyval.item= yyvsp[0].item; ;
- break;}
- case 541:
- #line 1691 "sql_yacc.yy"
- { yyval.item= NULL; ;
- break;}
- case 542:
- #line 1692 "sql_yacc.yy"
- { yyval.item= yyvsp[0].item; ;
- break;}
- case 543:
- #line 1695 "sql_yacc.yy"
- { Lex->when_list.push_front(new List<Item>) ;
- break;}
- case 544:
- #line 1697 "sql_yacc.yy"
- { yyval.item_list= Lex->when_list.pop(); ;
- break;}
- case 545:
- #line 1701 "sql_yacc.yy"
- {
- Lex->when_list.head()->push_back(yyvsp[-2].item);
- Lex->when_list.head()->push_back(yyvsp[0].item);
- ;
- break;}
- case 546:
- #line 1706 "sql_yacc.yy"
- {
- Lex->when_list.head()->push_back(yyvsp[-2].item);
- Lex->when_list.head()->push_back(yyvsp[0].item);
- ;
- break;}
- case 547:
- #line 1712 "sql_yacc.yy"
- { yyval.item=new Item_string(" ",1); ;
- break;}
- case 548:
- #line 1713 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; ;
- break;}
- case 549:
- #line 1716 "sql_yacc.yy"
- { yyval.table_list=yyvsp[-1].table_list; ;
- break;}
- case 550:
- #line 1717 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list; ;
- break;}
- case 551:
- #line 1718 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list ;
- break;}
- case 552:
- #line 1719 "sql_yacc.yy"
- { yyval.table_list=yyvsp[0].table_list ; yyval.table_list->straight=1; ;
- break;}
- case 553:
- #line 1721 "sql_yacc.yy"
- { add_join_on(yyvsp[-2].table_list,yyvsp[0].item); yyval.table_list=yyvsp[-2].table_list; ;
- break;}
- case 554:
- #line 1723 "sql_yacc.yy"
- { Lex->db1=yyvsp[-3].table_list->db; Lex->table1=yyvsp[-3].table_list->name;
- Lex->db2=yyvsp[0].table_list->db; Lex->table2=yyvsp[0].table_list->name; ;
- break;}
- case 555:
- #line 1726 "sql_yacc.yy"
- { add_join_on(yyvsp[-5].table_list,yyvsp[-1].item); yyval.table_list=yyvsp[-5].table_list; ;
- break;}
- case 556:
- #line 1728 "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 557:
- #line 1730 "sql_yacc.yy"
- { Lex->db1=yyvsp[-4].table_list->db; Lex->table1=yyvsp[-4].table_list->name;
- Lex->db2=yyvsp[0].table_list->db; Lex->table2=yyvsp[0].table_list->name; ;
- break;}
- case 558:
- #line 1733 "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 559:
- #line 1735 "sql_yacc.yy"
- { add_join_natural(yyvsp[-5].table_list,yyvsp[0].table_list); yyvsp[0].table_list->outer_join|=JOIN_TYPE_LEFT; yyval.table_list=yyvsp[0].table_list; ;
- break;}
- case 560:
- #line 1737 "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[-6].table_list; ;
- break;}
- case 561:
- #line 1739 "sql_yacc.yy"
- { Lex->db1=yyvsp[-4].table_list->db; Lex->table1=yyvsp[-4].table_list->name;
- Lex->db2=yyvsp[0].table_list->db; Lex->table2=yyvsp[0].table_list->name; ;
- break;}
- case 562:
- #line 1742 "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[-9].table_list; ;
- break;}
- case 563:
- #line 1744 "sql_yacc.yy"
- { add_join_natural(yyvsp[0].table_list,yyvsp[-5].table_list); yyvsp[-5].table_list->outer_join|=JOIN_TYPE_RIGHT; yyval.table_list=yyvsp[-5].table_list; ;
- break;}
- case 564:
- #line 1746 "sql_yacc.yy"
- { add_join_natural(yyvsp[-3].table_list,yyvsp[0].table_list); yyval.table_list=yyvsp[0].table_list; ;
- break;}
- case 565:
- #line 1749 "sql_yacc.yy"
- {;
- break;}
- case 566:
- #line 1750 "sql_yacc.yy"
- {;
- break;}
- case 567:
- #line 1751 "sql_yacc.yy"
- {;
- break;}
- case 568:
- #line 1754 "sql_yacc.yy"
- { Lex->use_index_ptr=Lex->ignore_index_ptr=0; ;
- break;}
- case 569:
- #line 1756 "sql_yacc.yy"
- { if (!(yyval.table_list=add_table_to_list(yyvsp[-2].table,yyvsp[-1].lex_str_ptr,0,TL_UNLOCK, Lex->use_index_ptr,
- Lex->ignore_index_ptr))) YYABORT; ;
- break;}
- case 570:
- #line 1759 "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 571:
- #line 1762 "sql_yacc.yy"
- {;
- break;}
- case 572:
- #line 1763 "sql_yacc.yy"
- {;
- break;}
- case 573:
- #line 1766 "sql_yacc.yy"
- {;
- break;}
- case 574:
- #line 1768 "sql_yacc.yy"
- { Lex->use_index= *yyvsp[0].string_list; Lex->use_index_ptr= &Lex->use_index; ;
- break;}
- case 575:
- #line 1770 "sql_yacc.yy"
- { Lex->ignore_index= *yyvsp[0].string_list; Lex->ignore_index_ptr= &Lex->ignore_index;;
- break;}
- case 576:
- #line 1773 "sql_yacc.yy"
- { Lex->interval_list.empty() ;
- break;}
- case 577:
- #line 1774 "sql_yacc.yy"
- { yyval.string_list= &Lex->interval_list; ;
- break;}
- case 578:
- #line 1778 "sql_yacc.yy"
- { Lex->interval_list.push_back(new String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length)); ;
- break;}
- case 579:
- #line 1780 "sql_yacc.yy"
- { Lex->interval_list.push_back(new String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length)); ;
- break;}
- case 580:
- #line 1782 "sql_yacc.yy"
- { Lex->interval_list.push_back(new String("PRIMARY",7)); ;
- break;}
- case 581:
- #line 1786 "sql_yacc.yy"
- { if (!(yyval.item= new Item_func_eq(new Item_field(Lex->db1,Lex->table1, yyvsp[0].lex_str.str), new Item_field(Lex->db2,Lex->table2,yyvsp[0].lex_str.str))))
- YYABORT;
- ;
- break;}
- case 582:
- #line 1790 "sql_yacc.yy"
- {
- if (!(yyval.item= new Item_cond_and(new Item_func_eq(new Item_field(Lex->db1,Lex->table1,yyvsp[0].lex_str.str), new Item_field(Lex->db2,Lex->table2,yyvsp[0].lex_str.str)), yyvsp[-2].item)))
- YYABORT;
- ;
- break;}
- case 583:
- #line 1796 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_HOUR; ;
- break;}
- case 584:
- #line 1797 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_MINUTE; ;
- break;}
- case 585:
- #line 1798 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY_SECOND; ;
- break;}
- case 586:
- #line 1799 "sql_yacc.yy"
- { yyval.interval=INTERVAL_DAY; ;
- break;}
- case 587:
- #line 1800 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR_MINUTE; ;
- break;}
- case 588:
- #line 1801 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR_SECOND; ;
- break;}
- case 589:
- #line 1802 "sql_yacc.yy"
- { yyval.interval=INTERVAL_HOUR; ;
- break;}
- case 590:
- #line 1803 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MINUTE_SECOND; ;
- break;}
- case 591:
- #line 1804 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MINUTE; ;
- break;}
- case 592:
- #line 1805 "sql_yacc.yy"
- { yyval.interval=INTERVAL_MONTH; ;
- break;}
- case 593:
- #line 1806 "sql_yacc.yy"
- { yyval.interval=INTERVAL_SECOND; ;
- break;}
- case 594:
- #line 1807 "sql_yacc.yy"
- { yyval.interval=INTERVAL_YEAR_MONTH; ;
- break;}
- case 595:
- #line 1808 "sql_yacc.yy"
- { yyval.interval=INTERVAL_YEAR; ;
- break;}
- case 599:
- #line 1816 "sql_yacc.yy"
- { yyval.lex_str_ptr=0; ;
- break;}
- case 600:
- #line 1818 "sql_yacc.yy"
- { yyval.lex_str_ptr= (LEX_STRING*) sql_memdup(&yyvsp[0].lex_str,sizeof(LEX_STRING)); ;
- break;}
- case 601:
- #line 1822 "sql_yacc.yy"
- { Lex->where= 0; ;
- break;}
- case 602:
- #line 1823 "sql_yacc.yy"
- { Lex->where= yyvsp[0].item; ;
- break;}
- case 604:
- #line 1827 "sql_yacc.yy"
- { Lex->create_refs=1; ;
- break;}
- case 605:
- #line 1828 "sql_yacc.yy"
- { Lex->having= yyvsp[0].item; Lex->create_refs=0; ;
- break;}
- case 606:
- #line 1831 "sql_yacc.yy"
- { yyval.simple_string= yyvsp[0].lex_str.str; ;
- break;}
- case 607:
- #line 1832 "sql_yacc.yy"
- { yyval.simple_string= (char*) "\"; ;
- break;}
- case 610:
- #line 1845 "sql_yacc.yy"
- { if (add_group_to_list(yyvsp[0].item,(bool) 1)) YYABORT; ;
- break;}
- case 611:
- #line 1847 "sql_yacc.yy"
- { if (add_group_to_list(yyvsp[0].item,(bool) 1)) YYABORT; ;
- break;}
- case 614:
- #line 1858 "sql_yacc.yy"
- { Lex->sort_default=1; ;
- break;}
- case 616:
- #line 1862 "sql_yacc.yy"
- { if (add_order_to_list(yyvsp[-1].item,(bool) yyvsp[0].num)) YYABORT; ;
- break;}
- case 617:
- #line 1864 "sql_yacc.yy"
- { if (add_order_to_list(yyvsp[-1].item,(bool) yyvsp[0].num)) YYABORT; ;
- break;}
- case 618:
- #line 1867 "sql_yacc.yy"
- { yyval.num = 1; ;
- break;}
- case 619:
- #line 1868 "sql_yacc.yy"
- { yyval.num = Lex->sort_default=1; ;
- break;}
- case 620:
- #line 1869 "sql_yacc.yy"
- { yyval.num = Lex->sort_default=0; ;
- break;}
- case 621:
- #line 1874 "sql_yacc.yy"
- {
- Lex->select_limit= current_thd->default_select_limit;
- Lex->offset_limit= 0L;
- ;
- break;}
- case 622:
- #line 1879 "sql_yacc.yy"
- { Lex->select_limit= yyvsp[0].ulong_num; Lex->offset_limit=0L; ;
- break;}
- case 623:
- #line 1881 "sql_yacc.yy"
- { Lex->select_limit= yyvsp[0].ulong_num; Lex->offset_limit=yyvsp[-2].ulong_num; ;
- break;}
- case 624:
- #line 1885 "sql_yacc.yy"
- {
- Lex->select_limit= HA_POS_ERROR;
- ;
- break;}
- case 625:
- #line 1889 "sql_yacc.yy"
- { Lex->select_limit= (ha_rows) yyvsp[0].ulonglong_num; ;
- break;}
- case 626:
- #line 1892 "sql_yacc.yy"
- { yyval.ulong_num= strtoul(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 627:
- #line 1893 "sql_yacc.yy"
- { yyval.ulong_num= strtoul(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 628:
- #line 1894 "sql_yacc.yy"
- { yyval.ulong_num= strtoul(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 629:
- #line 1897 "sql_yacc.yy"
- { yyval.ulonglong_num= (ulonglong) strtoul(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 630:
- #line 1898 "sql_yacc.yy"
- { yyval.ulonglong_num= strtoull(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 631:
- #line 1899 "sql_yacc.yy"
- { yyval.ulonglong_num= strtoull(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 632:
- #line 1900 "sql_yacc.yy"
- { yyval.ulonglong_num= strtoull(yyvsp[0].lex_str.str,NULL,10); ;
- break;}
- case 634:
- #line 1905 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->proc_list.elements=0;
- lex->proc_list.first=0;
- lex->proc_list.next= (byte**) &lex->proc_list.first;
- if (add_proc_to_list(new Item_field(NULL,NULL,yyvsp[0].lex_str.str)))
- YYABORT;
- ;
- break;}
- case 636:
- #line 1917 "sql_yacc.yy"
- {;
- break;}
- case 637:
- #line 1918 "sql_yacc.yy"
- {;
- break;}
- case 640:
- #line 1926 "sql_yacc.yy"
- {
- if (add_proc_to_list(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));
- ;
- break;}
- case 641:
- #line 1935 "sql_yacc.yy"
- {
- if (!(Lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,0)))
- YYABORT;
- ;
- break;}
- case 643:
- #line 1941 "sql_yacc.yy"
- {
- if (!(Lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,1)))
- YYABORT;
- ;
- break;}
- case 644:
- #line 1953 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_DROP_TABLE;
- Lex->drop_if_exists = yyvsp[-2].num;
- ;
- break;}
- case 645:
- #line 1957 "sql_yacc.yy"
- {;
- break;}
- case 646:
- #line 1958 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_DROP_INDEX;
- Lex->drop_list.empty();
- Lex->drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- yyvsp[-3].lex_str.str));
- if (!add_table_to_list(yyvsp[-1].table,NULL, 1))
- YYABORT;
- ;
- break;}
- case 647:
- #line 1967 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_DROP_DB;
- Lex->drop_if_exists=yyvsp[-1].num;
- Lex->name=yyvsp[0].lex_str.str;
- ;
- break;}
- case 648:
- #line 1973 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_DROP_FUNCTION;
- Lex->udf.name=yyvsp[0].lex_str.str;
- ;
- break;}
- case 651:
- #line 1985 "sql_yacc.yy"
- { if (!add_table_to_list(yyvsp[0].table,NULL,1)) YYABORT; ;
- break;}
- case 652:
- #line 1988 "sql_yacc.yy"
- { yyval.num=0; ;
- break;}
- case 653:
- #line 1989 "sql_yacc.yy"
- { yyval.num= 1; ;
- break;}
- case 654:
- #line 1996 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_INSERT; ;
- break;}
- case 656:
- #line 1999 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_REPLACE; ;
- break;}
- case 658:
- #line 2002 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_CONCURRENT_INSERT; ;
- break;}
- case 659:
- #line 2003 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_LOW_PRIORITY; ;
- break;}
- case 660:
- #line 2004 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_DELAYED; ;
- break;}
- case 661:
- #line 2005 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE; ;
- break;}
- case 662:
- #line 2008 "sql_yacc.yy"
- {;
- break;}
- case 663:
- #line 2009 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_DELAYED; ;
- break;}
- case 664:
- #line 2012 "sql_yacc.yy"
- {;
- break;}
- case 665:
- #line 2013 "sql_yacc.yy"
- {;
- break;}
- case 666:
- #line 2017 "sql_yacc.yy"
- {
- Lex->field_list.empty();
- Lex->many_values.empty();
- Lex->insert_list=0;
- ;
- break;}
- case 667:
- #line 2024 "sql_yacc.yy"
- {;
- break;}
- case 668:
- #line 2026 "sql_yacc.yy"
- {
- if (!(Lex->insert_list = new List_item) ||
- Lex->many_values.push_back(Lex->insert_list))
- YYABORT;
- ;
- break;}
- case 670:
- #line 2034 "sql_yacc.yy"
- { ;
- break;}
- case 671:
- #line 2035 "sql_yacc.yy"
- { ;
- break;}
- case 672:
- #line 2036 "sql_yacc.yy"
- { ;
- break;}
- case 673:
- #line 2039 "sql_yacc.yy"
- { Lex->field_list.push_back(yyvsp[0].item); ;
- break;}
- case 674:
- #line 2040 "sql_yacc.yy"
- { Lex->field_list.push_back(yyvsp[0].item); ;
- break;}
- case 675:
- #line 2043 "sql_yacc.yy"
- {;
- break;}
- case 676:
- #line 2045 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = (lex->sql_command == SQLCOM_INSERT ?
- SQLCOM_INSERT_SELECT : SQLCOM_REPLACE_SELECT);
- mysql_init_select(lex);
- ;
- break;}
- case 677:
- #line 2051 "sql_yacc.yy"
- {;
- break;}
- case 682:
- #line 2064 "sql_yacc.yy"
- {
- if (Lex->field_list.push_back(yyvsp[-2].item) ||
- Lex->insert_list->push_back(yyvsp[0].item))
- YYABORT;
- ;
- break;}
- case 683:
- #line 2070 "sql_yacc.yy"
- {;
- break;}
- case 684:
- #line 2071 "sql_yacc.yy"
- {;
- break;}
- case 685:
- #line 2075 "sql_yacc.yy"
- {
- if (!(Lex->insert_list = new List_item))
- YYABORT;
- ;
- break;}
- case 686:
- #line 2080 "sql_yacc.yy"
- {
- if (Lex->many_values.push_back(Lex->insert_list))
- YYABORT;
- ;
- break;}
- case 687:
- #line 2086 "sql_yacc.yy"
- {;
- break;}
- case 689:
- #line 2091 "sql_yacc.yy"
- {
- if (Lex->insert_list->push_back(yyvsp[0].item))
- YYABORT;
- ;
- break;}
- case 690:
- #line 2096 "sql_yacc.yy"
- {
- if (Lex->insert_list->push_back(yyvsp[0].item))
- YYABORT;
- ;
- break;}
- case 691:
- #line 2105 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_UPDATE; ;
- break;}
- case 692:
- #line 2109 "sql_yacc.yy"
- {
- if (add_item_to_list(yyvsp[-2].item) || add_value_to_list(yyvsp[0].item))
- YYABORT;
- ;
- break;}
- case 693:
- #line 2114 "sql_yacc.yy"
- {
- if (add_item_to_list(yyvsp[-2].item) || add_value_to_list(yyvsp[0].item))
- YYABORT;
- ;
- break;}
- case 694:
- #line 2120 "sql_yacc.yy"
- { Lex->lock_option= current_thd->update_lock_default; ;
- break;}
- case 695:
- #line 2121 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_LOW_PRIORITY; ;
- break;}
- case 696:
- #line 2127 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_DELETE; Lex->options=0;
- Lex->lock_option= current_thd->update_lock_default; ;
- break;}
- case 698:
- #line 2134 "sql_yacc.yy"
- {;
- break;}
- case 699:
- #line 2135 "sql_yacc.yy"
- {;
- break;}
- case 700:
- #line 2138 "sql_yacc.yy"
- { Lex->options|= OPTION_QUICK; ;
- break;}
- case 701:
- #line 2139 "sql_yacc.yy"
- { Lex->lock_option= TL_WRITE_LOW_PRIORITY; ;
- break;}
- case 702:
- #line 2143 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_TRUNCATE; Lex->options=0;
- Lex->lock_option= current_thd->update_lock_default; ;
- break;}
- case 705:
- #line 2152 "sql_yacc.yy"
- { Lex->wild=0;;
- break;}
- case 707:
- #line 2156 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_DATABASES; ;
- break;}
- case 708:
- #line 2158 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_TABLES; Lex->db= yyvsp[-1].simple_string; Lex->options=0;;
- break;}
- case 709:
- #line 2160 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_TABLES;
- Lex->options|= SELECT_DESCRIBE;
- Lex->db= yyvsp[-1].simple_string;
- ;
- break;}
- case 710:
- #line 2165 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
- Lex->db= yyvsp[-1].simple_string;
- Lex->options=0;
- ;
- break;}
- case 711:
- #line 2170 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_SHOW_FIELDS;
- if (yyvsp[-1].simple_string)
- yyvsp[-2].table->change_db(yyvsp[-1].simple_string);
- if (!add_table_to_list(yyvsp[-2].table,NULL,0))
- YYABORT;
- ;
- break;}
- case 712:
- #line 2178 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_BINLOGS;
- ;
- break;}
- case 713:
- #line 2182 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_SHOW_KEYS;
- if (yyvsp[0].simple_string)
- yyvsp[-1].table->change_db(yyvsp[0].simple_string);
- if (!add_table_to_list(yyvsp[-1].table,NULL,0))
- YYABORT;
- ;
- break;}
- case 714:
- #line 2190 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_STATUS; ;
- break;}
- case 715:
- #line 2192 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;;
- break;}
- case 716:
- #line 2194 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_VARIABLES; ;
- break;}
- case 717:
- #line 2196 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_LOGS; ;
- break;}
- case 718:
- #line 2198 "sql_yacc.yy"
- { Lex->sql_command= SQLCOM_SHOW_GRANTS;
- Lex->grant_user=yyvsp[0].lex_user; Lex->grant_user->password.str=NullS; ;
- break;}
- case 719:
- #line 2201 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_CREATE;
- if(!add_table_to_list(yyvsp[0].table, NULL,0))
- YYABORT;
- ;
- break;}
- case 720:
- #line 2207 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
- ;
- break;}
- case 721:
- #line 2211 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
- ;
- break;}
- case 722:
- #line 2216 "sql_yacc.yy"
- { yyval.simple_string= 0; ;
- break;}
- case 723:
- #line 2217 "sql_yacc.yy"
- { yyval.simple_string= yyvsp[0].lex_str.str; ;
- break;}
- case 725:
- #line 2221 "sql_yacc.yy"
- { Lex->wild= yyvsp[0].string; ;
- break;}
- case 726:
- #line 2224 "sql_yacc.yy"
- { Lex->verbose=0; ;
- break;}
- case 727:
- #line 2225 "sql_yacc.yy"
- { Lex->verbose=1; ;
- break;}
- case 728:
- #line 2230 "sql_yacc.yy"
- {
- Lex->wild=0;
- Lex->verbose=0;
- Lex->sql_command=SQLCOM_SHOW_FIELDS;
- if (!add_table_to_list(yyvsp[0].table, NULL,0))
- YYABORT;
- ;
- break;}
- case 730:
- #line 2238 "sql_yacc.yy"
- { Lex->options|= SELECT_DESCRIBE ;
- break;}
- case 733:
- #line 2246 "sql_yacc.yy"
- {;
- break;}
- case 734:
- #line 2247 "sql_yacc.yy"
- { Lex->wild= yyvsp[0].string; ;
- break;}
- case 735:
- #line 2248 "sql_yacc.yy"
- { Lex->wild= new String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); ;
- break;}
- case 736:
- #line 2254 "sql_yacc.yy"
- {Lex->sql_command= SQLCOM_FLUSH; Lex->type=0; ;
- break;}
- case 740:
- #line 2261 "sql_yacc.yy"
- { Lex->type|= REFRESH_TABLES; ;
- break;}
- case 742:
- #line 2262 "sql_yacc.yy"
- { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; ;
- break;}
- case 743:
- #line 2263 "sql_yacc.yy"
- { Lex->type|= REFRESH_HOSTS; ;
- break;}
- case 744:
- #line 2264 "sql_yacc.yy"
- { Lex->type|= REFRESH_GRANT; ;
- break;}
- case 745:
- #line 2265 "sql_yacc.yy"
- { Lex->type|= REFRESH_LOG; ;
- break;}
- case 746:
- #line 2266 "sql_yacc.yy"
- { Lex->type|= REFRESH_STATUS; ;
- break;}
- case 747:
- #line 2267 "sql_yacc.yy"
- { Lex->type|= REFRESH_SLAVE; ;
- break;}
- case 748:
- #line 2268 "sql_yacc.yy"
- { Lex->type|= REFRESH_MASTER; ;
- break;}
- case 749:
- #line 2271 "sql_yacc.yy"
- {;
- break;}
- case 750:
- #line 2272 "sql_yacc.yy"
- {;
- break;}
- case 751:
- #line 2275 "sql_yacc.yy"
- {Lex->sql_command= SQLCOM_RESET; Lex->type=0; ;
- break;}
- case 755:
- #line 2282 "sql_yacc.yy"
- { Lex->type|= REFRESH_SLAVE; ;
- break;}
- case 756:
- #line 2283 "sql_yacc.yy"
- { Lex->type|= REFRESH_MASTER; ;
- break;}
- case 757:
- #line 2286 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_PURGE; Lex->type=0;;
- break;}
- case 758:
- #line 2288 "sql_yacc.yy"
- {
- Lex->to_log = yyvsp[0].lex_str.str;
- ;
- break;}
- case 759:
- #line 2296 "sql_yacc.yy"
- {
- if (yyvsp[0].item->fix_fields(current_thd,0))
- {
- send_error(¤t_thd->net, ER_SET_CONSTANTS_ONLY);
- YYABORT;
- }
- Lex->sql_command=SQLCOM_KILL;
- Lex->thread_id= (ulong) yyvsp[0].item->val_int();
- ;
- break;}
- case 760:
- #line 2309 "sql_yacc.yy"
- { Lex->sql_command=SQLCOM_CHANGE_DB; Lex->db= yyvsp[0].lex_str.str; ;
- break;}
- case 761:
- #line 2314 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_LOAD;
- Lex->local_file= yyvsp[-2].num;
- if (!(Lex->exchange= new sql_exchange(yyvsp[0].lex_str.str,0)))
- YYABORT;
- Lex->field_list.empty();
- ;
- break;}
- case 762:
- #line 2323 "sql_yacc.yy"
- {
- if (!add_table_to_list(yyvsp[-4].table,NULL,1))
- YYABORT;
- ;
- break;}
- case 763:
- #line 2329 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
- if (!add_table_to_list(yyvsp[-2].table,NULL,1))
- YYABORT;
- ;
- break;}
- case 764:
- #line 2337 "sql_yacc.yy"
- { yyval.num=0;;
- break;}
- case 765:
- #line 2338 "sql_yacc.yy"
- { yyval.num=1;;
- break;}
- case 766:
- #line 2341 "sql_yacc.yy"
- { Lex->duplicates=DUP_ERROR; ;
- break;}
- case 767:
- #line 2342 "sql_yacc.yy"
- { Lex->duplicates=DUP_REPLACE; ;
- break;}
- case 768:
- #line 2343 "sql_yacc.yy"
- { Lex->duplicates=DUP_IGNORE; ;
- break;}
- case 773:
- #line 2354 "sql_yacc.yy"
- { Lex->exchange->field_term= yyvsp[0].string;;
- break;}
- case 774:
- #line 2356 "sql_yacc.yy"
- { Lex->exchange->enclosed= yyvsp[0].string; Lex->exchange->opt_enclosed=1;;
- break;}
- case 775:
- #line 2357 "sql_yacc.yy"
- { Lex->exchange->enclosed= yyvsp[0].string;;
- break;}
- case 776:
- #line 2358 "sql_yacc.yy"
- { Lex->exchange->escaped= yyvsp[0].string;;
- break;}
- case 781:
- #line 2369 "sql_yacc.yy"
- { Lex->exchange->line_term= yyvsp[0].string;;
- break;}
- case 782:
- #line 2370 "sql_yacc.yy"
- { Lex->exchange->line_start= yyvsp[0].string;;
- break;}
- case 784:
- #line 2375 "sql_yacc.yy"
- { Lex->exchange->skip_lines=atol(yyvsp[-1].lex_str.str); ;
- break;}
- case 785:
- #line 2380 "sql_yacc.yy"
- { yyval.item = new Item_string(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); ;
- break;}
- case 786:
- #line 2382 "sql_yacc.yy"
- { ((Item_string*) yyvsp[-1].item)->append(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); ;
- break;}
- case 787:
- #line 2385 "sql_yacc.yy"
- { yyval.string= new String(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length); ;
- break;}
- case 788:
- #line 2387 "sql_yacc.yy"
- {
- Item *tmp = new Item_varbinary(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length);
- yyval.string= tmp ? tmp->val_str((String*) 0) : (String*) 0;
- ;
- break;}
- case 789:
- #line 2393 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; ;
- break;}
- case 790:
- #line 2394 "sql_yacc.yy"
- { yyval.item = new Item_int(yyvsp[0].lex_str.str, (longlong) atol(yyvsp[0].lex_str.str),yyvsp[0].lex_str.length); ;
- break;}
- case 791:
- #line 2395 "sql_yacc.yy"
- { yyval.item = new Item_int(yyvsp[0].lex_str.str); ;
- break;}
- case 792:
- #line 2396 "sql_yacc.yy"
- { yyval.item = new Item_real(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); ;
- break;}
- case 793:
- #line 2397 "sql_yacc.yy"
- { yyval.item = new Item_float(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); ;
- break;}
- case 794:
- #line 2398 "sql_yacc.yy"
- { yyval.item = new Item_null();
- Lex->next_state=STATE_OPERATOR_OR_IDENT;;
- break;}
- case 795:
- #line 2400 "sql_yacc.yy"
- { yyval.item = new Item_varbinary(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length);
- break;}
- case 796:
- #line 2401 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; ;
- break;}
- case 797:
- #line 2402 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; ;
- break;}
- case 798:
- #line 2403 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; ;
- break;}
- case 799:
- #line 2410 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; ;
- break;}
- case 800:
- #line 2411 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; ;
- break;}
- case 801:
- #line 2414 "sql_yacc.yy"
- { yyval.item = new Item_field(NullS,yyvsp[-2].lex_str.str,"*"); ;
- break;}
- case 802:
- #line 2416 "sql_yacc.yy"
- { yyval.item = new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str),yyvsp[-2].lex_str.str,"*"); ;
- break;}
- case 804:
- #line 2422 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; ;
- break;}
- case 805:
- #line 2426 "sql_yacc.yy"
- { yyval.item = !Lex->create_refs || Lex->in_sum_expr > 0 ? (Item*) new Item_field(NullS,NullS,yyvsp[0].lex_str.str) : (Item*) new Item_ref(NullS,NullS,yyvsp[0].lex_str.str); ;
- break;}
- case 806:
- #line 2428 "sql_yacc.yy"
- { yyval.item = !Lex->create_refs || Lex->in_sum_expr > 0 ? (Item*) new Item_field(NullS,yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str) : (Item*) new Item_ref(NullS,yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str); ;
- break;}
- case 807:
- #line 2430 "sql_yacc.yy"
- { yyval.item = !Lex->create_refs || Lex->in_sum_expr > 0 ? (Item*) new Item_field(NullS,yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str) : (Item*) new Item_ref(NullS,yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str); ;
- break;}
- case 808:
- #line 2432 "sql_yacc.yy"
- { yyval.item = !Lex->create_refs || Lex->in_sum_expr > 0 ? (Item*) new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS :yyvsp[-4].lex_str.str),yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str) : (Item*) new Item_ref((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS :yyvsp[-4].lex_str.str),yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str); ;
- break;}
- case 809:
- #line 2436 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;;
- break;}
- case 810:
- #line 2437 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;;
- break;}
- case 811:
- #line 2438 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;;
- break;}
- case 812:
- #line 2441 "sql_yacc.yy"
- { yyval.table=new Table_ident(yyvsp[0].lex_str); ;
- break;}
- case 813:
- #line 2442 "sql_yacc.yy"
- { yyval.table=new Table_ident(yyvsp[-2].lex_str,yyvsp[0].lex_str,0);;
- break;}
- case 814:
- #line 2443 "sql_yacc.yy"
- { yyval.table=new Table_ident(yyvsp[0].lex_str);;
- break;}
- case 815:
- #line 2446 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str; ;
- break;}
- case 816:
- #line 2448 "sql_yacc.yy"
- {
- yyval.lex_str.str=sql_strmake(yyvsp[0].symbol.str,yyvsp[0].symbol.length);
- yyval.lex_str.length=yyvsp[0].symbol.length;
- if (Lex->next_state != STATE_END)
- Lex->next_state=STATE_OPERATOR_OR_IDENT;
- ;
- break;}
- case 817:
- #line 2456 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;;
- break;}
- case 818:
- #line 2457 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;;
- break;}
- case 819:
- #line 2458 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;;
- break;}
- case 820:
- #line 2462 "sql_yacc.yy"
- {
- if (!(yyval.lex_user=(LEX_USER*) sql_alloc(sizeof(st_lex_user))))
- YYABORT;
- yyval.lex_user->user = yyvsp[0].lex_str; yyval.lex_user->host.str=NullS;
- ;
- break;}
- case 821:
- #line 2468 "sql_yacc.yy"
- {
- if (!(yyval.lex_user=(LEX_USER*) sql_alloc(sizeof(st_lex_user))))
- YYABORT;
- yyval.lex_user->user = yyvsp[-2].lex_str; yyval.lex_user->host=yyvsp[0].lex_str;
- ;
- break;}
- case 822:
- #line 2477 "sql_yacc.yy"
- {;
- break;}
- case 823:
- #line 2478 "sql_yacc.yy"
- {;
- break;}
- case 824:
- #line 2479 "sql_yacc.yy"
- {;
- break;}
- case 825:
- #line 2480 "sql_yacc.yy"
- {;
- break;}
- case 826:
- #line 2481 "sql_yacc.yy"
- {;
- break;}
- case 827:
- #line 2482 "sql_yacc.yy"
- {;
- break;}
- case 828:
- #line 2483 "sql_yacc.yy"
- {;
- break;}
- case 829:
- #line 2484 "sql_yacc.yy"
- {;
- break;}
- case 830:
- #line 2485 "sql_yacc.yy"
- {;
- break;}
- case 831:
- #line 2486 "sql_yacc.yy"
- {;
- break;}
- case 832:
- #line 2487 "sql_yacc.yy"
- {;
- break;}
- case 833:
- #line 2488 "sql_yacc.yy"
- {;
- break;}
- case 834:
- #line 2489 "sql_yacc.yy"
- {;
- break;}
- case 835:
- #line 2490 "sql_yacc.yy"
- {;
- break;}
- case 836:
- #line 2491 "sql_yacc.yy"
- {;
- break;}
- case 837:
- #line 2492 "sql_yacc.yy"
- {;
- break;}
- case 838:
- #line 2493 "sql_yacc.yy"
- {;
- break;}
- case 839:
- #line 2494 "sql_yacc.yy"
- {;
- break;}
- case 840:
- #line 2495 "sql_yacc.yy"
- {;
- break;}
- case 841:
- #line 2496 "sql_yacc.yy"
- {;
- break;}
- case 842:
- #line 2497 "sql_yacc.yy"
- {;
- break;}
- case 843:
- #line 2498 "sql_yacc.yy"
- {;
- break;}
- case 844:
- #line 2499 "sql_yacc.yy"
- {;
- break;}
- case 845:
- #line 2500 "sql_yacc.yy"
- {;
- break;}
- case 846:
- #line 2501 "sql_yacc.yy"
- {;
- break;}
- case 847:
- #line 2502 "sql_yacc.yy"
- {;
- break;}
- case 848:
- #line 2503 "sql_yacc.yy"
- {;
- break;}
- case 849:
- #line 2504 "sql_yacc.yy"
- {;
- break;}
- case 850:
- #line 2505 "sql_yacc.yy"
- {;
- break;}
- case 851:
- #line 2506 "sql_yacc.yy"
- {;
- break;}
- case 852:
- #line 2507 "sql_yacc.yy"
- {;
- break;}
- case 853:
- #line 2508 "sql_yacc.yy"
- {;
- break;}
- case 854:
- #line 2509 "sql_yacc.yy"
- {;
- break;}
- case 855:
- #line 2510 "sql_yacc.yy"
- {;
- break;}
- case 856:
- #line 2511 "sql_yacc.yy"
- {;
- break;}
- case 857:
- #line 2512 "sql_yacc.yy"
- {;
- break;}
- case 858:
- #line 2513 "sql_yacc.yy"
- {;
- break;}
- case 859:
- #line 2514 "sql_yacc.yy"
- {;
- break;}
- case 860:
- #line 2515 "sql_yacc.yy"
- {;
- break;}
- case 861:
- #line 2516 "sql_yacc.yy"
- {;
- break;}
- case 862:
- #line 2517 "sql_yacc.yy"
- {;
- break;}
- case 863:
- #line 2518 "sql_yacc.yy"
- {;
- break;}
- case 864:
- #line 2519 "sql_yacc.yy"
- {;
- break;}
- case 865:
- #line 2520 "sql_yacc.yy"
- {;
- break;}
- case 866:
- #line 2521 "sql_yacc.yy"
- {;
- break;}
- case 867:
- #line 2522 "sql_yacc.yy"
- {;
- break;}
- case 868:
- #line 2523 "sql_yacc.yy"
- {;
- break;}
- case 869:
- #line 2524 "sql_yacc.yy"
- {;
- break;}
- case 870:
- #line 2525 "sql_yacc.yy"
- {;
- break;}
- case 871:
- #line 2526 "sql_yacc.yy"
- {;
- break;}
- case 872:
- #line 2527 "sql_yacc.yy"
- {;
- break;}
- case 873:
- #line 2528 "sql_yacc.yy"
- {;
- break;}
- case 874:
- #line 2529 "sql_yacc.yy"
- {;
- break;}
- case 875:
- #line 2530 "sql_yacc.yy"
- {;
- break;}
- case 876:
- #line 2531 "sql_yacc.yy"
- {;
- break;}
- case 877:
- #line 2532 "sql_yacc.yy"
- {;
- break;}
- case 878:
- #line 2533 "sql_yacc.yy"
- {;
- break;}
- case 879:
- #line 2534 "sql_yacc.yy"
- {;
- break;}
- case 880:
- #line 2535 "sql_yacc.yy"
- {;
- break;}
- case 881:
- #line 2536 "sql_yacc.yy"
- {;
- break;}
- case 882:
- #line 2537 "sql_yacc.yy"
- {;
- break;}
- case 883:
- #line 2538 "sql_yacc.yy"
- {;
- break;}
- case 884:
- #line 2539 "sql_yacc.yy"
- {;
- break;}
- case 885:
- #line 2540 "sql_yacc.yy"
- {;
- break;}
- case 886:
- #line 2541 "sql_yacc.yy"
- {;
- break;}
- case 887:
- #line 2542 "sql_yacc.yy"
- {;
- break;}
- case 888:
- #line 2543 "sql_yacc.yy"
- {;
- break;}
- case 889:
- #line 2544 "sql_yacc.yy"
- {;
- break;}
- case 890:
- #line 2545 "sql_yacc.yy"
- {;
- break;}
- case 891:
- #line 2546 "sql_yacc.yy"
- {;
- break;}
- case 892:
- #line 2547 "sql_yacc.yy"
- {;
- break;}
- case 893:
- #line 2548 "sql_yacc.yy"
- {;
- break;}
- case 894:
- #line 2549 "sql_yacc.yy"
- {;
- break;}
- case 895:
- #line 2550 "sql_yacc.yy"
- {;
- break;}
- case 896:
- #line 2551 "sql_yacc.yy"
- {;
- break;}
- case 897:
- #line 2552 "sql_yacc.yy"
- {;
- break;}
- case 898:
- #line 2553 "sql_yacc.yy"
- {;
- break;}
- case 899:
- #line 2554 "sql_yacc.yy"
- {;
- break;}
- case 900:
- #line 2555 "sql_yacc.yy"
- {;
- break;}
- case 901:
- #line 2556 "sql_yacc.yy"
- {;
- break;}
- case 902:
- #line 2557 "sql_yacc.yy"
- {;
- break;}
- case 903:
- #line 2558 "sql_yacc.yy"
- {;
- break;}
- case 904:
- #line 2559 "sql_yacc.yy"
- {;
- break;}
- case 905:
- #line 2560 "sql_yacc.yy"
- {;
- break;}
- case 906:
- #line 2561 "sql_yacc.yy"
- {;
- break;}
- case 907:
- #line 2562 "sql_yacc.yy"
- {;
- break;}
- case 908:
- #line 2563 "sql_yacc.yy"
- {;
- break;}
- case 909:
- #line 2564 "sql_yacc.yy"
- {;
- break;}
- case 910:
- #line 2565 "sql_yacc.yy"
- {;
- break;}
- case 911:
- #line 2566 "sql_yacc.yy"
- {;
- break;}
- case 912:
- #line 2567 "sql_yacc.yy"
- {;
- break;}
- case 913:
- #line 2568 "sql_yacc.yy"
- {;
- break;}
- case 914:
- #line 2569 "sql_yacc.yy"
- {;
- break;}
- case 915:
- #line 2570 "sql_yacc.yy"
- {;
- break;}
- case 916:
- #line 2571 "sql_yacc.yy"
- {;
- break;}
- case 917:
- #line 2572 "sql_yacc.yy"
- {;
- break;}
- case 918:
- #line 2573 "sql_yacc.yy"
- {;
- break;}
- case 919:
- #line 2574 "sql_yacc.yy"
- {;
- break;}
- case 920:
- #line 2575 "sql_yacc.yy"
- {;
- break;}
- case 921:
- #line 2581 "sql_yacc.yy"
- {
- Lex->sql_command= SQLCOM_SET_OPTION;
- Lex->options=current_thd->options;
- Lex->select_limit=current_thd->default_select_limit;
- ;
- break;}
- case 923:
- #line 2589 "sql_yacc.yy"
- {;
- break;}
- case 924:
- #line 2590 "sql_yacc.yy"
- {;
- break;}
- case 927:
- #line 2598 "sql_yacc.yy"
- {
- if (atoi(yyvsp[0].lex_str.str) == 0)
- Lex->options&= ~yyvsp[-2].num;
- else
- Lex->options|= yyvsp[-2].num;
- ;
- break;}
- case 928:
- #line 2605 "sql_yacc.yy"
- {
- if (atoi(yyvsp[0].lex_str.str) != 0) /* Test NOT AUTOCOMMIT */
- Lex->options&= ~(OPTION_NOT_AUTO_COMMIT);
- else
- Lex->options|= OPTION_NOT_AUTO_COMMIT;
- ;
- break;}
- case 929:
- #line 2612 "sql_yacc.yy"
- {
- Lex->select_limit= yyvsp[0].ulong_num;
- ;
- break;}
- case 930:
- #line 2616 "sql_yacc.yy"
- {
- Lex->select_limit= HA_POS_ERROR;
- ;
- break;}
- case 931:
- #line 2620 "sql_yacc.yy"
- {
- current_thd->max_join_size= yyvsp[0].ulong_num;
- Lex->options&= ~OPTION_BIG_SELECTS;
- ;
- break;}
- case 932:
- #line 2625 "sql_yacc.yy"
- {
- current_thd->max_join_size= HA_POS_ERROR;
- ;
- break;}
- case 933:
- #line 2629 "sql_yacc.yy"
- {
- current_thd->set_time((time_t) yyvsp[0].ulong_num);
- ;
- break;}
- case 934:
- #line 2633 "sql_yacc.yy"
- {
- current_thd->user_time=0;
- ;
- break;}
- case 935:
- #line 2637 "sql_yacc.yy"
- {
- current_thd->insert_id(yyvsp[0].ulonglong_num);
- ;
- break;}
- case 936:
- #line 2641 "sql_yacc.yy"
- {
- current_thd->next_insert_id=yyvsp[0].ulonglong_num;
- ;
- break;}
- case 937:
- #line 2645 "sql_yacc.yy"
- {
- CONVERT *tmp;
- if (!(tmp=get_convert_set(yyvsp[0].lex_str.str)))
- {
- net_printf(¤t_thd->net,ER_UNKNOWN_CHARACTER_SET,yyvsp[0].lex_str);
- YYABORT;
- }
- current_thd->convert_set=tmp;
- ;
- break;}
- case 938:
- #line 2655 "sql_yacc.yy"
- {
- current_thd->convert_set=0;
- ;
- break;}
- case 939:
- #line 2659 "sql_yacc.yy"
- {
- if (change_password(current_thd,current_thd->host,
- current_thd->priv_user,yyvsp[0].simple_string))
- YYABORT;
- ;
- break;}
- case 940:
- #line 2665 "sql_yacc.yy"
- {
- if (change_password(current_thd,
- yyvsp[-2].lex_user->host.str ? yyvsp[-2].lex_user->host.str : current_thd->host,
- yyvsp[-2].lex_user->user.str,yyvsp[0].simple_string))
- YYABORT;
- ;
- break;}
- case 941:
- #line 2672 "sql_yacc.yy"
- {
- Item_func_set_user_var *item = new Item_func_set_user_var(yyvsp[-2].lex_str,yyvsp[0].item);
- if (item->fix_fields(current_thd,0) || item->update())
- {
- send_error(¤t_thd->net, ER_SET_CONSTANTS_ONLY);
- YYABORT;
- }
- ;
- break;}
- case 942:
- #line 2681 "sql_yacc.yy"
- {
- pthread_mutex_lock(&LOCK_slave);
- if(slave_running)
- send_error(¤t_thd->net, ER_SLAVE_MUST_STOP);
- else
- slave_skip_counter = yyvsp[0].ulong_num;
- pthread_mutex_unlock(&LOCK_slave);
- ;
- break;}
- case 943:
- #line 2691 "sql_yacc.yy"
- { yyval.simple_string=yyvsp[0].lex_str.str;;
- break;}
- case 944:
- #line 2693 "sql_yacc.yy"
- {
- if (!yyvsp[-1].lex_str.length)
- yyval.simple_string=yyvsp[-1].lex_str.str;
- else
- {
- char *buff=(char*) sql_alloc(HASH_PASSWORD_LENGTH+1);
- make_scrambled_password(buff,yyvsp[-1].lex_str.str);
- yyval.simple_string=buff;
- }
- ;
- break;}
- case 945:
- #line 2705 "sql_yacc.yy"
- { yyval.num= OPTION_BIG_TABLES; ;
- break;}
- case 946:
- #line 2706 "sql_yacc.yy"
- { yyval.num= OPTION_BIG_SELECTS; ;
- break;}
- case 947:
- #line 2707 "sql_yacc.yy"
- { yyval.num= OPTION_LOG_OFF; ;
- break;}
- case 948:
- #line 2709 "sql_yacc.yy"
- {
- yyval.num= (opt_sql_bin_update)?
- OPTION_UPDATE_LOG|OPTION_BIN_LOG:
- OPTION_UPDATE_LOG ;
- ;
- break;}
- case 949:
- #line 2715 "sql_yacc.yy"
- {
- yyval.num= (opt_sql_bin_update)?
- OPTION_UPDATE_LOG|OPTION_BIN_LOG:
- OPTION_BIN_LOG ;
- ;
- break;}
- case 950:
- #line 2720 "sql_yacc.yy"
- { yyval.num= OPTION_WARNINGS; ;
- break;}
- case 951:
- #line 2721 "sql_yacc.yy"
- { yyval.num= OPTION_LOW_PRIORITY_UPDATES; ;
- break;}
- case 952:
- #line 2722 "sql_yacc.yy"
- { yyval.num= OPTION_AUTO_IS_NULL; ;
- break;}
- case 953:
- #line 2723 "sql_yacc.yy"
- { yyval.num= OPTION_SAFE_UPDATES; ;
- break;}
- case 954:
- #line 2724 "sql_yacc.yy"
- { yyval.num= OPTION_BUFFER_RESULT; ;
- break;}
- case 955:
- #line 2725 "sql_yacc.yy"
- { yyval.num= OPTION_QUOTE_SHOW_CREATE; ;
- break;}
- case 956:
- #line 2731 "sql_yacc.yy"
- {
- Lex->sql_command=SQLCOM_LOCK_TABLES;
- ;
- break;}
- case 962:
- #line 2746 "sql_yacc.yy"
- { if (!add_table_to_list(yyvsp[-2].table,yyvsp[-1].lex_str_ptr,0,(thr_lock_type) yyvsp[0].num)) YYABORT; ;
- break;}
- case 963:
- #line 2749 "sql_yacc.yy"
- { yyval.num=TL_READ_NO_INSERT; ;
- break;}
- case 964:
- #line 2750 "sql_yacc.yy"
- { yyval.num=current_thd->update_lock_default; ;
- break;}
- case 965:
- #line 2751 "sql_yacc.yy"
- { yyval.num=TL_WRITE_LOW_PRIORITY; ;
- break;}
- case 966:
- #line 2752 "sql_yacc.yy"
- { yyval.num= TL_READ; ;
- break;}
- case 967:
- #line 2755 "sql_yacc.yy"
- { Lex->sql_command=SQLCOM_UNLOCK_TABLES; ;
- break;}
- case 968:
- #line 2762 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_REVOKE;
- Lex->users_list.empty();
- Lex->columns.empty();
- Lex->grant= Lex->grant_tot_col=0;
- Lex->db=0;
- ;
- break;}
- case 970:
- #line 2773 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_GRANT;
- Lex->users_list.empty();
- Lex->columns.empty();
- Lex->grant= Lex->grant_tot_col=0;
- Lex->db=0;
- ;
- break;}
- case 972:
- #line 2784 "sql_yacc.yy"
- {;
- break;}
- case 973:
- #line 2785 "sql_yacc.yy"
- { Lex->grant = UINT_MAX;;
- break;}
- case 974:
- #line 2786 "sql_yacc.yy"
- { Lex->grant = UINT_MAX;;
- break;}
- case 977:
- #line 2794 "sql_yacc.yy"
- { Lex->which_columns = SELECT_ACL;;
- break;}
- case 979:
- #line 2797 "sql_yacc.yy"
- { Lex->which_columns = INSERT_ACL; ;
- break;}
- case 981:
- #line 2800 "sql_yacc.yy"
- { Lex->which_columns = UPDATE_ACL; ;
- break;}
- case 983:
- #line 2802 "sql_yacc.yy"
- { Lex->grant |= DELETE_ACL;;
- break;}
- case 984:
- #line 2803 "sql_yacc.yy"
- { Lex->which_columns = REFERENCES_ACL;;
- break;}
- case 986:
- #line 2804 "sql_yacc.yy"
- {;
- break;}
- case 987:
- #line 2805 "sql_yacc.yy"
- { Lex->grant |= INDEX_ACL;;
- break;}
- case 988:
- #line 2806 "sql_yacc.yy"
- { Lex->grant |= ALTER_ACL;;
- break;}
- case 989:
- #line 2807 "sql_yacc.yy"
- { Lex->grant |= CREATE_ACL;;
- break;}
- case 990:
- #line 2808 "sql_yacc.yy"
- { Lex->grant |= DROP_ACL;;
- break;}
- case 991:
- #line 2809 "sql_yacc.yy"
- { Lex->grant |= RELOAD_ACL;;
- break;}
- case 992:
- #line 2810 "sql_yacc.yy"
- { Lex->grant |= SHUTDOWN_ACL;;
- break;}
- case 993:
- #line 2811 "sql_yacc.yy"
- { Lex->grant |= PROCESS_ACL;;
- break;}
- case 994:
- #line 2812 "sql_yacc.yy"
- { Lex->grant |= FILE_ACL;;
- break;}
- case 995:
- #line 2813 "sql_yacc.yy"
- { Lex->grant |= GRANT_ACL;;
- break;}
- case 996:
- #line 2817 "sql_yacc.yy"
- {
- Lex->db=current_thd->db;
- if (Lex->grant == UINT_MAX)
- Lex->grant = DB_ACLS & ~GRANT_ACL;
- else if (Lex->columns.elements)
- {
- net_printf(¤t_thd->net,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
- }
- ;
- break;}
- case 997:
- #line 2828 "sql_yacc.yy"
- {
- Lex->db = yyvsp[-2].lex_str.str;
- if (Lex->grant == UINT_MAX)
- Lex->grant = DB_ACLS & ~GRANT_ACL;
- else if (Lex->columns.elements)
- {
- net_printf(¤t_thd->net,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
- }
- ;
- break;}
- case 998:
- #line 2839 "sql_yacc.yy"
- {
- Lex->db = NULL;
- if (Lex->grant == UINT_MAX)
- Lex->grant = GLOBAL_ACLS & ~GRANT_ACL;
- else if (Lex->columns.elements)
- {
- net_printf(¤t_thd->net,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
- }
- ;
- break;}
- case 999:
- #line 2850 "sql_yacc.yy"
- {
- if (!add_table_to_list(yyvsp[0].table,NULL,0))
- YYABORT;
- if (Lex->grant == UINT_MAX)
- Lex->grant = TABLE_ACLS & ~GRANT_ACL;
- ;
- break;}
- case 1000:
- #line 2859 "sql_yacc.yy"
- { if (Lex->users_list.push_back(yyvsp[0].lex_user)) YYABORT;;
- break;}
- case 1001:
- #line 2860 "sql_yacc.yy"
- { if (Lex->users_list.push_back(yyvsp[0].lex_user)) YYABORT;;
- break;}
- case 1002:
- #line 2865 "sql_yacc.yy"
- {
- yyval.lex_user=yyvsp[-3].lex_user; yyvsp[-3].lex_user->password=yyvsp[0].lex_str;
- if (yyvsp[0].lex_str.length)
- {
- char *buff=(char*) sql_alloc(HASH_PASSWORD_LENGTH+1);
- if (buff)
- {
- make_scrambled_password(buff,yyvsp[0].lex_str.str);
- yyvsp[-3].lex_user->password.str=buff;
- yyvsp[-3].lex_user->password.length=HASH_PASSWORD_LENGTH;
- }
- }
- ;
- break;}
- case 1003:
- #line 2879 "sql_yacc.yy"
- { yyval.lex_user=yyvsp[-4].lex_user; yyvsp[-4].lex_user->password=yyvsp[0].lex_str ; ;
- break;}
- case 1004:
- #line 2881 "sql_yacc.yy"
- { yyval.lex_user=yyvsp[0].lex_user; yyvsp[0].lex_user->password.str=NullS; ;
- break;}
- case 1005:
- #line 2885 "sql_yacc.yy"
- { Lex->grant |= Lex->which_columns; ;
- break;}
- case 1009:
- #line 2894 "sql_yacc.yy"
- {
- String *new_str = new String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length);
- List_iterator <LEX_COLUMN> iter(Lex->columns);
- class LEX_COLUMN *point;
- while ((point=iter++))
- {
- if (!my_strcasecmp(point->column.ptr(),new_str->ptr()))
- break;
- }
- Lex->grant_tot_col|= Lex->which_columns;
- if (point)
- point->rights |= Lex->which_columns;
- else
- Lex->columns.push_back(new LEX_COLUMN (*new_str,Lex->which_columns));
- ;
- break;}
- case 1010:
- #line 2911 "sql_yacc.yy"
- {;
- break;}
- case 1011:
- #line 2912 "sql_yacc.yy"
- { Lex->grant |= GRANT_ACL;;
- break;}
- case 1012:
- #line 2915 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_BEGIN;;
- break;}
- case 1014:
- #line 2918 "sql_yacc.yy"
- {;
- break;}
- case 1015:
- #line 2919 "sql_yacc.yy"
- {;
- break;}
- case 1016:
- #line 2922 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_COMMIT;;
- break;}
- case 1017:
- #line 2925 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_ROLLBACK;;
- break;}
- }
- /* the action file gets copied in in place of this dollarsign */
- #line 543 "/usr/lib/bison.simple"
- yyvsp -= yylen;
- yyssp -= yylen;
- #ifdef YYLSP_NEEDED
- yylsp -= yylen;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "n");
- }
- #endif
- *++yyvsp = yyval;
- #ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
- #endif
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
- yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
- goto yynewstate;
- yyerrlab: /* here on detecting error */
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
- {
- ++yynerrs;
- #ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- int size = 0;
- char *msg;
- int x, count;
- count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
- if (msg != 0)
- {
- strcpy(msg, "parse error");
- if (count < 5)
- {
- count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- {
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
- }
- }
- yyerror(msg);
- free(msg);
- }
- else
- yyerror ("parse error; also virtual memory exceeded");
- }
- else
- #endif /* YYERROR_VERBOSE */
- yyerror("parse error");
- }
- goto yyerrlab1;
- yyerrlab1: /* here on error raised explicitly by an action */
- if (yyerrstatus == 3)
- {
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).n", yychar, yytname[yychar1]);
- #endif
- yychar = YYEMPTY;
- }
- /* Else will try to reuse lookahead token
- after shifting the error token. */
- yyerrstatus = 3; /* Each real token shifted decrements this */
- goto yyerrhandle;
- yyerrdefault: /* current state does not do anything special for the error token. */
- #if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
- #endif
- yyerrpop: /* pop the current state because it cannot handle the error token */
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
- #ifdef YYLSP_NEEDED
- yylsp--;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "n");
- }
- #endif
- yyerrhandle:
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
- if (yyn == YYFINAL)
- YYACCEPT;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
- #endif
- *++yyvsp = yylval;
- #ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
- #endif
- yystate = yyn;
- goto yynewstate;
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 0;
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 1;
- }
- #line 2926 "sql_yacc.yy"