~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.h

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
    straight(false),
95
95
    force_index(false),
96
96
    ignore_leaves(false),
97
 
    create(false),
98
97
    join_using_fields(NULL),
99
98
    join_columns(NULL),
100
99
    next_name_resolution_table(NULL),
105
104
    select_lex(NULL),
106
105
    next_leaf(NULL),
107
106
    outer_join(0),
108
 
    shared(0),
109
 
    i_s_requested_object(0),
110
107
    db_length(0),
111
108
    table_name_length(0),
112
109
    dep_tables(0),
118
115
    internal_tmp_table(false),
119
116
    is_alias(false),
120
117
    is_fqtn(false),
121
 
    has_db_lookup_value(false),
122
 
    has_table_lookup_value(false)
 
118
    create(false)
123
119
  {}
124
120
 
125
121
  /**
132
128
  /** link in a global list of all queries tables */
133
129
  TableList *next_global; 
134
130
  TableList **prev_global;
135
 
 
136
131
  char *db;
137
132
  const char *alias;
138
133
  char *table_name;
170
165
  bool force_index; ///< prefer index over table scan
171
166
  bool ignore_leaves; ///< preload only non-leaf nodes
172
167
 
173
 
  /**
174
 
   * This TableList object corresponds to the table to be created
175
 
   * so it is possible that it does not exist (used in CREATE TABLE
176
 
   * ... SELECT implementation).
177
 
   */
178
 
  bool create;
 
168
  /*
 
169
    is the table a cartesian join, assumption is yes unless "solved"
 
170
  */
 
171
  bool isCartesian() const;
179
172
 
180
173
  /** Field names in a USING clause for JOIN ... USING. */
181
174
  List<String> *join_using_fields;
212
205
  TableList *next_leaf;
213
206
  thr_lock_type lock_type;
214
207
  uint32_t outer_join; ///< Which join type
215
 
  uint32_t shared; ///<Used in multi-upd
216
 
  uint32_t i_s_requested_object;
217
208
  size_t db_length;
218
209
  size_t table_name_length;
219
 
  table_map dep_tables; ///< tables the table depends on
220
 
  table_map on_expr_dep_tables; ///< tables on expression depends on
221
 
  nested_join_st *nested_join; ///< if the element is a nested join
222
 
  TableList *embedding; ///< nested join containing the table
223
 
  List<TableList> *join_list; ///< join list the table belongs to
224
 
  plugin::StorageEngine *db_type; ///< table_type for handler
225
 
  char timestamp_buffer[20]; ///< buffer for timestamp (19+1)
226
 
  bool internal_tmp_table;
227
 
  /** true if an alias for this table was specified in the SQL. */
228
 
  bool is_alias;
229
 
  /** 
230
 
   * true if the table is referred to in the statement using a fully
231
 
   * qualified name (<db_name>.<table_name>).
232
 
   */
233
 
  bool is_fqtn;
234
 
 
235
 
  bool has_db_lookup_value;
236
 
  bool has_table_lookup_value;
237
210
 
238
211
  void set_underlying_merge();
239
212
  bool setup_underlying(Session *session);
407
380
   *  Length of key
408
381
   */
409
382
  uint32_t create_table_def_key(char *key);
 
383
 
 
384
  friend std::ostream& operator<<(std::ostream& output, const TableList &list)
 
385
  {
 
386
    output << "TableList:(";
 
387
    output << list.db;
 
388
    output << ", ";
 
389
    output << list.table_name;
 
390
    output << ", ";
 
391
    output << list.alias;
 
392
    output << ", ";
 
393
    output << "is_natural_join:" << list.is_natural_join;
 
394
    output << ", ";
 
395
    output << "is_join_columns_complete:" << list.is_join_columns_complete;
 
396
    output << ", ";
 
397
    output << "straight:" << list.straight;
 
398
    output << ", ";
 
399
    output << "force_index" << list.force_index;
 
400
    output << ", ";
 
401
    output << "ignore_leaves:" << list.ignore_leaves;
 
402
    output << ", ";
 
403
    output << "create:" << list.create;
 
404
    output << ", ";
 
405
    output << "outer_join:" << list.outer_join;
 
406
    output << ", ";
 
407
    output << "nested_join:" << list.nested_join;
 
408
    output << ")";
 
409
 
 
410
    return output;  // for multiple << operators.
 
411
  }
 
