Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2127 06/02/17 15:24:30 tomas@stripped +7 -0
Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
- do not try to create ndb temp tables even if default storage is ndb
mysql-test/t/ndb_temporary.test
1.1 06/02/17 15:24:20 tomas@stripped +38 -0
New BitKeeper file ``mysql-test/t/ndb_temporary.test''
mysql-test/r/ndb_temporary.result
1.1 06/02/17 15:24:20 tomas@stripped +21 -0
New BitKeeper file ``mysql-test/r/ndb_temporary.result''
mysql-test/t/ndb_temporary.test
1.0 06/02/17 15:24:20 tomas@stripped +0 -0
BitKeeper file /home/tomas/mysql-5.1-new/mysql-test/t/ndb_temporary.test
mysql-test/r/ndb_temporary.result
1.0 06/02/17 15:24:20 tomas@stripped +0 -0
BitKeeper file /home/tomas/mysql-5.1-new/mysql-test/r/ndb_temporary.result
sql/sql_yacc.yy
1.461 06/02/17 15:24:19 tomas@stripped +10 -1
Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
- do not try to create ndb temp tables even if default storage is ndb
sql/sql_table.cc
1.306 06/02/17 15:24:19 tomas@stripped +16 -20
Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
- do not try to create ndb temp tables even if default storage is ndb
sql/share/errmsg.txt
1.81 06/02/17 15:24:19 tomas@stripped +2 -0
Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
- do not try to create ndb temp tables even if default storage is ndb
sql/handler.h
1.193 06/02/17 15:24:19 tomas@stripped +1 -0
Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
- do not try to create ndb temp tables even if default storage is ndb
sql/ha_ndbcluster.cc
1.272 06/02/17 15:24:19 tomas@stripped +1 -1
Bug #17210 Create temp table call to ha_ndbcluster::create_handler_files caused core
- do not try to create ndb temp tables even if default storage is ndb
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-new
--- 1.192/sql/handler.h 2006-02-14 11:51:36 +01:00
+++ 1.193/sql/handler.h 2006-02-17 15:24:19 +01:00
@@ -601,6 +601,7 @@
#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
{
--- 1.305/sql/sql_table.cc 2006-02-14 09:29:30 +01:00
+++ 1.306/sql/sql_table.cc 2006-02-17 15:24:19 +01:00
@@ -42,7 +42,7 @@
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 @@
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 @@
}
#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,
@@ -3982,7 +3966,7 @@
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)
@@ -5407,8 +5391,9 @@
}
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);
@@ -5423,6 +5408,17 @@
ER(ER_WARN_USING_OTHER_HANDLER),
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;
}
--- 1.460/sql/sql_yacc.yy 2006-02-14 16:27:36 +01:00
+++ 1.461/sql/sql_yacc.yy 2006-02-17 15:24:19 +01:00
@@ -3992,7 +3992,16 @@
| create_table_option ',' create_table_options;
create_table_option:
- ENGINE_SYM opt_equal storage_engines { Lex->create_info.db_type= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; }
+ ENGINE_SYM opt_equal storage_engines
+ {
+ Lex->create_info.db_type= $3; Lex->create_info.used_fields|=
HA_CREATE_USED_ENGINE;
+ if (Lex->create_info.options & HA_LEX_CREATE_TMP_TABLE &&
+ Lex->create_info.db_type->flags & HTON_TEMPORARY_NOT_SUPPORTED)
+ {
+ my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
Lex->create_info.db_type->name, "TEMPORARY");
+ YYABORT;
+ }
+ }
| MAX_ROWS opt_equal ulonglong_num { Lex->create_info.max_rows= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;}
| MIN_ROWS opt_equal ulonglong_num { Lex->create_info.min_rows= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;}
| AVG_ROW_LENGTH opt_equal ulong_num { Lex->create_info.avg_row_length=$3;
Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;}
--- 1.80/sql/share/errmsg.txt 2006-02-14 20:10:43 +01:00
+++ 1.81/sql/share/errmsg.txt 2006-02-17 15:24:19 +01:00
@@ -5804,3 +5804,5 @@
eng "Upholding foreign key constraints for table '%.64s', entry '%-.64s', key %d would
lead to a duplicate entry"
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_ILLEGAL_HA_CREATE_OPTION
+ eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
--- 1.271/sql/ha_ndbcluster.cc 2006-02-16 17:25:20 +01:00
+++ 1.272/sql/ha_ndbcluster.cc 2006-02-17 15:24:19 +01:00
@@ -5848,7 +5848,7 @@
#ifdef HAVE_NDB_BINLOG
ndbcluster_binlog_init_handlerton();
#endif
- h.flags= HTON_NO_FLAGS;
+ h.flags= HTON_TEMPORARY_NOT_SUPPORTED;
}
// Set connectstring if specified
--- New file ---
+++ mysql-test/r/ndb_temporary.result 06/02/17 15:24:20
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;
--- New file ---
+++ mysql-test/t/ndb_temporary.test 06/02/17 15:24:20
-- 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;
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2127) BUG#17210 | tomas | 17 Feb |