~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Andrew Hutchings
  • Date: 2011-02-07 17:20:59 UTC
  • mfrom: (2148 staging)
  • mto: (2148.2.3 build)
  • mto: This revision was merged to the branch mainline in revision 2149.
  • Revision ID: andrew@linuxjedi.co.uk-20110207172059-dyeahrgzrlincoe3
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
696
696
  @param var_name               Variable name
697
697
*/
698
698
 
699
 
void create_select_for_variable(const char *var_name)
 
699
void create_select_for_variable(Session *session, const char *var_name)
700
700
{
701
 
  Session *session;
702
701
  LEX *lex;
703
702
  LEX_STRING tmp, null_lex_string;
704
703
  Item *var;
705
704
  char buff[MAX_SYS_VAR_LENGTH*2+4+8];
706
705
  char *end= buff;
707
706
 
708
 
  session= current_session;
709
707
  lex= session->lex;
710
708
  init_select(lex);
711
709
  lex->sql_command= SQLCOM_SELECT;
722
720
    var->set_name(buff, end-buff, system_charset_info);
723
721
    session->add_item_to_list(var);
724
722
  }
725
 
  return;
726
723
}
727
724
 
728
725
 
887
884
}
888
885
 
889
886
 
890
 
/** Store position for column in ALTER TABLE .. ADD column. */
891
 
 
892
 
void store_position_for_column(const char *name)
893
 
{
894
 
  current_session->lex->last_field->after=const_cast<char*> (name);
895
 
}
896
 
 
897
887
/**
898
888
  Add a table to list of used tables.
899
889
 
1058
1048
bool Select_Lex::init_nested_join(Session *session)
1059
1049
{
1060
1050
  TableList *ptr;
1061
 
  nested_join_st *nested_join;
 
1051
  NestedJoin *nested_join;
1062
1052
 
1063
1053
  if (!(ptr= (TableList*) session->calloc(ALIGN_SIZE(sizeof(TableList))+
1064
 
                                       sizeof(nested_join_st))))
 
1054
                                       sizeof(NestedJoin))))
1065
1055
    return true;
1066
 
  ptr->setNestedJoin(((nested_join_st*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList)))));
 
1056
  ptr->setNestedJoin(((NestedJoin*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList)))));
1067
1057
  nested_join= ptr->getNestedJoin();
1068
1058
  join_list->push_front(ptr);
1069
1059
  ptr->setEmbedding(embedding);
1093
1083
TableList *Select_Lex::end_nested_join(Session *)
1094
1084
{
1095
1085
  TableList *ptr;
1096
 
  nested_join_st *nested_join;
 
1086
  NestedJoin *nested_join;
1097
1087
 
1098
1088
  assert(embedding);
1099
1089
  ptr= embedding;
1134
1124
TableList *Select_Lex::nest_last_join(Session *session)
1135
1125
{
1136
1126
  TableList *ptr;
1137
 
  nested_join_st *nested_join;
 
1127
  NestedJoin *nested_join;
1138
1128
  List<TableList> *embedded_list;
1139
1129
 
1140
1130
  if (!(ptr= (TableList*) session->calloc(ALIGN_SIZE(sizeof(TableList))+
1141
 
                                          sizeof(nested_join_st))))
 
1131
                                          sizeof(NestedJoin))))
1142
1132
    return NULL;
1143
 
  ptr->setNestedJoin(((nested_join_st*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList)))));
 
1133
  ptr->setNestedJoin(((NestedJoin*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList)))));
1144
1134
  nested_join= ptr->getNestedJoin();
1145
1135
  ptr->setEmbedding(embedding);
1146
1136
  ptr->setJoinList(join_list);