~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/sql_insert.cc

  • Committer: Brian Aker
  • Date: 2008-07-18 18:55:10 UTC
  • mfrom: (177.1.5 drizzle)
  • Revision ID: brian@tangent.org-20080718185510-o5nnn7g5ub81llqr
Head merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    }
99
99
 
100
100
    thd->dup_field= 0;
101
 
    select_lex->no_wrap_view_item= true;
102
101
 
103
102
    /* Save the state of the current name resolution context. */
104
103
    ctx_state.save_state(context, table_list);
113
112
 
114
113
    /* Restore the current context. */
115
114
    ctx_state.restore_state(context, table_list);
116
 
    thd->lex->select_lex.no_wrap_view_item= false;
117
115
 
118
116
    if (res)
119
117
      return -1;
721
719
 
722
720
    if (!res && duplic == DUP_UPDATE)
723
721
    {
724
 
      select_lex->no_wrap_view_item= true;
725
722
      res= check_update_fields(thd, context->table_list, update_fields, &map);
726
 
      select_lex->no_wrap_view_item= false;
727
723
    }
728
724
 
729
725
    /* Restore the current context. */
741
737
 
742
738
  if (!select_insert)
743
739
  {
744
 
    Item *fake_conds= 0;
745
740
    TABLE_LIST *duplicate;
746
741
    if ((duplicate= unique_table(thd, table_list, table_list->next_global, 1)))
747
742
    {
748
743
      update_non_unique_table_error(table_list, "INSERT", duplicate);
749
744
      return(true);
750
745
    }
751
 
    select_lex->fix_prepare_information(thd, &fake_conds, &fake_conds);
752
746
    select_lex->first_execution= 0;
753
747
  }
754
748
  if (duplic == DUP_UPDATE || duplic == DUP_REPLACE)
1199
1193
    table_list->next_local= 0;
1200
1194
    context->resolve_in_table_list_only(table_list);
1201
1195
 
1202
 
    lex->select_lex.no_wrap_view_item= true;
1203
1196
    res= res || check_update_fields(thd, context->table_list,
1204
1197
                                    *info.update_fields, &map);
1205
 
    lex->select_lex.no_wrap_view_item= false;
1206
1198
    /*
1207
1199
      When we are not using GROUP BY and there are no ungrouped aggregate functions 
1208
1200
      we can refer to other tables in the ON DUPLICATE KEY part.