~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:27:09 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103032709-oyvfrc6eb8fzj0mr
fix docs warning: docs/unlock.rst:2: (WARNING/2) Title underline too short.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
16
/*
17
17
  Derived tables
54
54
          Force join->join_tmp creation, because we will use this JOIN
55
55
          twice for EXPLAIN and we have to have unchanged join for EXPLAINing
56
56
        */
57
 
        sl->uncacheable|= UNCACHEABLE_EXPLAIN;
58
 
        sl->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
 
57
        sl->uncacheable.set(UNCACHEABLE_EXPLAIN);
 
58
        sl->master_unit()->uncacheable.set(UNCACHEABLE_EXPLAIN);
59
59
      }
60
60
    }
61
61
  }
137
137
    if (res)
138
138
    {
139
139
      if (table)
140
 
        table->free_tmp_table(session);
 
140
      {
 
141
        table= 0;
 
142
      }
141
143
      delete derived_result;
142
144
    }
143
145
    else
144
146
    {
145
 
      if (! session->fill_derived_tables())
146
 
      {
147
 
        delete derived_result;
148
 
        derived_result= NULL;
149
 
      }
150
147
      orig_table_list->derived_result= derived_result;
151
148
      orig_table_list->table= table;
152
 
      orig_table_list->table_name=        table->s->table_name.str;
153
 
      orig_table_list->table_name_length= table->s->table_name.length;
 
149
      orig_table_list->setTableName(const_cast<char *>(table->getShare()->getTableName()));
 
150
      orig_table_list->table_name_length= table->getShare()->getTableNameSize();
154
151
      table->derived_select_number= first_select->select_number;
155
 
      table->s->tmp_table= message::Table::TEMPORARY;
156
 
      orig_table_list->db= (char *)"";
 
152
      orig_table_list->setSchemaName((char *)"");
157
153
      orig_table_list->db_length= 0;
158
154
      /* Force read of table stats in the optimizer */
159
155
      table->cursor->info(HA_STATUS_VARIABLE);
160
156
      /* Add new temporary table to list of open derived tables */
161
 
      table->next= session->derived_tables;
 
157
      table->setNext(session->derived_tables);
162
158
      session->derived_tables= table;
163
159
    }
164
160
  }
218
214
                        first_select->item_list, first_select->where,
219
215
                        (first_select->order_list.elements+
220
216
                        first_select->group_list.elements),
221
 
                        (order_st *) first_select->order_list.first,
222
 
                        (order_st *) first_select->group_list.first,
 
217
                        (Order *) first_select->order_list.first,
 
218
                        (Order *) first_select->group_list.first,
223
219
                        first_select->having,
224
220
                        (first_select->options | session->options | SELECT_NO_UNLOCK),
225
221
                        derived_result, unit, first_select);