~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Mark Atwood
  • Date: 2008-10-16 11:16:12 UTC
  • mfrom: (520.1.2 drizzle)
  • mto: (520.1.13 drizzle)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: mark@fallenpegasus.com-20081016111612-5nei7m5subslx912
mergeĀ fromĀ head

Show diffs side-by-side

added added

removed removed

Lines of Context:
495
495
  bool error= 0;
496
496
 
497
497
  thd->command=command;
498
 
  /*
499
 
    Commands which always take a long time are logged into
500
 
    the slow log only if opt_log_slow_admin_statements is set.
501
 
  */
502
 
  thd->enable_slow_log= true;
503
498
  thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
504
499
  thd->set_time();
505
500
  pthread_mutex_lock(&LOCK_thread_count);
758
753
      uint32_t slave_server_id;
759
754
 
760
755
      status_var_increment(thd->status_var.com_other);
761
 
      thd->enable_slow_log= opt_log_slow_admin_statements;
762
756
      /* TODO: The following has to be changed to an 8 byte integer */
763
757
      pos = uint4korr(packet);
764
758
      flags = uint2korr(packet + 4);
1476
1470
    assert(first_table == all_tables && first_table != 0);
1477
1471
    if (end_active_trans(thd))
1478
1472
      goto error;
1479
 
    /*
1480
 
      Currently CREATE INDEX or DROP INDEX cause a full table rebuild
1481
 
      and thus classify as slow administrative statements just like
1482
 
      ALTER TABLE.
1483
 
    */
1484
 
    thd->enable_slow_log= opt_log_slow_admin_statements;
1485
1473
 
1486
1474
    memset(&create_info, 0, sizeof(create_info));
1487
1475
    create_info.db_type= 0;
1573
1561
        break;
1574
1562
      }
1575
1563
 
1576
 
      thd->enable_slow_log= opt_log_slow_admin_statements;
1577
1564
      res= mysql_alter_table(thd, select_lex->db, lex->name.str,
1578
1565
                             &create_info,
1579
1566
                             first_table,
1624
1611
  case SQLCOM_REPAIR:
1625
1612
  {
1626
1613
    assert(first_table == all_tables && first_table != 0);
1627
 
    thd->enable_slow_log= opt_log_slow_admin_statements;
1628
1614
    res= mysql_repair_table(thd, first_table, &lex->check_opt);
1629
1615
    /* ! we write after unlocking the table */
1630
1616
    /*
1638
1624
  case SQLCOM_CHECK:
1639
1625
  {
1640
1626
    assert(first_table == all_tables && first_table != 0);
1641
 
    thd->enable_slow_log= opt_log_slow_admin_statements;
1642
1627
    res = mysql_check_table(thd, first_table, &lex->check_opt);
1643
1628
    select_lex->table_list.first= (unsigned char*) first_table;
1644
1629
    lex->query_tables=all_tables;
1647
1632
  case SQLCOM_ANALYZE:
1648
1633
  {
1649
1634
    assert(first_table == all_tables && first_table != 0);
1650
 
    thd->enable_slow_log= opt_log_slow_admin_statements;
1651
1635
    res= mysql_analyze_table(thd, first_table, &lex->check_opt);
1652
1636
    /* ! we write after unlocking the table */
1653
1637
    write_bin_log(thd, true, thd->query, thd->query_length);
1659
1643
  case SQLCOM_OPTIMIZE:
1660
1644
  {
1661
1645
    assert(first_table == all_tables && first_table != 0);
1662
 
    thd->enable_slow_log= opt_log_slow_admin_statements;
1663
1646
    res= mysql_optimize_table(thd, first_table, &lex->check_opt);
1664
1647
    /* ! we write after unlocking the table */
1665
1648
    write_bin_log(thd, true, thd->query, thd->query_length);
2867
2850
                       Item *default_value, Item *on_update_value,
2868
2851
                       LEX_STRING *comment,
2869
2852
                       char *change,
2870
 
                       List<String> *interval_list, const CHARSET_INFO * const cs)
 
2853
                       List<String> *interval_list, const CHARSET_INFO * const cs,
 
2854
                       virtual_column_info *vcol_info)
2871
2855
{
2872
2856
  register Create_field *new_field;
2873
2857
  LEX  *lex= thd->lex;
2938
2922
  if (!(new_field= new Create_field()) ||
2939
2923
      new_field->init(thd, field_name->str, type, length, decimals, type_modifier,
2940
2924
                      default_value, on_update_value, comment, change,
2941
 
                      interval_list, cs, 0, column_format))
 
2925
                      interval_list, cs, 0, column_format,
 
2926
                      vcol_info))
2942
2927
    return(1);
2943
2928
 
2944
2929
  lex->alter_info.create_list.push_back(new_field);