412
 
 
413
  void setIsAlias(bool in_is_alias)
 
414
  {
 
415
    is_alias= in_is_alias;
 
416
  }
 
417
 
 
418
  void setIsFqtn(bool in_is_fqtn)
 
419
  {
 
420
    is_fqtn= in_is_fqtn;
 
421
  }
 
422
 
 
423
  void setCreate(bool in_create)
 
424
  {
 
425
    create= in_create;
 
426
  }
 
427
 
 
428
  void setInternalTmpTable(bool in_internal_tmp_table)
 
429
  {
 
430
    internal_tmp_table= in_internal_tmp_table;
 
431
  }
 
432
 
 
433
  void setDbType(plugin::StorageEngine *in_db_type)
 
434
  {
 
435
    db_type= in_db_type;
 
436
  }
 
437
 
 
438
  void setJoinList(List<TableList> *in_join_list)
 
439
  {
 
440
    join_list= in_join_list;
 
441
  }
 
442
 
 
443
  void setEmbedding(TableList *in_embedding)
 
444
  {
 
445
    embedding= in_embedding;
 
446
  }
 
447
 
 
448
  void setNestedJoin(nested_join_st *in_nested_join)
 
449
  {
 
450
    nested_join= in_nested_join;
 
451
  }
 
452
 
 
453
  void setDepTables(table_map in_dep_tables)
 
454
  {
 
455
    dep_tables= in_dep_tables;
 
456
  }
 
457
 
 
458
  void setOnExprDepTables(table_map in_on_expr_dep_tables)
 
459
  {
 
460
    on_expr_dep_tables= in_on_expr_dep_tables;
 
461
  }
 
462
 
 
463
  bool getIsAlias() const
 
464
  {
 
465
    return is_alias;
 
466
  }
 
467
 
 
468
  bool getIsFqtn() const
 
469
  {
 
470
    return is_fqtn;
 
471
  }
 
472
 
 
473
  bool isCreate() const
 
474
  {
 
475
    return create;
 
476
  }
 
477
 
 
478
  bool getInternalTmpTable() const
 
479
  {
 
480
    return internal_tmp_table;
 
481
  }
 
482
 
 
483
  plugin::StorageEngine *getDbType() const
 
484
  {
 
485
    return db_type;
 
486
  }
 
487
 
 
488
  TableList *getEmbedding() const
 
489
  {
 
490
    return embedding;
 
491
  }
 
492
 
 
493
  List<TableList> *getJoinList() const
 
494
  {
 
495
    return join_list;
 
496
  }
 
497
 
 
498
  nested_join_st *getNestedJoin() const
 
499
  {
 
500
    return nested_join;
 
501
  }
 
502
 
 
503
  table_map getDepTables() const
 
504
  {
 
505
    return dep_tables;
 
506
  }
 
507
 
 
508
  table_map getOnExprDepTables() const
 
509
  {
 
510
    return on_expr_dep_tables;
 
511
  }
 
512
 
 
513
private:
 
514
 
 
515
  table_map dep_tables; ///< tables the table depends on
 
516
  table_map on_expr_dep_tables; ///< tables on expression depends on
 
517
  nested_join_st *nested_join; ///< if the element is a nested join
 
518
  TableList *embedding; ///< nested join containing the table
 
519
  List<TableList> *join_list; ///< join list the table belongs to
 
520
  plugin::StorageEngine *db_type; ///< table_type for handler
 
521
  char timestamp_buffer[20]; ///< buffer for timestamp (19+1)
 
522
  bool internal_tmp_table;
 
523
  /** true if an alias for this table was specified in the SQL. */
 
524
  bool is_alias;
 
525
 
 
526
  /** 
 
527
   * true if the table is referred to in the statement using a fully
 
528
   * qualified name (<db_name>.<table_name>).
 
529
   */
 
530
  bool is_fqtn;
 
531
  /**
 
532
   * This TableList object corresponds to the table to be created
 
533
   * so it is possible that it does not exist (used in CREATE TABLE
 
534
   * ... SELECT implementation).
 
535
   */
 
536
  bool create;
 
537
 
410
538
};
411
539
 
412
540
void close_thread_tables(Session *session);