~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.h

  • Committer: Brian Aker
  • Date: 2008-08-18 22:20:43 UTC
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: brian@tangent.org-20080818222043-et6zf93ogrgx1cz9
Refactoring table.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
class Protocol;
17
 
struct TABLE_LIST;
 
17
struct TableList;
18
18
void item_init(void);                   /* Init item functions */
19
19
class Item_field;
20
20
 
264
264
    statements we have to change this member dynamically to ensure correct
265
265
    name resolution of different parts of the statement.
266
266
  */
267
 
  TABLE_LIST *table_list;
 
267
  TableList *table_list;
268
268
  /*
269
269
    In most cases the two table references below replace 'table_list' above
270
270
    for the purpose of name resolution. The first and last name resolution
272
272
    join tree in a FROM clause. This is needed for NATURAL JOIN, JOIN ... USING
273
273
    and JOIN ... ON. 
274
274
  */
275
 
  TABLE_LIST *first_name_resolution_table;
 
275
  TableList *first_name_resolution_table;
276
276
  /*
277
277
    Last table to search in the list of leaf table references that begins
278
278
    with first_name_resolution_table.
279
279
  */
280
 
  TABLE_LIST *last_name_resolution_table;
 
280
  TableList *last_name_resolution_table;
281
281
 
282
282
  /*
283
283
    SELECT_LEX item belong to, in case of merged VIEW it can differ from
321
321
    last_name_resolution_table= NULL;
322
322
  }
323
323
 
324
 
  void resolve_in_table_list_only(TABLE_LIST *tables)
 
324
  void resolve_in_table_list_only(TableList *tables)
325
325
  {
326
326
    table_list= first_name_resolution_table= tables;
327
327
    resolve_in_select_list= false;
341
341
class Name_resolution_context_state
342
342
{
343
343
private:
344
 
  TABLE_LIST *save_table_list;
345
 
  TABLE_LIST *save_first_name_resolution_table;
346
 
  TABLE_LIST *save_next_name_resolution_table;
 
344
  TableList *save_table_list;
 
345
  TableList *save_first_name_resolution_table;
 
346
  TableList *save_next_name_resolution_table;
347
347
  bool        save_resolve_in_select_list;
348
 
  TABLE_LIST *save_next_local;
 
348
  TableList *save_next_local;
349
349
 
350
350
public:
351
351
  Name_resolution_context_state() {}          /* Remove gcc warning */
352
352
 
353
353
public:
354
354
  /* Save the state of a name resolution context. */
355
 
  void save_state(Name_resolution_context *context, TABLE_LIST *table_list)
 
355
  void save_state(Name_resolution_context *context, TableList *table_list)
356
356
  {
357
357
    save_table_list=                  context->table_list;
358
358
    save_first_name_resolution_table= context->first_name_resolution_table;
362
362
  }
363
363
 
364
364
  /* Restore a name resolution context from saved state. */
365
 
  void restore_state(Name_resolution_context *context, TABLE_LIST *table_list)
 
365
  void restore_state(Name_resolution_context *context, TableList *table_list)
366
366
  {
367
367
    table_list->next_local=                save_next_local;
368
368
    table_list->next_name_resolution_table= save_next_name_resolution_table;
371
371
    context->resolve_in_select_list=       save_resolve_in_select_list;
372
372
  }
373
373
 
374
 
  TABLE_LIST *get_first_name_resolution_table()
 
374
  TableList *get_first_name_resolution_table()
375
375
  {
376
376
    return save_first_name_resolution_table;
377
377
  }
1026
1026
    by prep. stmt. too in case then we have not-fully qualified field.
1027
1027
    0 - means no cached value.
1028
1028
  */
1029
 
  TABLE_LIST *cached_table;
 
1029
  TableList *cached_table;
1030
1030
  st_select_lex *depended_from;
1031
1031
  Item_ident(Name_resolution_context *context_arg,
1032
1032
             const char *db_name_arg, const char *table_name_arg,