~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Mark Atwood
  • Date: 2011-11-11 18:23:18 UTC
  • mfrom: (2456.1.5 rf)
  • Revision ID: me@mark.atwood.name-20111111182318-skgcp9ce65fd2goa
mergeĀ lp:~olafvdspek/drizzle/refactor11

Show diffs side-by-side

added added

removed removed

Lines of Context:
909
909
 
910
910
  if (not table->is_derived_table() && table->db.data())
911
911
  {
912
 
    my_casedn_str(files_charset_info, table->db.str_);
 
912
    files_charset_info->casedn_str(table->db.str_);
913
913
    if (not schema::check(*session, identifier::Schema(table->db)))
914
914
    {
915
915
      my_error(ER_WRONG_DB_NAME, MYF(0), table->db.data());
958
958
    TableList *first_table= (TableList*) table_list.first;
959
959
    for (TableList *tables= first_table; tables; tables= tables->next_local)
960
960
    {
961
 
      if (not my_strcasecmp(table_alias_charset, alias_str, tables->alias) &&
962
 
        not my_strcasecmp(system_charset_info, ptr->getSchemaName(), tables->getSchemaName()))
 
961
      if (not table_alias_charset->strcasecmp(alias_str, tables->alias) &&
 
962
        not system_charset_info->strcasecmp(ptr->getSchemaName(), tables->getSchemaName()))
963
963
      {
964
964
        my_error(ER_NONUNIQ_TABLE, MYF(0), alias_str);
965
965
        return NULL;
974
974
      element
975
975
      We don't use the offsetof() macro here to avoid warnings from gcc
976
976
    */
977
 
    previous_table_ref= (TableList*) ((char*) table_list.next -
978
 
                                       ((char*) &(ptr->next_local) -
979
 
                                        (char*) ptr));
 
977
    previous_table_ref= (TableList*) ((char*) table_list.next - ((char*) &(ptr->next_local) - (char*) ptr));
980
978
    /*
981
979
      Set next_name_resolution_table of the previous table reference to point
982
980
      to the current table reference. In effect the list
1049
1047
    - 0, otherwise
1050
1048
*/
1051
1049
 
1052
 
TableList *Select_Lex::end_nested_join(Session *)
 
1050
TableList *Select_Lex::end_nested_join()
1053
1051
{
1054
 
  TableList *ptr;
1055
 
  NestedJoin *nested_join;
1056
 
 
1057
1052
  assert(embedding);
1058
 
  ptr= embedding;
 
1053
  TableList* ptr= embedding;
1059
1054
  join_list= ptr->getJoinList();
1060
1055
  embedding= ptr->getEmbedding();
1061
 
  nested_join= ptr->getNestedJoin();
 
1056
  NestedJoin* nested_join= ptr->getNestedJoin();
1062
1057
  if (nested_join->join_list.size() == 1)
1063
1058
  {
1064
1059
    TableList *embedded= &nested_join->join_list.front();
1066
1061
    embedded->setJoinList(join_list);
1067
1062
    embedded->setEmbedding(embedding);
1068
1063
    join_list->push_front(embedded);
1069
 
    ptr= embedded;
 
1064
    return embedded;
1070
1065
  }
1071
 
  else if (nested_join->join_list.size() == 0)
 
1066
  else if (not nested_join->join_list.size())
1072
1067
  {
1073
1068
    join_list->pop();
1074
 
    ptr= NULL;                                     // return value
 
1069
    return NULL;
1075
1070
  }
1076
1071
  return ptr;
1077
1072
}
1202
1197
 
1203
1198
void Select_Lex::set_lock_for_tables(thr_lock_type lock_type)
1204
1199
{
1205
 
  for (TableList *tables= (TableList*) table_list.first;
1206
 
       tables;
1207
 
       tables= tables->next_local)
 
1200
  for (TableList *tables= (TableList*) table_list.first; tables; tables= tables->next_local)
1208
1201
  {
1209
1202
    tables->lock_type= lock_type;
1210
1203
  }