mirror of
https://github.com/MariaDB/server.git
synced 2025-04-14 11:15:34 +02:00
Merge branch '10.5' into 10.6
This commit is contained in:
commit
d06b6de305
90 changed files with 713 additions and 198 deletions
cmake/os
config.h.cmakeconfigure.cmakeinclude
libmysqld
mysql-test
lib
main
suite
mysys
plugin
sql
item.cclog_event_server.ccmysqld.ccsql_acl.ccsql_class.ccsql_cte.ccsql_cte.hsql_lex.hsql_sequence.ccsql_view.cctable.cctable.htable_cache.cctable_cache.h
storage
connect
maria/unittest
ma_pagecache_consist.cma_pagecache_rwconsist.cma_pagecache_rwconsist2.cma_pagecache_single.cma_test_loghandler_multithread-t.c
sphinx
spider
ha_spider.ccspd_conn.ccspd_db_mysql.ccspd_include.hspd_param.ccspd_sys_table.cc
mysql-test/spider/bugfix
r
mdev_26151.resultmdev_28739_simple.resultmdev_28856.resultmdev_28998.resultmdev_29002.resultmdev_29163.resultmdev_29456.resultmdev_29502.resultmdev_29963.resultmdev_30014.resultmdev_30170.resultmdev_30392.resultmdev_31338.resultmdev_31524.resultmdev_31645.resultmdev_31996.resultmdev_32986.resultmdev_33008.resultself_reference_multi.resultspider_join_with_non_spider.resultsubquery.result
t
mdev_26151.testmdev_28739_simple.testmdev_28856.testmdev_28998.testmdev_29002.testmdev_29163.testmdev_29456.testmdev_29502.testmdev_29963.testmdev_30014.testmdev_30170.testmdev_30392.testmdev_31338.testmdev_31524.testmdev_31645.testmdev_31996.testmdev_32986.testmdev_33008.testself_reference_multi.testspider_join_with_non_spider.testsubquery.test
|
@ -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 "")
|
||||
|
|
|
@ -231,7 +231,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
|
||||
|
|
|
@ -417,7 +417,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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -2624,4 +2624,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;
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
20
sql/item.cc
20
sql/item.cc
|
@ -7008,7 +7008,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;
|
||||
}
|
||||
|
|
|
@ -7154,7 +7154,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;
|
||||
|
|
142
sql/mysqld.cc
142
sql/mysqld.cc
|
@ -5686,8 +5686,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;
|
||||
|
||||
|
@ -6772,8 +6770,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;
|
||||
|
@ -6781,16 +6779,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;
|
||||
|
@ -6799,8 +6797,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;
|
||||
|
@ -6810,32 +6808,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 &&
|
||||
mi->rli.slave_running != MYSQL_SLAVE_NOT_RUN);
|
||||
*((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;
|
||||
|
@ -6845,7 +6839,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;
|
||||
|
@ -6856,19 +6851,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;
|
||||
|
@ -6876,19 +6869,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;
|
||||
|
||||
var->type= SHOW_CHAR;
|
||||
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))
|
||||
{
|
||||
sprintf(buff, "%.3f", mi->heartbeat_period);
|
||||
sprintf(static_cast<char*>(buff), "%.3f", mi->heartbeat_period);
|
||||
mi->release();
|
||||
var->type= SHOW_CHAR;
|
||||
var->value= buff;
|
||||
}
|
||||
else
|
||||
var->type= SHOW_UNDEF;
|
||||
|
@ -6898,8 +6889,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;
|
||||
|
@ -6907,8 +6898,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;
|
||||
|
@ -6918,8 +6909,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;
|
||||
|
@ -6938,8 +6929,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 )
|
||||
|
@ -6949,8 +6940,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;
|
||||
|
@ -6961,8 +6952,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;
|
||||
|
@ -6977,8 +6968,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;
|
||||
|
@ -6990,8 +6981,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 )
|
||||
|
@ -7001,9 +6992,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)
|
||||
|
@ -7088,8 +7080,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)
|
||||
|
@ -7098,7 +7090,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;
|
||||
|
@ -7122,8 +7114,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)
|
||||
|
@ -7132,7 +7124,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;
|
||||
|
@ -7186,7 +7178,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)
|
||||
{
|
||||
|
@ -7242,8 +7234,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;
|
||||
|
@ -7252,8 +7244,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;
|
||||
|
|
|
@ -8290,11 +8290,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(),
|
||||
|
@ -12043,8 +12038,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;
|
||||
|
@ -12060,8 +12055,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;
|
||||
|
|
|
@ -728,7 +728,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
|
|||
wsrep_wfc()
|
||||
#endif /*WITH_WSREP */
|
||||
{
|
||||
ulong tmp;
|
||||
bzero(&variables, sizeof(variables));
|
||||
|
||||
/*
|
||||
|
@ -882,14 +881,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;
|
||||
|
||||
|
@ -1331,6 +1322,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);
|
||||
|
||||
|
|
|
@ -1590,7 +1590,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);
|
||||
|
@ -4872,7 +4873,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,
|
||||
|
|
|
@ -7567,7 +7567,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);
|
||||
/*
|
||||
|
@ -7575,7 +7575,8 @@ 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);
|
||||
bitmap_set_bit(write_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);
|
||||
file->column_bitmaps_signal();
|
||||
|
@ -7700,7 +7701,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)
|
||||
|
@ -7774,7 +7775,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);
|
||||
/* Mark virtual columns for insert */
|
||||
|
|
|
@ -1568,7 +1568,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. */
|
||||
/***********************************************************************/
|
||||
|
|
|
@ -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 $
|
||||
//
|
||||
|
|
|
@ -11372,7 +11372,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;
|
||||
}
|
||||
|
@ -11843,6 +11846,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,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);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
|
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
|
||||
|
|
|
@ -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,6 +12,7 @@ if (`select not(count(*)) from information_schema.system_variables where variabl
|
|||
--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);
|
||||
|
|
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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1806,13 +1806,7 @@ int spider_conn_queue_and_merge_loop_check(
|
|||
lcptr->flag = SPIDER_LOP_CHK_MERAGED;
|
||||
lcptr->next = NULL;
|
||||
if (!conn->loop_check_meraged_first)
|
||||
{
|
||||
conn->loop_check_meraged_first = lcptr;
|
||||
conn->loop_check_meraged_last = lcptr;
|
||||
} else {
|
||||
conn->loop_check_meraged_last->next = lcptr;
|
||||
conn->loop_check_meraged_last = lcptr;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
|
||||
|
|
|
@ -1579,10 +1579,13 @@ int spider_db_mbase_result::fetch_index_for_discover_table_structure(
|
|||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if (num_fields() != 13)
|
||||
if (num_fields() < 13)
|
||||
{
|
||||
DBUG_PRINT("info",("spider num_fields != 13"));
|
||||
my_printf_error(ER_SPIDER_UNKNOWN_NUM, ER_SPIDER_UNKNOWN_STR, MYF(0));
|
||||
DBUG_PRINT("info",("spider num_fields < 13"));
|
||||
my_printf_error(ER_SPIDER_CANT_NUM, ER_SPIDER_CANT_STR1, MYF(0),
|
||||
"fetch index for table structure discovery because of "
|
||||
"wrong number of columns in SHOW INDEX FROM output: ",
|
||||
num_fields());
|
||||
DBUG_RETURN(ER_SPIDER_UNKNOWN_NUM);
|
||||
}
|
||||
bool first = TRUE;
|
||||
|
@ -1998,7 +2001,7 @@ int spider_db_mbase::connect(
|
|||
|
||||
if (!spider_param_same_server_link(thd))
|
||||
{
|
||||
if (!strcmp(tgt_host, my_localhost))
|
||||
if (!strcmp(tgt_host, my_localhost) || !tgt_host || !tgt_host[0])
|
||||
{
|
||||
if (!strcmp(tgt_socket, *spd_mysqld_unix_port))
|
||||
{
|
||||
|
@ -2008,7 +2011,7 @@ int spider_db_mbase::connect(
|
|||
DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM);
|
||||
}
|
||||
} else if (!strcmp(tgt_host, "127.0.0.1") ||
|
||||
!strcmp(tgt_host, glob_hostname))
|
||||
!strcmp(tgt_host, glob_hostname) || !tgt_host || !tgt_host[0])
|
||||
{
|
||||
if (tgt_port == (long) *spd_mysqld_port)
|
||||
{
|
||||
|
|
|
@ -952,7 +952,6 @@ typedef struct st_spider_conn
|
|||
SPIDER_CONN_LOOP_CHECK *loop_check_ignored_first;
|
||||
SPIDER_CONN_LOOP_CHECK *loop_check_ignored_last;
|
||||
SPIDER_CONN_LOOP_CHECK *loop_check_meraged_first;
|
||||
SPIDER_CONN_LOOP_CHECK *loop_check_meraged_last;
|
||||
} SPIDER_CONN;
|
||||
|
||||
typedef struct st_spider_lgtm_tblhnd_share
|
||||
|
|
|
@ -117,7 +117,7 @@ extern volatile ulonglong spider_mon_table_cache_version_req;
|
|||
}
|
||||
|
||||
extern handlerton *spider_hton_ptr;
|
||||
static void spider_trx_status_var(THD *thd, SHOW_VAR *var, char *buff,
|
||||
static void spider_trx_status_var(THD *thd, SHOW_VAR *var, void *buff,
|
||||
ulonglong SPIDER_TRX::*counter)
|
||||
{
|
||||
DBUG_ENTER("spider_direct_update");
|
||||
|
@ -134,14 +134,16 @@ static void spider_trx_status_var(THD *thd, SHOW_VAR *var, char *buff,
|
|||
|
||||
|
||||
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
|
||||
static int spider_direct_update(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int spider_direct_update(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
DBUG_ENTER("spider_direct_update");
|
||||
spider_trx_status_var(thd, var, buff, &SPIDER_TRX::direct_update_count);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
static int spider_direct_delete(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int spider_direct_delete(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
DBUG_ENTER("spider_direct_delete");
|
||||
spider_trx_status_var(thd, var, buff, &SPIDER_TRX::direct_delete_count);
|
||||
|
@ -149,21 +151,24 @@ static int spider_direct_delete(THD *thd, SHOW_VAR *var, char *buff)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int spider_direct_order_limit(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int spider_direct_order_limit(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
DBUG_ENTER("spider_direct_order_limit");
|
||||
spider_trx_status_var(thd, var, buff, &SPIDER_TRX::direct_order_limit_count);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
static int spider_direct_aggregate(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int spider_direct_aggregate(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
DBUG_ENTER("spider_direct_aggregate");
|
||||
spider_trx_status_var(thd, var, buff, &SPIDER_TRX::direct_aggregate_count);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
static int spider_parallel_search(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int spider_parallel_search(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
DBUG_ENTER("spider_parallel_search");
|
||||
spider_trx_status_var(thd, var, buff, &SPIDER_TRX::parallel_search_count);
|
||||
|
@ -171,7 +176,8 @@ static int spider_parallel_search(THD *thd, SHOW_VAR *var, char *buff)
|
|||
}
|
||||
|
||||
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
|
||||
static int spider_hs_result_free(THD *thd, SHOW_VAR *var, char *buff)
|
||||
static int spider_hs_result_free(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum_var_type)
|
||||
{
|
||||
DBUG_ENTER("spider_hs_result_free");
|
||||
spider_trx_status_var(thd, var, buff, &SPIDER_TRX::hs_result_free_count);
|
||||
|
|
|
@ -1915,6 +1915,16 @@ int spider_delete_xa_member(
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
/**
|
||||
Delete a Spider table from mysql.spider_tables.
|
||||
|
||||
@param table The table mysql.spider_tables
|
||||
@param name The name of the Spider table to delete
|
||||
@param old_link_count The number of links in the deleted table
|
||||
|
||||
@retval 0 Success
|
||||
@retval nonzero Failure
|
||||
*/
|
||||
int spider_delete_tables(
|
||||
TABLE *table,
|
||||
const char *name,
|
||||
|
@ -1930,10 +1940,20 @@ int spider_delete_tables(
|
|||
{
|
||||
spider_store_tables_link_idx(table, roop_count);
|
||||
if ((error_num = spider_check_sys_table(table, table_key)))
|
||||
break;
|
||||
{
|
||||
/* There's a problem with finding the first record for the
|
||||
spider table, likely because it does not exist. Fail */
|
||||
if (roop_count == 0)
|
||||
DBUG_RETURN(error_num);
|
||||
/* At least one row has been deleted for the Spider table.
|
||||
Success */
|
||||
else
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if ((error_num = spider_delete_sys_table_row(table)))
|
||||
{
|
||||
/* There's a problem deleting the row. Fail */
|
||||
DBUG_RETURN(error_num);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue