Commit 9df1f385 authored by unknown's avatar unknown
Browse files

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/home/marty/MySQL/mysql-5.1


sql/mysqld.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
parents de253b63 0795b20b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ enum enum_server_command
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
#define FIELD_IN_ADD_INDEX (1<< 20)	/* Intern: Field used in ADD INDEX */
#define FIELD_IS_RENAMED (1<< 21)       /* Intern: Field is being renamed */

#define REFRESH_GRANT		1	/* Refresh grant tables */
#define REFRESH_LOG		2	/* Start on new log file */
+6 −1
Original line number Diff line number Diff line
@@ -320,8 +320,13 @@ LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
set @t1_id = (select id from ndb_show_tables where name like '%t1%');
truncate ndb_show_tables;
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
no_copy
set @t1_id = (select id from ndb_show_tables where name like '%t1%');
truncate ndb_show_tables;
create index i1 on t1(medium);
alter table t1 add index i2(long_int);
alter table t1 add index i2(new_tiny);
drop index i1 on t1;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
+12 −1
Original line number Diff line number Diff line
@@ -367,12 +367,23 @@ CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
--enable_warnings

# Ndb doesn't support renaming attributes on-line
set @t1_id = (select id from ndb_show_tables where name like '%t1%');
truncate ndb_show_tables;

alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
--disable_warnings
--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
--enable_warnings

select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';

set @t1_id = (select id from ndb_show_tables where name like '%t1%');
truncate ndb_show_tables;

create index i1 on t1(medium);
alter table t1 add index i2(long_int);
alter table t1 add index i2(new_tiny);
drop index i1 on t1;

--disable_warnings
+12 −1
Original line number Diff line number Diff line
@@ -9871,10 +9871,21 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *info,
  uint i;
  const NDBTAB *tab= (const NDBTAB *) m_table;

  if (current_thd->variables.ndb_use_copying_alter_table)
  {
    DBUG_PRINT("info", ("On-line alter table disabled"));
    DBUG_RETURN(COMPATIBLE_DATA_NO);
  }

  for (i= 0; i < table->s->fields; i++) 
  {
    Field *field= table->field[i];
    const NDBCOL *col= tab->getColumn(field->field_name);
    const NDBCOL *col= tab->getColumn(i);
    if (field->flags & FIELD_IS_RENAMED)
    {
      DBUG_PRINT("info", ("Field has been renamed, copy table"));
      DBUG_RETURN(COMPATIBLE_DATA_NO);
    }
    if ((field->flags & FIELD_IN_ADD_INDEX) &&
        col->getStorageType() == NdbDictionary::Column::StorageTypeDisk)
    {
+7 −0
Original line number Diff line number Diff line
@@ -4695,6 +4695,7 @@ enum options_mysqld
  OPT_NDB_EXTRA_LOGGING,
  OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
  OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
  OPT_NDB_USE_COPYING_ALTER_TABLE,
  OPT_SKIP_SAFEMALLOC,
  OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
  OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
@@ -5430,6 +5431,12 @@ Disable with --skip-ndbcluster (will save memory).",
   (gptr*) &max_system_variables.ndb_index_stat_update_freq,
   0, GET_ULONG, OPT_ARG, 20, 0, ~0L, 0, 0, 0},
#endif
  {"nb-use-copying-alter-table",
   OPT_NDB_USE_COPYING_ALTER_TABLE,
   "Force ndbcluster to always copy tables at alter table (used for ensuring that operations such as renaming fields are propagated to ndb data dictionary).",
   (gptr*) &global_system_variables.ndb_use_copying_alter_table,
   (gptr*) &global_system_variables.ndb_use_copying_alter_table,
   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},  
  {"new", 'n', "Use very new possible 'unsafe' functions.",
   (gptr*) &global_system_variables.new_mode,
   (gptr*) &max_system_variables.new_mode,
Loading