~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • 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:
385
385
  virtual bool hasShare() const= 0; /* Get rid of this long term */
386
386
  virtual void setShare(TableShare *new_share)= 0; /* Get rid of this long term */
387
387
 
388
 
  virtual void release(void)= 0;
389
 
 
390
388
  uint32_t sizeKeys() { return getMutableShare()->sizeKeys(); }
391
389
  uint32_t sizeFields() { return getMutableShare()->sizeFields(); }
392
390
  uint32_t getRecordLength() const { return getShare()->getRecordLength(); }
416
414
  inline const char *getTableName()  const { return getShare()->getTableName(); }
417
415
 
418
416
  inline bool isDatabaseLowByteFirst() { return getShare()->db_low_byte_first; } /* Portable row format */
419
 
  inline bool isNameLock() const { return open_placeholder; }
 
417
  inline bool isNameLock() const { return getShare()->isNameLock(); }
 
418
  inline bool isReplaceWithNameLock() { return getShare()->replace_with_name_lock; }
420
419
 
421
420
  uint32_t index_flags(uint32_t idx) const
422
421
  {
437
436
  size_t max_row_length(const unsigned char *data);
438
437
  uint32_t find_shortest_key(const key_map *usable_keys);
439
438
  bool compare_record(Field **ptr);
440
 
  bool records_are_comparable();
441
 
  bool compare_records();
 
439
  bool compare_record();
442
440
  /* TODO: the (re)storeRecord's may be able to be further condensed */
443
441
  void storeRecord();
444
442
  void storeRecordAsInsert();
447
445
  void restoreRecordAsDefault();
448
446
  void emptyRecord();
449
447
 
450
 
 
451
448
  /* See if this can be blown away */
452
449
  inline uint32_t getDBStat () { return db_stat; }
453
450
  inline uint32_t setDBStat () { return db_stat; }
603
600
  */
604
601
  bool operator<(const Table &right) const
605
602
  {
606
 
    return getShare()->getCacheKey() < right.getShare()->getCacheKey();
 
603
    int result= strcasecmp(this->getShare()->getSchemaName(), right.getShare()->getSchemaName());
 
604
 
 
605
    if (result <  0)
 
606
      return true;
 
607
 
 
608
    if (result >  0)
 
609
      return false;
 
610
 
 
611
    result= strcasecmp(this->getShare()->getTableName(), right.getShare()->getTableName());
 
612
 
 
613
    if (result <  0)
 
614
      return true;
 
615
 
 
616
    if (result >  0)
 
617
      return false;
 
618
 
 
619
    if (this->getShare()->getTableProto()->type()  < right.getShare()->getTableProto()->type())
 
620
      return true;
 
621
 
 
622
    return false;
607
623
  }
608
624
 
609
625
  static bool compare(const Table *a, const Table *b)
613
629
 
614
630
  friend std::ostream& operator<<(std::ostream& output, const Table &table)
615
631
  {
616
 
    if (table.getShare())
617
 
    {
618
 
      output << "Table:(";
619
 
      output << table.getShare()->getSchemaName();
620
 
      output << ", ";
621
 
      output <<  table.getShare()->getTableName();
622
 
      output << ", ";
623
 
      output <<  table.getShare()->getTableTypeAsString();
624
 
      output << ")";
625
 
    }
626
 
    else
627
 
    {
628
 
      output << "Table:(has no share)";
629
 
    }
 
632
    output << "Table:(";
 
633
    output << table.getShare()->getSchemaName();
 
634
    output << ", ";
 
635
    output <<  table.getShare()->getTableName();
 
636
    output << ", ";
 
637
    output <<  table.getShare()->getTableTypeAsString();
 
638
    output << ")";
630
639
 
631
640
    return output;  // for multiple << operators.
632
641
  }
830
839
 
831
840
namespace optimizer { class SqlSelect; }
832
841
 
 
842
ha_rows filesort(Session *session,
 
843
                 Table *form,
 
844
                 SortField *sortorder,
 
845
                 uint32_t s_length,
 
846
                 optimizer::SqlSelect *select,
 
847
                 ha_rows max_rows,
 
848
                 bool sort_positions,
 
849
                 ha_rows *examined_rows);
 
850
 
 
851
void filesort_free_buffers(Table *table, bool full);
833
852
void change_double_for_sort(double nr,unsigned char *to);
834
853
double my_double_round(double value, int64_t dec, bool dec_unsigned,
835
854
                       bool truncate);
839
858
TYPELIB *convert_strings_to_array_type(char * *typelibs, char * *end);
840
859
TYPELIB *typelib(memory::Root *mem_root, List<String> &strings);
841
860
ulong get_form_pos(int file, unsigned char *head, TYPELIB *save_names);
 
861
ulong next_io_size(ulong pos);
842
862
void append_unescaped(String *res, const char *pos, uint32_t length);
843
863
 
844
864
int rename_file_ext(const char * from,const char * to,const char * ext);