~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2009-02-03 18:51:40 UTC
  • Revision ID: brian@tangent.org-20090203185140-bt9pe55bnyo4h6jz
Cleaned up interface notes on UPDATE

Show diffs side-by-side

added added

removed removed

Lines of Context:
962
962
{
963
963
  int res= false;
964
964
  bool need_start_waiting= false; // have protection against global read lock
965
 
  int  up_result= 0;
966
965
  LEX  *lex= session->lex;
967
966
  /* first SELECT_LEX (have special meaning for many of non-SELECTcommands) */
968
967
  SELECT_LEX *select_lex= &lex->select_lex;
1406
1405
      break;
1407
1406
    assert(select_lex->offset_limit == 0);
1408
1407
    unit->set_limit(select_lex);
1409
 
    res= (up_result= mysql_update(session, all_tables,
1410
 
                                  select_lex->item_list,
1411
 
                                  lex->value_list,
1412
 
                                  select_lex->where,
1413
 
                                  select_lex->order_list.elements,
1414
 
                                  (order_st *) select_lex->order_list.first,
1415
 
                                  unit->select_limit_cnt,
1416
 
                                  lex->duplicates, lex->ignore));
1417
 
    /* mysql_update return 2 if we need to switch to multi-update */
1418
 
    if (up_result != 2)
1419
 
      break;
1420
 
    /* Fall through */
 
1408
    res= mysql_update(session, all_tables,
 
1409
                      select_lex->item_list,
 
1410
                      lex->value_list,
 
1411
                      select_lex->where,
 
1412
                      select_lex->order_list.elements,
 
1413
                      (order_st *) select_lex->order_list.first,
 
1414
                      unit->select_limit_cnt,
 
1415
                      lex->duplicates, lex->ignore);
 
1416
    break;
1421
1417
  case SQLCOM_UPDATE_MULTI:
1422
1418
  {
1423
1419
    assert(first_table == all_tables && first_table != 0);
1424
 
    /* if we switched from normal update, rights are checked */
1425
 
    if (up_result != 2)
1426
 
    {
1427
 
      if ((res= multi_update_precheck(session, all_tables)))
1428
 
        break;
1429
 
    }
1430
 
    else
1431
 
      res= 0;
1432
 
 
1433
 
    res= mysql_multi_update_prepare(session);
1434
 
 
1435
 
    {
1436
 
      if (res)
1437
 
        break;
1438
 
 
1439
 
    }  /* unlikely */
 
1420
    if ((res= multi_update_precheck(session, all_tables)))
 
1421
      break;
 
1422
 
 
1423
    if ((res= mysql_multi_update_prepare(session)))
 
1424
      break;
1440
1425
 
1441
1426
    res= mysql_multi_update(session, all_tables,
1442
1427
                            &select_lex->item_list,