mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
bump the VERSION to 10.1.6 and related changes
fix two #if MYSQL_VERSION_ID > 100105
This commit is contained in:
2
VERSION
2
VERSION
@ -1,4 +1,4 @@
|
|||||||
MYSQL_VERSION_MAJOR=10
|
MYSQL_VERSION_MAJOR=10
|
||||||
MYSQL_VERSION_MINOR=1
|
MYSQL_VERSION_MINOR=1
|
||||||
MYSQL_VERSION_PATCH=5
|
MYSQL_VERSION_PATCH=6
|
||||||
MYSQL_VERSION_EXTRA=
|
MYSQL_VERSION_EXTRA=
|
||||||
|
@ -2,18 +2,18 @@ drop table if exists t1,t2;
|
|||||||
create table t1 (a int) engine=myisam;
|
create table t1 (a int) engine=myisam;
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
create table t1 (a int) engine=myisam;
|
create table t1 (a int) engine=myisam;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
ERROR HY000: Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
ERROR HY000: Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
drop table t1;
|
drop table t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
create table t1 (a int) engine=myisam;
|
create table t1 (a int) engine=myisam;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
ERROR HY000: File './test/t1.MYD' not found (Errcode: 2 "No such file or directory")
|
ERROR HY000: File './test/t1.MYD' not found (Errcode: 2 "No such file or directory")
|
||||||
drop table t1;
|
drop table t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
drop table t1;
|
drop table t1;
|
||||||
ERROR 42S02: Unknown table 'test.t1'
|
ERROR 42S02: Unknown table 'test.t1'
|
||||||
|
@ -29,7 +29,7 @@ Warnings:
|
|||||||
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
#
|
#
|
||||||
# Cleanup
|
# Cleanup
|
||||||
#
|
#
|
||||||
|
@ -2484,7 +2484,7 @@ INSERT INTO t2 VALUES(1);
|
|||||||
DELETE FROM t1 WHERE id = 1;
|
DELETE FROM t1 WHERE id = 1;
|
||||||
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
|
||||||
SET FOREIGN_KEY_CHECKS=0;
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET FOREIGN_KEY_CHECKS=1;
|
SET FOREIGN_KEY_CHECKS=1;
|
||||||
|
@ -634,7 +634,7 @@ ERROR 42S02: Table 'test.bug29807' doesn't exist in engine
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
drop table bug29807;
|
drop table bug29807;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 155 Table 'test.bug29807' doesn't exist in engine
|
Warning 1932 Table 'test.bug29807' doesn't exist in engine
|
||||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||||
switch to connection c1
|
switch to connection c1
|
||||||
|
@ -1551,7 +1551,7 @@ INSERT INTO t2 VALUES(1);
|
|||||||
--error 1451
|
--error 1451
|
||||||
DELETE FROM t1 WHERE id = 1;
|
DELETE FROM t1 WHERE id = 1;
|
||||||
|
|
||||||
--error 1217
|
--error 1451
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS=0;
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
|
@ -17,7 +17,7 @@ OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
|
|||||||
insert into performance_schema.setup_objects
|
insert into performance_schema.setup_objects
|
||||||
set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
|
set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
|
||||||
enabled='YES', timed='YES';
|
enabled='YES', timed='YES';
|
||||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
|
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
|
||||||
insert into performance_schema.setup_objects
|
insert into performance_schema.setup_objects
|
||||||
set object_type='TABLE', object_schema='FOO', object_name='BAR',
|
set object_type='TABLE', object_schema='FOO', object_name='BAR',
|
||||||
enabled='YES', timed='YES';
|
enabled='YES', timed='YES';
|
||||||
|
@ -27,25 +27,25 @@ insert into performance_schema.setup_objects
|
|||||||
values ('TABLE', 'db4', '%', 'YES', 'NO');
|
values ('TABLE', 'db4', '%', 'YES', 'NO');
|
||||||
insert into performance_schema.setup_objects
|
insert into performance_schema.setup_objects
|
||||||
values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
|
values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
|
||||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
|
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
Warning 1265 Data truncated for column 'OBJECT_TYPE' at row 1
|
Warning 1265 Data truncated for column 'OBJECT_TYPE' at row 1
|
||||||
Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
|
Error 1452 Cannot add or update a child row: a foreign key constraint fails
|
||||||
insert into performance_schema.setup_objects
|
insert into performance_schema.setup_objects
|
||||||
values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
|
values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
|
||||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
|
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
Warning 1265 Data truncated for column 'ENABLED' at row 1
|
Warning 1265 Data truncated for column 'ENABLED' at row 1
|
||||||
Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
|
Error 1452 Cannot add or update a child row: a foreign key constraint fails
|
||||||
insert into performance_schema.setup_objects
|
insert into performance_schema.setup_objects
|
||||||
values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
|
values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
|
||||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
|
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
Warning 1265 Data truncated for column 'TIMED' at row 1
|
Warning 1265 Data truncated for column 'TIMED' at row 1
|
||||||
Error 1452 Cannot add or update a child row: a foreign key constraint fails ()
|
Error 1452 Cannot add or update a child row: a foreign key constraint fails
|
||||||
select * from performance_schema.setup_objects
|
select * from performance_schema.setup_objects
|
||||||
order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
|
order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
|
||||||
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
|
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
|
||||||
@ -64,10 +64,10 @@ set OBJECT_TYPE='SOMETHING' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
|
|||||||
ERROR HY000: Invalid performance_schema usage.
|
ERROR HY000: Invalid performance_schema usage.
|
||||||
update performance_schema.setup_objects
|
update performance_schema.setup_objects
|
||||||
set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
|
set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
|
||||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
|
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
|
||||||
update performance_schema.setup_objects
|
update performance_schema.setup_objects
|
||||||
set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
|
set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
|
||||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
|
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
|
||||||
select * from performance_schema.setup_objects
|
select * from performance_schema.setup_objects
|
||||||
order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
|
order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
|
||||||
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
|
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
|
||||||
|
@ -4,5 +4,5 @@ create table t1 (a int) engine=myisam;
|
|||||||
flush tables;
|
flush tables;
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
include/rpl_end.inc
|
include/rpl_end.inc
|
||||||
|
@ -2296,41 +2296,6 @@ const char *get_canonical_filename(handler *file, const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
An interceptor to hijack the text of the error message without
|
|
||||||
setting an error in the thread. We need the text to present it
|
|
||||||
in the form of a warning to the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct Ha_delete_table_error_handler: public Internal_error_handler
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual bool handle_condition(THD *thd,
|
|
||||||
uint sql_errno,
|
|
||||||
const char* sqlstate,
|
|
||||||
Sql_condition::enum_warning_level level,
|
|
||||||
const char* msg,
|
|
||||||
Sql_condition ** cond_hdl);
|
|
||||||
char buff[MYSQL_ERRMSG_SIZE];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
Ha_delete_table_error_handler::
|
|
||||||
handle_condition(THD *,
|
|
||||||
uint,
|
|
||||||
const char*,
|
|
||||||
Sql_condition::enum_warning_level,
|
|
||||||
const char* msg,
|
|
||||||
Sql_condition ** cond_hdl)
|
|
||||||
{
|
|
||||||
*cond_hdl= NULL;
|
|
||||||
/* Grab the error message */
|
|
||||||
strmake_buf(buff, msg);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** delete a table in the engine
|
/** delete a table in the engine
|
||||||
|
|
||||||
@note
|
@note
|
||||||
@ -2367,14 +2332,6 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
|
|||||||
|
|
||||||
if (!intercept || generate_warning)
|
if (!intercept || generate_warning)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
Because file->print_error() use my_error() to generate the error message
|
|
||||||
we use an internal error handler to intercept it and store the text
|
|
||||||
in a temporary buffer. Later the message will be presented to user
|
|
||||||
as a warning.
|
|
||||||
*/
|
|
||||||
Ha_delete_table_error_handler ha_delete_table_error_handler;
|
|
||||||
|
|
||||||
/* Fill up strucutures that print_error may need */
|
/* Fill up strucutures that print_error may need */
|
||||||
dummy_share.path.str= (char*) path;
|
dummy_share.path.str= (char*) path;
|
||||||
dummy_share.path.length= strlen(path);
|
dummy_share.path.length= strlen(path);
|
||||||
@ -2385,28 +2342,8 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
|
|||||||
dummy_share.table_name.length= strlen(alias);
|
dummy_share.table_name.length= strlen(alias);
|
||||||
dummy_table.alias.set(alias, dummy_share.table_name.length,
|
dummy_table.alias.set(alias, dummy_share.table_name.length,
|
||||||
table_alias_charset);
|
table_alias_charset);
|
||||||
|
|
||||||
file->change_table_ptr(&dummy_table, &dummy_share);
|
file->change_table_ptr(&dummy_table, &dummy_share);
|
||||||
|
file->print_error(error, MYF(intercept ? ME_JUST_WARNING : 0));
|
||||||
#if MYSQL_VERSION_ID > 100105
|
|
||||||
// XXX as an ugly 10.0-only hack we intercept HA_ERR_ROW_IS_REFERENCED,
|
|
||||||
// to report it under the old historical error number.
|
|
||||||
#error remove HA_ERR_ROW_IS_REFERENCED, use ME_JUST_WARNING instead of a handler
|
|
||||||
#endif
|
|
||||||
if (intercept || error == HA_ERR_ROW_IS_REFERENCED)
|
|
||||||
thd->push_internal_handler(&ha_delete_table_error_handler);
|
|
||||||
|
|
||||||
file->print_error(error, 0);
|
|
||||||
|
|
||||||
if (intercept || error == HA_ERR_ROW_IS_REFERENCED)
|
|
||||||
{
|
|
||||||
thd->pop_internal_handler();
|
|
||||||
if (error == HA_ERR_ROW_IS_REFERENCED)
|
|
||||||
my_message(ER_ROW_IS_REFERENCED, ER(ER_ROW_IS_REFERENCED), MYF(0));
|
|
||||||
else
|
|
||||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, error,
|
|
||||||
ha_delete_table_error_handler.buff);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (intercept)
|
if (intercept)
|
||||||
error= 0;
|
error= 0;
|
||||||
@ -3528,14 +3465,18 @@ void handler::print_error(int error, myf errflag)
|
|||||||
{
|
{
|
||||||
String str;
|
String str;
|
||||||
get_error_message(error, &str);
|
get_error_message(error, &str);
|
||||||
my_error(ER_ROW_IS_REFERENCED_2, errflag, str.c_ptr_safe());
|
my_printf_error(ER_ROW_IS_REFERENCED_2,
|
||||||
|
ER(str.length() ? ER_ROW_IS_REFERENCED_2 : ER_ROW_IS_REFERENCED),
|
||||||
|
errflag, str.c_ptr_safe());
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
case HA_ERR_NO_REFERENCED_ROW:
|
case HA_ERR_NO_REFERENCED_ROW:
|
||||||
{
|
{
|
||||||
String str;
|
String str;
|
||||||
get_error_message(error, &str);
|
get_error_message(error, &str);
|
||||||
my_error(ER_NO_REFERENCED_ROW_2, errflag, str.c_ptr_safe());
|
my_printf_error(ER_NO_REFERENCED_ROW_2,
|
||||||
|
ER(str.length() ? ER_NO_REFERENCED_ROW_2 : ER_NO_REFERENCED_ROW),
|
||||||
|
errflag, str.c_ptr_safe());
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
case HA_ERR_TABLE_DEF_CHANGED:
|
case HA_ERR_TABLE_DEF_CHANGED:
|
||||||
|
@ -7913,13 +7913,21 @@ bool get_schema_tables_result(JOIN *join,
|
|||||||
TABLE_LIST *table_list= tab->table->pos_in_table_list;
|
TABLE_LIST *table_list= tab->table->pos_in_table_list;
|
||||||
if (table_list->schema_table && thd->fill_information_schema_tables())
|
if (table_list->schema_table && thd->fill_information_schema_tables())
|
||||||
{
|
{
|
||||||
#if MYSQL_VERSION_ID > 100105
|
/*
|
||||||
#error I_S tables only need to be re-populated if make_cond_for_info_schema() will preserve outer fields
|
Note, currently I_S tables are filled once per query.
|
||||||
bool is_subselect= (&lex->unit != lex->current_select->master_unit() &&
|
This needs to be changed if if make_cond_for_info_schema()
|
||||||
lex->current_select->master_unit()->item);
|
will preserve outer fields (and thus I_S content will depend on
|
||||||
#else
|
the outer subquery) - in this new case I_S tables will need to
|
||||||
#define is_subselect false
|
be re-populated here.
|
||||||
#endif
|
|
||||||
|
And in that case, get_all_tables() might be called O(N^2) times
|
||||||
|
(in self-join of TABLES, for example) and it will allocate
|
||||||
|
table names on THD::mem_root O(N^2) times. To fix it, get_all_tables
|
||||||
|
needs to be fixed to use a local memroot, that is reset or destroyed
|
||||||
|
between get_all_tables invocations. Or fixed not to allocate
|
||||||
|
table names on THD::memroot if these names don't satisfy lookup_field
|
||||||
|
*/
|
||||||
|
const bool is_subselect= false;
|
||||||
|
|
||||||
/* A value of 0 indicates a dummy implementation */
|
/* A value of 0 indicates a dummy implementation */
|
||||||
if (table_list->schema_table->fill_table == 0)
|
if (table_list->schema_table->fill_table == 0)
|
||||||
@ -7960,7 +7968,6 @@ bool get_schema_tables_result(JOIN *join,
|
|||||||
else
|
else
|
||||||
table_list->table->file->stats.records= 0;
|
table_list->table->file->stats.records= 0;
|
||||||
|
|
||||||
|
|
||||||
Item *cond= tab->select_cond;
|
Item *cond= tab->select_cond;
|
||||||
if (tab->cache_select && tab->cache_select->cond)
|
if (tab->cache_select && tab->cache_select->cond)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user