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
f49ac24a
Commit
f49ac24a
authored
Oct 03, 2005
by
kent@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/Users/kent/mysql/bk/mysql-5.0
parents
5ec73ea1
b2f52819
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
111 additions
and
18 deletions
+111
-18
mysql-test/r/federated.result
mysql-test/r/federated.result
+26
-0
mysql-test/t/federated.test
mysql-test/t/federated.test
+43
-1
sql/examples/ha_example.cc
sql/examples/ha_example.cc
+1
-1
sql/examples/ha_tina.cc
sql/examples/ha_tina.cc
+1
-1
sql/ha_blackhole.cc
sql/ha_blackhole.cc
+1
-1
sql/ha_federated.cc
sql/ha_federated.cc
+1
-1
sql/ha_heap.cc
sql/ha_heap.cc
+1
-1
sql/ha_myisam.cc
sql/ha_myisam.cc
+1
-1
sql/ha_myisammrg.cc
sql/ha_myisammrg.cc
+1
-1
sql/handler.cc
sql/handler.cc
+17
-0
sql/handler.h
sql/handler.h
+5
-8
sql/sql_delete.cc
sql/sql_delete.cc
+3
-2
sql/sql_table.cc
sql/sql_table.cc
+10
-0
No files found.
mysql-test/r/federated.result
View file @
f49ac24a
...
@@ -1457,6 +1457,32 @@ federated.t1 repair status OK
...
@@ -1457,6 +1457,32 @@ federated.t1 repair status OK
REPAIR TABLE federated.t1 USE_FRM;
REPAIR TABLE federated.t1 USE_FRM;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
federated.t1 repair status OK
federated.t1 repair status OK
DROP TABLE IF EXISTS federated.normal_table;
CREATE TABLE federated.normal_table (
`id` int(4) NOT NULL,
`name` varchar(10) default NULL
) DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS federated.alter_me;
CREATE TABLE federated.alter_me (
`id` int(4) NOT NULL,
`name` varchar(10) default NULL,
PRIMARY KEY (`id`)
) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/normal_table';
INSERT INTO federated.alter_me (id, name) VALUES (1, 'Monty');
INSERT INTO federated.alter_me (id, name) VALUES (2, 'David');
SELECT * FROM federated.alter_me;
id name
1 Monty
2 David
ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL;
ERROR HY000: Table storage engine for 'alter_me' doesn't have this option
SELECT * FROM federated.alter_me;
id name
1 Monty
2 David
DROP TABLE federated.alter_me;
DROP TABLE federated.normal_table;
DROP TABLE IF EXISTS federated.t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP TABLE IF EXISTS federated.t1;
...
...
mysql-test/t/federated.test
View file @
f49ac24a
...
@@ -1137,11 +1137,53 @@ ORDER BY federated.t1.country_id;
...
@@ -1137,11 +1137,53 @@ ORDER BY federated.t1.country_id;
DROP
TABLE
federated
.
countries
;
DROP
TABLE
federated
.
countries
;
# optimize and repair tests
#
BEGIN
optimize and repair tests
OPTIMIZE
TABLE
federated
.
t1
;
OPTIMIZE
TABLE
federated
.
t1
;
REPAIR
TABLE
federated
.
t1
;
REPAIR
TABLE
federated
.
t1
;
REPAIR
TABLE
federated
.
t1
QUICK
;
REPAIR
TABLE
federated
.
t1
QUICK
;
REPAIR
TABLE
federated
.
t1
EXTENDED
;
REPAIR
TABLE
federated
.
t1
EXTENDED
;
REPAIR
TABLE
federated
.
t1
USE_FRM
;
REPAIR
TABLE
federated
.
t1
USE_FRM
;
#END optimize and repair tests
# BEGIN ALTER TEST
connection
slave
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
federated
.
normal_table
;
--
enable_warnings
CREATE
TABLE
federated
.
normal_table
(
`id`
int
(
4
)
NOT
NULL
,
`name`
varchar
(
10
)
default
NULL
)
DEFAULT
CHARSET
=
latin1
;
connection
master
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
federated
.
alter_me
;
--
enable_warnings
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
CREATE
TABLE
federated
.
alter_me
(
`id`
int
(
4
)
NOT
NULL
,
`name`
varchar
(
10
)
default
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
CONNECTION
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/normal_table'
;
INSERT
INTO
federated
.
alter_me
(
id
,
name
)
VALUES
(
1
,
'Monty'
);
INSERT
INTO
federated
.
alter_me
(
id
,
name
)
VALUES
(
2
,
'David'
);
SELECT
*
FROM
federated
.
alter_me
;
--
error
1031
ALTER
TABLE
federated
.
alter_me
MODIFY
COLUMN
id
int
(
16
)
NOT
NULL
;
SELECT
*
FROM
federated
.
alter_me
;
DROP
TABLE
federated
.
alter_me
;
connection
slave
;
DROP
TABLE
federated
.
normal_table
;
# END ALTER TEST
source
include
/
federated_cleanup
.
inc
;
source
include
/
federated_cleanup
.
inc
;
sql/examples/ha_example.cc
View file @
f49ac24a
...
@@ -90,7 +90,7 @@ handlerton example_hton= {
...
@@ -90,7 +90,7 @@ handlerton example_hton= {
NULL
,
/* create_cursor_read_view */
NULL
,
/* create_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* close_cursor_read_view */
NULL
,
/* close_cursor_read_view */
HTON_
NO_FLAGS
HTON_
CAN_RECREATE
};
};
/* Variables for example share methods */
/* Variables for example share methods */
...
...
sql/examples/ha_tina.cc
View file @
f49ac24a
...
@@ -71,7 +71,7 @@ handlerton tina_hton= {
...
@@ -71,7 +71,7 @@ handlerton tina_hton= {
NULL
,
/* create_cursor_read_view */
NULL
,
/* create_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* close_cursor_read_view */
NULL
,
/* close_cursor_read_view */
HTON_
NO_FLAGS
HTON_
CAN_RECREATE
};
};
/*****************************************************************************
/*****************************************************************************
...
...
sql/ha_blackhole.cc
View file @
f49ac24a
...
@@ -43,7 +43,7 @@ handlerton blackhole_hton= {
...
@@ -43,7 +43,7 @@ handlerton blackhole_hton= {
NULL
,
/* create_cursor_read_view */
NULL
,
/* create_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* close_cursor_read_view */
NULL
,
/* close_cursor_read_view */
HTON_
NO_FLAGS
HTON_
CAN_RECREATE
};
};
/*****************************************************************************
/*****************************************************************************
...
...
sql/ha_federated.cc
View file @
f49ac24a
...
@@ -713,7 +713,7 @@ handlerton federated_hton= {
...
@@ -713,7 +713,7 @@ handlerton federated_hton= {
NULL
,
/* create_cursor_read_view */
NULL
,
/* create_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* close_cursor_read_view */
NULL
,
/* close_cursor_read_view */
HTON_
NO_FLAGS
HTON_
ALTER_NOT_SUPPORTED
};
};
...
...
sql/ha_heap.cc
View file @
f49ac24a
...
@@ -40,7 +40,7 @@ handlerton heap_hton= {
...
@@ -40,7 +40,7 @@ handlerton heap_hton= {
NULL
,
/* create_cursor_read_view */
NULL
,
/* create_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* close_cursor_read_view */
NULL
,
/* close_cursor_read_view */
HTON_
NO_FLAGS
HTON_
CAN_RECREATE
};
};
/*****************************************************************************
/*****************************************************************************
...
...
sql/ha_myisam.cc
View file @
f49ac24a
...
@@ -73,7 +73,7 @@ handlerton myisam_hton= {
...
@@ -73,7 +73,7 @@ handlerton myisam_hton= {
MyISAM doesn't support transactions and doesn't have
MyISAM doesn't support transactions and doesn't have
transaction-dependent context: cursors can survive a commit.
transaction-dependent context: cursors can survive a commit.
*/
*/
HTON_
NO_FLAGS
HTON_
CAN_RECREATE
};
};
// collect errors printed by mi_check routines
// collect errors printed by mi_check routines
...
...
sql/ha_myisammrg.cc
View file @
f49ac24a
...
@@ -51,7 +51,7 @@ handlerton myisammrg_hton= {
...
@@ -51,7 +51,7 @@ handlerton myisammrg_hton= {
NULL
,
/* create_cursor_read_view */
NULL
,
/* create_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* set_cursor_read_view */
NULL
,
/* close_cursor_read_view */
NULL
,
/* close_cursor_read_view */
HTON_
NO_FLAGS
HTON_
CAN_RECREATE
};
};
...
...
sql/handler.cc
View file @
f49ac24a
...
@@ -183,6 +183,23 @@ const char *ha_get_storage_engine(enum db_type db_type)
...
@@ -183,6 +183,23 @@ const char *ha_get_storage_engine(enum db_type db_type)
return
"none"
;
return
"none"
;
}
}
bool
ha_check_storage_engine_flag
(
enum
db_type
db_type
,
uint32
flag
)
{
show_table_type_st
*
types
;
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
if
(
db_type
==
types
->
db_type
)
{
if
(
types
->
ht
->
flags
&
flag
)
return
TRUE
;
else
return
FALSE
;
}
}
return
FALSE
;
}
my_bool
ha_storage_engine_is_enabled
(
enum
db_type
database_type
)
my_bool
ha_storage_engine_is_enabled
(
enum
db_type
database_type
)
{
{
...
...
sql/handler.h
View file @
f49ac24a
...
@@ -378,7 +378,9 @@ struct show_table_alias_st {
...
@@ -378,7 +378,9 @@ struct show_table_alias_st {
/* Possible flags of a handlerton */
/* Possible flags of a handlerton */
#define HTON_NO_FLAGS 0
#define HTON_NO_FLAGS 0
#define HTON_CLOSE_CURSORS_AT_COMMIT 1
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
#define HTON_ALTER_NOT_SUPPORTED (1 << 1)
#define HTON_CAN_RECREATE (1 << 2)
typedef
struct
st_thd_trans
typedef
struct
st_thd_trans
{
{
...
@@ -848,18 +850,13 @@ extern ulong total_ha, total_ha_2pc;
...
@@ -848,18 +850,13 @@ extern ulong total_ha, total_ha_2pc;
#define ha_commit(thd) (ha_commit_trans((thd), TRUE))
#define ha_commit(thd) (ha_commit_trans((thd), TRUE))
#define ha_rollback(thd) (ha_rollback_trans((thd), TRUE))
#define ha_rollback(thd) (ha_rollback_trans((thd), TRUE))
#define ha_supports_generate(T) (T != DB_TYPE_INNODB && \
T != DB_TYPE_BERKELEY_DB && \
T != DB_TYPE_ARCHIVE_DB && \
T != DB_TYPE_FEDERATED_DB && \
T != DB_TYPE_NDBCLUSTER)
/* lookups */
/* lookups */
enum
db_type
ha_resolve_by_name
(
const
char
*
name
,
uint
namelen
);
enum
db_type
ha_resolve_by_name
(
const
char
*
name
,
uint
namelen
);
const
char
*
ha_get_storage_engine
(
enum
db_type
db_type
);
const
char
*
ha_get_storage_engine
(
enum
db_type
db_type
);
handler
*
get_new_handler
(
TABLE
*
table
,
enum
db_type
db_type
);
handler
*
get_new_handler
(
TABLE
*
table
,
enum
db_type
db_type
);
enum
db_type
ha_checktype
(
THD
*
thd
,
enum
db_type
database_type
,
enum
db_type
ha_checktype
(
THD
*
thd
,
enum
db_type
database_type
,
bool
no_substitute
,
bool
report_error
);
bool
no_substitute
,
bool
report_error
);
bool
ha_check_storage_engine_flag
(
enum
db_type
db_type
,
uint32
flag
);
/* basic stuff */
/* basic stuff */
int
ha_init
(
void
);
int
ha_init
(
void
);
...
...
sql/sql_delete.cc
View file @
f49ac24a
...
@@ -787,7 +787,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
...
@@ -787,7 +787,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
TABLE
*
table
=
*
table_ptr
;
TABLE
*
table
=
*
table_ptr
;
table
->
file
->
info
(
HA_STATUS_AUTO
|
HA_STATUS_NO_LOCK
);
table
->
file
->
info
(
HA_STATUS_AUTO
|
HA_STATUS_NO_LOCK
);
db_type
table_type
=
table
->
s
->
db_type
;
db_type
table_type
=
table
->
s
->
db_type
;
if
(
!
ha_
supports_generate
(
table_type
))
if
(
!
ha_
check_storage_engine_flag
(
table_type
,
HTON_CAN_RECREATE
))
goto
trunc_by_del
;
goto
trunc_by_del
;
strmov
(
path
,
table
->
s
->
path
);
strmov
(
path
,
table
->
s
->
path
);
*
table_ptr
=
table
->
next
;
// Unlink table from list
*
table_ptr
=
table
->
next
;
// Unlink table from list
...
@@ -818,7 +818,8 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
...
@@ -818,7 +818,8 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table_list
->
db
,
table_list
->
table_name
);
table_list
->
db
,
table_list
->
table_name
);
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
if
(
!
ha_supports_generate
(
table_type
)
||
thd
->
lex
->
sphead
)
if
(
!
ha_check_storage_engine_flag
(
table_type
,
HTON_CAN_RECREATE
)
||
thd
->
lex
->
sphead
)
goto
trunc_by_del
;
goto
trunc_by_del
;
if
(
lock_and_wait_for_table_name
(
thd
,
table_list
))
if
(
lock_and_wait_for_table_name
(
thd
,
table_list
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
...
...
sql/sql_table.cc
View file @
f49ac24a
...
@@ -3156,6 +3156,16 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -3156,6 +3156,16 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if
(
create_info
->
row_type
==
ROW_TYPE_NOT_USED
)
if
(
create_info
->
row_type
==
ROW_TYPE_NOT_USED
)
create_info
->
row_type
=
table
->
s
->
row_type
;
create_info
->
row_type
=
table
->
s
->
row_type
;
DBUG_PRINT
(
"info"
,
(
"old type: %d new type: %d"
,
old_db_type
,
new_db_type
));
if
(
ha_check_storage_engine_flag
(
old_db_type
,
HTON_ALTER_NOT_SUPPORTED
)
||
ha_check_storage_engine_flag
(
new_db_type
,
HTON_ALTER_NOT_SUPPORTED
))
{
DBUG_PRINT
(
"info"
,
(
"doesn't support alter"
));
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
table_name
);
DBUG_RETURN
(
TRUE
);
}
DBUG_PRINT
(
"info"
,
(
"supports alter"
));
thd
->
proc_info
=
"setup"
;
thd
->
proc_info
=
"setup"
;
if
(
!
(
alter_info
->
flags
&
~
(
ALTER_RENAME
|
ALTER_KEYS_ONOFF
))
&&
if
(
!
(
alter_info
->
flags
&
~
(
ALTER_RENAME
|
ALTER_KEYS_ONOFF
))
&&
!
table
->
s
->
tmp_table
)
// no need to touch frm
!
table
->
s
->
tmp_table
)
// no need to touch frm
...
...
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