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
96daffbb
Commit
96daffbb
authored
Feb 17, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-new
into neptunus.(none):/home/msvensson/mysql/mysql-5.1
parents
49bae459
a5fa2d30
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
21 deletions
+79
-21
mysql-test/r/ndb_temporary.result
mysql-test/r/ndb_temporary.result
+21
-0
mysql-test/t/ndb_temporary.test
mysql-test/t/ndb_temporary.test
+38
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+1
-1
sql/handler.h
sql/handler.h
+1
-0
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_table.cc
sql/sql_table.cc
+16
-20
No files found.
mysql-test/r/ndb_temporary.result
0 → 100644
View file @
96daffbb
DROP TABLE IF EXISTS t1;
create temporary table t1 (a int key) engine=ndb;
ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
create temporary table t1 (a int key) engine=myisam;
alter table t1 engine=ndb;
ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
drop table t1;
SET SESSION storage_engine=NDBCLUSTER;
create table t1 (a int key);
select engine from information_schema.tables where table_name = 't1';
engine
NDBCLUSTER
drop table t1;
create temporary table t1 (a int key);
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
mysql-test/t/ndb_temporary.test
0 → 100644
View file @
96daffbb
--
source
include
/
have_ndb
.
inc
--
source
include
/
not_embedded
.
inc
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
#
# creating a temporary table with engine=ndb should give an error
#
--
error
ER_ILLEGAL_HA_CREATE_OPTION
create
temporary
table
t1
(
a
int
key
)
engine
=
ndb
;
#
# alter temporary table to engine=ndb should give an error
#
create
temporary
table
t1
(
a
int
key
)
engine
=
myisam
;
--
error
ER_ILLEGAL_HA_CREATE_OPTION
alter
table
t1
engine
=
ndb
;
drop
table
t1
;
#
# if default storage engine=ndb, temporary tables
# without explicit engine= should be created as myisam
#
SET
SESSION
storage_engine
=
NDBCLUSTER
;
create
table
t1
(
a
int
key
);
# verify that we have a ndb table
select
engine
from
information_schema
.
tables
where
table_name
=
't1'
;
drop
table
t1
;
# verify that we have a myisam table
create
temporary
table
t1
(
a
int
key
);
show
create
table
t1
;
drop
table
t1
;
sql/ha_ndbcluster.cc
View file @
96daffbb
...
...
@@ -5848,7 +5848,7 @@ static bool ndbcluster_init()
#ifdef HAVE_NDB_BINLOG
ndbcluster_binlog_init_handlerton
();
#endif
h
.
flags
=
HTON_
NO_FLAGS
;
h
.
flags
=
HTON_
TEMPORARY_NOT_SUPPORTED
;
}
// Set connectstring if specified
...
...
sql/handler.h
View file @
96daffbb
...
...
@@ -604,6 +604,7 @@ struct show_table_alias_st {
#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists
#define HTON_FLUSH_AFTER_RENAME (1 << 4)
#define HTON_NOT_USER_SELECTABLE (1 << 5)
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
typedef
struct
st_thd_trans
{
...
...
sql/share/errmsg.txt
View file @
96daffbb
...
...
@@ -5806,3 +5806,5 @@ ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use scripts/mysql_fix_privilege_tables"
ER_TABLE_NEEDS_UPGRADE
eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"
ER_ILLEGAL_HA_CREATE_OPTION
eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
sql/sql_table.cc
View file @
96daffbb
...
...
@@ -42,7 +42,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
ha_rows
*
copied
,
ha_rows
*
deleted
);
static
bool
prepare_blob_field
(
THD
*
thd
,
create_field
*
sql_field
);
static
bool
check_engine
(
THD
*
thd
,
const
char
*
table_name
,
handlerton
**
new_engine
);
HA_CREATE_INFO
*
create_info
);
static
int
mysql_prepare_table
(
THD
*
thd
,
HA_CREATE_INFO
*
create_info
,
List
<
create_field
>
*
fields
,
List
<
Key
>
*
keys
,
bool
tmp_table
,
...
...
@@ -2021,7 +2021,7 @@ bool mysql_create_table_internal(THD *thd,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
if
(
check_engine
(
thd
,
table_name
,
&
create_info
->
db_type
))
if
(
check_engine
(
thd
,
table_name
,
create_info
))
DBUG_RETURN
(
TRUE
);
db_options
=
create_info
->
table_options
;
if
(
create_info
->
row_type
==
ROW_TYPE_DYNAMIC
)
...
...
@@ -2148,22 +2148,6 @@ bool mysql_create_table_internal(THD *thd,
}
#endif
#ifdef NOT_USED
/*
if there is a technical reason for a handler not to have support
for temp. tables this code can be re-enabled.
Otherwise, if a handler author has a wish to prohibit usage of
temporary tables for his handler he should implement a check in
::create() method
*/
if
((
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
&&
(
file
->
table_flags
()
&
HA_NO_TEMP_TABLES
))
{
my_error
(
ER_ILLEGAL_HA
,
MYF
(
0
),
table_name
);
goto
err
;
}
#endif
set_table_default_charset
(
thd
,
create_info
,
(
char
*
)
db
);
if
(
mysql_prepare_table
(
thd
,
create_info
,
&
fields
,
...
...
@@ -4010,7 +3994,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DBUG_RETURN
(
TRUE
);
}
#endif
if
(
check_engine
(
thd
,
new_name
,
&
create_info
->
db_type
))
if
(
check_engine
(
thd
,
new_name
,
create_info
))
DBUG_RETURN
(
TRUE
);
new_db_type
=
create_info
->
db_type
;
if
(
create_info
->
row_type
==
ROW_TYPE_NOT_USED
)
...
...
@@ -5435,8 +5419,9 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
}
static
bool
check_engine
(
THD
*
thd
,
const
char
*
table_name
,
handlerton
**
new_engine
)
HA_CREATE_INFO
*
create_info
)
{
handlerton
**
new_engine
=
&
create_info
->
db_type
;
handlerton
*
req_engine
=
*
new_engine
;
bool
no_substitution
=
test
(
thd
->
variables
.
sql_mode
&
MODE_NO_ENGINE_SUBSTITUTION
);
...
...
@@ -5452,5 +5437,16 @@ static bool check_engine(THD *thd, const char *table_name,
ha_resolve_storage_engine_name
(
*
new_engine
),
table_name
);
}
if
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
&&
ha_check_storage_engine_flag
(
*
new_engine
,
HTON_TEMPORARY_NOT_SUPPORTED
))
{
if
(
create_info
->
used_fields
&
HA_CREATE_USED_ENGINE
)
{
my_error
(
ER_ILLEGAL_HA_CREATE_OPTION
,
MYF
(
0
),
(
*
new_engine
)
->
name
,
"TEMPORARY"
);
*
new_engine
=
0
;
return
TRUE
;
}
*
new_engine
=
&
myisam_hton
;
}
return
FALSE
;
}
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