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
9e67557d
Commit
9e67557d
authored
Sep 26, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#104 write frm for existing tables before the txn is committed
parent
bb1fdf7d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
27 deletions
+70
-27
mysql-test/suite/tokudb.alter_table/r/drop_add_pk_104.result
mysql-test/suite/tokudb.alter_table/r/drop_add_pk_104.result
+5
-0
mysql-test/suite/tokudb.alter_table/r/drop_add_pk_part_104.result
...st/suite/tokudb.alter_table/r/drop_add_pk_part_104.result
+5
-0
mysql-test/suite/tokudb.alter_table/r/rename_column_cold_104.result
.../suite/tokudb.alter_table/r/rename_column_cold_104.result
+6
-0
mysql-test/suite/tokudb.alter_table/r/rename_column_cold_part_104.result
...e/tokudb.alter_table/r/rename_column_cold_part_104.result
+6
-0
mysql-test/suite/tokudb.alter_table/t/drop_add_pk_104.test
mysql-test/suite/tokudb.alter_table/t/drop_add_pk_104.test
+11
-0
mysql-test/suite/tokudb.alter_table/t/drop_add_pk_part_104.test
...test/suite/tokudb.alter_table/t/drop_add_pk_part_104.test
+12
-0
mysql-test/suite/tokudb.alter_table/t/rename_column_cold_104.test
...st/suite/tokudb.alter_table/t/rename_column_cold_104.test
+12
-0
mysql-test/suite/tokudb.alter_table/t/rename_column_cold_part_104.test
...ite/tokudb.alter_table/t/rename_column_cold_part_104.test
+13
-0
storage/tokudb/ha_tokudb.h
storage/tokudb/ha_tokudb.h
+0
-4
storage/tokudb/ha_tokudb_alter_55.cc
storage/tokudb/ha_tokudb_alter_55.cc
+0
-23
No files found.
mysql-test/suite/tokudb.alter_table/r/drop_add_pk_104.result
0 → 100644
View file @
9e67557d
set default_storage_engine='tokudb';
drop table if exists t;
create table t (x int, y int, primary key (x));
alter table t drop primary key, add primary key(x);
drop table t;
mysql-test/suite/tokudb.alter_table/r/drop_add_pk_part_104.result
0 → 100644
View file @
9e67557d
set default_storage_engine='tokudb';
drop table if exists t;
create table t (x int, y int, primary key (x)) partition by hash(x) partitions 1;
alter table t drop primary key, add primary key(x);
drop table t;
mysql-test/suite/tokudb.alter_table/r/rename_column_cold_104.result
0 → 100644
View file @
9e67557d
set default_storage_engine='tokudb';
set tokudb_disable_hot_alter=1;
drop table if exists t;
create table t (x int, y int, primary key (x));
alter table t change column y newy int;
drop table t;
mysql-test/suite/tokudb.alter_table/r/rename_column_cold_part_104.result
0 → 100644
View file @
9e67557d
set default_storage_engine='tokudb';
set tokudb_disable_hot_alter=1;
drop table if exists t;
create table t (x int, y int, primary key (x)) partition by hash(x) partitions 2;
alter table t change column y newy int;
drop table t;
mysql-test/suite/tokudb.alter_table/t/drop_add_pk_104.test
0 → 100644
View file @
9e67557d
source
include
/
have_tokudb
.
inc
;
set
default_storage_engine
=
'tokudb'
;
disable_warnings
;
drop
table
if
exists
t
;
enable_warnings
;
create
table
t
(
x
int
,
y
int
,
primary
key
(
x
));
alter
table
t
drop
primary
key
,
add
primary
key
(
x
);
drop
table
t
;
mysql-test/suite/tokudb.alter_table/t/drop_add_pk_part_104.test
0 → 100644
View file @
9e67557d
source
include
/
have_tokudb
.
inc
;
source
include
/
have_partition
.
inc
;
set
default_storage_engine
=
'tokudb'
;
disable_warnings
;
drop
table
if
exists
t
;
enable_warnings
;
create
table
t
(
x
int
,
y
int
,
primary
key
(
x
))
partition
by
hash
(
x
)
partitions
1
;
alter
table
t
drop
primary
key
,
add
primary
key
(
x
);
drop
table
t
;
mysql-test/suite/tokudb.alter_table/t/rename_column_cold_104.test
0 → 100644
View file @
9e67557d
source
include
/
have_tokudb
.
inc
;
set
default_storage_engine
=
'tokudb'
;
set
tokudb_disable_hot_alter
=
1
;
disable_warnings
;
drop
table
if
exists
t
;
enable_warnings
;
create
table
t
(
x
int
,
y
int
,
primary
key
(
x
));
alter
table
t
change
column
y
newy
int
;
drop
table
t
;
mysql-test/suite/tokudb.alter_table/t/rename_column_cold_part_104.test
0 → 100644
View file @
9e67557d
source
include
/
have_tokudb
.
inc
;
source
include
/
have_partition
.
inc
;
set
default_storage_engine
=
'tokudb'
;
set
tokudb_disable_hot_alter
=
1
;
disable_warnings
;
drop
table
if
exists
t
;
enable_warnings
;
create
table
t
(
x
int
,
y
int
,
primary
key
(
x
))
partition
by
hash
(
x
)
partitions
2
;
alter
table
t
change
column
y
newy
int
;
drop
table
t
;
storage/tokudb/ha_tokudb.h
View file @
9e67557d
...
...
@@ -681,10 +681,6 @@ public:
// Returns true of the 5.6 inplace alter table interface is used.
bool
try_hot_alter_table
();
// We need a txn in the mysql_alter_table function to write new frm data, so this function
// gets called to sometimes create one.
void
prepare_for_alter
();
// Used by the partition storage engine to provide new frm data for the table.
int
new_alter_table_frm_data
(
const
uchar
*
frm_data
,
size_t
frm_len
);
#endif
...
...
storage/tokudb/ha_tokudb_alter_55.cc
View file @
9e67557d
...
...
@@ -98,29 +98,6 @@ bool ha_tokudb::try_hot_alter_table() {
DBUG_RETURN
(
!
disable_hot_alter
);
}
void
ha_tokudb
::
prepare_for_alter
()
{
TOKUDB_DBUG_ENTER
(
"prepare_for_alter"
);
// this is here because mysql commits the transaction before prepare_for_alter is called.
// we need a transaction to add indexes, drop indexes, and write the new frm data, so we
// create one. this transaction will be retired by mysql alter table when it commits
//
// if we remove the commit before prepare_for_alter, then this is not needed.
transaction
=
NULL
;
THD
*
thd
=
ha_thd
();
tokudb_trx_data
*
trx
=
(
tokudb_trx_data
*
)
thd_data_get
(
thd
,
tokudb_hton
->
slot
);
assert
(
trx
);
// for partitioned tables, a transaction may already exist,
// as we call prepare_for_alter on all partitions
if
(
!
trx
->
sub_sp_level
)
{
int
error
=
create_txn
(
thd
,
trx
);
assert
(
error
==
0
);
assert
(
thd
->
in_sub_stmt
==
0
);
}
transaction
=
trx
->
sub_sp_level
;
DBUG_VOID_RETURN
;
}
int
ha_tokudb
::
new_alter_table_frm_data
(
const
uchar
*
frm_data
,
size_t
frm_len
)
{
return
write_frm_data
(
frm_data
,
frm_len
);
}
...
...
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