mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.6 into 10.11
This commit is contained in:
@@ -242,7 +242,6 @@ SET(HAVE_TERMCAP_H CACHE INTERNAL "")
|
||||
SET(HAVE_TERMIOS_H CACHE INTERNAL "")
|
||||
SET(HAVE_TERMIO_H CACHE INTERNAL "")
|
||||
SET(HAVE_TERM_H CACHE INTERNAL "")
|
||||
SET(HAVE_THR_SETCONCURRENCY CACHE INTERNAL "")
|
||||
SET(HAVE_THR_YIELD CACHE INTERNAL "")
|
||||
SET(HAVE_TIME 1 CACHE INTERNAL "")
|
||||
SET(HAVE_TIMES CACHE INTERNAL "")
|
||||
|
@@ -232,7 +232,6 @@
|
||||
#cmakedefine HAVE_STRTOUL 1
|
||||
#cmakedefine HAVE_STRTOULL 1
|
||||
#cmakedefine HAVE_TELL 1
|
||||
#cmakedefine HAVE_THR_SETCONCURRENCY 1
|
||||
#cmakedefine HAVE_THR_YIELD 1
|
||||
#cmakedefine HAVE_TIME 1
|
||||
#cmakedefine HAVE_TIMES 1
|
||||
|
@@ -418,7 +418,6 @@ CHECK_FUNCTION_EXISTS (strtoul HAVE_STRTOUL)
|
||||
CHECK_FUNCTION_EXISTS (strtoull HAVE_STRTOULL)
|
||||
CHECK_FUNCTION_EXISTS (strcasecmp HAVE_STRCASECMP)
|
||||
CHECK_FUNCTION_EXISTS (tell HAVE_TELL)
|
||||
CHECK_FUNCTION_EXISTS (thr_setconcurrency HAVE_THR_SETCONCURRENCY)
|
||||
CHECK_FUNCTION_EXISTS (thr_yield HAVE_THR_YIELD)
|
||||
CHECK_FUNCTION_EXISTS (vasprintf HAVE_VASPRINTF)
|
||||
CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF)
|
||||
|
@@ -147,9 +147,6 @@ int pthread_cancel(pthread_t thread);
|
||||
#ifndef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
#include <thread.h> /* Probably solaris */
|
||||
#endif
|
||||
#ifdef HAVE_SCHED_H
|
||||
#include <sched.h>
|
||||
#endif
|
||||
@@ -618,9 +615,6 @@ extern int my_rw_trywrlock(my_rw_lock_t *);
|
||||
|
||||
#define GETHOSTBYADDR_BUFF_SIZE 2048
|
||||
|
||||
#ifndef HAVE_THR_SETCONCURRENCY
|
||||
#define thr_setconcurrency(A) pthread_dummy(0)
|
||||
#endif
|
||||
#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize)
|
||||
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
|
||||
#endif
|
||||
|
@@ -531,7 +531,13 @@ struct st_mysql_plugin
|
||||
const char *author; /* plugin author (for I_S.PLUGINS) */
|
||||
const char *descr; /* general descriptive text (for I_S.PLUGINS) */
|
||||
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
|
||||
int (*init)(void *); /* the function to invoke when plugin is loaded */
|
||||
/*
|
||||
The function to invoke when plugin is loaded. Plugin
|
||||
initialisation done here should defer any ALTER TABLE queries to
|
||||
after the ddl recovery is done, in the signal_ddl_recovery_done()
|
||||
callback called by ha_signal_ddl_recovery_done().
|
||||
*/
|
||||
int (*init)(void *);
|
||||
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
|
||||
unsigned int version; /* plugin version (for I_S.PLUGINS) */
|
||||
struct st_mysql_show_var *status_vars;
|
||||
@@ -555,7 +561,13 @@ struct st_maria_plugin
|
||||
const char *author; /* plugin author (for SHOW PLUGINS) */
|
||||
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
|
||||
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
|
||||
int (*init)(void *); /* the function to invoke when plugin is loaded */
|
||||
/*
|
||||
The function to invoke when plugin is loaded. Plugin
|
||||
initialisation done here should defer any ALTER TABLE queries to
|
||||
after the ddl recovery is done, in the signal_ddl_recovery_done()
|
||||
callback called by ha_signal_ddl_recovery_done().
|
||||
*/
|
||||
int (*init)(void *);
|
||||
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
|
||||
unsigned int version; /* plugin version (for SHOW PLUGINS) */
|
||||
struct st_mysql_show_var *status_vars;
|
||||
|
@@ -634,8 +634,6 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
||||
udf_init();
|
||||
#endif
|
||||
|
||||
(void) thr_setconcurrency(concurrency); // 10 by default
|
||||
|
||||
if (flush_time && flush_time != ~(ulong) 0L)
|
||||
start_handle_manager();
|
||||
|
||||
|
@@ -892,6 +892,12 @@ sub collect_one_test_case {
|
||||
}
|
||||
my @no_combs = grep { $test_combs{$_} == 1 } keys %test_combs;
|
||||
if (@no_combs) {
|
||||
if ($::opt_skip_not_found) {
|
||||
push @{$tinfo->{combinations}}, @no_combs;
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "combination not found";
|
||||
return $tinfo;
|
||||
}
|
||||
mtr_error("Could not run $name with '".(
|
||||
join(',', sort @no_combs))."' combination(s)");
|
||||
}
|
||||
|
@@ -768,14 +768,11 @@ INSERT INTO t1 VALUES (-1.0);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#enable after MDEV-32645 is fixed
|
||||
--disable_view_protocol
|
||||
SELECT CAST(-1e0 AS UNSIGNED);
|
||||
CREATE TABLE t1 (a BIGINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (-1e0);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--enable_view_protocol
|
||||
|
||||
SELECT CAST(-1e308 AS UNSIGNED);
|
||||
CREATE TABLE t1 (a BIGINT UNSIGNED);
|
||||
|
@@ -2632,4 +2632,49 @@ a
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-31657: CTE with the same name as base table used twice
|
||||
# in another CTE
|
||||
#
|
||||
create table t (a int);
|
||||
insert into t values (3), (7), (1);
|
||||
with
|
||||
t as (select * from t),
|
||||
cte as (select t1.a as t1a, t2.a as t2a from t as t1, t as t2 where t1.a=t2.a)
|
||||
select * from cte;
|
||||
t1a t2a
|
||||
3 3
|
||||
7 7
|
||||
1 1
|
||||
create table s (a int);
|
||||
insert into s values (1), (4), (7);
|
||||
with
|
||||
t as (select * from t),
|
||||
s as (select a-1 as a from s),
|
||||
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
|
||||
union
|
||||
select t.a+1, s.a+1 from t, s where t.a=s.a+1)
|
||||
select * from cte;
|
||||
ta sa
|
||||
3 3
|
||||
2 1
|
||||
8 7
|
||||
with
|
||||
t as (select * from t),
|
||||
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
|
||||
union
|
||||
select t.a+1, s.a+1 from t, s where t.a=s.a),
|
||||
s as (select a+10 as a from s)
|
||||
select * from cte;
|
||||
ta sa
|
||||
1 1
|
||||
7 7
|
||||
2 2
|
||||
8 8
|
||||
drop table t,s;
|
||||
with
|
||||
t as (select * from t),
|
||||
cte as (select t1.a as t1a, t2.a as t2a from t as t1, t as t2 where t1.a=t2.a)
|
||||
select * from cte;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist
|
||||
# End of 10.4 tests
|
||||
|
@@ -1979,4 +1979,50 @@ SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31657: CTE with the same name as base table used twice
|
||||
--echo # in another CTE
|
||||
--echo #
|
||||
|
||||
create table t (a int);
|
||||
insert into t values (3), (7), (1);
|
||||
|
||||
let $q1=
|
||||
with
|
||||
t as (select * from t),
|
||||
cte as (select t1.a as t1a, t2.a as t2a from t as t1, t as t2 where t1.a=t2.a)
|
||||
select * from cte;
|
||||
|
||||
eval $q1;
|
||||
|
||||
create table s (a int);
|
||||
insert into s values (1), (4), (7);
|
||||
|
||||
let $q2=
|
||||
with
|
||||
t as (select * from t),
|
||||
s as (select a-1 as a from s),
|
||||
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
|
||||
union
|
||||
select t.a+1, s.a+1 from t, s where t.a=s.a+1)
|
||||
select * from cte;
|
||||
|
||||
eval $q2;
|
||||
|
||||
let $q3=
|
||||
with
|
||||
t as (select * from t),
|
||||
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
|
||||
union
|
||||
select t.a+1, s.a+1 from t, s where t.a=s.a),
|
||||
s as (select a+10 as a from s)
|
||||
select * from cte;
|
||||
|
||||
eval $q3;
|
||||
|
||||
drop table t,s;
|
||||
|
||||
--ERROR ER_NO_SUCH_TABLE
|
||||
eval $q1;
|
||||
|
||||
--echo # End of 10.4 tests
|
||||
|
@@ -1173,6 +1173,43 @@ d 50
|
||||
fdbl 123.456.789,12345678000000000000000000000000000000
|
||||
fdec 123.456.789,12345678900000000000000000000000000000
|
||||
#
|
||||
# MDEV-32645 CAST(AS UNSIGNED) fails with --view-protocol
|
||||
#
|
||||
SELECT
|
||||
CAST(-1e0 AS UNSIGNED),
|
||||
CAST(--2e0 AS UNSIGNED),
|
||||
CAST(---3e0 AS UNSIGNED),
|
||||
CAST(----4e0 AS UNSIGNED);
|
||||
CAST(-1e0 AS UNSIGNED) CAST(--2e0 AS UNSIGNED) CAST(---3e0 AS UNSIGNED) CAST(----4e0 AS UNSIGNED)
|
||||
0 2 0 4
|
||||
Warnings:
|
||||
Note 1916 Got overflow when converting '-1' to UNSIGNED BIGINT. Value truncated
|
||||
Note 1916 Got overflow when converting '-3' to UNSIGNED BIGINT. Value truncated
|
||||
EXPLAIN EXTENDED SELECT
|
||||
CAST(-1e0 AS UNSIGNED),
|
||||
CAST(--2e0 AS UNSIGNED),
|
||||
CAST(---3e0 AS UNSIGNED),
|
||||
CAST(----4e0 AS UNSIGNED);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select cast(-1e0 as unsigned) AS `CAST(-1e0 AS UNSIGNED)`,cast(2e0 as unsigned) AS `CAST(--2e0 AS UNSIGNED)`,cast(-3e0 as unsigned) AS `CAST(---3e0 AS UNSIGNED)`,cast(4e0 as unsigned) AS `CAST(----4e0 AS UNSIGNED)`
|
||||
CREATE VIEW v1 AS SELECT
|
||||
CAST(-1e0 AS UNSIGNED),
|
||||
CAST(--2e0 AS UNSIGNED),
|
||||
CAST(---3e0 AS UNSIGNED),
|
||||
CAST(----4e0 AS UNSIGNED);
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(-1e0 as unsigned) AS `CAST(-1e0 AS UNSIGNED)`,cast(2e0 as unsigned) AS `CAST(--2e0 AS UNSIGNED)`,cast(-3e0 as unsigned) AS `CAST(---3e0 AS UNSIGNED)`,cast(4e0 as unsigned) AS `CAST(----4e0 AS UNSIGNED)` latin1 latin1_swedish_ci
|
||||
SELECT * FROM v1;
|
||||
CAST(-1e0 AS UNSIGNED) CAST(--2e0 AS UNSIGNED) CAST(---3e0 AS UNSIGNED) CAST(----4e0 AS UNSIGNED)
|
||||
0 2 0 4
|
||||
Warnings:
|
||||
Note 1916 Got overflow when converting '-1' to UNSIGNED BIGINT. Value truncated
|
||||
Note 1916 Got overflow when converting '-3' to UNSIGNED BIGINT. Value truncated
|
||||
DROP VIEW v1;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
||||
#
|
||||
|
@@ -716,6 +716,32 @@ $$
|
||||
DELIMITER ;$$
|
||||
--horizontal_results
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32645 CAST(AS UNSIGNED) fails with --view-protocol
|
||||
--echo #
|
||||
|
||||
SELECT
|
||||
CAST(-1e0 AS UNSIGNED),
|
||||
CAST(--2e0 AS UNSIGNED),
|
||||
CAST(---3e0 AS UNSIGNED),
|
||||
CAST(----4e0 AS UNSIGNED);
|
||||
|
||||
EXPLAIN EXTENDED SELECT
|
||||
CAST(-1e0 AS UNSIGNED),
|
||||
CAST(--2e0 AS UNSIGNED),
|
||||
CAST(---3e0 AS UNSIGNED),
|
||||
CAST(----4e0 AS UNSIGNED);
|
||||
|
||||
CREATE VIEW v1 AS SELECT
|
||||
CAST(-1e0 AS UNSIGNED),
|
||||
CAST(--2e0 AS UNSIGNED),
|
||||
CAST(---3e0 AS UNSIGNED),
|
||||
CAST(----4e0 AS UNSIGNED);
|
||||
|
||||
SHOW CREATE VIEW v1;
|
||||
SELECT * FROM v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
36
mysql-test/suite/federated/update.result
Normal file
36
mysql-test/suite/federated/update.result
Normal file
@@ -0,0 +1,36 @@
|
||||
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
|
||||
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
||||
connection master;
|
||||
CREATE DATABASE federated;
|
||||
connection slave;
|
||||
CREATE DATABASE federated;
|
||||
#
|
||||
# MDEV-32984 Update federated table and column privileges
|
||||
#
|
||||
connection slave;
|
||||
create database db1;
|
||||
create user my@localhost identified by '1qaz2wsx';
|
||||
create table db1.t1 (
|
||||
f1 int auto_increment primary key,
|
||||
f2 varchar(50),
|
||||
f3 varchar(50),
|
||||
unique (f2)
|
||||
);
|
||||
grant insert, select (f1, f2, f3), update (f3) on db1.t1 to my@localhost;
|
||||
connection master;
|
||||
create table tt1 engine=federated connection='mysql://my:1qaz2wsx@localhost:$SLAVE_MYPORT/db1/t1';
|
||||
insert into tt1 (f2,f3) values ('test','123');
|
||||
select * from tt1;
|
||||
f1 f2 f3
|
||||
1 test 123
|
||||
update tt1 set f3='123456' where f2='test';
|
||||
drop table tt1;
|
||||
connection slave;
|
||||
drop database db1;
|
||||
drop user my@localhost;
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
32
mysql-test/suite/federated/update.test
Normal file
32
mysql-test/suite/federated/update.test
Normal file
@@ -0,0 +1,32 @@
|
||||
source include/federated.inc;
|
||||
source have_federatedx.inc;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32984 Update federated table and column privileges
|
||||
--echo #
|
||||
connection slave;
|
||||
create database db1;
|
||||
create user my@localhost identified by '1qaz2wsx';
|
||||
create table db1.t1 (
|
||||
f1 int auto_increment primary key,
|
||||
f2 varchar(50),
|
||||
f3 varchar(50),
|
||||
unique (f2)
|
||||
);
|
||||
grant insert, select (f1, f2, f3), update (f3) on db1.t1 to my@localhost;
|
||||
|
||||
connection master;
|
||||
evalp create table tt1 engine=federated connection='mysql://my:1qaz2wsx@localhost:$SLAVE_MYPORT/db1/t1';
|
||||
insert into tt1 (f2,f3) values ('test','123');
|
||||
select * from tt1;
|
||||
update tt1 set f3='123456' where f2='test';
|
||||
|
||||
drop table tt1;
|
||||
|
||||
connection slave;
|
||||
drop database db1;
|
||||
drop user my@localhost;
|
||||
|
||||
source include/federated_cleanup.inc;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
CREATE TABLE t (pk int PRIMARY KEY, c varchar(10)) ENGINE=InnoDB;
|
||||
CREATE TABLE t (pk int PRIMARY KEY, c varchar(10))
|
||||
STATS_PERSISTENT=0 ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (10, "0123456789");
|
||||
connection default;
|
||||
BEGIN;
|
||||
|
@@ -3,7 +3,8 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
CREATE TABLE t (pk int PRIMARY KEY, c varchar(10)) ENGINE=InnoDB;
|
||||
CREATE TABLE t (pk int PRIMARY KEY, c varchar(10))
|
||||
STATS_PERSISTENT=0 ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (10, "0123456789");
|
||||
|
||||
--connection default
|
||||
|
@@ -253,6 +253,55 @@ NEXTVAL(s)
|
||||
1
|
||||
DROP SEQUENCE s;
|
||||
#
|
||||
# MDEV-33169 Alter sequence 2nd ps fails while alter sequence 2nd time (no ps) succeeds
|
||||
#
|
||||
create sequence s;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
alter sequence s maxvalue 123;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
alter sequence s maxvalue 123;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
drop sequence s;
|
||||
create sequence s;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
prepare stmt from 'alter sequence s maxvalue 123';
|
||||
execute stmt;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
execute stmt;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
deallocate prepare stmt;
|
||||
drop sequence s;
|
||||
create sequence s;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
create procedure p() alter sequence s maxvalue 123;
|
||||
call p;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
call p;
|
||||
show create sequence s;
|
||||
Table Create Table
|
||||
s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
drop procedure p;
|
||||
drop sequence s;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
||||
#
|
||||
# MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
|
||||
#
|
||||
CREATE SEQUENCE s1 ENGINE=InnoDB;
|
||||
@@ -266,3 +315,6 @@ s2 CREATE SEQUENCE `s2` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
DROP SEQUENCE s2;
|
||||
RENAME TABLE s1 TO s2;
|
||||
DROP SEQUENCE s2;
|
||||
#
|
||||
# End of 10.6 tests
|
||||
#
|
||||
|
@@ -167,6 +167,41 @@ ALTER TABLE s ORDER BY cache_size;
|
||||
SELECT NEXTVAL(s);
|
||||
DROP SEQUENCE s;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33169 Alter sequence 2nd ps fails while alter sequence 2nd time (no ps) succeeds
|
||||
--echo #
|
||||
create sequence s;
|
||||
show create sequence s;
|
||||
alter sequence s maxvalue 123;
|
||||
show create sequence s;
|
||||
alter sequence s maxvalue 123;
|
||||
show create sequence s;
|
||||
drop sequence s;
|
||||
|
||||
create sequence s;
|
||||
show create sequence s;
|
||||
prepare stmt from 'alter sequence s maxvalue 123';
|
||||
execute stmt;
|
||||
show create sequence s;
|
||||
execute stmt;
|
||||
show create sequence s;
|
||||
deallocate prepare stmt;
|
||||
drop sequence s;
|
||||
|
||||
create sequence s;
|
||||
show create sequence s;
|
||||
create procedure p() alter sequence s maxvalue 123;
|
||||
call p;
|
||||
show create sequence s;
|
||||
call p;
|
||||
show create sequence s;
|
||||
drop procedure p;
|
||||
drop sequence s;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
|
||||
--echo #
|
||||
@@ -180,3 +215,7 @@ RENAME TABLE s1 TO s2;
|
||||
DROP SEQUENCE s2;
|
||||
|
||||
--enable_ps2_protocol
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.6 tests
|
||||
--echo #
|
||||
|
@@ -786,7 +786,6 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
|
||||
mysql_mutex_unlock(&LOCK_thread_count);
|
||||
DBUG_PRINT("info",("signal thread created"));
|
||||
|
||||
thr_setconcurrency(3);
|
||||
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
|
||||
printf("Main thread: %s\n",my_thread_name());
|
||||
for (i=0 ; i < 2 ; i++)
|
||||
|
@@ -1783,9 +1783,6 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
|
||||
error,errno);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
(void) thr_setconcurrency(2);
|
||||
#endif
|
||||
for (i=0 ; i < array_elements(lock_counts) ; i++)
|
||||
{
|
||||
|
@@ -533,7 +533,6 @@ static void run_test()
|
||||
mysql_mutex_init(0, &LOCK_thread_count, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(0, &COND_thread_count, NULL);
|
||||
|
||||
thr_setconcurrency(3);
|
||||
pthread_attr_init(&thr_attr);
|
||||
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
|
||||
printf("Main thread: %s\n",my_thread_name());
|
||||
|
@@ -10,8 +10,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <security/pam_modules.h>
|
||||
#include <security/pam_appl.h>
|
||||
#include <security/pam_modules.h>
|
||||
|
||||
#define N 3
|
||||
|
||||
|
@@ -19,10 +19,14 @@
|
||||
#include <sys/types.h>
|
||||
#if defined(HAVE_GETMNTENT)
|
||||
#include <mntent.h>
|
||||
#elif defined(HAVE_SYS_MNTENT)
|
||||
#include <sys/mntent.h>
|
||||
#elif !defined(HAVE_GETMNTINFO_TAKES_statvfs)
|
||||
/* getmntinfo (the not NetBSD variants) */
|
||||
#include <sys/param.h>
|
||||
#if defined(HAVE_SYS_UCRED)
|
||||
#include <sys/ucred.h>
|
||||
#endif
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#if defined(HAVE_GETMNTENT_IN_SYS_MNTAB)
|
||||
|
@@ -958,7 +958,8 @@ static my_bool signal_ddl_recovery_done(THD *, plugin_ref plugin, void *)
|
||||
{
|
||||
handlerton *hton= plugin_hton(plugin);
|
||||
if (hton->signal_ddl_recovery_done)
|
||||
(hton->signal_ddl_recovery_done)(hton);
|
||||
if ((hton->signal_ddl_recovery_done)(hton))
|
||||
plugin_ref_to_int(plugin)->state= PLUGIN_IS_DELETED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -1495,7 +1495,7 @@ struct handlerton
|
||||
const LEX_CUSTRING *version, ulonglong create_id);
|
||||
|
||||
/* Called for all storage handlers after ddl recovery is done */
|
||||
void (*signal_ddl_recovery_done)(handlerton *hton);
|
||||
int (*signal_ddl_recovery_done)(handlerton *hton);
|
||||
|
||||
/*
|
||||
Optional clauses in the CREATE/ALTER TABLE
|
||||
|
20
sql/item.cc
20
sql/item.cc
@@ -7041,7 +7041,25 @@ Item *Item_float::neg(THD *thd)
|
||||
else if (value < 0 && max_length)
|
||||
max_length--;
|
||||
value= -value;
|
||||
presentation= 0;
|
||||
if (presentation)
|
||||
{
|
||||
if (*presentation == '-')
|
||||
{
|
||||
// Strip double minus: -(-1) -> '1' instead of '--1'
|
||||
presentation++;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t presentation_length= strlen(presentation);
|
||||
if (char *tmp= (char*) thd->alloc(presentation_length + 2))
|
||||
{
|
||||
tmp[0]= '-';
|
||||
// Copy with the trailing '\0'
|
||||
memcpy(tmp + 1, presentation, presentation_length + 1);
|
||||
presentation= tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
name= null_clex_str;
|
||||
return this;
|
||||
}
|
||||
|
@@ -7521,7 +7521,7 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability
|
||||
indexed and it cannot have a DEFAULT value).
|
||||
*/
|
||||
m_table->auto_increment_field_not_null= FALSE;
|
||||
m_table->mark_auto_increment_column();
|
||||
m_table->mark_auto_increment_column(true);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
148
sql/mysqld.cc
148
sql/mysqld.cc
@@ -5221,6 +5221,14 @@ static int init_server_components()
|
||||
if (!opt_abort && ddl_log_initialize())
|
||||
unireg_abort(1);
|
||||
|
||||
/*
|
||||
Plugins may not be completed because system table DDLs are only
|
||||
run after the ddl recovery done. Therefore between the
|
||||
plugin_init() call and the ha_signal_ddl_recovery_done() call
|
||||
below only things related to preparation for recovery should be
|
||||
done and nothing else, and definitely not anything assuming that
|
||||
all plugins have been initialised.
|
||||
*/
|
||||
if (plugin_init(&remaining_argc, remaining_argv,
|
||||
(opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
|
||||
(opt_abort ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
|
||||
@@ -5791,8 +5799,6 @@ int mysqld_main(int argc, char **argv)
|
||||
SYSVAR_AUTOSIZE(my_thread_stack_size, new_thread_stack_size);
|
||||
}
|
||||
|
||||
(void) thr_setconcurrency(concurrency); // 10 by default
|
||||
|
||||
select_thread=pthread_self();
|
||||
select_thread_in_use=1;
|
||||
|
||||
@@ -6867,8 +6873,8 @@ struct my_option my_long_options[]=
|
||||
#endif
|
||||
};
|
||||
|
||||
static int show_queries(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_queries(THD *thd, SHOW_VAR *var, void *,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONGLONG;
|
||||
var->value= &thd->query_id;
|
||||
@@ -6876,16 +6882,16 @@ static int show_queries(THD *thd, SHOW_VAR *var, char *buff,
|
||||
}
|
||||
|
||||
|
||||
static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_net_compression(THD *thd, SHOW_VAR *var, void *,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_MY_BOOL;
|
||||
var->value= &thd->net.compress;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_starttime(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_starttime(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -6894,8 +6900,8 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff,
|
||||
}
|
||||
|
||||
#ifdef ENABLED_PROFILING
|
||||
static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_flushstatustime(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -6905,32 +6911,28 @@ static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_rpl_status(THD *, SHOW_VAR *var, void *, system_status_var *,
|
||||
enum_var_type)
|
||||
{
|
||||
var->type= SHOW_CHAR;
|
||||
var->value= const_cast<char*>(rpl_status_type[(int)rpl_status]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_slave_running(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
Master_info *mi= NULL;
|
||||
bool UNINIT_VAR(tmp);
|
||||
|
||||
var->type= SHOW_MY_BOOL;
|
||||
var->value= buff;
|
||||
|
||||
if ((mi= get_master_info(&thd->variables.default_master_connection,
|
||||
Sql_condition::WARN_LEVEL_NOTE)))
|
||||
if (Master_info *mi=
|
||||
get_master_info(&thd->variables.default_master_connection,
|
||||
Sql_condition::WARN_LEVEL_NOTE))
|
||||
{
|
||||
tmp= (my_bool) (mi->slave_running == MYSQL_SLAVE_RUN_READING &&
|
||||
*((my_bool*) buff)=
|
||||
(mi->slave_running == MYSQL_SLAVE_RUN_READING &&
|
||||
mi->rli.slave_running != MYSQL_SLAVE_NOT_RUN);
|
||||
mi->release();
|
||||
var->type= SHOW_MY_BOOL;
|
||||
var->value= buff;
|
||||
}
|
||||
if (mi)
|
||||
*((my_bool *)buff)= tmp;
|
||||
else
|
||||
var->type= SHOW_UNDEF;
|
||||
return 0;
|
||||
@@ -6940,7 +6942,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff,
|
||||
/* How many masters this slave is connected to */
|
||||
|
||||
|
||||
static int show_slaves_running(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int show_slaves_running(THD *, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONGLONG;
|
||||
var->value= buff;
|
||||
@@ -6951,19 +6954,17 @@ static int show_slaves_running(THD *thd, SHOW_VAR *var, char *buff)
|
||||
}
|
||||
|
||||
|
||||
static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
Master_info *mi;
|
||||
|
||||
var->type= SHOW_LONGLONG;
|
||||
var->value= buff;
|
||||
|
||||
if ((mi= get_master_info(&thd->variables.default_master_connection,
|
||||
Sql_condition::WARN_LEVEL_NOTE)))
|
||||
if (Master_info *mi=
|
||||
get_master_info(&thd->variables.default_master_connection,
|
||||
Sql_condition::WARN_LEVEL_NOTE))
|
||||
{
|
||||
*((longlong *)buff)= mi->received_heartbeats;
|
||||
mi->release();
|
||||
var->type= SHOW_LONGLONG;
|
||||
var->value= buff;
|
||||
}
|
||||
else
|
||||
var->type= SHOW_UNDEF;
|
||||
@@ -6971,19 +6972,17 @@ static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff,
|
||||
}
|
||||
|
||||
|
||||
static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_heartbeat_period(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
Master_info *mi;
|
||||
|
||||
if (Master_info *mi=
|
||||
get_master_info(&thd->variables.default_master_connection,
|
||||
Sql_condition::WARN_LEVEL_NOTE))
|
||||
{
|
||||
sprintf(static_cast<char*>(buff), "%.3f", mi->heartbeat_period);
|
||||
mi->release();
|
||||
var->type= SHOW_CHAR;
|
||||
var->value= buff;
|
||||
|
||||
if ((mi= get_master_info(&thd->variables.default_master_connection,
|
||||
Sql_condition::WARN_LEVEL_NOTE)))
|
||||
{
|
||||
sprintf(buff, "%.3f", mi->heartbeat_period);
|
||||
mi->release();
|
||||
}
|
||||
else
|
||||
var->type= SHOW_UNDEF;
|
||||
@@ -6993,8 +6992,8 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff,
|
||||
|
||||
#endif /* HAVE_REPLICATION */
|
||||
|
||||
static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_open_tables(THD *, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -7002,8 +7001,8 @@ static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_prepared_stmt_count(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_prepared_stmt_count(THD *, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -7013,8 +7012,8 @@ static int show_prepared_stmt_count(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_table_definitions(THD *, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -7033,8 +7032,8 @@ static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff,
|
||||
inside an Event.
|
||||
*/
|
||||
|
||||
static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_ssl_get_version(THD *thd, SHOW_VAR *var, void *,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_CHAR;
|
||||
if( thd->vio_ok() && thd->net.vio->ssl_arg )
|
||||
@@ -7044,8 +7043,8 @@ static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -7056,8 +7055,8 @@ static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -7072,8 +7071,8 @@ static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -7085,8 +7084,8 @@ static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_CHAR;
|
||||
if( thd->vio_ok() && thd->net.vio->ssl_arg )
|
||||
@@ -7096,9 +7095,10 @@ static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, void *buf,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
char *buff= static_cast<char*>(buf);
|
||||
var->type= SHOW_CHAR;
|
||||
var->value= buff;
|
||||
if (thd->vio_ok() && thd->net.vio->ssl_arg)
|
||||
@@ -7183,8 +7183,8 @@ end:
|
||||
*/
|
||||
|
||||
static int
|
||||
show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_CHAR;
|
||||
if(thd->vio_ok() && thd->net.vio->ssl_arg)
|
||||
@@ -7193,7 +7193,7 @@ show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff,
|
||||
X509 *cert= SSL_get_certificate(ssl);
|
||||
const ASN1_TIME *not_before= X509_get0_notBefore(cert);
|
||||
|
||||
var->value= my_asn1_time_to_string(not_before, buff,
|
||||
var->value= my_asn1_time_to_string(not_before, static_cast<char*>(buff),
|
||||
SHOW_VAR_FUNC_BUFF_SIZE);
|
||||
if (!var->value)
|
||||
return 1;
|
||||
@@ -7217,8 +7217,8 @@ show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff,
|
||||
*/
|
||||
|
||||
static int
|
||||
show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_CHAR;
|
||||
if(thd->vio_ok() && thd->net.vio->ssl_arg)
|
||||
@@ -7227,7 +7227,7 @@ show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, char *buff,
|
||||
X509 *cert= SSL_get_certificate(ssl);
|
||||
const ASN1_TIME *not_after= X509_get0_notAfter(cert);
|
||||
|
||||
var->value= my_asn1_time_to_string(not_after, buff,
|
||||
var->value= my_asn1_time_to_string(not_after, static_cast<char*>(buff),
|
||||
SHOW_VAR_FUNC_BUFF_SIZE);
|
||||
if (!var->value)
|
||||
return 1;
|
||||
@@ -7281,7 +7281,7 @@ static int show_default_keycache(THD *thd, SHOW_VAR *var, void *buff,
|
||||
}
|
||||
|
||||
|
||||
static int show_memory_used(THD *thd, SHOW_VAR *var, char *buff,
|
||||
static int show_memory_used(THD *thd, SHOW_VAR *var, void *buff,
|
||||
struct system_status_var *status_var,
|
||||
enum enum_var_type scope)
|
||||
{
|
||||
@@ -7337,8 +7337,8 @@ static int debug_status_func(THD *thd, SHOW_VAR *var, void *buff,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POOL_OF_THREADS
|
||||
static int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_threadpool_idle_threads(THD *, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_INT;
|
||||
var->value= buff;
|
||||
@@ -7347,8 +7347,8 @@ static int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff,
|
||||
}
|
||||
|
||||
|
||||
static int show_threadpool_threads(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_threadpool_threads(THD *, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
var->type= SHOW_INT;
|
||||
var->value= buff;
|
||||
|
@@ -8395,11 +8395,6 @@ bool check_grant(THD *thd, privilege_t want_access, TABLE_LIST *tables,
|
||||
INSERT_ACL : SELECT_ACL);
|
||||
}
|
||||
|
||||
if (tl->with || !tl->db.str ||
|
||||
(tl->select_lex &&
|
||||
(tl->with= tl->select_lex->find_table_def_in_with_clauses(tl))))
|
||||
continue;
|
||||
|
||||
const ACL_internal_table_access *access=
|
||||
get_cached_table_access(&t_ref->grant.m_internal,
|
||||
t_ref->get_db_name(),
|
||||
@@ -12181,8 +12176,8 @@ static my_bool count_column_grants(void *grant_table,
|
||||
This must be performed under the mutex in order to make sure the
|
||||
iteration does not fail.
|
||||
*/
|
||||
static int show_column_grants(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_column_grants(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum enum_var_type scope)
|
||||
{
|
||||
var->type= SHOW_ULONG;
|
||||
var->value= buff;
|
||||
@@ -12198,8 +12193,8 @@ static int show_column_grants(THD *thd, SHOW_VAR *var, char *buff,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_database_grants(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_database_grants(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum enum_var_type scope)
|
||||
{
|
||||
var->type= SHOW_UINT;
|
||||
var->value= buff;
|
||||
|
@@ -727,7 +727,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
|
||||
wsrep_wfc()
|
||||
#endif /*WITH_WSREP */
|
||||
{
|
||||
ulong tmp;
|
||||
bzero(&variables, sizeof(variables));
|
||||
|
||||
/*
|
||||
@@ -879,14 +878,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
|
||||
|
||||
tablespace_op=FALSE;
|
||||
|
||||
/*
|
||||
Initialize the random generator. We call my_rnd() without a lock as
|
||||
it's not really critical if two threads modifies the structure at the
|
||||
same time. We ensure that we have an unique number foreach thread
|
||||
by adding the address of the stack.
|
||||
*/
|
||||
tmp= (ulong) (my_rnd(&sql_rand) * 0xffffffff);
|
||||
my_rnd_init(&rand, tmp + (ulong)((size_t) &rand), tmp + (ulong) ::global_query_id);
|
||||
substitute_null_with_insert_id = FALSE;
|
||||
lock_info.mysql_thd= (void *)this;
|
||||
|
||||
@@ -1314,6 +1305,17 @@ void THD::init()
|
||||
/* Set to handle counting of aborted connections */
|
||||
userstat_running= opt_userstat_running;
|
||||
last_global_update_time= current_connect_time= time(NULL);
|
||||
|
||||
/*
|
||||
Initialize the random generator. We call my_rnd() without a lock as
|
||||
it's not really critical if two threads modify the structure at the
|
||||
same time. We ensure that we have a unique number for each thread
|
||||
by adding the address of this THD.
|
||||
*/
|
||||
ulong tmp= (ulong) (my_rnd(&sql_rand) * 0xffffffff);
|
||||
my_rnd_init(&rand, tmp + (ulong)(intptr) this,
|
||||
(ulong)(my_timer_cycles() + global_query_id));
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
session_tracker.enable(this);
|
||||
#endif //EMBEDDED_LIBRARY
|
||||
|
@@ -106,6 +106,7 @@ bool LEX::check_dependencies_in_with_clauses()
|
||||
|
||||
@param tables Points to the beginning of the sub-chain
|
||||
@param tables_last Points to the address with the sub-chain barrier
|
||||
@param excl_spec Ignore the definition with this spec
|
||||
|
||||
@details
|
||||
The method resolves tables references to CTE from the chain of
|
||||
@@ -147,7 +148,8 @@ bool LEX::check_dependencies_in_with_clauses()
|
||||
*/
|
||||
|
||||
bool LEX::resolve_references_to_cte(TABLE_LIST *tables,
|
||||
TABLE_LIST **tables_last)
|
||||
TABLE_LIST **tables_last,
|
||||
st_select_lex_unit *excl_spec)
|
||||
{
|
||||
With_element *with_elem= 0;
|
||||
|
||||
@@ -156,7 +158,8 @@ bool LEX::resolve_references_to_cte(TABLE_LIST *tables,
|
||||
if (tbl->derived)
|
||||
continue;
|
||||
if (!tbl->db.str && !tbl->with)
|
||||
tbl->with= tbl->select_lex->find_table_def_in_with_clauses(tbl);
|
||||
tbl->with= tbl->select_lex->find_table_def_in_with_clauses(tbl,
|
||||
excl_spec);
|
||||
if (!tbl->with) // no CTE matches table reference tbl
|
||||
{
|
||||
if (only_cte_resolution)
|
||||
@@ -244,7 +247,7 @@ LEX::check_cte_dependencies_and_resolve_references()
|
||||
return true;
|
||||
if (!with_cte_resolution)
|
||||
return false;
|
||||
if (resolve_references_to_cte(query_tables, query_tables_last))
|
||||
if (resolve_references_to_cte(query_tables, query_tables_last, NULL))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -388,6 +391,7 @@ bool With_element::check_dependencies_in_spec()
|
||||
|
||||
@param table The reference to the table that is looked for
|
||||
@param barrier The barrier with element for the search
|
||||
@param excl_spec Ignore the definition with this spec
|
||||
|
||||
@details
|
||||
The function looks through the elements of this with clause trying to find
|
||||
@@ -401,12 +405,15 @@ bool With_element::check_dependencies_in_spec()
|
||||
*/
|
||||
|
||||
With_element *With_clause::find_table_def(TABLE_LIST *table,
|
||||
With_element *barrier)
|
||||
With_element *barrier,
|
||||
st_select_lex_unit *excl_spec)
|
||||
{
|
||||
for (With_element *with_elem= with_list.first;
|
||||
with_elem != barrier;
|
||||
with_elem= with_elem->next)
|
||||
{
|
||||
if (excl_spec && with_elem->spec == excl_spec)
|
||||
continue;
|
||||
if (my_strcasecmp(system_charset_info, with_elem->get_name_str(),
|
||||
table->table_name.str) == 0 &&
|
||||
!table->is_fqtn)
|
||||
@@ -466,7 +473,7 @@ With_element *find_table_def_in_with_clauses(TABLE_LIST *tbl,
|
||||
top_unit->with_element &&
|
||||
top_unit->with_element->get_owner() == with_clause)
|
||||
barrier= top_unit->with_element;
|
||||
found= with_clause->find_table_def(tbl, barrier);
|
||||
found= with_clause->find_table_def(tbl, barrier, NULL);
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
@@ -521,10 +528,11 @@ void With_element::check_dependencies_in_select(st_select_lex *sl,
|
||||
{
|
||||
With_clause *with_clause= sl->master_unit()->with_clause;
|
||||
if (with_clause)
|
||||
tbl->with= with_clause->find_table_def(tbl, NULL);
|
||||
tbl->with= with_clause->find_table_def(tbl, NULL, NULL);
|
||||
if (!tbl->with)
|
||||
tbl->with= owner->find_table_def(tbl,
|
||||
owner->with_recursive ? NULL : this);
|
||||
owner->with_recursive ? NULL : this,
|
||||
NULL);
|
||||
}
|
||||
if (!tbl->with)
|
||||
tbl->with= find_table_def_in_with_clauses(tbl, ctxt);
|
||||
@@ -1101,7 +1109,8 @@ st_select_lex_unit *With_element::clone_parsed_spec(LEX *old_lex,
|
||||
*/
|
||||
lex->only_cte_resolution= old_lex->only_cte_resolution;
|
||||
if (lex->resolve_references_to_cte(lex->query_tables,
|
||||
lex->query_tables_last))
|
||||
lex->query_tables_last,
|
||||
spec))
|
||||
{
|
||||
res= NULL;
|
||||
goto err;
|
||||
@@ -1304,6 +1313,7 @@ bool With_element::is_anchor(st_select_lex *sel)
|
||||
Search for the definition of the given table referred in this select node
|
||||
|
||||
@param table reference to the table whose definition is searched for
|
||||
@param excl_spec ignore the definition with this spec
|
||||
|
||||
@details
|
||||
The method looks for the definition of the table whose reference is occurred
|
||||
@@ -1316,7 +1326,8 @@ bool With_element::is_anchor(st_select_lex *sel)
|
||||
NULL - otherwise
|
||||
*/
|
||||
|
||||
With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
|
||||
With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table,
|
||||
st_select_lex_unit *excl_spec)
|
||||
{
|
||||
With_element *found= NULL;
|
||||
With_clause *containing_with_clause= NULL;
|
||||
@@ -1333,7 +1344,7 @@ With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
|
||||
With_clause *attached_with_clause= sl->get_with_clause();
|
||||
if (attached_with_clause &&
|
||||
attached_with_clause != containing_with_clause &&
|
||||
(found= attached_with_clause->find_table_def(table, NULL)))
|
||||
(found= attached_with_clause->find_table_def(table, NULL, excl_spec)))
|
||||
break;
|
||||
master_unit= sl->master_unit();
|
||||
outer_sl= master_unit->outer_select();
|
||||
@@ -1343,7 +1354,8 @@ With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
|
||||
containing_with_clause= with_elem->get_owner();
|
||||
With_element *barrier= containing_with_clause->with_recursive ?
|
||||
NULL : with_elem;
|
||||
if ((found= containing_with_clause->find_table_def(table, barrier)))
|
||||
if ((found= containing_with_clause->find_table_def(table, barrier,
|
||||
excl_spec)))
|
||||
break;
|
||||
if (outer_sl && !outer_sl->get_with_element())
|
||||
break;
|
||||
|
@@ -325,7 +325,8 @@ public:
|
||||
|
||||
friend
|
||||
bool LEX::resolve_references_to_cte(TABLE_LIST *tables,
|
||||
TABLE_LIST **tables_last);
|
||||
TABLE_LIST **tables_last,
|
||||
st_select_lex_unit *excl_spec);
|
||||
};
|
||||
|
||||
const uint max_number_of_elements_in_with_clause= sizeof(table_map)*8;
|
||||
@@ -425,7 +426,8 @@ public:
|
||||
|
||||
void move_anchors_ahead();
|
||||
|
||||
With_element *find_table_def(TABLE_LIST *table, With_element *barrier);
|
||||
With_element *find_table_def(TABLE_LIST *table, With_element *barrier,
|
||||
st_select_lex_unit *excl_spec);
|
||||
|
||||
With_element *find_table_def_in_with_clauses(TABLE_LIST *table);
|
||||
|
||||
|
@@ -1594,7 +1594,8 @@ public:
|
||||
master_unit()->cloned_from->with_element :
|
||||
master_unit()->with_element;
|
||||
}
|
||||
With_element *find_table_def_in_with_clauses(TABLE_LIST *table);
|
||||
With_element *find_table_def_in_with_clauses(TABLE_LIST *table,
|
||||
st_select_lex_unit * excl_spec);
|
||||
bool check_unrestricted_recursive(bool only_standard_compliant);
|
||||
bool check_subqueries_with_recursive_references();
|
||||
void collect_grouping_fields_for_derived(THD *thd, ORDER *grouping_list);
|
||||
@@ -4890,7 +4891,8 @@ public:
|
||||
bool check_dependencies_in_with_clauses();
|
||||
bool check_cte_dependencies_and_resolve_references();
|
||||
bool resolve_references_to_cte(TABLE_LIST *tables,
|
||||
TABLE_LIST **tables_last);
|
||||
TABLE_LIST **tables_last,
|
||||
st_select_lex_unit *excl_spec);
|
||||
|
||||
/**
|
||||
Turn on the SELECT_DESCRIBE flag for every SELECT_LEX involved into
|
||||
|
@@ -921,6 +921,7 @@ bool Sql_cmd_alter_sequence::execute(THD *thd)
|
||||
TABLE_LIST *first_table= lex->query_tables;
|
||||
TABLE *table;
|
||||
sequence_definition *new_seq= lex->create_info.seq_create_info;
|
||||
uint saved_used_fields= new_seq->used_fields;
|
||||
SEQUENCE *seq;
|
||||
No_such_table_error_handler no_such_table_handler;
|
||||
DBUG_ENTER("Sql_cmd_alter_sequence::execute");
|
||||
@@ -1042,5 +1043,6 @@ bool Sql_cmd_alter_sequence::execute(THD *thd)
|
||||
my_ok(thd);
|
||||
|
||||
end:
|
||||
new_seq->used_fields= saved_used_fields;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
@@ -297,7 +297,8 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
|
||||
for (tbl= sl->get_table_list(); tbl; tbl= tbl->next_local)
|
||||
{
|
||||
if (!tbl->with && tbl->select_lex)
|
||||
tbl->with= tbl->select_lex->find_table_def_in_with_clauses(tbl);
|
||||
tbl->with= tbl->select_lex->find_table_def_in_with_clauses(tbl,
|
||||
NULL);
|
||||
/*
|
||||
Ensure that we have some privileges on this table, more strict check
|
||||
will be done on column level after preparation,
|
||||
|
@@ -7585,7 +7585,7 @@ inline void TABLE::mark_index_columns_for_read(uint index)
|
||||
always set and sometimes read.
|
||||
*/
|
||||
|
||||
void TABLE::mark_auto_increment_column()
|
||||
void TABLE::mark_auto_increment_column(bool is_insert)
|
||||
{
|
||||
DBUG_ASSERT(found_next_number_field);
|
||||
/*
|
||||
@@ -7593,6 +7593,7 @@ void TABLE::mark_auto_increment_column()
|
||||
store() to check overflow of auto_increment values
|
||||
*/
|
||||
bitmap_set_bit(read_set, found_next_number_field->field_index);
|
||||
if (is_insert)
|
||||
bitmap_set_bit(write_set, found_next_number_field->field_index);
|
||||
if (s->next_number_keypart)
|
||||
mark_index_columns_for_read(s->next_number_index);
|
||||
@@ -7718,7 +7719,7 @@ void TABLE::mark_columns_needed_for_update()
|
||||
else
|
||||
{
|
||||
if (found_next_number_field)
|
||||
mark_auto_increment_column();
|
||||
mark_auto_increment_column(false);
|
||||
}
|
||||
|
||||
if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE)
|
||||
@@ -7794,7 +7795,7 @@ void TABLE::mark_columns_needed_for_insert()
|
||||
triggers->mark_fields_used(TRG_EVENT_INSERT);
|
||||
}
|
||||
if (found_next_number_field)
|
||||
mark_auto_increment_column();
|
||||
mark_auto_increment_column(true);
|
||||
if (default_field)
|
||||
mark_default_fields_for_write(TRUE);
|
||||
if (s->versioned)
|
||||
|
@@ -1585,7 +1585,7 @@ public:
|
||||
void mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap);
|
||||
void mark_index_columns_for_read(uint index);
|
||||
void restore_column_maps_after_keyread(MY_BITMAP *backup);
|
||||
void mark_auto_increment_column(void);
|
||||
void mark_auto_increment_column(bool insert_fl);
|
||||
void mark_columns_needed_for_update(void);
|
||||
void mark_columns_needed_for_delete(void);
|
||||
void mark_columns_needed_for_insert(void);
|
||||
|
@@ -1213,8 +1213,8 @@ int tdc_iterate(THD *thd, my_hash_walk_action action, void *argument,
|
||||
}
|
||||
|
||||
|
||||
int show_tc_active_instances(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
int show_tc_active_instances(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum enum_var_type scope)
|
||||
{
|
||||
var->type= SHOW_UINT;
|
||||
var->value= buff;
|
||||
|
@@ -87,8 +87,8 @@ extern int tdc_iterate(THD *thd, my_hash_walk_action action, void *argument,
|
||||
bool no_dups= false);
|
||||
|
||||
extern uint tc_records(void);
|
||||
int show_tc_active_instances(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope);
|
||||
int show_tc_active_instances(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum enum_var_type scope);
|
||||
extern void tc_purge();
|
||||
extern void tc_add_table(THD *thd, TABLE *table);
|
||||
extern void tc_release_table(TABLE *table);
|
||||
|
@@ -71,11 +71,6 @@
|
||||
#include "tabvct.h"
|
||||
#include "valblk.h"
|
||||
|
||||
#if defined(UNIX)
|
||||
//add dummy strerror (NGC)
|
||||
char *strerror(int num);
|
||||
#endif // UNIX
|
||||
|
||||
/***********************************************************************/
|
||||
/* External function. */
|
||||
/***********************************************************************/
|
||||
|
@@ -2087,7 +2087,7 @@ all_fail:
|
||||
ut_d(purge_sys.resume_FTS());
|
||||
}
|
||||
|
||||
static void innodb_ddl_recovery_done(handlerton*)
|
||||
static int innodb_ddl_recovery_done(handlerton*)
|
||||
{
|
||||
ut_ad(!ddl_recovery_done);
|
||||
ut_d(ddl_recovery_done= true);
|
||||
@@ -2098,6 +2098,7 @@ static void innodb_ddl_recovery_done(handlerton*)
|
||||
drop_garbage_tables_after_restore();
|
||||
srv_init_purge_tasks();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/********************************************************************//**
|
||||
|
@@ -140,6 +140,15 @@ private:
|
||||
bool m_initialized{false};
|
||||
/** whether purge is enabled; protected by latch and std::atomic */
|
||||
std::atomic<bool> m_enabled{false};
|
||||
/** The primary candidate for iterator::free_history() is
|
||||
rseg=trx_sys.rseg_array[skipped_rseg]. This field may be changed
|
||||
after invoking rseg.set_skip_allocation() and rseg.clear_skip_allocation()
|
||||
and while holding the exclusive rseg.latch.
|
||||
|
||||
This may only be 0 if innodb_undo_tablespaces=0, because rollback segment
|
||||
0 always resides in the system tablespace and would never be used when
|
||||
dedicated undo tablespaces are in use. */
|
||||
Atomic_relaxed<uint8_t> skipped_rseg;
|
||||
public:
|
||||
/** whether purge is active (may hold table handles) */
|
||||
std::atomic<bool> m_active{false};
|
||||
@@ -197,6 +206,11 @@ public:
|
||||
return undo_no <= other.undo_no;
|
||||
}
|
||||
|
||||
/** Remove unnecessary history data from a rollback segment.
|
||||
@param rseg rollback segment
|
||||
@return error code */
|
||||
inline dberr_t free_history_rseg(trx_rseg_t &rseg) const;
|
||||
|
||||
/** Free the undo pages up to this. */
|
||||
dberr_t free_history() const;
|
||||
|
||||
@@ -240,14 +254,15 @@ public:
|
||||
by the pq_mutex */
|
||||
mysql_mutex_t pq_mutex; /*!< Mutex protecting purge_queue */
|
||||
|
||||
/** Undo tablespace file truncation (only accessed by the
|
||||
srv_purge_coordinator_thread) */
|
||||
/** innodb_undo_log_truncate=ON state;
|
||||
only modified by purge_coordinator_callback() */
|
||||
struct {
|
||||
/** The undo tablespace that is currently being truncated */
|
||||
fil_space_t* current;
|
||||
/** The undo tablespace that was last truncated */
|
||||
fil_space_t* last;
|
||||
} truncate;
|
||||
Atomic_relaxed<fil_space_t*> current;
|
||||
/** The number of the undo tablespace that was last truncated,
|
||||
relative from srv_undo_space_id_start */
|
||||
uint32_t last;
|
||||
} truncate_undo_space;
|
||||
|
||||
/** Create the instance */
|
||||
void create();
|
||||
@@ -357,6 +372,26 @@ public:
|
||||
typically via purge_sys_t::view_guard. */
|
||||
return view.sees(id);
|
||||
}
|
||||
|
||||
private:
|
||||
/** Enable the use of a rollback segment and advance skipped_rseg,
|
||||
after iterator::free_history_rseg() had invoked
|
||||
rseg.set_skip_allocation(). */
|
||||
inline void rseg_enable(trx_rseg_t &rseg);
|
||||
|
||||
/** Try to start truncating a tablespace.
|
||||
@param id undo tablespace identifier
|
||||
@param size the maximum desired undo tablespace size, in pages
|
||||
@return undo tablespace whose truncation was started
|
||||
@retval nullptr if truncation is not currently possible */
|
||||
inline fil_space_t *undo_truncate_try(uint32_t id, uint32_t size);
|
||||
public:
|
||||
/** Check if innodb_undo_log_truncate=ON needs to be handled.
|
||||
This is only to be called by purge_coordinator_callback().
|
||||
@return undo tablespace chosen by innodb_undo_log_truncate=ON
|
||||
@retval nullptr if truncation is not currently possible */
|
||||
fil_space_t *truncating_tablespace();
|
||||
|
||||
/** A wrapper around trx_sys_t::clone_oldest_view(). */
|
||||
template<bool also_end_view= false>
|
||||
void clone_oldest_view()
|
||||
|
@@ -73,14 +73,15 @@ private:
|
||||
/** Reference counter to track is_persistent() transactions,
|
||||
with SKIP flag. */
|
||||
std::atomic<uint32_t> ref;
|
||||
|
||||
public:
|
||||
/** Whether undo tablespace truncation is pending */
|
||||
static constexpr uint32_t SKIP= 1;
|
||||
/** Transaction reference count multiplier */
|
||||
static constexpr uint32_t REF= 2;
|
||||
|
||||
/** @return the reference count and flags */
|
||||
uint32_t ref_load() const { return ref.load(std::memory_order_relaxed); }
|
||||
|
||||
private:
|
||||
/** Set the SKIP bit */
|
||||
void ref_set_skip()
|
||||
{
|
||||
|
@@ -1191,6 +1191,11 @@ public:
|
||||
return count;
|
||||
}
|
||||
|
||||
/** Disable further allocation of transactions in a rollback segment
|
||||
that are subject to innodb_undo_log_truncate=ON
|
||||
@param space undo tablespace that will be truncated */
|
||||
inline void undo_truncate_start(fil_space_t &space);
|
||||
|
||||
/** Set the undo log empty value */
|
||||
void set_undo_non_empty(bool val)
|
||||
{
|
||||
|
@@ -1503,7 +1503,8 @@ inline void purge_coordinator_state::do_purge()
|
||||
ulint n_pages_handled= trx_purge(n_threads, history_size);
|
||||
if (!trx_sys.history_exists())
|
||||
goto no_history;
|
||||
if (purge_sys.truncate.current || srv_shutdown_state != SRV_SHUTDOWN_NONE)
|
||||
if (purge_sys.truncating_tablespace() ||
|
||||
srv_shutdown_state != SRV_SHUTDOWN_NONE)
|
||||
{
|
||||
purge_truncation_task.wait();
|
||||
trx_purge_truncate_history();
|
||||
|
@@ -169,10 +169,15 @@ void purge_sys_t::create()
|
||||
ut_ad(this == &purge_sys);
|
||||
ut_ad(!m_initialized);
|
||||
ut_ad(!enabled());
|
||||
ut_ad(!m_active);
|
||||
/* If innodb_undo_tablespaces>0, the rollback segment 0
|
||||
(which always resides in the system tablespace) will
|
||||
never be used; @see trx_assign_rseg_low() */
|
||||
skipped_rseg= srv_undo_tablespaces > 0;
|
||||
m_paused= 0;
|
||||
query= purge_graph_build();
|
||||
next_stored= false;
|
||||
rseg= NULL;
|
||||
rseg= nullptr;
|
||||
page_no= 0;
|
||||
offset= 0;
|
||||
hdr_page_no= 0;
|
||||
@@ -180,8 +185,8 @@ void purge_sys_t::create()
|
||||
latch.SRW_LOCK_INIT(trx_purge_latch_key);
|
||||
end_latch.init();
|
||||
mysql_mutex_init(purge_sys_pq_mutex_key, &pq_mutex, nullptr);
|
||||
truncate.current= NULL;
|
||||
truncate.last= NULL;
|
||||
truncate_undo_space.current= nullptr;
|
||||
truncate_undo_space.last= 0;
|
||||
m_initialized= true;
|
||||
}
|
||||
|
||||
@@ -388,17 +393,50 @@ static void trx_purge_free_segment(buf_block_t *rseg_hdr, buf_block_t *block,
|
||||
block->page.frame, &mtr));
|
||||
}
|
||||
|
||||
void purge_sys_t::rseg_enable(trx_rseg_t &rseg)
|
||||
{
|
||||
ut_ad(this == &purge_sys);
|
||||
#ifndef SUX_LOCK_GENERIC
|
||||
ut_ad(rseg.latch.is_write_locked());
|
||||
#endif
|
||||
uint8_t skipped= skipped_rseg;
|
||||
ut_ad(skipped < TRX_SYS_N_RSEGS);
|
||||
if (&rseg == &trx_sys.rseg_array[skipped])
|
||||
{
|
||||
/* If this rollback segment is subject to innodb_undo_log_truncate=ON,
|
||||
we must not clear the flag. But we will advance purge_sys.skipped_rseg
|
||||
to be able to choose another candidate for this soft truncation, and
|
||||
to prevent the following scenario:
|
||||
|
||||
(1) purge_sys_t::iterator::free_history_rseg() had invoked
|
||||
rseg.set_skip_allocation()
|
||||
(2) undo log truncation had completed on this rollback segment
|
||||
(3) SET GLOBAL innodb_undo_log_truncate=OFF
|
||||
(4) purge_sys_t::iterator::free_history_rseg() would not be able to
|
||||
invoke rseg.set_skip_allocation() on any other rollback segment
|
||||
before this rseg has grown enough */
|
||||
if (truncate_undo_space.current != rseg.space)
|
||||
rseg.clear_skip_allocation();
|
||||
skipped++;
|
||||
/* If innodb_undo_tablespaces>0, the rollback segment 0
|
||||
(which always resides in the system tablespace) will
|
||||
never be used; @see trx_assign_rseg_low() */
|
||||
if (!(skipped%= TRX_SYS_N_RSEGS) && srv_undo_tablespaces)
|
||||
skipped++;
|
||||
skipped_rseg= skipped;
|
||||
}
|
||||
}
|
||||
|
||||
/** Remove unnecessary history data from a rollback segment.
|
||||
@param rseg rollback segment
|
||||
@param limit truncate anything before this
|
||||
@param all whether everything can be truncated
|
||||
@return error code */
|
||||
static dberr_t
|
||||
trx_purge_truncate_rseg_history(trx_rseg_t &rseg,
|
||||
const purge_sys_t::iterator &limit, bool all)
|
||||
inline dberr_t purge_sys_t::iterator::free_history_rseg(trx_rseg_t &rseg) const
|
||||
{
|
||||
fil_addr_t hdr_addr;
|
||||
mtr_t mtr;
|
||||
bool freed= false;
|
||||
uint32_t rseg_ref= 0;
|
||||
|
||||
mtr.start();
|
||||
|
||||
@@ -408,6 +446,8 @@ trx_purge_truncate_rseg_history(trx_rseg_t &rseg,
|
||||
{
|
||||
func_exit:
|
||||
mtr.commit();
|
||||
if (freed && (rseg.SKIP & rseg_ref))
|
||||
purge_sys.rseg_enable(rseg);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -429,16 +469,40 @@ loop:
|
||||
const trx_id_t undo_trx_no=
|
||||
mach_read_from_8(b->page.frame + hdr_addr.boffset + TRX_UNDO_TRX_NO);
|
||||
|
||||
if (undo_trx_no >= limit.trx_no)
|
||||
if (undo_trx_no >= trx_no)
|
||||
{
|
||||
if (undo_trx_no == limit.trx_no)
|
||||
if (undo_trx_no == trx_no)
|
||||
err= trx_undo_truncate_start(&rseg, hdr_addr.page,
|
||||
hdr_addr.boffset, limit.undo_no);
|
||||
hdr_addr.boffset, undo_no);
|
||||
goto func_exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
rseg_ref= rseg.ref_load();
|
||||
if (rseg_ref >= rseg.REF || !purge_sys.sees(rseg.needs_purge))
|
||||
{
|
||||
/* We cannot clear this entire rseg because trx_assign_rseg_low()
|
||||
has already chosen it for a future trx_undo_assign(), or
|
||||
because some recently started transaction needs purging.
|
||||
|
||||
if (!all)
|
||||
If this invocation could not reduce rseg.history_size at all
|
||||
(!freed), we will try to ensure progress and prevent our
|
||||
starvation by disabling one rollback segment for future
|
||||
trx_assign_rseg_low() invocations until a future invocation has
|
||||
made progress and invoked purge_sys_t::rseg_enable(rseg) on that
|
||||
rollback segment. */
|
||||
|
||||
if (!(rseg.SKIP & rseg_ref) && !freed &&
|
||||
ut_d(!trx_rseg_n_slots_debug &&)
|
||||
&rseg == &trx_sys.rseg_array[purge_sys.skipped_rseg])
|
||||
/* If rseg.space == purge_sys.truncate_undo_space.current
|
||||
the following will be a no-op. A possible conflict
|
||||
with innodb_undo_log_truncate=ON will be handled in
|
||||
purge_sys_t::rseg_enable(). */
|
||||
rseg.set_skip_allocation();
|
||||
goto func_exit;
|
||||
}
|
||||
}
|
||||
|
||||
fil_addr_t prev_hdr_addr=
|
||||
flst_get_prev_addr(b->page.frame + hdr_addr.boffset +
|
||||
@@ -501,6 +565,7 @@ loop:
|
||||
mtr.commit();
|
||||
ut_ad(rseg.history_size > 0);
|
||||
rseg.history_size--;
|
||||
freed= true;
|
||||
mtr.start();
|
||||
rseg_hdr->page.lock.x_lock();
|
||||
ut_ad(rseg_hdr->page.id() == rseg.page_id());
|
||||
@@ -555,9 +620,7 @@ dberr_t purge_sys_t::iterator::free_history() const
|
||||
ut_ad(rseg.is_persistent());
|
||||
log_free_check();
|
||||
rseg.latch.wr_lock(SRW_LOCK_CALL);
|
||||
dberr_t err=
|
||||
trx_purge_truncate_rseg_history(rseg, *this, !rseg.is_referenced() &&
|
||||
purge_sys.sees(rseg.needs_purge));
|
||||
dberr_t err= free_history_rseg(rseg);
|
||||
rseg.latch.wr_unlock();
|
||||
if (err)
|
||||
return err;
|
||||
@@ -565,6 +628,62 @@ dberr_t purge_sys_t::iterator::free_history() const
|
||||
return DB_SUCCESS;
|
||||
}
|
||||
|
||||
inline void trx_sys_t::undo_truncate_start(fil_space_t &space)
|
||||
{
|
||||
ut_ad(this == &trx_sys);
|
||||
/* Undo tablespace always are a single file. */
|
||||
ut_a(UT_LIST_GET_LEN(space.chain) == 1);
|
||||
fil_node_t *file= UT_LIST_GET_FIRST(space.chain);
|
||||
/* The undo tablespace files are never closed. */
|
||||
ut_ad(file->is_open());
|
||||
sql_print_information("InnoDB: Starting to truncate %s", file->name);
|
||||
|
||||
for (auto &rseg : rseg_array)
|
||||
if (rseg.space == &space)
|
||||
{
|
||||
/* Prevent a race with purge_sys_t::iterator::free_history_rseg() */
|
||||
rseg.latch.rd_lock(SRW_LOCK_CALL);
|
||||
/* Once set, this rseg will not be allocated to subsequent
|
||||
transactions, but we will wait for existing active
|
||||
transactions to finish. */
|
||||
rseg.set_skip_allocation();
|
||||
rseg.latch.rd_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
inline fil_space_t *purge_sys_t::undo_truncate_try(uint32_t id, uint32_t size)
|
||||
{
|
||||
ut_ad(srv_is_undo_tablespace(id));
|
||||
fil_space_t *space= fil_space_get(id);
|
||||
if (space && space->get_size() > size)
|
||||
{
|
||||
truncate_undo_space.current= space;
|
||||
trx_sys.undo_truncate_start(*space);
|
||||
return space;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
fil_space_t *purge_sys_t::truncating_tablespace()
|
||||
{
|
||||
ut_ad(this == &purge_sys);
|
||||
|
||||
fil_space_t *space= truncate_undo_space.current;
|
||||
if (space || srv_undo_tablespaces_active < 2 || !srv_undo_log_truncate)
|
||||
return space;
|
||||
|
||||
const uint32_t size= uint32_t(srv_max_undo_log_size >> srv_page_size_shift);
|
||||
for (uint32_t i= truncate_undo_space.last, j= i;; )
|
||||
{
|
||||
if (fil_space_t *s= undo_truncate_try(srv_undo_space_id_start + i, size))
|
||||
return s;
|
||||
++i;
|
||||
i%= srv_undo_tablespaces_active;
|
||||
if (i == j)
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ == 4 && !defined __clang__
|
||||
# if defined __arm__ || defined __aarch64__
|
||||
/* Work around an internal compiler error in GCC 4.8.5 */
|
||||
@@ -590,55 +709,14 @@ TRANSACTIONAL_TARGET void trx_purge_truncate_history()
|
||||
head.undo_no= 0;
|
||||
}
|
||||
|
||||
if (head.free_history() != DB_SUCCESS || srv_undo_tablespaces_active < 2)
|
||||
if (head.free_history() != DB_SUCCESS)
|
||||
return;
|
||||
|
||||
while (srv_undo_log_truncate)
|
||||
while (fil_space_t *space= purge_sys.truncating_tablespace())
|
||||
{
|
||||
if (!purge_sys.truncate.current)
|
||||
{
|
||||
const ulint threshold=
|
||||
ulint(srv_max_undo_log_size >> srv_page_size_shift);
|
||||
for (uint32_t i= purge_sys.truncate.last
|
||||
? purge_sys.truncate.last->id - srv_undo_space_id_start : 0,
|
||||
j= i;; )
|
||||
{
|
||||
const uint32_t space_id= srv_undo_space_id_start + i;
|
||||
ut_ad(srv_is_undo_tablespace(space_id));
|
||||
fil_space_t *space= fil_space_get(space_id);
|
||||
ut_a(UT_LIST_GET_LEN(space->chain) == 1);
|
||||
|
||||
if (space && space->get_size() > threshold)
|
||||
{
|
||||
purge_sys.truncate.current= space;
|
||||
break;
|
||||
}
|
||||
|
||||
++i;
|
||||
i %= srv_undo_tablespaces_active;
|
||||
if (i == j)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fil_space_t &space= *purge_sys.truncate.current;
|
||||
/* Undo tablespace always are a single file. */
|
||||
fil_node_t *file= UT_LIST_GET_FIRST(space.chain);
|
||||
/* The undo tablespace files are never closed. */
|
||||
ut_ad(file->is_open());
|
||||
|
||||
DBUG_LOG("undo", "marking for truncate: " << file->name);
|
||||
|
||||
for (auto &rseg : trx_sys.rseg_array)
|
||||
if (rseg.space == &space)
|
||||
/* Once set, this rseg will not be allocated to subsequent
|
||||
transactions, but we will wait for existing active
|
||||
transactions to finish. */
|
||||
rseg.set_skip_allocation();
|
||||
|
||||
for (auto &rseg : trx_sys.rseg_array)
|
||||
{
|
||||
if (rseg.space != &space)
|
||||
if (rseg.space != space)
|
||||
continue;
|
||||
|
||||
rseg.latch.rd_lock(SRW_LOCK_CALL);
|
||||
@@ -671,8 +749,9 @@ not_free:
|
||||
rseg.latch.rd_unlock();
|
||||
}
|
||||
|
||||
sql_print_information("InnoDB: Truncating %s", file->name);
|
||||
trx_purge_cleanse_purge_queue(space);
|
||||
const char *file_name= UT_LIST_GET_FIRST(space->chain)->name;
|
||||
sql_print_information("InnoDB: Truncating %s", file_name);
|
||||
trx_purge_cleanse_purge_queue(*space);
|
||||
|
||||
/* Lock all modified pages of the tablespace.
|
||||
|
||||
@@ -689,12 +768,12 @@ not_free:
|
||||
|
||||
/* Adjust the tablespace metadata. */
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
if (space.crypt_data)
|
||||
if (space->crypt_data)
|
||||
{
|
||||
space.reacquire();
|
||||
space->reacquire();
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
fil_space_crypt_close_tablespace(&space);
|
||||
space.release();
|
||||
fil_space_crypt_close_tablespace(space);
|
||||
space->release();
|
||||
}
|
||||
else
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
@@ -706,17 +785,17 @@ not_free:
|
||||
|
||||
mtr_t mtr;
|
||||
mtr.start();
|
||||
mtr.x_lock_space(&space);
|
||||
mtr.x_lock_space(space);
|
||||
/* Associate the undo tablespace with mtr.
|
||||
During mtr::commit_shrink(), InnoDB can use the undo
|
||||
tablespace object to clear all freed ranges */
|
||||
mtr.set_named_space(&space);
|
||||
mtr.trim_pages(page_id_t(space.id, size));
|
||||
ut_a(fsp_header_init(&space, size, &mtr) == DB_SUCCESS);
|
||||
mtr.set_named_space(space);
|
||||
mtr.trim_pages(page_id_t(space->id, size));
|
||||
ut_a(fsp_header_init(space, size, &mtr) == DB_SUCCESS);
|
||||
|
||||
for (auto &rseg : trx_sys.rseg_array)
|
||||
{
|
||||
if (rseg.space != &space)
|
||||
if (rseg.space != space)
|
||||
continue;
|
||||
|
||||
ut_ad(!rseg.is_referenced());
|
||||
@@ -725,7 +804,7 @@ not_free:
|
||||
possibly before this server had been started up. */
|
||||
|
||||
dberr_t err;
|
||||
buf_block_t *rblock= trx_rseg_header_create(&space,
|
||||
buf_block_t *rblock= trx_rseg_header_create(space,
|
||||
&rseg - trx_sys.rseg_array,
|
||||
trx_sys.get_max_trx_id(),
|
||||
&mtr, &err);
|
||||
@@ -738,7 +817,7 @@ not_free:
|
||||
rseg.reinit(rblock->page.id().page_no());
|
||||
}
|
||||
|
||||
mtr.commit_shrink(space, size);
|
||||
mtr.commit_shrink(*space, size);
|
||||
|
||||
/* No mutex; this is only updated by the purge coordinator. */
|
||||
export_vars.innodb_undo_truncations++;
|
||||
@@ -760,10 +839,10 @@ not_free:
|
||||
log_buffer_flush_to_disk();
|
||||
DBUG_SUICIDE(););
|
||||
|
||||
sql_print_information("InnoDB: Truncated %s", file->name);
|
||||
purge_sys.truncate.last= purge_sys.truncate.current;
|
||||
ut_ad(&space == purge_sys.truncate.current);
|
||||
purge_sys.truncate.current= nullptr;
|
||||
sql_print_information("InnoDB: Truncated %s", file_name);
|
||||
ut_ad(space == purge_sys.truncate_undo_space.current);
|
||||
purge_sys.truncate_undo_space.current= nullptr;
|
||||
purge_sys.truncate_undo_space.last= space->id - srv_undo_space_id_start;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -907,15 +907,13 @@ trx_undo_truncate_start(
|
||||
trx_undo_rec_t* last_rec;
|
||||
mtr_t mtr;
|
||||
|
||||
ut_ad(rseg->is_persistent());
|
||||
|
||||
if (!limit) {
|
||||
return DB_SUCCESS;
|
||||
}
|
||||
loop:
|
||||
mtr_start(&mtr);
|
||||
|
||||
if (!rseg->is_persistent()) {
|
||||
mtr.set_log_mode(MTR_LOG_NO_REDO);
|
||||
}
|
||||
mtr.start();
|
||||
|
||||
dberr_t err;
|
||||
const buf_block_t* undo_page;
|
||||
|
@@ -403,10 +403,6 @@ int main(int argc __attribute__((unused)),
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
thr_setconcurrency(2);
|
||||
#endif
|
||||
|
||||
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
||||
TEST_PAGE_SIZE, 0, 0)) == 0)
|
||||
{
|
||||
|
@@ -272,10 +272,6 @@ int main(int argc __attribute__((unused)),
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
thr_setconcurrency(2);
|
||||
#endif
|
||||
|
||||
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
||||
TEST_PAGE_SIZE, 0, 0)) == 0)
|
||||
{
|
||||
|
@@ -268,10 +268,6 @@ int main(int argc __attribute__((unused)),
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
thr_setconcurrency(2);
|
||||
#endif
|
||||
|
||||
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
||||
TEST_PAGE_SIZE, 0, 0)) == 0)
|
||||
{
|
||||
|
@@ -795,10 +795,6 @@ int main(int argc __attribute__((unused)),
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
thr_setconcurrency(2);
|
||||
#endif
|
||||
|
||||
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
||||
TEST_PAGE_SIZE, 0, MYF(MY_WME))) == 0)
|
||||
{
|
||||
|
@@ -331,10 +331,6 @@ int main(int argc __attribute__((unused)),
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_THR_SETCONCURRENCY
|
||||
thr_setconcurrency(2);
|
||||
#endif
|
||||
|
||||
if (ma_control_file_open(TRUE, TRUE, TRUE))
|
||||
{
|
||||
fprintf(stderr, "Can't init control file (%d)\n", errno);
|
||||
|
@@ -3541,7 +3541,8 @@ CSphSEStats * sphinx_get_stats ( THD * thd, SHOW_VAR * out )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sphinx_showfunc_total ( THD * thd, SHOW_VAR * out, char * )
|
||||
static int sphinx_showfunc_total ( THD * thd, SHOW_VAR * out, void *,
|
||||
system_status_var *, enum_var_type )
|
||||
{
|
||||
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
|
||||
if ( pStats )
|
||||
@@ -3552,7 +3553,8 @@ int sphinx_showfunc_total ( THD * thd, SHOW_VAR * out, char * )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sphinx_showfunc_total_found ( THD * thd, SHOW_VAR * out, char * )
|
||||
static int sphinx_showfunc_total_found ( THD * thd, SHOW_VAR * out, void *,
|
||||
system_status_var *, enum_var_type )
|
||||
{
|
||||
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
|
||||
if ( pStats )
|
||||
@@ -3563,7 +3565,8 @@ int sphinx_showfunc_total_found ( THD * thd, SHOW_VAR * out, char * )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sphinx_showfunc_time ( THD * thd, SHOW_VAR * out, char * )
|
||||
static int sphinx_showfunc_time ( THD * thd, SHOW_VAR * out, void *,
|
||||
system_status_var *, enum_var_type )
|
||||
{
|
||||
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
|
||||
if ( pStats )
|
||||
@@ -3574,7 +3577,8 @@ int sphinx_showfunc_time ( THD * thd, SHOW_VAR * out, char * )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sphinx_showfunc_word_count ( THD * thd, SHOW_VAR * out, char * )
|
||||
static int sphinx_showfunc_word_count ( THD * thd, SHOW_VAR * out, void *,
|
||||
system_status_var *, enum_var_type )
|
||||
{
|
||||
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
|
||||
if ( pStats )
|
||||
@@ -3585,9 +3589,11 @@ int sphinx_showfunc_word_count ( THD * thd, SHOW_VAR * out, char * )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sphinx_showfunc_words ( THD * thd, SHOW_VAR * out, char * sBuffer )
|
||||
static int sphinx_showfunc_words ( THD * thd, SHOW_VAR * out, void * buf,
|
||||
system_status_var *, enum_var_type )
|
||||
{
|
||||
#if MYSQL_VERSION_ID>50100
|
||||
char *sBuffer = static_cast<char*>(buf);
|
||||
if ( sphinx_hton_ptr )
|
||||
{
|
||||
CSphTLS * pTls = (CSphTLS *) thd_get_ha_data ( thd, sphinx_hton_ptr );
|
||||
@@ -3642,7 +3648,8 @@ int sphinx_showfunc_words ( THD * thd, SHOW_VAR * out, char * sBuffer )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sphinx_showfunc_error ( THD * thd, SHOW_VAR * out, char * )
|
||||
static int sphinx_showfunc_error ( THD * thd, SHOW_VAR * out, void *,
|
||||
system_status_var *, enum_var_type )
|
||||
{
|
||||
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
|
||||
out->type = SHOW_CHAR;
|
||||
|
@@ -164,12 +164,6 @@ private:
|
||||
bool sphinx_show_status ( THD * thd );
|
||||
#endif
|
||||
|
||||
int sphinx_showfunc_total_found ( THD *, SHOW_VAR *, char * );
|
||||
int sphinx_showfunc_total ( THD *, SHOW_VAR *, char * );
|
||||
int sphinx_showfunc_time ( THD *, SHOW_VAR *, char * );
|
||||
int sphinx_showfunc_word_count ( THD *, SHOW_VAR *, char * );
|
||||
int sphinx_showfunc_words ( THD *, SHOW_VAR *, char * );
|
||||
|
||||
//
|
||||
// $Id: ha_sphinx.h 4818 2014-09-24 08:53:38Z tomat $
|
||||
//
|
||||
|
@@ -8526,7 +8526,10 @@ int ha_spider::create(
|
||||
if (
|
||||
thd->lex->create_info.or_replace() &&
|
||||
(error_num = spider_delete_tables(
|
||||
table_tables, tmp_share.table_name, &dummy))
|
||||
table_tables, tmp_share.table_name, &dummy)) &&
|
||||
/* In this context, no key found in mysql.spider_tables means
|
||||
the Spider table does not exist */
|
||||
error_num != HA_ERR_KEY_NOT_FOUND
|
||||
) {
|
||||
goto error;
|
||||
}
|
||||
@@ -8965,6 +8968,10 @@ int ha_spider::delete_table(
|
||||
(error_num = spider_delete_tables(
|
||||
table_tables, name, &old_link_count))
|
||||
) {
|
||||
/* In this context, no key found in mysql.spider_tables means
|
||||
the Spider table does not exist */
|
||||
if (error_num == HA_ERR_KEY_NOT_FOUND)
|
||||
error_num= HA_ERR_NO_SUCH_TABLE;
|
||||
goto error;
|
||||
}
|
||||
spider_close_sys_table(current_thd, table_tables,
|
||||
|
@@ -6,6 +6,9 @@ for child2
|
||||
for child3
|
||||
set @old_spider_bgs_mode= @@spider_bgs_mode;
|
||||
set session spider_bgs_mode=1;
|
||||
set spider_same_server_link=1;
|
||||
set @old_spider_same_server_link=@@global.spider_same_server_link;
|
||||
set global spider_same_server_link=1;
|
||||
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table td (a int, PRIMARY KEY (a));
|
||||
create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_26151",TABLE "td", casual_read "3"';
|
||||
@@ -26,6 +29,7 @@ min(a)
|
||||
drop table td, ts;
|
||||
drop server srv_mdev_26151;
|
||||
set session spider_bgs_mode=@old_spider_bgs_mode;
|
||||
set global spider_same_server_link=@old_spider_same_server_link;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
|
@@ -5,6 +5,7 @@ for master_1
|
||||
for child2
|
||||
for child3
|
||||
set global query_cache_type= on;
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (c int);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
# testing monitoring_*
|
||||
|
@@ -4,8 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set @old_spider_disable_group_by_handler=@@spider_disable_group_by_handler;
|
||||
set spider_disable_group_by_handler=1;
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
@@ -17,7 +16,6 @@ a
|
||||
2
|
||||
DROP TABLE t2, t1_SPIDER, t1;
|
||||
drop server s;
|
||||
set spider_disable_group_by_handler=@old_spider_disable_group_by_handler;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
|
34
storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result
Normal file
34
storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result
Normal file
@@ -0,0 +1,34 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
SET spider_same_server_link= on;
|
||||
CREATE SERVER s FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t (a INT);
|
||||
CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
|
||||
CREATE TABLE t2_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
|
||||
SELECT * FROM t1_spider, t2_spider;
|
||||
a a
|
||||
SELECT table_name, index_name, cardinality FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name IN ('t1_spider','t2_spider');
|
||||
table_name index_name cardinality
|
||||
RENAME TABLE t1_spider TO t3_spider;
|
||||
SELECT * FROM t3_spider;
|
||||
a
|
||||
DROP TABLE t3_spider, t2_spider, t;
|
||||
drop server s;
|
||||
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
||||
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
||||
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
||||
SHOW TABLE STATUS;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
|
||||
t1 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
|
||||
t2 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
|
||||
t3 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
|
||||
Warnings:
|
||||
Warning 1429 Unable to connect to foreign data source: srv
|
||||
Warning 1429 Unable to connect to foreign data source: srv
|
||||
Warning 1429 Unable to connect to foreign data source: srv
|
||||
drop table t1, t2, t3;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (b INT);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t1 (c int);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t (a INT);
|
||||
INSERT INTO t VALUES (23),(48);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t (a INT) ENGINE=Spider;
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t1 (c int);
|
||||
|
@@ -0,0 +1,7 @@
|
||||
install soname 'ha_spider';
|
||||
DROP TABLE non_existing_table;
|
||||
ERROR 42S02: Unknown table 'test.non_existing_table'
|
||||
create or replace table non_existing_table (c int) engine=Spider;
|
||||
drop table non_existing_table;
|
||||
Warnings:
|
||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
|
||||
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
|
||||
|
@@ -5,6 +5,7 @@ for master_1
|
||||
for child2
|
||||
for child3
|
||||
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
set session spider_read_only_mode = default;
|
||||
create table t2 (c int);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t1 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a));
|
||||
CREATE TABLE t2 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a)) ENGINE=SPIDER COMMENT='srv "srv", WRAPPER "mysql", TABLE "t1"';
|
||||
|
@@ -1,6 +1,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
set session spider_delete_all_rows_type=0;
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (c varchar(16));
|
||||
|
25
storage/spider/mysql-test/spider/bugfix/r/mdev_33008.result
Normal file
25
storage/spider/mysql-test/spider/bugfix/r/mdev_33008.result
Normal file
@@ -0,0 +1,25 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=on;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
create table t1 ENGINE=Spider
|
||||
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=SPIDER DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'
|
||||
drop table t1, t2;
|
||||
drop server srv;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
@@ -4,6 +4,9 @@ for child3
|
||||
|
||||
MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
|
||||
|
||||
set spider_same_server_link=1;
|
||||
set @old_spider_same_server_link=@@global.spider_same_server_link;
|
||||
set global spider_same_server_link=1;
|
||||
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (c int);
|
||||
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_self_reference_multi",TABLE "t2"';
|
||||
@@ -17,6 +20,7 @@ select * from t2;
|
||||
ERROR HY000: An infinite loop is detected when opening table test.t0
|
||||
drop table t0, t1, t2;
|
||||
drop server srv_self_reference_multi;
|
||||
set global spider_same_server_link=@old_spider_same_server_link;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
|
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# MDEV-32559 Move alter table statements in spider init queries to be executed in the signal_ddl_recovery_done callback
|
||||
#
|
||||
select * from mysql.plugin;
|
||||
name dl
|
||||
#
|
||||
# end of test signal_ddl_fail
|
||||
#
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t1 (c int);
|
||||
create table t2 (d int);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link=1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t1 (c1 int);
|
||||
create table t2 (c2 int);
|
||||
|
@@ -14,6 +14,10 @@
|
||||
--let $srv=srv_mdev_26151
|
||||
set @old_spider_bgs_mode= @@spider_bgs_mode;
|
||||
set session spider_bgs_mode=1;
|
||||
set spider_same_server_link=1;
|
||||
set @old_spider_same_server_link=@@global.spider_same_server_link;
|
||||
set global spider_same_server_link=1;
|
||||
|
||||
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
# casual_read != 0 && casual_read != 1
|
||||
@@ -42,6 +46,7 @@ drop table td, ts;
|
||||
|
||||
eval drop server $srv;
|
||||
set session spider_bgs_mode=@old_spider_bgs_mode;
|
||||
set global spider_same_server_link=@old_spider_same_server_link;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#set @@global.debug_dbug="d:t:i:o,mysqld.trace";
|
||||
|
||||
set global query_cache_type= on;
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (c int);
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
# This test covers some table params under consideration for inclusion
|
||||
# in the engine-defined options to be implemented in MDEV-28856.
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
@@ -12,9 +12,7 @@ if (`select not(count(*)) from information_schema.system_variables where variabl
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
# FIXME: this is a workaround.
|
||||
set @old_spider_disable_group_by_handler=@@spider_disable_group_by_handler;
|
||||
set spider_disable_group_by_handler=1;
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
@@ -27,7 +25,6 @@ SELECT * FROM t2;
|
||||
# Cleanup
|
||||
DROP TABLE t2, t1_SPIDER, t1;
|
||||
drop server s;
|
||||
set spider_disable_group_by_handler=@old_spider_disable_group_by_handler;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
32
storage/spider/mysql-test/spider/bugfix/t/mdev_29002.test
Normal file
32
storage/spider/mysql-test/spider/bugfix/t/mdev_29002.test
Normal file
@@ -0,0 +1,32 @@
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
SET spider_same_server_link= on;
|
||||
evalp CREATE SERVER s FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
CREATE TABLE t (a INT);
|
||||
CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
|
||||
CREATE TABLE t2_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
|
||||
SELECT * FROM t1_spider, t2_spider;
|
||||
SELECT table_name, index_name, cardinality FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name IN ('t1_spider','t2_spider');
|
||||
RENAME TABLE t1_spider TO t3_spider;
|
||||
SELECT * FROM t3_spider;
|
||||
|
||||
DROP TABLE t3_spider, t2_spider, t;
|
||||
drop server s;
|
||||
|
||||
# case by roel
|
||||
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
||||
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
||||
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
|
||||
SHOW TABLE STATUS;
|
||||
drop table t1, t2, t3;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
@@ -6,6 +6,7 @@
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
@@ -8,6 +8,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
@@ -8,6 +8,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
--let $srv=srv_mdev_29502
|
||||
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
@@ -0,0 +1,8 @@
|
||||
install soname 'ha_spider';
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
DROP TABLE non_existing_table;
|
||||
# Test that create or replace a non existing spider table work
|
||||
create or replace table non_existing_table (c int) engine=Spider;
|
||||
drop table non_existing_table;
|
||||
--disable_query_log
|
||||
--source ../../include/clean_up_spider.inc
|
@@ -6,6 +6,7 @@
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
@@ -9,6 +9,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
|
||||
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
|
||||
|
@@ -10,6 +10,7 @@
|
||||
|
||||
--let $srv=srv_mdev_31524
|
||||
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
# when the user does not set var nor the table option, the default
|
||||
|
@@ -6,6 +6,7 @@
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
CREATE TABLE t1 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a));
|
||||
|
@@ -4,6 +4,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
|
24
storage/spider/mysql-test/spider/bugfix/t/mdev_33008.test
Normal file
24
storage/spider/mysql-test/spider/bugfix/t/mdev_33008.test
Normal file
@@ -0,0 +1,24 @@
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
set spider_same_server_link=on;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
create table t1 ENGINE=Spider
|
||||
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
|
||||
show create table t1;
|
||||
drop table t1, t2;
|
||||
|
||||
drop server srv;
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
@@ -8,6 +8,9 @@
|
||||
--echo MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
|
||||
--echo
|
||||
|
||||
set spider_same_server_link=1;
|
||||
set @old_spider_same_server_link=@@global.spider_same_server_link;
|
||||
set global spider_same_server_link=1;
|
||||
--let $srv=srv_self_reference_multi
|
||||
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t2 (c int);
|
||||
@@ -22,6 +25,7 @@ select * from t1;
|
||||
select * from t2;
|
||||
drop table t0, t1, t2;
|
||||
eval drop server $srv;
|
||||
set global spider_same_server_link=@old_spider_same_server_link;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
@@ -0,0 +1,2 @@
|
||||
--plugin-load-add=ha_spider
|
||||
--debug-dbug=d,fail_spider_ddl_recovery_done
|
@@ -0,0 +1,10 @@
|
||||
--source include/have_debug.inc
|
||||
--echo #
|
||||
--echo # MDEV-32559 Move alter table statements in spider init queries to be executed in the signal_ddl_recovery_done callback
|
||||
--echo #
|
||||
# This test tests that failure in ddl_recovery callback causes the
|
||||
# plugin to be deinitialized.
|
||||
select * from mysql.plugin;
|
||||
--echo #
|
||||
--echo # end of test signal_ddl_fail
|
||||
--echo #
|
@@ -8,6 +8,7 @@
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t1 (c int);
|
||||
create table t2 (d int);
|
||||
|
@@ -6,6 +6,7 @@
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
set spider_same_server_link=1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
create table t1 (c1 int);
|
||||
create table t2 (c2 int);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user