~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Brian Aker
  • Date: 2010-11-08 20:10:51 UTC
  • mfrom: (1910.2.8 merge)
  • Revision ID: brian@tangent.org-20101108201051-fmplr6oke3c088kf
Encapsulation around locking/kill

Show diffs side-by-side

added added

removed removed

Lines of Context:
591
591
    return 1;
592
592
  }
593
593
  if (const_tables && !(select_options & SELECT_NO_UNLOCK))
594
 
    mysql_unlock_some_tables(session, table, const_tables);
 
594
    session->unlockSomeTables(table, const_tables);
595
595
  if (!conds && outer_join)
596
596
  {
597
597
    /* Handle the case where we have an OUTER JOIN without a WHERE */
1788
1788
    is called after all rows are sent, but before EOF packet is sent.
1789
1789
 
1790
1790
    For a simple SELECT with no subqueries this function performs a full
1791
 
    cleanup of the Join and calls mysql_unlock_read_tables to free used base
 
1791
    cleanup of the Join and calls unlockReadTables to free used base
1792
1792
    tables.
1793
1793
 
1794
1794
    If a Join is executed for a subquery or if it has a subquery, we can't
1860
1860
      TODO: unlock tables even if the join isn't top level select in the
1861
1861
      tree.
1862
1862
    */
1863
 
    mysql_unlock_read_tables(session, lock);           // Don't free join->lock
 
1863
    session->unlockReadTables(lock);           // Don't free join->lock
1864
1864
    lock= 0;
1865
1865
  }
1866
1866
 
2462
2462
    return NESTED_LOOP_ERROR;
2463
2463
  if (error < 0)
2464
2464
    return NESTED_LOOP_NO_MORE_ROWS;
2465
 
  if (join->session->killed)                    // Aborted by user
 
2465
  if (join->session->getKilled())                       // Aborted by user
2466
2466
  {
2467
2467
    join->session->send_kill_message();
2468
2468
    return NESTED_LOOP_KILLED;
2674
2674
  info= &join_tab->read_record;
2675
2675
  do
2676
2676
  {
2677
 
    if (join->session->killed)
 
2677
    if (join->session->getKilled())
2678
2678
    {
2679
2679
      join->session->send_kill_message();
2680
2680
      return NESTED_LOOP_KILLED;
2806
2806
{
2807
2807
  Table *table= join->tmp_table;
2808
2808
 
2809
 
  if (join->session->killed)                    // Aborted by user
 
2809
  if (join->session->getKilled())                       // Aborted by user
2810
2810
  {
2811
2811
    join->session->send_kill_message();
2812
2812
    return NESTED_LOOP_KILLED;
2852
2852
 
2853
2853
  if (end_of_records)
2854
2854
    return NESTED_LOOP_OK;
2855
 
  if (join->session->killed)                    // Aborted by user
 
2855
  if (join->session->getKilled())                       // Aborted by user
2856
2856
  {
2857
2857
    join->session->send_kill_message();
2858
2858
    return NESTED_LOOP_KILLED;
2917
2917
 
2918
2918
  if (end_of_records)
2919
2919
    return NESTED_LOOP_OK;
2920
 
  if (join->session->killed)                    // Aborted by user
 
2920
  if (join->session->getKilled())                       // Aborted by user
2921
2921
  {
2922
2922
    join->session->send_kill_message();
2923
2923
    return NESTED_LOOP_KILLED;
4182
4182
                                             uint32_t prune_level)
4183
4183
{
4184
4184
  Session *session= join->session;
4185
 
  if (session->killed)  // Abort
 
4185
  if (session->getKilled())  // Abort
4186
4186
    return(true);
4187
4187
 
4188
4188
  /*
5880
5880
    join->best_read= 1.0;
5881
5881
  }
5882
5882
  /* Generate an execution plan from the found optimal join order. */
5883
 
  return (join->session->killed || get_best_combination(join));
 
5883
  return (join->session->getKilled() || get_best_combination(join));
5884
5884
}
5885
5885
 
5886
5886
/**