Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
274a23a9
Commit
274a23a9
authored
Jun 14, 2006
by
mskold@linux.site
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/marty/MySQL/mysql-5.1
parents
0ecea73c
5660fa6b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
3 deletions
+50
-3
include/mysql_com.h
include/mysql_com.h
+1
-0
mysql-test/r/ndb_alter_table.result
mysql-test/r/ndb_alter_table.result
+6
-1
mysql-test/t/ndb_alter_table.test
mysql-test/t/ndb_alter_table.test
+12
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+12
-1
sql/mysqld.cc
sql/mysqld.cc
+7
-0
sql/set_var.cc
sql/set_var.cc
+4
-0
sql/sql_class.h
sql/sql_class.h
+1
-0
sql/sql_table.cc
sql/sql_table.cc
+7
-0
No files found.
include/mysql_com.h
View file @
274a23a9
...
...
@@ -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 */
...
...
mysql-test/r/ndb_alter_table.result
View file @
274a23a9
...
...
@@ -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%';
...
...
mysql-test/t/ndb_alter_table.test
View file @
274a23a9
...
...
@@ -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
...
...
sql/ha_ndbcluster.cc
View file @
274a23a9
...
...
@@ -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
)
{
...
...
sql/mysqld.cc
View file @
274a23a9
...
...
@@ -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
,
...
...
sql/set_var.cc
View file @
274a23a9
...
...
@@ -548,6 +548,8 @@ sys_ndb_index_stat_update_freq("ndb_index_stat_update_freq",
&
SV
::
ndb_index_stat_update_freq
);
sys_var_long_ptr
sys_ndb_extra_logging
(
"ndb_extra_logging"
,
&
ndb_extra_logging
);
sys_var_thd_bool
sys_ndb_use_copying_alter_table
(
"ndb_use_copying_alter_table"
,
&
SV
::
ndb_use_copying_alter_table
);
/* Time/date/datetime formats */
...
...
@@ -917,6 +919,8 @@ SHOW_VAR init_vars[]= {
{
sys_ndb_report_thresh_binlog_mem_usage
.
name
,
(
char
*
)
&
sys_ndb_report_thresh_binlog_mem_usage
,
SHOW_SYS
},
#endif
{
sys_ndb_use_copying_alter_table
.
name
,
(
char
*
)
&
sys_ndb_use_copying_alter_table
,
SHOW_SYS
},
{
sys_ndb_use_exact_count
.
name
,(
char
*
)
&
sys_ndb_use_exact_count
,
SHOW_SYS
},
{
sys_ndb_use_transactions
.
name
,(
char
*
)
&
sys_ndb_use_transactions
,
SHOW_SYS
},
{
sys_net_buffer_length
.
name
,(
char
*
)
&
sys_net_buffer_length
,
SHOW_SYS
},
...
...
sql/sql_class.h
View file @
274a23a9
...
...
@@ -244,6 +244,7 @@ struct system_variables
my_bool
innodb_table_locks
;
my_bool
innodb_support_xa
;
my_bool
ndb_force_send
;
my_bool
ndb_use_copying_alter_table
;
my_bool
ndb_use_exact_count
;
my_bool
ndb_use_transactions
;
my_bool
ndb_index_stat_enable
;
...
...
sql/sql_table.cc
View file @
274a23a9
...
...
@@ -4744,6 +4744,13 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
create_info
->
row_type
!=
ROW_TYPE_FIXED
)
create_info
->
table_options
|=
HA_OPTION_PACK_RECORD
;
/* Check if field was renamed */
field
->
flags
&=
~
FIELD_IS_RENAMED
;
if
(
my_strcasecmp
(
system_charset_info
,
field
->
field_name
,
new_field
->
field_name
))
field
->
flags
|=
FIELD_IS_RENAMED
;
/* Evaluate changes bitmap and send to check_if_incompatible_data() */
if
(
!
(
tmp
=
field
->
is_equal
(
new_field
)))
DBUG_RETURN
(
ALTER_TABLE_DATA_CHANGED
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment