~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    false Items are OK
36
36
*/
37
37
 
38
 
static bool check_fields(THD *thd, List<Item> &items)
 
38
static bool check_fields(Session *thd, List<Item> &items)
39
39
{
40
40
  List_iterator<Item> it(items);
41
41
  Item *item;
148
148
    1  - error
149
149
*/
150
150
 
151
 
int mysql_update(THD *thd,
 
151
int mysql_update(Session *thd,
152
152
                 TableList *table_list,
153
153
                 List<Item> &fields,
154
154
                 List<Item> &values,
175
175
  bool          need_reopen;
176
176
  uint64_t     id;
177
177
  List<Item> all_fields;
178
 
  THD::killed_state killed_status= THD::NOT_KILLED;
 
178
  Session::killed_state killed_status= Session::NOT_KILLED;
179
179
  
180
180
  for ( ; ; )
181
181
  {
619
619
  */
620
620
  killed_status= thd->killed; // get the status of the volatile
621
621
  // simulated killing after the loop must be ineffective for binlogging
622
 
  error= (killed_status == THD::NOT_KILLED)?  error : 1;
 
622
  error= (killed_status == Session::NOT_KILLED)?  error : 1;
623
623
 
624
624
  if (error &&
625
625
      will_batch &&
668
668
    {
669
669
      if (error < 0)
670
670
        thd->clear_error();
671
 
      if (thd->binlog_query(THD::ROW_QUERY_TYPE,
 
671
      if (thd->binlog_query(Session::ROW_QUERY_TYPE,
672
672
                            thd->query, thd->query_length,
673
673
                            transactional_table, false, killed_status) &&
674
674
          transactional_table)
730
730
    false OK
731
731
    true  error
732
732
*/
733
 
bool mysql_prepare_update(THD *thd, TableList *table_list,
 
733
bool mysql_prepare_update(Session *thd, TableList *table_list,
734
734
                         Item **conds, uint32_t order_num, order_st *order)
735
735
{
736
736
  List<Item> all_fields;
810
810
    true  Error
811
811
*/
812
812
 
813
 
int mysql_multi_update_prepare(THD *thd)
 
813
int mysql_multi_update_prepare(Session *thd)
814
814
{
815
815
  LEX *lex= thd->lex;
816
816
  TableList *table_list= lex->query_tables;
960
960
  Setup multi-update handling and call SELECT to do the join
961
961
*/
962
962
 
963
 
bool mysql_multi_update(THD *thd,
 
963
bool mysql_multi_update(Session *thd,
964
964
                        TableList *table_list,
965
965
                        List<Item> *fields,
966
966
                        List<Item> *values,
1152
1152
    1           Safe to update
1153
1153
*/
1154
1154
 
1155
 
static bool safe_update_on_fly(THD *thd, JOIN_TAB *join_tab,
 
1155
static bool safe_update_on_fly(Session *thd, JOIN_TAB *join_tab,
1156
1156
                               TableList *table_ref, TableList *all_tables)
1157
1157
{
1158
1158
  Table *table= join_tab->table;
1496
1496
    if (mysql_bin_log.is_open())
1497
1497
    {
1498
1498
      /*
1499
 
        THD::killed status might not have been set ON at time of an error
 
1499
        Session::killed status might not have been set ON at time of an error
1500
1500
        got caught and if happens later the killed error is written
1501
1501
        into repl event.
1502
1502
      */
1503
 
      thd->binlog_query(THD::ROW_QUERY_TYPE,
 
1503
      thd->binlog_query(Session::ROW_QUERY_TYPE,
1504
1504
                        thd->query, thd->query_length,
1505
1505
                        transactional_tables, false);
1506
1506
    }
1668
1668
{
1669
1669
  char buff[STRING_BUFFER_USUAL_SIZE];
1670
1670
  uint64_t id;
1671
 
  THD::killed_state killed_status= THD::NOT_KILLED;
 
1671
  Session::killed_state killed_status= Session::NOT_KILLED;
1672
1672
  
1673
1673
  thd->set_proc_info("updating reference tables");
1674
1674
 
1681
1681
    if local_error is not set ON until after do_updates() then
1682
1682
    later carried out killing should not affect binlogging.
1683
1683
  */
1684
 
  killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed;
 
1684
  killed_status= (local_error == 0)? Session::NOT_KILLED : thd->killed;
1685
1685
  thd->set_proc_info("end");
1686
1686
 
1687
1687
  /*
1701
1701
    {
1702
1702
      if (local_error == 0)
1703
1703
        thd->clear_error();
1704
 
      if (thd->binlog_query(THD::ROW_QUERY_TYPE,
 
1704
      if (thd->binlog_query(Session::ROW_QUERY_TYPE,
1705
1705
                            thd->query, thd->query_length,
1706
1706
                            transactional_tables, false, killed_status) &&
1707
1707
          trans_safe)