~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2009-08-17 00:51:17 UTC
  • mfrom: (1115.3.4 captain)
  • Revision ID: brian@gaz-20090817005117-j9der2dkee8pwbw5
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <drizzled/sql_load.h>
36
36
#include <drizzled/lock.h>
37
37
#include <drizzled/select_send.h>
38
 
#include <drizzled/command.h>
 
38
#include <drizzled/statement.h>
39
39
 
40
40
#include <bitset>
41
41
#include <algorithm>
885
885
    res= mysql_truncate(session, first_table, 0);
886
886
 
887
887
    break;
888
 
  case SQLCOM_DELETE:
889
 
  {
890
 
    assert(first_table == all_tables && first_table != 0);
891
 
    assert(select_lex->offset_limit == 0);
892
 
    unit->set_limit(select_lex);
893
 
 
894
 
    if (!(need_start_waiting= !wait_if_global_read_lock(session, 0, 1)))
895
 
    {
896
 
      res= 1;
897
 
      break;
898
 
    }
899
 
 
900
 
    res = mysql_delete(session, all_tables, select_lex->where,
901
 
                       &select_lex->order_list,
902
 
                       unit->select_limit_cnt, select_lex->options,
903
 
                       false);
904
 
    break;
905
 
  }
906
888
  case SQLCOM_DROP_TABLE:
907
889
  {
908
890
    assert(first_table == all_tables && first_table != 0);
953
935
 
954
936
    break;
955
937
  }
956
 
 
957
 
  case SQLCOM_UNLOCK_TABLES:
958
 
    /*
959
 
      It is critical for mysqldump --single-transaction --master-data that
960
 
      UNLOCK TABLES does not implicitely commit a connection which has only
961
 
      done FLUSH TABLES WITH READ LOCK + BEGIN. If this assumption becomes
962
 
      false, mysqldump will not work.
963
 
    */
964
 
    if (session->global_read_lock)
965
 
      unlock_global_read_lock(session);
966
 
    session->my_ok();
967
 
    break;
968
938
  case SQLCOM_CREATE_DB:
969
939
  {
970
940
    /*
1025
995
    res= mysql_alter_db(session, db->str, &create_info);
1026
996
    break;
1027
997
  }
1028
 
  case SQLCOM_SHOW_CREATE_DB:
1029
 
  {
1030
 
    if (check_db_name(&lex->name))
1031
 
    {
1032
 
      my_error(ER_WRONG_DB_NAME, MYF(0), lex->name.str);
1033
 
      break;
1034
 
    }
1035
 
    res= mysqld_show_create_db(session, lex->name.str,
1036
 
                               lex->create_info.options &
1037
 
                                 HA_LEX_CREATE_IF_NOT_EXISTS);
1038
 
    break;
1039
 
  }
1040
998
  case SQLCOM_FLUSH:
1041
999
  {
1042
1000
    /*
1198
1156
   */
1199
1157
  if (comm_not_executed)
1200
1158
  {
1201
 
    /* now we are ready to execute the command */
1202
 
    res= lex->command->execute();
 
1159
    /* now we are ready to execute the statement */
 
1160
    res= lex->statement->execute();
1203
1161
  }
1204
1162
 
1205
1163
  session->set_proc_info("query end");