~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Jay Pipes
  • Date: 2010-02-27 23:47:33 UTC
  • mto: (1309.2.14 build)
  • mto: This revision was merged to the branch mainline in revision 1319.
  • Revision ID: jpipes@serialcoder-20100227234733-0e4pq1zxwluxud00
* Adds CREATE TABLE as a specific CreateTableStatement message in the
replication stream.
* Corrects previous incorrect behaviour where non-MyISAM tables were
incorrectly being defined with PACK_RECORD = TRUE.  This affected the
checksumming of the table.
* There is still one remaining test case failure in the create_table.test
case in the transaction log test suite regarding the incorrect setting
of Table::Index::IndexPart::compare_length.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
namespace drizzled
55
55
{
56
56
 
 
57
extern plugin::StorageEngine *myisam_engine;
57
58
extern pid_t current_pid;
58
59
 
59
60
static const char hexchars[]= "0123456789abcdef";
1009
1010
        }
1010
1011
      }
1011
1012
    }
1012
 
    /* Don't pack rows in old tables if the user has requested this */
1013
 
    if ((sql_field->flags & BLOB_FLAG) ||
1014
 
        (sql_field->sql_type == DRIZZLE_TYPE_VARCHAR && create_info->row_type != ROW_TYPE_FIXED))
 
1013
 
 
1014
    /** @todo Get rid of this MyISAM-specific crap. */
 
1015
    if (create_info->db_type == myisam_engine &&
 
1016
        ((sql_field->flags & BLOB_FLAG) ||
 
1017
         (sql_field->sql_type == DRIZZLE_TYPE_VARCHAR && create_info->row_type != ROW_TYPE_FIXED)))
1015
1018
      (*db_options)|= HA_OPTION_PACK_RECORD;
1016
1019
    it2.rewind();
1017
1020
  }
1703
1706
    }
1704
1707
  }
1705
1708
 
1706
 
  /*
1707
 
    Don't write statement if:
1708
 
    - It is an internal temporary table,
1709
 
    - Row-based logging is used and it we are creating a temporary table, or
1710
 
    - The binary log is not open.
1711
 
    Otherwise, the statement shall be binlogged.
1712
 
   */
1713
1709
  if (not internal_tmp_table && not lex_identified_temp_table)
1714
 
    write_bin_log(session, session->query.c_str());
 
1710
  {
 
1711
    ReplicationServices &replication_services= ReplicationServices::singleton();
 
1712
    replication_services.createTable(session, *table_proto);
 
1713
  }
1715
1714
  error= false;
1716
1715
unlock_and_end:
1717
1716
  pthread_mutex_unlock(&LOCK_open);